From e79c8fc04ca1bce61db51b0478abf4de60de1ade Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 14:57:04 +0000 Subject: [PATCH 01/33] SDK regeneration --- .eslintignore | 2 - .eslintrc | 22 - .fern/metadata.json | 19 + .fernignore | 1 + .github/CODEOWNERS | 1 - .github/workflows/ci.yml | 42 + .github/workflows/release.yml | 30 - .gitignore | 5 +- .openapi-generator-ignore | 23 - .openapi-generator/FILES | 408 - .openapi-generator/VERSION | 1 - .swagger-codegen/VERSION | 1 - CONTRIBUTING.md | 133 + LICENSE.md | 15 - README.md | 719 +- api.ts | 3 - api/accountApi.ts | 252 - api/apis.ts | 66 - api/companiesApi.ts | 659 - api/contactsApi.ts | 2487 --- api/conversationsApi.ts | 780 - api/couponsApi.ts | 489 - api/dealsApi.ts | 869 - api/domainsApi.ts | 461 - api/ecommerceApi.ts | 1501 -- api/emailCampaignsApi.ts | 1128 - api/eventsApi.ts | 169 - api/externalFeedsApi.ts | 507 - api/filesApi.ts | 517 - api/inboundParsingApi.ts | 344 - api/masterAccountApi.ts | 1950 -- api/notesApi.ts | 505 - api/paymentsApi.ts | 321 - api/processApi.ts | 254 - api/resellerApi.ts | 1369 -- api/sMSCampaignsApi.ts | 901 - api/sendersApi.ts | 618 - api/tasksApi.ts | 606 - api/transactionalEmailsApi.ts | 1956 -- api/transactionalSMSApi.ts | 468 - api/transactionalWhatsAppApi.ts | 280 - api/userApi.ts | 549 - api/webhooksApi.ts | 559 - api/whatsAppCampaignsApi.ts | 810 - biome.json | 74 + git_push.sh | 57 - model/abTestCampaignResult.ts | 106 - model/abTestCampaignResultClickedLinks.ts | 44 - model/abTestCampaignResultStatistics.ts | 62 - model/abTestVersionClicksInner.ts | 52 - model/abTestVersionStats.ts | 46 - model/addChildDomain.ts | 34 - model/addContactToList.ts | 43 - model/addCredits.ts | 43 - model/authenticateDomainModel.ts | 43 - model/blockDomain.ts | 34 - model/cart.ts | 51 - model/companiesIdPatchRequest.ts | 52 - model/companiesLinkUnlinkIdPatchRequest.ts | 61 - model/companiesList.ts | 38 - model/companiesPost200Response.ts | 37 - model/companiesPostRequest.ts | 70 - model/company.ts | 64 - model/companyAttributesInner.ts | 58 - model/componentItems.ts | 37 - model/configuration.ts | 37 - ...conversationsAgentOnlinePingPostRequest.ts | 61 - model/conversationsMessage.ts | 122 - model/conversationsMessageFile.ts | 68 - model/conversationsMessageFileImageInfo.ts | 55 - model/conversationsMessagesIdPutRequest.ts | 34 - model/conversationsMessagesPostRequest.ts | 79 - ...conversationsPushedMessagesIdPutRequest.ts | 34 - .../conversationsPushedMessagesPostRequest.ts | 61 - model/conversionSourceMetrics.ts | 60 - model/conversionSourceProduct.ts | 73 - model/corporateGroupDetailsResponse.ts | 46 - model/corporateGroupDetailsResponseGroup.ts | 52 - ...ateGroupDetailsResponseSubAccountsInner.ts | 52 - ...corporateGroupDetailsResponseUsersInner.ts | 52 - model/corporateGroupPost201Response.ts | 31 - model/corporateGroupPostRequest.ts | 43 - ...GroupUnlinkGroupIdSubAccountsPutRequest.ts | 34 - ...rporateSubAccountIpAssociatePostRequest.ts | 43 - ...rporateSubAccountIpDissociatePutRequest.ts | 43 - ...UserInvitationActionEmailPut200Response.ts | 31 - model/createApiKeyRequest.ts | 43 - model/createApiKeyResponse.ts | 43 - model/createAttribute.ts | 72 - model/createAttributeEnumerationInner.ts | 43 - model/createCategoryModel.ts | 34 - model/createChild.ts | 89 - model/createContact.ts | 97 - model/createCouponCollection201Response.ts | 34 - model/createCouponCollectionRequest.ts | 70 - model/createCouponsRequest.ts | 40 - model/createDoiContact.ts | 79 - model/createDomain.ts | 34 - model/createDomainModel.ts | 68 - model/createDomainModelDnsRecords.ts | 44 - .../createDomainModelDnsRecordsDkimRecord.ts | 49 - model/createEmailCampaign.ts | 306 - model/createEmailCampaignRecipients.ts | 55 - model/createEmailCampaignSender.ts | 55 - model/createExternalFeed.ts | 114 - model/createExternalFeed201Response.ts | 34 - model/createList.ts | 43 - model/createModel.ts | 34 - model/createPaymentRequest.ts | 73 - model/createPaymentResponse.ts | 43 - model/createProductModel.ts | 34 - model/createReseller.ts | 43 - model/createSender.ts | 53 - model/createSenderIpsInner.ts | 52 - model/createSenderModel.ts | 52 - model/createSmsCampaign.ts | 95 - model/createSmsCampaignRecipients.ts | 43 - model/createSmtpEmail.ts | 40 - model/createSmtpTemplate.ts | 113 - model/createSmtpTemplateSender.ts | 55 - model/createSubAccount.ts | 80 - model/createSubAccountResponse.ts | 34 - model/createUpdateBatchCategory.ts | 44 - model/createUpdateBatchCategoryModel.ts | 43 - model/createUpdateBatchProducts.ts | 44 - model/createUpdateBatchProductsModel.ts | 43 - model/createUpdateCategories.ts | 70 - model/createUpdateCategory.ts | 79 - model/createUpdateContactModel.ts | 34 - model/createUpdateFolder.ts | 34 - model/createUpdateProduct.ts | 133 - model/createUpdateProducts.ts | 124 - model/createWebhook.ts | 122 - model/createWhatsAppCampaign.ts | 59 - model/createWhatsAppCampaignRecipients.ts | 55 - model/createWhatsAppTemplate.ts | 98 - model/createdBatchId.ts | 34 - model/createdProcessId.ts | 34 - model/crmDealsIdPatchRequest.ts | 43 - model/crmDealsLinkUnlinkIdPatchRequest.ts | 61 - model/crmDealsPost201Response.ts | 37 - model/crmDealsPostRequest.ts | 61 - model/crmTasksIdPatchRequest.ts | 115 - model/crmTasksPost201Response.ts | 37 - model/crmTasksPostRequest.ts | 122 - model/deal.ts | 64 - model/dealAttributesInner.ts | 58 - model/dealsList.ts | 38 - model/deleteHardbounces.ts | 52 - ...nSourceConversionSourceIdGet200Response.ts | 66 - ...ommerceAttributionMetricsGet200Response.ts | 42 - ...eAttributionMetricsGet200ResponseTotals.ts | 46 - ...nSourceConversionSourceIdGet200Response.ts | 35 - ...erceConfigDisplayCurrencyGet200Response.ts | 34 - model/emailExportRecipients.ts | 55 - model/errorModel.ts | 64 - model/event.ts | 68 - model/eventIdentifiers.ts | 73 - model/exportWebhooksHistory.ts | 140 - model/fileData.ts | 91 - model/fileDownloadableLink.ts | 34 - model/getAccount.ts | 92 - model/getAccountActivity.ts | 35 - model/getAccountActivityLogsInner.ts | 70 - model/getAccountAllOfMarketingAutomation.ts | 43 - model/getAccountAllOfPlan.ts | 91 - model/getAccountAllOfRelay.ts | 44 - model/getAccountAllOfRelayData.ts | 55 - model/getAggregatedReport.ts | 142 - model/getAllExternalFeeds.ts | 41 - model/getAllExternalFeedsFeedsInner.ts | 141 - model/getAttributes.ts | 35 - model/getAttributesAttributesInner.ts | 87 - ...tributesAttributesInnerEnumerationInner.ts | 43 - model/getBlockedDomains.ts | 37 - model/getCampaignOverview.ts | 165 - model/getCampaignRecipients.ts | 37 - model/getCampaignStats.ts | 169 - model/getCategories.ts | 41 - model/getCategoryDetails.ts | 79 - model/getChildAccountCreationStatus.ts | 34 - model/getChildDomain.ts | 43 - model/getChildInfo.ts | 100 - model/getChildInfoAllOfApiKeys.ts | 42 - model/getChildInfoAllOfApiKeysV2.ts | 43 - model/getChildInfoAllOfApiKeysV3.ts | 43 - model/getChildInfoAllOfCredits.ts | 46 - model/getChildInfoAllOfStatistics.ts | 55 - model/getChildrenList.ts | 44 - model/getChildrenListChildrenInner.ts | 109 - model/getClient.ts | 61 - model/getContactCampaignStats.ts | 87 - model/getContactCampaignStatsClickedInner.ts | 41 - ...tactCampaignStatsClickedInnerLinksInner.ts | 61 - ...etContactCampaignStatsMessagesSentInner.ts | 43 - model/getContactCampaignStatsOpenedInner.ts | 61 - ...tactCampaignStatsTransacAttributesInner.ts | 52 - .../getContactCampaignStatsUnsubscriptions.ts | 45 - ...UnsubscriptionsAdminUnsubscriptionInner.ts | 43 - ...sUnsubscriptionsUserUnsubscriptionInner.ts | 52 - model/getContactDetails.ts | 100 - model/getContacts.ts | 41 - model/getCorporateInvitedUsersList.ts | 35 - .../getCorporateInvitedUsersListUsersInner.ts | 66 - ...InvitedUsersListUsersInnerFeatureAccess.ts | 64 - ...rporateInvitedUsersListUsersInnerGroups.ts | 46 - model/getCorporateUserPermission.ts | 60 - ...getCorporateUserPermissionFeatureAccess.ts | 64 - .../getCorporateUserPermissionGroupsInner.ts | 46 - model/getCouponCollection.ts | 106 - model/getDeviceBrowserStats.ts | 61 - model/getDomainConfigurationModel.ts | 59 - model/getDomainsList.ts | 35 - model/getDomainsListDomainsInner.ts | 70 - model/getEmailCampaign.ts | 357 - model/getEmailCampaigns.ts | 41 - model/getEmailCampaignsCampaignsInner.ts | 357 - model/getEmailEventReport.ts | 32 - model/getEmailEventReportEventsInner.ts | 142 - model/getExtendedCampaignOverview.ts | 343 - .../getExtendedCampaignOverviewAllOfSender.ts | 52 - model/getExtendedCampaignStats.ts | 88 - model/getExtendedClient.ts | 68 - model/getExtendedClientAllOfAddress.ts | 64 - model/getExtendedContactDetails.ts | 107 - ...etExtendedContactDetailsAllOfStatistics.ts | 110 - ...dedContactDetailsAllOfStatisticsClicked.ts | 44 - ...endedContactDetailsAllOfStatisticsLinks.ts | 61 - ...ntactDetailsAllOfStatisticsMessagesSent.ts | 43 - ...ndedContactDetailsAllOfStatisticsOpened.ts | 61 - ...ctDetailsAllOfStatisticsUnsubscriptions.ts | 48 - ...sticsUnsubscriptionsAdminUnsubscription.ts | 43 - ...isticsUnsubscriptionsUserUnsubscription.ts | 52 - model/getExtendedList.ts | 104 - model/getExtendedListAllOfCampaignStats.ts | 41 - model/getExternalFeedByUUID.ts | 141 - model/getExternalFeedByUUIDHeadersInner.ts | 43 - model/getFolder.ts | 70 - model/getFolderLists.ts | 41 - model/getFolders.ts | 41 - model/getInboundEmailEvents.ts | 32 - model/getInboundEmailEventsByUuid.ts | 99 - ...nboundEmailEventsByUuidAttachmentsInner.ts | 61 - model/getInboundEmailEventsByUuidLogsInner.ts | 51 - model/getInboundEmailEventsEventsInner.ts | 61 - model/getInvitedUsersList.ts | 35 - model/getInvitedUsersListUsersInner.ts | 59 - ...InvitedUsersListUsersInnerFeatureAccess.ts | 55 - model/getIp.ts | 61 - model/getIpFromSender.ts | 61 - model/getIps.ts | 35 - model/getIpsFromSender.ts | 35 - model/getList.ts | 70 - model/getLists.ts | 44 - model/getListsListsInner.ts | 79 - model/getOrders.ts | 41 - model/getOrdersOrdersInner.ts | 111 - model/getPaymentRequest.ts | 89 - model/getProcess.ts | 68 - model/getProcesses.ts | 44 - model/getProductDetails.ts | 160 - model/getProducts.ts | 41 - model/getReports.ts | 32 - model/getReportsReportsInner.ts | 142 - model/getScheduledEmailByBatchId.ts | 41 - .../getScheduledEmailByBatchIdBatchesInner.ts | 60 - model/getScheduledEmailByMessageId.ts | 60 - model/getSegments.ts | 41 - model/getSegmentsSegments.ts | 61 - model/getSendersList.ts | 35 - model/getSendersListSendersInner.ts | 71 - model/getSendersListSendersInnerIpsInner.ts | 52 - model/getSharedTemplateUrl.ts | 34 - model/getSmsCampaign.ts | 121 - model/getSmsCampaignOverview.ts | 107 - model/getSmsCampaignStats.ts | 88 - model/getSmsCampaigns.ts | 41 - model/getSmsCampaignsCampaignsInner.ts | 121 - model/getSmsEventReport.ts | 32 - model/getSmsEventReportEventsInner.ts | 100 - model/getSmtpTemplateOverview.ts | 140 - model/getSmtpTemplateOverviewSender.ts | 52 - model/getSmtpTemplates.ts | 41 - model/getSsoToken.ts | 34 - model/getStatsByDevice.ts | 62 - model/getSubAccountGroups200ResponseInner.ts | 43 - model/getTransacAggregatedSmsReport.ts | 124 - model/getTransacBlockedContacts.ts | 41 - .../getTransacBlockedContactsContactsInner.ts | 59 - ...ansacBlockedContactsContactsInnerReason.ts | 56 - model/getTransacEmailContent.ts | 89 - model/getTransacEmailContentEventsInner.ts | 43 - model/getTransacEmailsList.ts | 41 - ...ansacEmailsListTransactionalEmailsInner.ts | 97 - model/getTransacSmsReport.ts | 32 - model/getTransacSmsReportReportsInner.ts | 124 - model/getUserPermission.ts | 56 - model/getUserPermissionPrivilegesInner.ts | 37 - model/getWATemplates.ts | 41 - model/getWATemplatesTemplatesInner.ts | 97 - model/getWebhook.ts | 117 - model/getWebhookAuth.ts | 46 - model/getWebhookHeadersInner.ts | 43 - model/getWebhooks.ts | 32 - model/getWhatsAppConfig.ts | 91 - model/getWhatsappCampaignOverview.ts | 114 - model/getWhatsappCampaigns.ts | 41 - model/getWhatsappCampaignsCampaignsInner.ts | 134 - model/getWhatsappEventReport.ts | 32 - model/getWhatsappEventReportEventsInner.ts | 108 - model/inviteAdminUser.ts | 59 - model/inviteAdminUserPrivilegesInner.ts | 58 - model/inviteuser.ts | 50 - model/inviteuserPrivilegesInner.ts | 94 - model/manageIp.ts | 34 - model/masterDetailsResponse.ts | 84 - model/masterDetailsResponseBillingInfo.ts | 60 - ...masterDetailsResponseBillingInfoAddress.ts | 73 - model/masterDetailsResponseBillingInfoName.ts | 46 - model/masterDetailsResponsePlanInfo.ts | 89 - ...terDetailsResponsePlanInfoFeaturesInner.ts | 88 - model/models.ts | 1410 -- model/note.ts | 91 - model/noteData.ts | 64 - model/noteId.ts | 37 - model/notification.ts | 51 - model/order.ts | 102 - model/orderBatch.ts | 53 - model/orderBilling.ts | 100 - model/orderProductsInner.ts | 64 - model/otp.ts | 34 - model/pipeline.ts | 56 - model/pipelineStage.ts | 46 - model/postContactInfo.ts | 32 - model/postContactInfoContacts.ts | 55 - model/postSendFailed.ts | 61 - model/postSendSmsTestFailed.ts | 55 - model/putRevokeUserPermission.ts | 37 - model/putresendcancelinvitation.ts | 37 - model/remainingCreditModel.ts | 39 - model/remainingCreditModelChild.ts | 46 - model/remainingCreditModelReseller.ts | 43 - model/removeContactFromList.ts | 52 - model/removeCredits.ts | 43 - model/requestContactExport.ts | 50 - ...requestContactExportCustomContactFilter.ts | 104 - model/requestContactImport.ts | 123 - model/requestContactImportJsonBodyInner.ts | 40 - model/requestContactImportNewList.ts | 46 - model/requestSmsRecipientExport.ts | 53 - model/scheduleSmtpEmail.ts | 49 - model/sendReport.ts | 51 - model/sendReportEmail.ts | 46 - model/sendSms.ts | 64 - model/sendSmtpEmail.ts | 170 - model/sendSmtpEmailAttachmentInner.ts | 52 - model/sendSmtpEmailBccInner.ts | 43 - model/sendSmtpEmailCcInner.ts | 43 - model/sendSmtpEmailMessageVersionsInner.ts | 98 - ...endSmtpEmailMessageVersionsInnerReplyTo.ts | 46 - ...endSmtpEmailMessageVersionsInnerToInner.ts | 43 - model/sendSmtpEmailReplyTo.ts | 46 - model/sendSmtpEmailSender.ts | 55 - model/sendSmtpEmailToInner.ts | 43 - model/sendTestEmail.ts | 34 - model/sendTestSms.ts | 34 - model/sendTransacSms.ts | 103 - model/sendWhatsappMessage.ts | 70 - model/sendWhatsappMessage201Response.ts | 34 - model/ssoTokenRequest.ts | 73 - model/ssoTokenRequestCorporate.ts | 34 - model/subAccountAppsToggleRequest.ts | 145 - model/subAccountDetailsResponse.ts | 69 - model/subAccountDetailsResponseGroupsInner.ts | 43 - model/subAccountDetailsResponsePlanInfo.ts | 51 - ...ubAccountDetailsResponsePlanInfoCredits.ts | 49 - ...untDetailsResponsePlanInfoCreditsEmails.ts | 46 - ...ccountDetailsResponsePlanInfoCreditsSms.ts | 46 - ...ilsResponsePlanInfoCreditsWpSubscribers.ts | 46 - ...bAccountDetailsResponsePlanInfoFeatures.ts | 49 - ...untDetailsResponsePlanInfoFeaturesInbox.ts | 46 - ...ailsResponsePlanInfoFeaturesLandingPage.ts | 46 - ...untDetailsResponsePlanInfoFeaturesUsers.ts | 46 - model/subAccountUpdatePlanRequest.ts | 42 - model/subAccountUpdatePlanRequestCredits.ts | 55 - model/subAccountUpdatePlanRequestFeatures.ts | 55 - model/subAccountsResponse.ts | 41 - model/subAccountsResponseSubAccountsInner.ts | 71 - ...untsResponseSubAccountsInnerGroupsInner.ts | 43 - model/task.ts | 82 - model/taskList.ts | 38 - model/taskReminder.ts | 63 - model/taskTypes.ts | 46 - model/updateAttribute.ts | 44 - model/updateAttributeEnumerationInner.ts | 43 - model/updateBatchContacts.ts | 35 - model/updateBatchContactsContactsInner.ts | 115 - model/updateBatchContactsModel.ts | 37 - model/updateCampaignStatus.ts | 49 - model/updateChild.ts | 70 - model/updateChildAccountStatus.ts | 61 - model/updateChildDomain.ts | 34 - model/updateContact.ts | 88 - model/updateCouponCollection200Response.ts | 52 - model/updateCouponCollectionRequest.ts | 61 - model/updateEmailCampaign.ts | 306 - model/updateEmailCampaignRecipients.ts | 55 - model/updateEmailCampaignSender.ts | 55 - model/updateExternalFeed.ts | 114 - model/updateList.ts | 43 - model/updateSender.ts | 53 - model/updateSmsCampaign.ts | 95 - model/updateSmtpTemplate.ts | 113 - model/updateSmtpTemplateSender.ts | 55 - model/updateWebhook.ts | 108 - model/updateWhatsAppCampaign.ts | 65 - model/uploadImageModel.ts | 34 - model/uploadImageToGallery.ts | 43 - model/variablesItems.ts | 43 - model/whatsappCampStats.ts | 55 - model/whatsappCampTemplate.ts | 114 - package-lock.json | 2277 -- package.json | 84 +- pnpm-lock.yaml | 2164 ++ pnpm-workspace.yaml | 1 + reference.md | 17230 ++++++++++++++++ requestCompat.ts | 138 - scripts/rename-to-esm-files.js | 123 + src/BaseClient.ts | 85 + src/Client.ts | 210 + src/api/errors/BadRequestError.ts | 21 + src/api/errors/ConflictError.ts | 22 + src/api/errors/ExpectationFailedError.ts | 22 + src/api/errors/FailedDependencyError.ts | 21 + src/api/errors/ForbiddenError.ts | 21 + src/api/errors/InternalServerError.ts | 21 + src/api/errors/MethodNotAllowedError.ts | 22 + src/api/errors/NotFoundError.ts | 21 + src/api/errors/PaymentRequiredError.ts | 22 + src/api/errors/PreconditionFailedError.ts | 22 + src/api/errors/TooEarlyError.ts | 22 + src/api/errors/TooManyRequestsError.ts | 22 + src/api/errors/UnauthorizedError.ts | 21 + src/api/errors/UnprocessableEntityError.ts | 22 + src/api/errors/UnsupportedMediaTypeError.ts | 22 + src/api/errors/index.ts | 15 + src/api/index.ts | 3 + src/api/resources/account/client/Client.ts | 192 + src/api/resources/account/client/index.ts | 1 + .../requests/GetAccountActivityRequest.ts | 27 + .../account/client/requests/index.ts | 1 + src/api/resources/account/index.ts | 2 + .../types/GetAccountActivityResponse.ts | 31 + .../account/types/GetAccountResponse.ts | 182 + src/api/resources/account/types/index.ts | 2 + src/api/resources/balance/client/Client.ts | 1707 ++ src/api/resources/balance/client/index.ts | 1 + .../requests/BeginTransactionRequest.ts | 32 + .../requests/CancelTransactionRequest.ts | 15 + .../requests/CompleteTransactionRequest.ts | 15 + .../requests/CreateBalanceLimitRequest.ts | 55 + .../requests/CreateBalanceOrderRequest.ts | 31 + .../DeleteBalanceDefinitionRequest.ts | 15 + .../requests/DeleteBalanceLimitRequest.ts | 18 + .../GetBalanceDefinitionListRequest.ts | 24 + .../requests/GetBalanceDefinitionRequest.ts | 19 + .../client/requests/GetBalanceLimitRequest.ts | 22 + .../requests/GetContactBalancesRequest.ts | 12 + ...yBalanceProgramsPidActiveBalanceRequest.ts | 26 + ...nceProgramsPidTransactionHistoryRequest.ts | 30 + .../GetSubscriptionBalancesRequest.ts | 15 + ...nceProgramsPidBalanceDefinitionsRequest.ts | 110 + ...gramsPidSubscriptionsCidBalancesRequest.ts | 18 + .../UpdateBalanceDefinitionRequest.ts | 113 + .../requests/UpdateBalanceLimitRequest.ts | 58 + .../balance/client/requests/index.ts | 18 + src/api/resources/balance/index.ts | 2 + .../types/CreateBalanceOrderResponse.ts | 31 + .../GetBalanceDefinitionListRequestSort.ts | 8 + ...etBalanceDefinitionListRequestSortField.ts | 9 + .../GetBalanceDefinitionListRequestVersion.ts | 8 + .../types/GetBalanceDefinitionListResponse.ts | 8 + .../GetBalanceDefinitionRequestVersion.ts | 8 + .../types/GetBalanceLimitRequestVersion.ts | 8 + .../types/GetContactBalancesResponse.ts | 21 + ...rogramsPidTransactionHistoryRequestSort.ts | 8 + ...msPidTransactionHistoryRequestSortField.ts | 9 + ...ceProgramsPidTransactionHistoryResponse.ts | 49 + .../types/GetSubscriptionBalancesResponse.ts | 18 + ...ramsPidSubscriptionsCidBalancesResponse.ts | 22 + src/api/resources/balance/types/index.ts | 13 + src/api/resources/companies/client/Client.ts | 647 + src/api/resources/companies/client/index.ts | 1 + .../requests/DeleteCompaniesIdRequest.ts | 12 + .../client/requests/GetCompaniesIdRequest.ts | 12 + .../client/requests/GetCompaniesRequest.ts | 28 + .../requests/PatchCompaniesIdRequest.ts | 21 + .../PatchCompaniesLinkUnlinkIdRequest.ts | 19 + .../requests/PostCompaniesImportRequest.ts | 21 + .../client/requests/PostCompaniesRequest.ts | 20 + .../requests/PostCrmAttributesRequest.ts | 42 + .../companies/client/requests/index.ts | 8 + src/api/resources/companies/index.ts | 2 + .../types/GetCompaniesRequestSort.ts | 7 + .../companies/types/GetCompaniesResponse.ts | 11 + .../GetCrmAttributesCompaniesResponseItem.ts | 12 + .../types/PostCompaniesImportResponse.ts | 6 + .../companies/types/PostCompaniesResponse.ts | 9 + .../types/PostCrmAttributesResponse.ts | 6 + src/api/resources/companies/types/index.ts | 6 + src/api/resources/contacts/client/Client.ts | 2295 ++ src/api/resources/contacts/client/index.ts | 1 + .../requests/AddContactToListRequest.ts | 58 + .../client/requests/CreateAttributeRequest.ts | 53 + .../client/requests/CreateContactRequest.ts | 30 + .../requests/CreateDoiContactRequest.ts | 31 + .../client/requests/CreateListRequest.ts | 15 + .../client/requests/DeleteAttributeRequest.ts | 17 + .../client/requests/DeleteContactRequest.ts | 16 + .../client/requests/DeleteFolderRequest.ts | 12 + .../client/requests/DeleteListRequest.ts | 12 + .../DeleteMultiAttributeOptionsRequest.ts | 18 + .../client/requests/GetContactInfoRequest.ts | 20 + .../client/requests/GetContactStatsRequest.ts | 18 + .../requests/GetContactsFromListRequest.ts | 22 + .../client/requests/GetContactsRequest.ts | 26 + .../client/requests/GetFolderListsRequest.ts | 20 + .../client/requests/GetFolderRequest.ts | 12 + .../client/requests/GetFoldersRequest.ts | 16 + .../client/requests/GetListRequest.ts | 16 + .../client/requests/GetListsRequest.ts | 16 + .../client/requests/GetSegmentsRequest.ts | 16 + .../client/requests/ImportContactsRequest.ts | 52 + .../requests/RemoveContactFromListRequest.ts | 74 + .../requests/RequestContactExportRequest.ts | 77 + .../client/requests/UpdateAttributeRequest.ts | 36 + .../requests/UpdateBatchContactsRequest.ts | 39 + .../client/requests/UpdateContactRequest.ts | 36 + .../client/requests/UpdateFolderRequest.ts | 16 + .../client/requests/UpdateListRequest.ts | 16 + .../contacts/client/requests/index.ts | 28 + src/api/resources/contacts/index.ts | 2 + .../types/AddContactToListRequestBody.ts | 12 + ...CreateAttributeRequestAttributeCategory.ts | 11 + .../contacts/types/CreateContactResponse.ts | 6 + .../contacts/types/CreateFolderResponse.ts | 6 + .../contacts/types/CreateListResponse.ts | 6 + ...DeleteAttributeRequestAttributeCategory.ts | 11 + .../types/DeleteContactRequestIdentifier.ts | 3 + .../DeleteContactRequestIdentifierType.ts | 12 + .../contacts/types/GetAttributesResponse.ts | 61 + .../types/GetContactInfoRequestIdentifier.ts | 3 + .../GetContactInfoRequestIdentifierType.ts | 12 + .../contacts/types/GetContactInfoResponse.ts | 195 + .../types/GetContactStatsRequestIdentifier.ts | 3 + .../contacts/types/GetContactStatsResponse.ts | 161 + .../types/GetContactsFromListRequestSort.ts | 8 + .../contacts/types/GetContactsRequestSort.ts | 7 + .../types/GetFolderListsRequestSort.ts | 7 + .../contacts/types/GetFolderListsResponse.ts | 9 + .../contacts/types/GetFoldersRequestSort.ts | 7 + .../contacts/types/GetFoldersResponse.ts | 9 + .../contacts/types/GetListResponse.ts | 35 + .../contacts/types/GetListsRequestSort.ts | 7 + .../contacts/types/GetListsResponse.ts | 29 + .../contacts/types/GetSegmentsRequestSort.ts | 7 + .../contacts/types/GetSegmentsResponse.ts | 25 + .../contacts/types/ImportContactsResponse.ts | 6 + .../types/RemoveContactFromListRequestBody.ts | 15 + .../types/RequestContactExportResponse.ts | 6 + ...UpdateAttributeRequestAttributeCategory.ts | 10 + .../types/UpdateContactRequestIdentifier.ts | 3 + .../UpdateContactRequestIdentifierType.ts | 12 + src/api/resources/contacts/types/index.ts | 31 + .../resources/conversations/client/Client.ts | 797 + .../resources/conversations/client/index.ts | 1 + .../DeleteConversationsMessagesIdRequest.ts | 12 + ...eteConversationsPushedMessagesIdRequest.ts | 12 + .../GetConversationsMessagesIdRequest.ts | 12 + ...GetConversationsPushedMessagesIdRequest.ts | 12 + ...PostConversationsAgentOnlinePingRequest.ts | 25 + .../PostConversationsMessagesRequest.ts | 39 + .../PostConversationsPushedMessagesRequest.ts | 31 + .../PutConversationsMessagesIdRequest.ts | 15 + ...PutConversationsPushedMessagesIdRequest.ts | 15 + .../PutConversationsVisitorGroupRequest.ts | 11 + .../conversations/client/requests/index.ts | 10 + src/api/resources/conversations/index.ts | 2 + .../PutConversationsVisitorGroupResponse.ts | 8 + .../resources/conversations/types/index.ts | 1 + src/api/resources/coupons/client/Client.ts | 383 + src/api/resources/coupons/client/index.ts | 1 + .../requests/CreateCouponCollectionRequest.ts | 21 + .../client/requests/CreateCouponsRequest.ts | 14 + .../requests/GetCouponCollectionRequest.ts | 12 + .../requests/GetCouponCollectionsRequest.ts | 18 + .../requests/UpdateCouponCollectionRequest.ts | 20 + .../coupons/client/requests/index.ts | 5 + src/api/resources/coupons/index.ts | 2 + .../types/CreateCouponCollectionResponse.ts | 6 + .../types/GetCouponCollectionsRequestSort.ts | 8 + .../GetCouponCollectionsRequestSortBy.ts | 9 + .../types/UpdateCouponCollectionResponse.ts | 10 + src/api/resources/coupons/types/index.ts | 4 + .../resources/customObjects/client/Client.ts | 319 + .../resources/customObjects/client/index.ts | 1 + .../BatchDeleteObjectRecordsRequest.ts | 30 + .../client/requests/GetrecordsRequest.ts | 24 + .../client/requests/UpsertrecordsRequest.ts | 78 + .../customObjects/client/requests/index.ts | 3 + src/api/resources/customObjects/index.ts | 2 + .../types/BatchDeleteObjectRecordsResponse.ts | 7 + .../types/GetrecordsRequestAssociation.ts | 8 + .../types/GetrecordsRequestSort.ts | 7 + .../customObjects/types/GetrecordsResponse.ts | 86 + .../types/UpsertrecordsResponse.ts | 7 + .../resources/customObjects/types/index.ts | 5 + src/api/resources/deals/client/Client.ts | 764 + src/api/resources/deals/client/index.ts | 1 + .../requests/DeleteCrmDealsIdRequest.ts | 11 + .../client/requests/GetCrmDealsIdRequest.ts | 11 + .../client/requests/GetCrmDealsRequest.ts | 26 + .../GetCrmPipelineDetailsPipelineIdRequest.ts | 11 + .../client/requests/PatchCrmDealsIdRequest.ts | 19 + .../PatchCrmDealsLinkUnlinkIdRequest.ts | 19 + .../requests/PostCrmDealsImportRequest.ts | 21 + .../client/requests/PostCrmDealsRequest.ts | 18 + .../resources/deals/client/requests/index.ts | 8 + src/api/resources/deals/index.ts | 2 + .../GetCrmAttributesDealsResponseItem.ts | 12 + .../deals/types/GetCrmDealsRequestSort.ts | 7 + .../deals/types/GetCrmDealsResponse.ts | 11 + .../deals/types/PostCrmDealsImportResponse.ts | 6 + .../deals/types/PostCrmDealsResponse.ts | 9 + src/api/resources/deals/types/index.ts | 5 + src/api/resources/domains/client/Client.ts | 439 + src/api/resources/domains/client/index.ts | 1 + .../requests/AuthenticateDomainRequest.ts | 17 + .../client/requests/CreateDomainRequest.ts | 32 + .../client/requests/DeleteDomainRequest.ts | 12 + .../requests/GetDomainConfigurationRequest.ts | 17 + .../domains/client/requests/index.ts | 4 + src/api/resources/domains/index.ts | 2 + .../types/AuthenticateDomainResponse.ts | 8 + .../domains/types/CreateDomainResponse.ts | 72 + .../types/GetDomainConfigurationResponse.ts | 76 + .../domains/types/GetDomainsResponse.ts | 55 + src/api/resources/domains/types/index.ts | 4 + src/api/resources/ecommerce/client/Client.ts | 1384 ++ src/api/resources/ecommerce/client/index.ts | 1 + .../requests/CreateBatchOrderRequest.ts | 29 + .../requests/CreateProductAlertRequest.ts | 27 + .../CreateUpdateBatchCategoryRequest.ts | 35 + .../CreateUpdateBatchProductsRequest.ts | 56 + .../requests/CreateUpdateCategoryRequest.ts | 22 + .../requests/CreateUpdateProductRequest.ts | 43 + .../client/requests/GetCategoriesRequest.ts | 26 + .../client/requests/GetCategoryInfoRequest.ts | 12 + ...nversionSourceConversionSourceIdRequest.ts | 17 + .../GetEcommerceAttributionMetricsRequest.ts | 23 + ...nversionSourceConversionSourceIdRequest.ts | 17 + .../client/requests/GetOrdersRequest.ts | 20 + .../client/requests/GetProductInfoRequest.ts | 12 + .../client/requests/GetProductsRequest.ts | 40 + .../SetConfigDisplayCurrencyRequest.ts | 12 + .../ecommerce/client/requests/index.ts | 15 + src/api/resources/ecommerce/index.ts | 2 + .../types/CreateBatchOrderResponse.ts | 8 + .../CreateUpdateBatchCategoryResponse.ts | 8 + .../CreateUpdateBatchProductsResponse.ts | 8 + .../types/CreateUpdateCategoryResponse.ts | 6 + .../types/CreateUpdateProductResponse.ts | 6 + .../types/GetCategoriesRequestSort.ts | 7 + .../ecommerce/types/GetCategoriesResponse.ts | 9 + ...nversionSourceIdRequestConversionSource.ts | 10 + ...versionSourceConversionSourceIdResponse.ts | 20 + .../GetEcommerceAttributionMetricsResponse.ts | 21 + ...nversionSourceIdRequestConversionSource.ts | 10 + ...versionSourceConversionSourceIdResponse.ts | 23 + ...tEcommerceConfigDisplayCurrencyResponse.ts | 6 + .../ecommerce/types/GetOrdersRequestSort.ts | 7 + .../ecommerce/types/GetProductsRequestSort.ts | 7 + .../ecommerce/types/GetProductsResponse.ts | 9 + .../types/SetConfigDisplayCurrencyResponse.ts | 6 + src/api/resources/ecommerce/types/index.ts | 17 + .../resources/emailCampaigns/client/Client.ts | 1017 + .../resources/emailCampaigns/client/index.ts | 1 + .../requests/CreateEmailCampaignRequest.ts | 130 + .../requests/DeleteEmailCampaignRequest.ts | 12 + .../requests/EmailExportRecipientsRequest.ts | 32 + .../GetAbTestCampaignResultRequest.ts | 12 + .../requests/GetEmailCampaignRequest.ts | 16 + .../requests/GetEmailCampaignsRequest.ts | 28 + .../requests/GetSharedTemplateUrlRequest.ts | 12 + .../requests/SendEmailCampaignNowRequest.ts | 12 + .../client/requests/SendReportRequest.ts | 21 + .../client/requests/SendTestEmailRequest.ts | 16 + .../requests/UpdateCampaignStatusRequest.ts | 16 + .../requests/UpdateEmailCampaignRequest.ts | 131 + .../requests/UploadImageToGalleryRequest.ts | 14 + .../emailCampaigns/client/requests/index.ts | 13 + src/api/resources/emailCampaigns/index.ts | 2 + .../types/CreateEmailCampaignResponse.ts | 6 + .../types/EmailExportRecipientsResponse.ts | 6 + .../types/GetAbTestCampaignResultResponse.ts | 52 + .../GetEmailCampaignRequestStatistics.ts | 11 + .../types/GetEmailCampaignResponse.ts | 102 + .../types/GetEmailCampaignsRequestSort.ts | 8 + .../GetEmailCampaignsRequestStatistics.ts | 9 + .../types/GetEmailCampaignsRequestStatus.ts | 13 + .../types/GetEmailCampaignsRequestType.ts | 8 + .../types/GetEmailCampaignsResponse.ts | 114 + .../types/GetSharedTemplateUrlResponse.ts | 6 + .../types/UploadImageToGalleryResponse.ts | 6 + .../resources/emailCampaigns/types/index.ts | 12 + src/api/resources/event/client/Client.ts | 97 + src/api/resources/event/client/index.ts | 1 + .../client/requests/CreateEventRequest.ts | 73 + .../resources/event/client/requests/index.ts | 1 + src/api/resources/event/index.ts | 1 + .../resources/externalFeeds/client/Client.ts | 553 + .../resources/externalFeeds/client/index.ts | 1 + .../requests/CreateExternalFeedRequest.ts | 70 + .../requests/DeleteExternalFeedRequest.ts | 12 + .../requests/GetAllExternalFeedsRequest.ts | 39 + .../requests/GetExternalFeedByUuidRequest.ts | 22 + .../requests/UpdateExternalFeedRequest.ts | 96 + .../externalFeeds/client/requests/index.ts | 5 + src/api/resources/externalFeeds/index.ts | 2 + .../types/CreateExternalFeedResponse.ts | 6 + .../GetAllExternalFeedsRequestAuthType.ts | 9 + .../types/GetAllExternalFeedsRequestSort.ts | 8 + .../types/GetAllExternalFeedsResponse.ts | 65 + .../types/GetExternalFeedByUuidResponse.ts | 54 + .../resources/externalFeeds/types/index.ts | 5 + src/api/resources/files/client/Client.ts | 384 + src/api/resources/files/client/index.ts | 1 + .../requests/DeleteCrmFilesIdRequest.ts | 12 + .../requests/GetCrmFilesIdDataRequest.ts | 12 + .../client/requests/GetCrmFilesIdRequest.ts | 12 + .../client/requests/GetCrmFilesRequest.ts | 24 + .../client/requests/PostCrmFilesRequest.ts | 17 + .../resources/files/client/requests/index.ts | 5 + src/api/resources/files/index.ts | 2 + .../files/types/GetCrmFilesIdResponse.ts | 9 + .../files/types/GetCrmFilesRequestEntity.ts | 8 + .../files/types/GetCrmFilesRequestSort.ts | 7 + src/api/resources/files/types/index.ts | 3 + .../resources/inboundParsing/client/Client.ts | 234 + .../resources/inboundParsing/client/index.ts | 1 + .../GetInboundEmailAttachmentRequest.ts | 12 + .../GetInboundEmailEventsByUuidRequest.ts | 12 + .../requests/GetInboundEmailEventsRequest.ts | 22 + .../inboundParsing/client/requests/index.ts | 3 + src/api/resources/inboundParsing/index.ts | 2 + .../GetInboundEmailEventsByUuidResponse.ts | 59 + .../types/GetInboundEmailEventsRequestSort.ts | 8 + .../types/GetInboundEmailEventsResponse.ts | 22 + .../resources/inboundParsing/types/index.ts | 3 + src/api/resources/index.ts | 95 + .../resources/masterAccount/client/Client.ts | 1984 ++ .../resources/masterAccount/client/index.ts | 1 + .../requests/DeleteCorporateGroupIdRequest.ts | 12 + .../DeleteCorporateSubAccountIdRequest.ts | 12 + .../DeleteCorporateUserRevokeEmailRequest.ts | 12 + .../requests/GetCorporateGroupIdRequest.ts | 12 + .../GetCorporateInvitedUsersListRequest.ts | 23 + .../GetCorporateSubAccountIdRequest.ts | 12 + .../requests/GetCorporateSubAccountRequest.ts | 15 + .../GetCorporateUserPermissionRequest.ts | 12 + .../client/requests/InviteAdminUserRequest.ts | 64 + .../requests/PostCorporateGroupRequest.ts | 14 + .../requests/PostCorporateSsoTokenRequest.ts | 12 + ...stCorporateSubAccountIpAssociateRequest.ts | 18 + .../PostCorporateSubAccountKeyRequest.ts | 15 + .../PostCorporateSubAccountRequest.ts | 37 + .../PostCorporateSubAccountSsoTokenRequest.ts | 56 + .../requests/PutCorporateGroupIdRequest.ts | 16 + ...ateGroupUnlinkGroupIdSubAccountsRequest.ts | 15 + ...teSubAccountIdApplicationsToggleRequest.ts | 73 + .../PutCorporateSubAccountIdPlanRequest.ts | 76 + ...tCorporateSubAccountIpDissociateRequest.ts | 18 + .../PutCorporateSubAccountsPlanRequest.ts | 73 + ...PutCorporateUserEmailPermissionsRequest.ts | 91 + ...rporateUserInvitationActionEmailRequest.ts | 17 + .../masterAccount/client/requests/index.ts | 23 + src/api/resources/masterAccount/index.ts | 2 + .../types/GetCorporateGroupIdResponse.ts | 44 + .../GetCorporateInvitedUsersListResponse.ts | 77 + .../types/GetCorporateIpResponseItem.ts | 7 + .../GetCorporateMasterAccountResponse.ts | 116 + .../types/GetCorporateSubAccountIdResponse.ts | 172 + .../types/GetCorporateSubAccountResponse.ts | 39 + .../GetCorporateUserPermissionResponse.ts | 52 + .../types/GetSubAccountGroupsResponseItem.ts | 8 + .../types/InviteAdminUserResponse.ts | 5 + .../types/PostCorporateGroupResponse.ts | 5 + .../PostCorporateSubAccountKeyResponse.ts | 8 + .../types/PostCorporateSubAccountResponse.ts | 6 + ...eUserInvitationActionEmailRequestAction.ts | 8 + ...porateUserInvitationActionEmailResponse.ts | 6 + .../resources/masterAccount/types/index.ts | 14 + src/api/resources/notes/client/Client.ts | 385 + src/api/resources/notes/client/index.ts | 1 + .../requests/DeleteCrmNotesIdRequest.ts | 12 + .../client/requests/GetCrmNotesIdRequest.ts | 12 + .../client/requests/GetCrmNotesRequest.ts | 24 + .../client/requests/PatchCrmNotesIdRequest.ts | 18 + .../resources/notes/client/requests/index.ts | 4 + src/api/resources/notes/index.ts | 2 + .../notes/types/GetCrmNotesRequestEntity.ts | 8 + .../notes/types/GetCrmNotesRequestSort.ts | 7 + .../notes/types/PostCrmNotesResponse.ts | 9 + src/api/resources/notes/types/index.ts | 3 + src/api/resources/payments/client/Client.ts | 247 + src/api/resources/payments/client/index.ts | 1 + .../requests/CreatePaymentRequestRequest.ts | 26 + .../requests/DeletePaymentRequestRequest.ts | 12 + .../requests/GetPaymentRequestRequest.ts | 12 + .../payments/client/requests/index.ts | 3 + src/api/resources/payments/index.ts | 2 + .../types/CreatePaymentRequestResponse.ts | 8 + .../types/GetPaymentRequestResponse.ts | 28 + src/api/resources/payments/types/index.ts | 2 + src/api/resources/process/client/Client.ts | 209 + src/api/resources/process/client/index.ts | 1 + .../client/requests/GetProcessRequest.ts | 27 + .../client/requests/GetProcessesRequest.ts | 19 + .../process/client/requests/index.ts | 2 + src/api/resources/process/index.ts | 2 + .../process/types/GetProcessResponse.ts | 85 + .../process/types/GetProcessesRequestSort.ts | 7 + .../process/types/GetProcessesResponse.ts | 98 + src/api/resources/process/types/index.ts | 3 + src/api/resources/program/client/Client.ts | 1028 + src/api/resources/program/client/index.ts | 1 + .../client/requests/CreateNewLpRequest.ts | 18 + .../requests/DeleteContactMembersRequest.ts | 15 + .../requests/DeleteLoyaltyProgramRequest.ts | 12 + .../requests/GetLoyaltyProgramInfoRequest.ts | 12 + .../client/requests/GetLpListRequest.ts | 18 + .../GetParameterSubscriptionInfoRequest.ts | 18 + .../PartiallyUpdateLoyaltyProgramRequest.ts | 18 + .../requests/PublishLoyaltyProgramRequest.ts | 12 + .../SubscribeMemberToASubscriptionRequest.ts | 19 + .../SubscribeToLoyaltyProgramRequest.ts | 19 + .../requests/UpdateLoyaltyProgramRequest.ts | 19 + .../program/client/requests/index.ts | 11 + src/api/resources/program/index.ts | 2 + .../types/GetLpListRequestSortField.ts | 8 + .../program/types/GetLpListResponse.ts | 8 + .../GetParameterSubscriptionInfoResponse.ts | 95 + .../SubscribeMemberToASubscriptionResponse.ts | 14 + .../SubscribeToLoyaltyProgramResponse.ts | 18 + src/api/resources/program/types/index.ts | 5 + src/api/resources/reward/client/Client.ts | 978 + src/api/resources/reward/client/index.ts | 1 + .../CompleteRedeemTransactionRequest.ts | 15 + .../client/requests/CreateRewardRequest.ts | 21 + .../client/requests/CreateVoucherRequest.ts | 27 + .../client/requests/GetCodeCountRequest.ts | 15 + ...GetLoyaltyOfferProgramsPidOffersRequest.ts | 22 + ...oyaltyOfferProgramsPidRewardsRidRequest.ts | 19 + ...tLoyaltyOfferProgramsPidVouchersRequest.ts | 29 + .../client/requests/RedeemVoucherRequest.ts | 100 + .../client/requests/RevokeVouchersRequest.ts | 14 + .../client/requests/ValidateRewardRequest.ts | 24 + .../resources/reward/client/requests/index.ts | 10 + src/api/resources/reward/index.ts | 2 + .../reward/types/CreateRewardResponse.ts | 20 + .../reward/types/CreateVoucherResponse.ts | 26 + .../reward/types/GetCodeCountResponse.ts | 6 + ...ltyOfferProgramsPidOffersRequestVersion.ts | 8 + ...etLoyaltyOfferProgramsPidOffersResponse.ts | 35 + ...fferProgramsPidRewardsRidRequestVersion.ts | 8 + ...yaltyOfferProgramsPidRewardsRidResponse.ts | 222 + ...altyOfferProgramsPidVouchersRequestSort.ts | 8 + ...fferProgramsPidVouchersRequestSortField.ts | 8 + ...LoyaltyOfferProgramsPidVouchersResponse.ts | 43 + .../reward/types/ValidateRewardResponse.ts | 6 + src/api/resources/reward/types/index.ts | 11 + src/api/resources/senders/client/Client.ts | 673 + src/api/resources/senders/client/index.ts | 1 + .../client/requests/CreateSenderRequest.ts | 81 + .../client/requests/DeleteSenderRequest.ts | 12 + .../requests/GetIpsFromSenderRequest.ts | 17 + .../client/requests/GetSendersRequest.ts | 15 + .../client/requests/UpdateSenderRequest.ts | 83 + .../requests/ValidateSenderByOtpRequest.ts | 21 + .../senders/client/requests/index.ts | 6 + src/api/resources/senders/index.ts | 2 + .../senders/types/CreateSenderResponse.ts | 16 + .../senders/types/GetIpsFromSenderResponse.ts | 26 + .../resources/senders/types/GetIpsResponse.ts | 26 + .../senders/types/GetSendersResponse.ts | 44 + src/api/resources/senders/types/index.ts | 4 + .../resources/smsCampaigns/client/Client.ts | 769 + .../resources/smsCampaigns/client/index.ts | 1 + .../requests/CreateSmsCampaignRequest.ts | 36 + .../requests/DeleteSmsCampaignRequest.ts | 12 + .../client/requests/GetSmsCampaignRequest.ts | 12 + .../client/requests/GetSmsCampaignsRequest.ts | 22 + .../RequestSmsRecipientExportRequest.ts | 30 + .../requests/SendSmsCampaignNowRequest.ts | 12 + .../client/requests/SendSmsReportRequest.ts | 21 + .../client/requests/SendTestSmsRequest.ts | 14 + .../requests/UpdateSmsCampaignRequest.ts | 36 + .../UpdateSmsCampaignStatusRequest.ts | 16 + .../smsCampaigns/client/requests/index.ts | 10 + src/api/resources/smsCampaigns/index.ts | 2 + .../types/CreateSmsCampaignResponse.ts | 6 + .../types/GetSmsCampaignResponse.ts | 37 + .../types/GetSmsCampaignsRequestSort.ts | 7 + .../types/GetSmsCampaignsRequestStatus.ts | 12 + .../types/GetSmsCampaignsResponse.ts | 49 + .../RequestSmsRecipientExportResponse.ts | 6 + src/api/resources/smsCampaigns/types/index.ts | 6 + .../resources/smsTemplates/client/Client.ts | 92 + .../resources/smsTemplates/client/index.ts | 1 + .../client/requests/GetSmsTemplatesRequest.ts | 16 + .../smsTemplates/client/requests/index.ts | 1 + src/api/resources/smsTemplates/index.ts | 2 + .../types/GetSmsTemplatesRequestSort.ts | 7 + .../types/GetSmsTemplatesResponse.ts | 54 + src/api/resources/smsTemplates/types/index.ts | 2 + src/api/resources/tasks/client/Client.ts | 446 + src/api/resources/tasks/client/index.ts | 1 + .../requests/DeleteCrmTasksIdRequest.ts | 11 + .../client/requests/GetCrmTasksIdRequest.ts | 11 + .../client/requests/GetCrmTasksRequest.ts | 38 + .../client/requests/PatchCrmTasksIdRequest.ts | 34 + .../client/requests/PostCrmTasksRequest.ts | 35 + .../resources/tasks/client/requests/index.ts | 5 + src/api/resources/tasks/index.ts | 2 + .../types/GetCrmTasksRequestFilterDate.ts | 11 + .../types/GetCrmTasksRequestFilterStatus.ts | 8 + .../tasks/types/GetCrmTasksRequestSort.ts | 7 + .../tasks/types/GetCrmTasksResponse.ts | 11 + .../tasks/types/GetCrmTasktypesResponse.ts | 11 + .../tasks/types/PostCrmTasksResponse.ts | 9 + src/api/resources/tasks/types/index.ts | 6 + src/api/resources/tier/client/Client.ts | 945 + src/api/resources/tier/client/index.ts | 1 + .../requests/AddSubscriptionToTierRequest.ts | 18 + .../requests/CreateTierForTierGroupRequest.ts | 45 + .../client/requests/CreateTierGroupRequest.ts | 38 + .../client/requests/DeleteTierGroupRequest.ts | 15 + .../tier/client/requests/DeleteTierRequest.ts | 15 + .../requests/GetListOfTierGroupsRequest.ts | 16 + .../requests/GetLoyaltyProgramTierRequest.ts | 16 + .../client/requests/GetTierGroupRequest.ts | 19 + .../client/requests/UpdateTierGroupRequest.ts | 44 + .../tier/client/requests/UpdateTierRequest.ts | 46 + .../resources/tier/client/requests/index.ts | 10 + src/api/resources/tier/index.ts | 2 + .../types/AddSubscriptionToTierResponse.ts | 16 + .../GetListOfTierGroupsRequestVersion.ts | 8 + .../tier/types/GetListOfTierGroupsResponse.ts | 7 + .../GetLoyaltyProgramTierRequestVersion.ts | 8 + .../types/GetLoyaltyProgramTierResponse.ts | 7 + .../tier/types/GetTierGroupRequestVersion.ts | 7 + src/api/resources/tier/types/index.ts | 6 + .../transactionalEmails/client/Client.ts | 1622 ++ .../transactionalEmails/client/index.ts | 1 + .../client/requests/BlockNewDomainRequest.ts | 12 + .../requests/CreateSmtpTemplateRequest.ts | 46 + .../requests/DeleteBlockedDomainRequest.ts | 12 + .../requests/DeleteHardbouncesRequest.ts | 14 + .../DeleteScheduledEmailByIdRequest.ts | 12 + .../DeleteSmtpBlockedContactsEmailRequest.ts | 12 + .../DeleteSmtpLogIdentifierRequest.ts | 12 + .../requests/DeleteSmtpTemplateRequest.ts | 12 + .../GetAggregatedSmtpReportRequest.ts | 16 + .../requests/GetEmailEventReportRequest.ts | 32 + .../requests/GetScheduledEmailByIdRequest.ts | 35 + .../client/requests/GetSmtpReportRequest.ts | 24 + .../client/requests/GetSmtpTemplateRequest.ts | 12 + .../requests/GetSmtpTemplatesRequest.ts | 18 + .../GetTransacBlockedContactsRequest.ts | 22 + .../requests/GetTransacEmailContentRequest.ts | 12 + .../requests/GetTransacEmailsListRequest.ts | 26 + .../requests/SendTestTemplateRequest.ts | 16 + .../requests/SendTransacEmailRequest.ts | 207 + .../requests/UpdateSmtpTemplateRequest.ts | 46 + .../client/requests/index.ts | 20 + .../resources/transactionalEmails/index.ts | 2 + .../types/CreateSmtpTemplateResponse.ts | 6 + .../types/GetAggregatedSmtpReportResponse.ts | 30 + .../types/GetBlockedDomainsResponse.ts | 6 + .../types/GetEmailEventReportRequestEvent.ts | 20 + .../types/GetEmailEventReportRequestSort.ts | 8 + .../types/GetEmailEventReportResponse.ts | 57 + .../types/GetScheduledEmailByIdRequestSort.ts | 8 + .../GetScheduledEmailByIdRequestStatus.ts | 9 + .../types/GetScheduledEmailByIdResponse.ts | 18 + .../types/GetSmtpReportRequestSort.ts | 7 + .../types/GetSmtpReportResponse.ts | 40 + .../types/GetSmtpTemplatesRequestSort.ts | 8 + .../types/GetSmtpTemplatesResponse.ts | 9 + .../GetTransacBlockedContactsRequestSort.ts | 8 + .../GetTransacBlockedContactsResponse.ts | 49 + .../types/GetTransacEmailContentResponse.ts | 31 + .../types/GetTransacEmailsListRequestSort.ts | 8 + .../types/GetTransacEmailsListResponse.ts | 32 + .../PostPreviewSmtpEmailTemplatesResponse.ts | 15 + .../types/SendTransacEmailResponse.ts | 7 + .../transactionalEmails/types/index.ts | 20 + .../transactionalSms/client/Client.ts | 410 + .../transactionalSms/client/index.ts | 1 + .../client/requests/GetSmsEventsRequest.ts | 28 + .../GetTransacAggregatedSmsReportRequest.ts | 16 + .../requests/GetTransacSmsReportRequest.ts | 20 + .../transactionalSms/client/requests/index.ts | 3 + src/api/resources/transactionalSms/index.ts | 2 + .../types/GetSmsEventsRequestEvent.ts | 16 + .../types/GetSmsEventsRequestSort.ts | 7 + .../types/GetSmsEventsResponse.ts | 45 + .../GetTransacAggregatedSmsReportResponse.ts | 26 + .../types/GetTransacSmsReportRequestSort.ts | 8 + .../types/GetTransacSmsReportResponse.ts | 36 + .../SendAsyncTransactionalSmsResponse.ts | 5 + .../types/SendTransacSmsResponse.ts | 12 + .../resources/transactionalSms/types/index.ts | 8 + .../transactionalWhatsApp/client/Client.ts | 171 + .../transactionalWhatsApp/client/index.ts | 1 + .../requests/GetWhatsappEventReportRequest.ts | 26 + .../client/requests/index.ts | 1 + .../resources/transactionalWhatsApp/index.ts | 2 + .../GetWhatsappEventReportRequestEvent.ts | 13 + .../GetWhatsappEventReportRequestSort.ts | 8 + .../types/GetWhatsappEventReportResponse.ts | 44 + .../types/SendWhatsappMessageRequest.ts | 14 + .../types/SendWhatsappMessageResponse.ts | 6 + .../transactionalWhatsApp/types/index.ts | 5 + src/api/resources/user/client/Client.ts | 585 + src/api/resources/user/client/index.ts | 1 + .../requests/GetUserPermissionRequest.ts | 12 + .../PutRevokeUserPermissionRequest.ts | 12 + .../PutresendcancelinvitationRequest.ts | 17 + .../resources/user/client/requests/index.ts | 3 + src/api/resources/user/index.ts | 2 + .../user/types/EditUserPermissionResponse.ts | 10 + .../user/types/GetInvitedUsersListResponse.ts | 37 + .../user/types/GetUserPermissionResponse.ts | 24 + .../user/types/InviteuserResponse.ts | 8 + .../types/PutRevokeUserPermissionResponse.ts | 8 + .../PutresendcancelinvitationRequestAction.ts | 8 + .../PutresendcancelinvitationResponse.ts | 8 + src/api/resources/user/types/index.ts | 7 + src/api/resources/webhooks/client/Client.ts | 520 + src/api/resources/webhooks/client/index.ts | 1 + .../client/requests/CreateWebhookRequest.ts | 110 + .../client/requests/DeleteWebhookRequest.ts | 12 + .../requests/ExportWebhooksHistoryRequest.ts | 74 + .../client/requests/GetWebhookRequest.ts | 12 + .../client/requests/GetWebhooksRequest.ts | 14 + .../client/requests/UpdateWebhookRequest.ts | 83 + .../webhooks/client/requests/index.ts | 6 + src/api/resources/webhooks/index.ts | 2 + .../webhooks/types/CreateWebhookResponse.ts | 6 + .../types/ExportWebhooksHistoryResponse.ts | 6 + .../webhooks/types/GetWebhooksRequestSort.ts | 7 + .../webhooks/types/GetWebhooksRequestType.ts | 8 + .../webhooks/types/GetWebhooksResponse.ts | 7 + src/api/resources/webhooks/types/index.ts | 5 + .../whatsAppCampaigns/client/Client.ts | 710 + .../whatsAppCampaigns/client/index.ts | 1 + .../requests/CreateWhatsAppCampaignRequest.ts | 35 + .../requests/CreateWhatsAppTemplateRequest.ts | 45 + .../requests/DeleteWhatsAppCampaignRequest.ts | 12 + .../requests/GetWhatsAppCampaignRequest.ts | 12 + .../requests/GetWhatsAppCampaignsRequest.ts | 20 + .../requests/GetWhatsAppTemplatesRequest.ts | 22 + .../SendWhatsAppTemplateApprovalRequest.ts | 12 + .../requests/UpdateWhatsAppCampaignRequest.ts | 41 + .../client/requests/index.ts | 8 + src/api/resources/whatsAppCampaigns/index.ts | 2 + .../types/CreateWhatsAppCampaignResponse.ts | 6 + .../types/CreateWhatsAppTemplateResponse.ts | 6 + .../types/GetWhatsAppCampaignResponse.ts | 69 + .../types/GetWhatsAppCampaignsRequestSort.ts | 8 + .../types/GetWhatsAppCampaignsResponse.ts | 54 + .../types/GetWhatsAppConfigResponse.ts | 41 + .../types/GetWhatsAppTemplatesRequestSort.ts | 8 + .../GetWhatsAppTemplatesRequestSource.ts | 8 + .../types/GetWhatsAppTemplatesResponse.ts | 32 + .../whatsAppCampaigns/types/index.ts | 9 + src/api/types/AbTestVersionClicks.ts | 8 + src/api/types/AbTestVersionClicksItem.ts | 10 + src/api/types/AbTestVersionStats.ts | 11 + src/api/types/BadRequestErrorBody.ts | 51 + src/api/types/BalanceDefinition.ts | 55 + src/api/types/BalanceLimit.ts | 24 + src/api/types/Cart.ts | 11 + src/api/types/Company.ts | 15 + src/api/types/Configuration.ts | 9 + src/api/types/ContactErrorModel.ts | 24 + src/api/types/ConversationsMessage.ts | 166 + src/api/types/ConversionSourceMetrics.ts | 19 + src/api/types/CreateUpdateFolder.ts | 6 + src/api/types/Deal.ts | 15 + src/api/types/ErrorModel.ts | 8 + src/api/types/FileData.ts | 21 + src/api/types/ForbiddenErrorBody.ts | 51 + src/api/types/GetCampaignRecipients.ts | 6 + src/api/types/GetCampaignStats.ts | 40 + src/api/types/GetCategoryDetails.ts | 16 + src/api/types/GetContactDetails.ts | 27 + src/api/types/GetContacts.ts | 9 + src/api/types/GetCouponCollection.ts | 22 + src/api/types/GetDeviceBrowserStats.ts | 12 + src/api/types/GetExtendedCampaignOverview.ts | 98 + src/api/types/GetExtendedCampaignStats.ts | 37 + src/api/types/GetFolder.ts | 14 + src/api/types/GetList.ts | 14 + src/api/types/GetProductDetails.ts | 36 + src/api/types/GetSmsCampaignOverview.ts | 33 + src/api/types/GetSmsCampaignStats.ts | 18 + src/api/types/GetSmtpTemplateOverview.ts | 40 + src/api/types/GetSsoToken.ts | 6 + src/api/types/GetWebhook.ts | 42 + src/api/types/Inviteuser.ts | 84 + src/api/types/LoyaltyProgram.ts | 37 + src/api/types/NodeResponse.ts | 22 + src/api/types/NotFoundErrorBody.ts | 51 + src/api/types/Note.ts | 21 + src/api/types/NoteData.ts | 15 + src/api/types/Notification.ts | 11 + src/api/types/Order.ts | 85 + src/api/types/Pipeline.ts | 29 + src/api/types/Pipelines.ts | 8 + src/api/types/PostContactInfo.ts | 21 + src/api/types/PostSendFailed.ts | 11 + src/api/types/Redeem.ts | 32 + src/api/types/RuleConditionResponse.ts | 16 + src/api/types/SendReport.ts | 31 + src/api/types/SendTestEmail.ts | 6 + src/api/types/SendTransacSms.ts | 42 + src/api/types/Task.ts | 19 + src/api/types/TaskReminder.ts | 34 + src/api/types/Tier.ts | 46 + src/api/types/TierGroup.ts | 37 + src/api/types/Transaction.ts | 37 + src/api/types/UnauthorizedErrorBody.ts | 51 + src/api/types/UpdateCampaignStatus.ts | 24 + src/api/types/ValueResponse.ts | 22 + src/api/types/VariablesItems.ts | 7 + src/api/types/WhatsappCampStats.ts | 9 + src/api/types/index.ts | 61 + src/auth/HeaderAuthProvider.ts | 48 + src/auth/index.ts | 1 + src/core/auth/AuthProvider.ts | 6 + src/core/auth/AuthRequest.ts | 9 + src/core/auth/BasicAuth.ts | 32 + src/core/auth/BearerToken.ts | 20 + src/core/auth/NoOpAuthProvider.ts | 8 + src/core/auth/index.ts | 5 + src/core/base64.ts | 27 + src/core/exports.ts | 2 + src/core/fetcher/APIResponse.ts | 23 + src/core/fetcher/BinaryResponse.ts | 34 + src/core/fetcher/EndpointMetadata.ts | 13 + src/core/fetcher/EndpointSupplier.ts | 14 + src/core/fetcher/Fetcher.ts | 391 + src/core/fetcher/Headers.ts | 93 + src/core/fetcher/HttpResponsePromise.ts | 116 + src/core/fetcher/RawResponse.ts | 61 + src/core/fetcher/Supplier.ts | 11 + src/core/fetcher/createRequestUrl.ts | 6 + src/core/fetcher/getErrorResponseBody.ts | 33 + src/core/fetcher/getFetchFn.ts | 3 + src/core/fetcher/getHeader.ts | 8 + src/core/fetcher/getRequestBody.ts | 20 + src/core/fetcher/getResponseBody.ts | 58 + src/core/fetcher/index.ts | 11 + src/core/fetcher/makeRequest.ts | 42 + src/core/fetcher/requestWithRetries.ts | 64 + src/core/fetcher/signals.ts | 26 + src/core/file/exports.ts | 1 + src/core/file/file.ts | 217 + src/core/file/index.ts | 2 + src/core/file/types.ts | 81 + src/core/form-data-utils/FormDataWrapper.ts | 140 + .../form-data-utils/encodeAsFormParameter.ts | 12 + src/core/form-data-utils/index.ts | 2 + src/core/headers.ts | 33 + src/core/index.ts | 8 + src/core/json.ts | 27 + src/core/logging/exports.ts | 19 + src/core/logging/index.ts | 1 + src/core/logging/logger.ts | 203 + src/core/runtime/index.ts | 1 + src/core/runtime/runtime.ts | 134 + src/core/url/encodePathParam.ts | 18 + src/core/url/index.ts | 3 + src/core/url/join.ts | 79 + src/core/url/qs.ts | 74 + src/environments.ts | 7 + src/errors/BrevoError.ts | 58 + src/errors/BrevoTimeoutError.ts | 13 + src/errors/handleNonStatusCodeError.ts | 37 + src/errors/index.ts | 2 + src/exports.ts | 1 + src/index.ts | 6 + src/version.ts | 1 + tests/custom.test.ts | 13 + tests/mock-server/MockServer.ts | 29 + tests/mock-server/MockServerPool.ts | 106 + tests/mock-server/mockEndpointBuilder.ts | 227 + tests/mock-server/randomBaseUrl.ts | 4 + tests/mock-server/setup.ts | 10 + tests/mock-server/withFormUrlEncoded.ts | 89 + tests/mock-server/withHeaders.ts | 70 + tests/mock-server/withJson.ts | 173 + tests/setup.ts | 80 + tests/tsconfig.json | 11 + tests/unit/auth/BasicAuth.test.ts | 92 + tests/unit/auth/BearerToken.test.ts | 14 + tests/unit/base64.test.ts | 53 + tests/unit/fetcher/Fetcher.test.ts | 262 + .../unit/fetcher/HttpResponsePromise.test.ts | 143 + tests/unit/fetcher/RawResponse.test.ts | 34 + tests/unit/fetcher/createRequestUrl.test.ts | 163 + tests/unit/fetcher/getRequestBody.test.ts | 129 + tests/unit/fetcher/getResponseBody.test.ts | 97 + tests/unit/fetcher/logging.test.ts | 517 + tests/unit/fetcher/makeRequest.test.ts | 54 + tests/unit/fetcher/redacting.test.ts | 1115 + tests/unit/fetcher/requestWithRetries.test.ts | 230 + tests/unit/fetcher/signals.test.ts | 69 + tests/unit/fetcher/test-file.txt | 1 + tests/unit/file/file.test.ts | 498 + .../encodeAsFormParameter.test.ts | 344 + .../form-data-utils/formDataWrapper.test.ts | 346 + tests/unit/logging/logger.test.ts | 454 + tests/unit/test-file.txt | 1 + tests/unit/url/join.test.ts | 284 + tests/unit/url/qs.test.ts | 278 + tests/wire/.gitkeep | 0 tests/wire/account.test.ts | 232 + tests/wire/balance.test.ts | 2995 +++ tests/wire/companies.test.ts | 447 + tests/wire/contacts.test.ts | 2791 +++ tests/wire/conversations.test.ts | 1925 ++ tests/wire/coupons.test.ts | 378 + tests/wire/customObjects.test.ts | 373 + tests/wire/deals.test.ts | 513 + tests/wire/domains.test.ts | 768 + tests/wire/ecommerce.test.ts | 1347 ++ tests/wire/emailCampaigns.test.ts | 1712 ++ tests/wire/event.test.ts | 65 + tests/wire/externalFeeds.test.ts | 670 + tests/wire/files.test.ts | 190 + tests/wire/inboundParsing.test.ts | 140 + tests/wire/masterAccount.test.ts | 1590 ++ tests/wire/notes.test.ts | 327 + tests/wire/payments.test.ts | 329 + tests/wire/process.test.ts | 324 + tests/wire/program.test.ts | 1712 ++ tests/wire/reward.test.ts | 1731 ++ tests/wire/senders.test.ts | 798 + tests/wire/smsCampaigns.test.ts | 736 + tests/wire/smsTemplates.test.ts | 84 + tests/wire/tasks.test.ts | 269 + tests/wire/tier.test.ts | 1656 ++ tests/wire/transactionalEmails.test.ts | 1442 ++ tests/wire/transactionalSms.test.ts | 384 + tests/wire/transactionalWhatsApp.test.ts | 179 + tests/wire/user.test.ts | 425 + tests/wire/webhooks.test.ts | 376 + tests/wire/whatsAppCampaigns.test.ts | 572 + tsconfig.base.json | 18 + tsconfig.cjs.json | 9 + tsconfig.esm.json | 10 + tsconfig.json | 23 +- vitest.config.mts | 28 + yarn.lock | 853 - 1277 files changed, 94609 insertions(+), 51069 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc create mode 100644 .fern/metadata.json create mode 100644 .fernignore delete mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .openapi-generator-ignore delete mode 100644 .openapi-generator/FILES delete mode 100644 .openapi-generator/VERSION delete mode 100644 .swagger-codegen/VERSION create mode 100644 CONTRIBUTING.md delete mode 100644 LICENSE.md delete mode 100644 api.ts delete mode 100644 api/accountApi.ts delete mode 100644 api/apis.ts delete mode 100644 api/companiesApi.ts delete mode 100644 api/contactsApi.ts delete mode 100644 api/conversationsApi.ts delete mode 100644 api/couponsApi.ts delete mode 100644 api/dealsApi.ts delete mode 100644 api/domainsApi.ts delete mode 100644 api/ecommerceApi.ts delete mode 100644 api/emailCampaignsApi.ts delete mode 100644 api/eventsApi.ts delete mode 100644 api/externalFeedsApi.ts delete mode 100644 api/filesApi.ts delete mode 100644 api/inboundParsingApi.ts delete mode 100644 api/masterAccountApi.ts delete mode 100644 api/notesApi.ts delete mode 100644 api/paymentsApi.ts delete mode 100644 api/processApi.ts delete mode 100644 api/resellerApi.ts delete mode 100644 api/sMSCampaignsApi.ts delete mode 100644 api/sendersApi.ts delete mode 100644 api/tasksApi.ts delete mode 100644 api/transactionalEmailsApi.ts delete mode 100644 api/transactionalSMSApi.ts delete mode 100644 api/transactionalWhatsAppApi.ts delete mode 100644 api/userApi.ts delete mode 100644 api/webhooksApi.ts delete mode 100644 api/whatsAppCampaignsApi.ts create mode 100644 biome.json delete mode 100644 git_push.sh delete mode 100644 model/abTestCampaignResult.ts delete mode 100644 model/abTestCampaignResultClickedLinks.ts delete mode 100644 model/abTestCampaignResultStatistics.ts delete mode 100644 model/abTestVersionClicksInner.ts delete mode 100644 model/abTestVersionStats.ts delete mode 100644 model/addChildDomain.ts delete mode 100644 model/addContactToList.ts delete mode 100644 model/addCredits.ts delete mode 100644 model/authenticateDomainModel.ts delete mode 100644 model/blockDomain.ts delete mode 100644 model/cart.ts delete mode 100644 model/companiesIdPatchRequest.ts delete mode 100644 model/companiesLinkUnlinkIdPatchRequest.ts delete mode 100644 model/companiesList.ts delete mode 100644 model/companiesPost200Response.ts delete mode 100644 model/companiesPostRequest.ts delete mode 100644 model/company.ts delete mode 100644 model/companyAttributesInner.ts delete mode 100644 model/componentItems.ts delete mode 100644 model/configuration.ts delete mode 100644 model/conversationsAgentOnlinePingPostRequest.ts delete mode 100644 model/conversationsMessage.ts delete mode 100644 model/conversationsMessageFile.ts delete mode 100644 model/conversationsMessageFileImageInfo.ts delete mode 100644 model/conversationsMessagesIdPutRequest.ts delete mode 100644 model/conversationsMessagesPostRequest.ts delete mode 100644 model/conversationsPushedMessagesIdPutRequest.ts delete mode 100644 model/conversationsPushedMessagesPostRequest.ts delete mode 100644 model/conversionSourceMetrics.ts delete mode 100644 model/conversionSourceProduct.ts delete mode 100644 model/corporateGroupDetailsResponse.ts delete mode 100644 model/corporateGroupDetailsResponseGroup.ts delete mode 100644 model/corporateGroupDetailsResponseSubAccountsInner.ts delete mode 100644 model/corporateGroupDetailsResponseUsersInner.ts delete mode 100644 model/corporateGroupPost201Response.ts delete mode 100644 model/corporateGroupPostRequest.ts delete mode 100644 model/corporateGroupUnlinkGroupIdSubAccountsPutRequest.ts delete mode 100644 model/corporateSubAccountIpAssociatePostRequest.ts delete mode 100644 model/corporateSubAccountIpDissociatePutRequest.ts delete mode 100644 model/corporateUserInvitationActionEmailPut200Response.ts delete mode 100644 model/createApiKeyRequest.ts delete mode 100644 model/createApiKeyResponse.ts delete mode 100644 model/createAttribute.ts delete mode 100644 model/createAttributeEnumerationInner.ts delete mode 100644 model/createCategoryModel.ts delete mode 100644 model/createChild.ts delete mode 100644 model/createContact.ts delete mode 100644 model/createCouponCollection201Response.ts delete mode 100644 model/createCouponCollectionRequest.ts delete mode 100644 model/createCouponsRequest.ts delete mode 100644 model/createDoiContact.ts delete mode 100644 model/createDomain.ts delete mode 100644 model/createDomainModel.ts delete mode 100644 model/createDomainModelDnsRecords.ts delete mode 100644 model/createDomainModelDnsRecordsDkimRecord.ts delete mode 100644 model/createEmailCampaign.ts delete mode 100644 model/createEmailCampaignRecipients.ts delete mode 100644 model/createEmailCampaignSender.ts delete mode 100644 model/createExternalFeed.ts delete mode 100644 model/createExternalFeed201Response.ts delete mode 100644 model/createList.ts delete mode 100644 model/createModel.ts delete mode 100644 model/createPaymentRequest.ts delete mode 100644 model/createPaymentResponse.ts delete mode 100644 model/createProductModel.ts delete mode 100644 model/createReseller.ts delete mode 100644 model/createSender.ts delete mode 100644 model/createSenderIpsInner.ts delete mode 100644 model/createSenderModel.ts delete mode 100644 model/createSmsCampaign.ts delete mode 100644 model/createSmsCampaignRecipients.ts delete mode 100644 model/createSmtpEmail.ts delete mode 100644 model/createSmtpTemplate.ts delete mode 100644 model/createSmtpTemplateSender.ts delete mode 100644 model/createSubAccount.ts delete mode 100644 model/createSubAccountResponse.ts delete mode 100644 model/createUpdateBatchCategory.ts delete mode 100644 model/createUpdateBatchCategoryModel.ts delete mode 100644 model/createUpdateBatchProducts.ts delete mode 100644 model/createUpdateBatchProductsModel.ts delete mode 100644 model/createUpdateCategories.ts delete mode 100644 model/createUpdateCategory.ts delete mode 100644 model/createUpdateContactModel.ts delete mode 100644 model/createUpdateFolder.ts delete mode 100644 model/createUpdateProduct.ts delete mode 100644 model/createUpdateProducts.ts delete mode 100644 model/createWebhook.ts delete mode 100644 model/createWhatsAppCampaign.ts delete mode 100644 model/createWhatsAppCampaignRecipients.ts delete mode 100644 model/createWhatsAppTemplate.ts delete mode 100644 model/createdBatchId.ts delete mode 100644 model/createdProcessId.ts delete mode 100644 model/crmDealsIdPatchRequest.ts delete mode 100644 model/crmDealsLinkUnlinkIdPatchRequest.ts delete mode 100644 model/crmDealsPost201Response.ts delete mode 100644 model/crmDealsPostRequest.ts delete mode 100644 model/crmTasksIdPatchRequest.ts delete mode 100644 model/crmTasksPost201Response.ts delete mode 100644 model/crmTasksPostRequest.ts delete mode 100644 model/deal.ts delete mode 100644 model/dealAttributesInner.ts delete mode 100644 model/dealsList.ts delete mode 100644 model/deleteHardbounces.ts delete mode 100644 model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ts delete mode 100644 model/ecommerceAttributionMetricsGet200Response.ts delete mode 100644 model/ecommerceAttributionMetricsGet200ResponseTotals.ts delete mode 100644 model/ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.ts delete mode 100644 model/ecommerceConfigDisplayCurrencyGet200Response.ts delete mode 100644 model/emailExportRecipients.ts delete mode 100644 model/errorModel.ts delete mode 100644 model/event.ts delete mode 100644 model/eventIdentifiers.ts delete mode 100644 model/exportWebhooksHistory.ts delete mode 100644 model/fileData.ts delete mode 100644 model/fileDownloadableLink.ts delete mode 100644 model/getAccount.ts delete mode 100644 model/getAccountActivity.ts delete mode 100644 model/getAccountActivityLogsInner.ts delete mode 100644 model/getAccountAllOfMarketingAutomation.ts delete mode 100644 model/getAccountAllOfPlan.ts delete mode 100644 model/getAccountAllOfRelay.ts delete mode 100644 model/getAccountAllOfRelayData.ts delete mode 100644 model/getAggregatedReport.ts delete mode 100644 model/getAllExternalFeeds.ts delete mode 100644 model/getAllExternalFeedsFeedsInner.ts delete mode 100644 model/getAttributes.ts delete mode 100644 model/getAttributesAttributesInner.ts delete mode 100644 model/getAttributesAttributesInnerEnumerationInner.ts delete mode 100644 model/getBlockedDomains.ts delete mode 100644 model/getCampaignOverview.ts delete mode 100644 model/getCampaignRecipients.ts delete mode 100644 model/getCampaignStats.ts delete mode 100644 model/getCategories.ts delete mode 100644 model/getCategoryDetails.ts delete mode 100644 model/getChildAccountCreationStatus.ts delete mode 100644 model/getChildDomain.ts delete mode 100644 model/getChildInfo.ts delete mode 100644 model/getChildInfoAllOfApiKeys.ts delete mode 100644 model/getChildInfoAllOfApiKeysV2.ts delete mode 100644 model/getChildInfoAllOfApiKeysV3.ts delete mode 100644 model/getChildInfoAllOfCredits.ts delete mode 100644 model/getChildInfoAllOfStatistics.ts delete mode 100644 model/getChildrenList.ts delete mode 100644 model/getChildrenListChildrenInner.ts delete mode 100644 model/getClient.ts delete mode 100644 model/getContactCampaignStats.ts delete mode 100644 model/getContactCampaignStatsClickedInner.ts delete mode 100644 model/getContactCampaignStatsClickedInnerLinksInner.ts delete mode 100644 model/getContactCampaignStatsMessagesSentInner.ts delete mode 100644 model/getContactCampaignStatsOpenedInner.ts delete mode 100644 model/getContactCampaignStatsTransacAttributesInner.ts delete mode 100644 model/getContactCampaignStatsUnsubscriptions.ts delete mode 100644 model/getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner.ts delete mode 100644 model/getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner.ts delete mode 100644 model/getContactDetails.ts delete mode 100644 model/getContacts.ts delete mode 100644 model/getCorporateInvitedUsersList.ts delete mode 100644 model/getCorporateInvitedUsersListUsersInner.ts delete mode 100644 model/getCorporateInvitedUsersListUsersInnerFeatureAccess.ts delete mode 100644 model/getCorporateInvitedUsersListUsersInnerGroups.ts delete mode 100644 model/getCorporateUserPermission.ts delete mode 100644 model/getCorporateUserPermissionFeatureAccess.ts delete mode 100644 model/getCorporateUserPermissionGroupsInner.ts delete mode 100644 model/getCouponCollection.ts delete mode 100644 model/getDeviceBrowserStats.ts delete mode 100644 model/getDomainConfigurationModel.ts delete mode 100644 model/getDomainsList.ts delete mode 100644 model/getDomainsListDomainsInner.ts delete mode 100644 model/getEmailCampaign.ts delete mode 100644 model/getEmailCampaigns.ts delete mode 100644 model/getEmailCampaignsCampaignsInner.ts delete mode 100644 model/getEmailEventReport.ts delete mode 100644 model/getEmailEventReportEventsInner.ts delete mode 100644 model/getExtendedCampaignOverview.ts delete mode 100644 model/getExtendedCampaignOverviewAllOfSender.ts delete mode 100644 model/getExtendedCampaignStats.ts delete mode 100644 model/getExtendedClient.ts delete mode 100644 model/getExtendedClientAllOfAddress.ts delete mode 100644 model/getExtendedContactDetails.ts delete mode 100644 model/getExtendedContactDetailsAllOfStatistics.ts delete mode 100644 model/getExtendedContactDetailsAllOfStatisticsClicked.ts delete mode 100644 model/getExtendedContactDetailsAllOfStatisticsLinks.ts delete mode 100644 model/getExtendedContactDetailsAllOfStatisticsMessagesSent.ts delete mode 100644 model/getExtendedContactDetailsAllOfStatisticsOpened.ts delete mode 100644 model/getExtendedContactDetailsAllOfStatisticsUnsubscriptions.ts delete mode 100644 model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.ts delete mode 100644 model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.ts delete mode 100644 model/getExtendedList.ts delete mode 100644 model/getExtendedListAllOfCampaignStats.ts delete mode 100644 model/getExternalFeedByUUID.ts delete mode 100644 model/getExternalFeedByUUIDHeadersInner.ts delete mode 100644 model/getFolder.ts delete mode 100644 model/getFolderLists.ts delete mode 100644 model/getFolders.ts delete mode 100644 model/getInboundEmailEvents.ts delete mode 100644 model/getInboundEmailEventsByUuid.ts delete mode 100644 model/getInboundEmailEventsByUuidAttachmentsInner.ts delete mode 100644 model/getInboundEmailEventsByUuidLogsInner.ts delete mode 100644 model/getInboundEmailEventsEventsInner.ts delete mode 100644 model/getInvitedUsersList.ts delete mode 100644 model/getInvitedUsersListUsersInner.ts delete mode 100644 model/getInvitedUsersListUsersInnerFeatureAccess.ts delete mode 100644 model/getIp.ts delete mode 100644 model/getIpFromSender.ts delete mode 100644 model/getIps.ts delete mode 100644 model/getIpsFromSender.ts delete mode 100644 model/getList.ts delete mode 100644 model/getLists.ts delete mode 100644 model/getListsListsInner.ts delete mode 100644 model/getOrders.ts delete mode 100644 model/getOrdersOrdersInner.ts delete mode 100644 model/getPaymentRequest.ts delete mode 100644 model/getProcess.ts delete mode 100644 model/getProcesses.ts delete mode 100644 model/getProductDetails.ts delete mode 100644 model/getProducts.ts delete mode 100644 model/getReports.ts delete mode 100644 model/getReportsReportsInner.ts delete mode 100644 model/getScheduledEmailByBatchId.ts delete mode 100644 model/getScheduledEmailByBatchIdBatchesInner.ts delete mode 100644 model/getScheduledEmailByMessageId.ts delete mode 100644 model/getSegments.ts delete mode 100644 model/getSegmentsSegments.ts delete mode 100644 model/getSendersList.ts delete mode 100644 model/getSendersListSendersInner.ts delete mode 100644 model/getSendersListSendersInnerIpsInner.ts delete mode 100644 model/getSharedTemplateUrl.ts delete mode 100644 model/getSmsCampaign.ts delete mode 100644 model/getSmsCampaignOverview.ts delete mode 100644 model/getSmsCampaignStats.ts delete mode 100644 model/getSmsCampaigns.ts delete mode 100644 model/getSmsCampaignsCampaignsInner.ts delete mode 100644 model/getSmsEventReport.ts delete mode 100644 model/getSmsEventReportEventsInner.ts delete mode 100644 model/getSmtpTemplateOverview.ts delete mode 100644 model/getSmtpTemplateOverviewSender.ts delete mode 100644 model/getSmtpTemplates.ts delete mode 100644 model/getSsoToken.ts delete mode 100644 model/getStatsByDevice.ts delete mode 100644 model/getSubAccountGroups200ResponseInner.ts delete mode 100644 model/getTransacAggregatedSmsReport.ts delete mode 100644 model/getTransacBlockedContacts.ts delete mode 100644 model/getTransacBlockedContactsContactsInner.ts delete mode 100644 model/getTransacBlockedContactsContactsInnerReason.ts delete mode 100644 model/getTransacEmailContent.ts delete mode 100644 model/getTransacEmailContentEventsInner.ts delete mode 100644 model/getTransacEmailsList.ts delete mode 100644 model/getTransacEmailsListTransactionalEmailsInner.ts delete mode 100644 model/getTransacSmsReport.ts delete mode 100644 model/getTransacSmsReportReportsInner.ts delete mode 100644 model/getUserPermission.ts delete mode 100644 model/getUserPermissionPrivilegesInner.ts delete mode 100644 model/getWATemplates.ts delete mode 100644 model/getWATemplatesTemplatesInner.ts delete mode 100644 model/getWebhook.ts delete mode 100644 model/getWebhookAuth.ts delete mode 100644 model/getWebhookHeadersInner.ts delete mode 100644 model/getWebhooks.ts delete mode 100644 model/getWhatsAppConfig.ts delete mode 100644 model/getWhatsappCampaignOverview.ts delete mode 100644 model/getWhatsappCampaigns.ts delete mode 100644 model/getWhatsappCampaignsCampaignsInner.ts delete mode 100644 model/getWhatsappEventReport.ts delete mode 100644 model/getWhatsappEventReportEventsInner.ts delete mode 100644 model/inviteAdminUser.ts delete mode 100644 model/inviteAdminUserPrivilegesInner.ts delete mode 100644 model/inviteuser.ts delete mode 100644 model/inviteuserPrivilegesInner.ts delete mode 100644 model/manageIp.ts delete mode 100644 model/masterDetailsResponse.ts delete mode 100644 model/masterDetailsResponseBillingInfo.ts delete mode 100644 model/masterDetailsResponseBillingInfoAddress.ts delete mode 100644 model/masterDetailsResponseBillingInfoName.ts delete mode 100644 model/masterDetailsResponsePlanInfo.ts delete mode 100644 model/masterDetailsResponsePlanInfoFeaturesInner.ts delete mode 100644 model/models.ts delete mode 100644 model/note.ts delete mode 100644 model/noteData.ts delete mode 100644 model/noteId.ts delete mode 100644 model/notification.ts delete mode 100644 model/order.ts delete mode 100644 model/orderBatch.ts delete mode 100644 model/orderBilling.ts delete mode 100644 model/orderProductsInner.ts delete mode 100644 model/otp.ts delete mode 100644 model/pipeline.ts delete mode 100644 model/pipelineStage.ts delete mode 100644 model/postContactInfo.ts delete mode 100644 model/postContactInfoContacts.ts delete mode 100644 model/postSendFailed.ts delete mode 100644 model/postSendSmsTestFailed.ts delete mode 100644 model/putRevokeUserPermission.ts delete mode 100644 model/putresendcancelinvitation.ts delete mode 100644 model/remainingCreditModel.ts delete mode 100644 model/remainingCreditModelChild.ts delete mode 100644 model/remainingCreditModelReseller.ts delete mode 100644 model/removeContactFromList.ts delete mode 100644 model/removeCredits.ts delete mode 100644 model/requestContactExport.ts delete mode 100644 model/requestContactExportCustomContactFilter.ts delete mode 100644 model/requestContactImport.ts delete mode 100644 model/requestContactImportJsonBodyInner.ts delete mode 100644 model/requestContactImportNewList.ts delete mode 100644 model/requestSmsRecipientExport.ts delete mode 100644 model/scheduleSmtpEmail.ts delete mode 100644 model/sendReport.ts delete mode 100644 model/sendReportEmail.ts delete mode 100644 model/sendSms.ts delete mode 100644 model/sendSmtpEmail.ts delete mode 100644 model/sendSmtpEmailAttachmentInner.ts delete mode 100644 model/sendSmtpEmailBccInner.ts delete mode 100644 model/sendSmtpEmailCcInner.ts delete mode 100644 model/sendSmtpEmailMessageVersionsInner.ts delete mode 100644 model/sendSmtpEmailMessageVersionsInnerReplyTo.ts delete mode 100644 model/sendSmtpEmailMessageVersionsInnerToInner.ts delete mode 100644 model/sendSmtpEmailReplyTo.ts delete mode 100644 model/sendSmtpEmailSender.ts delete mode 100644 model/sendSmtpEmailToInner.ts delete mode 100644 model/sendTestEmail.ts delete mode 100644 model/sendTestSms.ts delete mode 100644 model/sendTransacSms.ts delete mode 100644 model/sendWhatsappMessage.ts delete mode 100644 model/sendWhatsappMessage201Response.ts delete mode 100644 model/ssoTokenRequest.ts delete mode 100644 model/ssoTokenRequestCorporate.ts delete mode 100644 model/subAccountAppsToggleRequest.ts delete mode 100644 model/subAccountDetailsResponse.ts delete mode 100644 model/subAccountDetailsResponseGroupsInner.ts delete mode 100644 model/subAccountDetailsResponsePlanInfo.ts delete mode 100644 model/subAccountDetailsResponsePlanInfoCredits.ts delete mode 100644 model/subAccountDetailsResponsePlanInfoCreditsEmails.ts delete mode 100644 model/subAccountDetailsResponsePlanInfoCreditsSms.ts delete mode 100644 model/subAccountDetailsResponsePlanInfoCreditsWpSubscribers.ts delete mode 100644 model/subAccountDetailsResponsePlanInfoFeatures.ts delete mode 100644 model/subAccountDetailsResponsePlanInfoFeaturesInbox.ts delete mode 100644 model/subAccountDetailsResponsePlanInfoFeaturesLandingPage.ts delete mode 100644 model/subAccountDetailsResponsePlanInfoFeaturesUsers.ts delete mode 100644 model/subAccountUpdatePlanRequest.ts delete mode 100644 model/subAccountUpdatePlanRequestCredits.ts delete mode 100644 model/subAccountUpdatePlanRequestFeatures.ts delete mode 100644 model/subAccountsResponse.ts delete mode 100644 model/subAccountsResponseSubAccountsInner.ts delete mode 100644 model/subAccountsResponseSubAccountsInnerGroupsInner.ts delete mode 100644 model/task.ts delete mode 100644 model/taskList.ts delete mode 100644 model/taskReminder.ts delete mode 100644 model/taskTypes.ts delete mode 100644 model/updateAttribute.ts delete mode 100644 model/updateAttributeEnumerationInner.ts delete mode 100644 model/updateBatchContacts.ts delete mode 100644 model/updateBatchContactsContactsInner.ts delete mode 100644 model/updateBatchContactsModel.ts delete mode 100644 model/updateCampaignStatus.ts delete mode 100644 model/updateChild.ts delete mode 100644 model/updateChildAccountStatus.ts delete mode 100644 model/updateChildDomain.ts delete mode 100644 model/updateContact.ts delete mode 100644 model/updateCouponCollection200Response.ts delete mode 100644 model/updateCouponCollectionRequest.ts delete mode 100644 model/updateEmailCampaign.ts delete mode 100644 model/updateEmailCampaignRecipients.ts delete mode 100644 model/updateEmailCampaignSender.ts delete mode 100644 model/updateExternalFeed.ts delete mode 100644 model/updateList.ts delete mode 100644 model/updateSender.ts delete mode 100644 model/updateSmsCampaign.ts delete mode 100644 model/updateSmtpTemplate.ts delete mode 100644 model/updateSmtpTemplateSender.ts delete mode 100644 model/updateWebhook.ts delete mode 100644 model/updateWhatsAppCampaign.ts delete mode 100644 model/uploadImageModel.ts delete mode 100644 model/uploadImageToGallery.ts delete mode 100644 model/variablesItems.ts delete mode 100644 model/whatsappCampStats.ts delete mode 100644 model/whatsappCampTemplate.ts delete mode 100644 package-lock.json create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 reference.md delete mode 100644 requestCompat.ts create mode 100644 scripts/rename-to-esm-files.js create mode 100644 src/BaseClient.ts create mode 100644 src/Client.ts create mode 100644 src/api/errors/BadRequestError.ts create mode 100644 src/api/errors/ConflictError.ts create mode 100644 src/api/errors/ExpectationFailedError.ts create mode 100644 src/api/errors/FailedDependencyError.ts create mode 100644 src/api/errors/ForbiddenError.ts create mode 100644 src/api/errors/InternalServerError.ts create mode 100644 src/api/errors/MethodNotAllowedError.ts create mode 100644 src/api/errors/NotFoundError.ts create mode 100644 src/api/errors/PaymentRequiredError.ts create mode 100644 src/api/errors/PreconditionFailedError.ts create mode 100644 src/api/errors/TooEarlyError.ts create mode 100644 src/api/errors/TooManyRequestsError.ts create mode 100644 src/api/errors/UnauthorizedError.ts create mode 100644 src/api/errors/UnprocessableEntityError.ts create mode 100644 src/api/errors/UnsupportedMediaTypeError.ts create mode 100644 src/api/errors/index.ts create mode 100644 src/api/index.ts create mode 100644 src/api/resources/account/client/Client.ts create mode 100644 src/api/resources/account/client/index.ts create mode 100644 src/api/resources/account/client/requests/GetAccountActivityRequest.ts create mode 100644 src/api/resources/account/client/requests/index.ts create mode 100644 src/api/resources/account/index.ts create mode 100644 src/api/resources/account/types/GetAccountActivityResponse.ts create mode 100644 src/api/resources/account/types/GetAccountResponse.ts create mode 100644 src/api/resources/account/types/index.ts create mode 100644 src/api/resources/balance/client/Client.ts create mode 100644 src/api/resources/balance/client/index.ts create mode 100644 src/api/resources/balance/client/requests/BeginTransactionRequest.ts create mode 100644 src/api/resources/balance/client/requests/CancelTransactionRequest.ts create mode 100644 src/api/resources/balance/client/requests/CompleteTransactionRequest.ts create mode 100644 src/api/resources/balance/client/requests/CreateBalanceLimitRequest.ts create mode 100644 src/api/resources/balance/client/requests/CreateBalanceOrderRequest.ts create mode 100644 src/api/resources/balance/client/requests/DeleteBalanceDefinitionRequest.ts create mode 100644 src/api/resources/balance/client/requests/DeleteBalanceLimitRequest.ts create mode 100644 src/api/resources/balance/client/requests/GetBalanceDefinitionListRequest.ts create mode 100644 src/api/resources/balance/client/requests/GetBalanceDefinitionRequest.ts create mode 100644 src/api/resources/balance/client/requests/GetBalanceLimitRequest.ts create mode 100644 src/api/resources/balance/client/requests/GetContactBalancesRequest.ts create mode 100644 src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts create mode 100644 src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts create mode 100644 src/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.ts create mode 100644 src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.ts create mode 100644 src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest.ts create mode 100644 src/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.ts create mode 100644 src/api/resources/balance/client/requests/UpdateBalanceLimitRequest.ts create mode 100644 src/api/resources/balance/client/requests/index.ts create mode 100644 src/api/resources/balance/index.ts create mode 100644 src/api/resources/balance/types/CreateBalanceOrderResponse.ts create mode 100644 src/api/resources/balance/types/GetBalanceDefinitionListRequestSort.ts create mode 100644 src/api/resources/balance/types/GetBalanceDefinitionListRequestSortField.ts create mode 100644 src/api/resources/balance/types/GetBalanceDefinitionListRequestVersion.ts create mode 100644 src/api/resources/balance/types/GetBalanceDefinitionListResponse.ts create mode 100644 src/api/resources/balance/types/GetBalanceDefinitionRequestVersion.ts create mode 100644 src/api/resources/balance/types/GetBalanceLimitRequestVersion.ts create mode 100644 src/api/resources/balance/types/GetContactBalancesResponse.ts create mode 100644 src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.ts create mode 100644 src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts create mode 100644 src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts create mode 100644 src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts create mode 100644 src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts create mode 100644 src/api/resources/balance/types/index.ts create mode 100644 src/api/resources/companies/client/Client.ts create mode 100644 src/api/resources/companies/client/index.ts create mode 100644 src/api/resources/companies/client/requests/DeleteCompaniesIdRequest.ts create mode 100644 src/api/resources/companies/client/requests/GetCompaniesIdRequest.ts create mode 100644 src/api/resources/companies/client/requests/GetCompaniesRequest.ts create mode 100644 src/api/resources/companies/client/requests/PatchCompaniesIdRequest.ts create mode 100644 src/api/resources/companies/client/requests/PatchCompaniesLinkUnlinkIdRequest.ts create mode 100644 src/api/resources/companies/client/requests/PostCompaniesImportRequest.ts create mode 100644 src/api/resources/companies/client/requests/PostCompaniesRequest.ts create mode 100644 src/api/resources/companies/client/requests/PostCrmAttributesRequest.ts create mode 100644 src/api/resources/companies/client/requests/index.ts create mode 100644 src/api/resources/companies/index.ts create mode 100644 src/api/resources/companies/types/GetCompaniesRequestSort.ts create mode 100644 src/api/resources/companies/types/GetCompaniesResponse.ts create mode 100644 src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts create mode 100644 src/api/resources/companies/types/PostCompaniesImportResponse.ts create mode 100644 src/api/resources/companies/types/PostCompaniesResponse.ts create mode 100644 src/api/resources/companies/types/PostCrmAttributesResponse.ts create mode 100644 src/api/resources/companies/types/index.ts create mode 100644 src/api/resources/contacts/client/Client.ts create mode 100644 src/api/resources/contacts/client/index.ts create mode 100644 src/api/resources/contacts/client/requests/AddContactToListRequest.ts create mode 100644 src/api/resources/contacts/client/requests/CreateAttributeRequest.ts create mode 100644 src/api/resources/contacts/client/requests/CreateContactRequest.ts create mode 100644 src/api/resources/contacts/client/requests/CreateDoiContactRequest.ts create mode 100644 src/api/resources/contacts/client/requests/CreateListRequest.ts create mode 100644 src/api/resources/contacts/client/requests/DeleteAttributeRequest.ts create mode 100644 src/api/resources/contacts/client/requests/DeleteContactRequest.ts create mode 100644 src/api/resources/contacts/client/requests/DeleteFolderRequest.ts create mode 100644 src/api/resources/contacts/client/requests/DeleteListRequest.ts create mode 100644 src/api/resources/contacts/client/requests/DeleteMultiAttributeOptionsRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetContactInfoRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetContactStatsRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetContactsFromListRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetContactsRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetFolderListsRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetFolderRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetFoldersRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetListRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetListsRequest.ts create mode 100644 src/api/resources/contacts/client/requests/GetSegmentsRequest.ts create mode 100644 src/api/resources/contacts/client/requests/ImportContactsRequest.ts create mode 100644 src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts create mode 100644 src/api/resources/contacts/client/requests/RequestContactExportRequest.ts create mode 100644 src/api/resources/contacts/client/requests/UpdateAttributeRequest.ts create mode 100644 src/api/resources/contacts/client/requests/UpdateBatchContactsRequest.ts create mode 100644 src/api/resources/contacts/client/requests/UpdateContactRequest.ts create mode 100644 src/api/resources/contacts/client/requests/UpdateFolderRequest.ts create mode 100644 src/api/resources/contacts/client/requests/UpdateListRequest.ts create mode 100644 src/api/resources/contacts/client/requests/index.ts create mode 100644 src/api/resources/contacts/index.ts create mode 100644 src/api/resources/contacts/types/AddContactToListRequestBody.ts create mode 100644 src/api/resources/contacts/types/CreateAttributeRequestAttributeCategory.ts create mode 100644 src/api/resources/contacts/types/CreateContactResponse.ts create mode 100644 src/api/resources/contacts/types/CreateFolderResponse.ts create mode 100644 src/api/resources/contacts/types/CreateListResponse.ts create mode 100644 src/api/resources/contacts/types/DeleteAttributeRequestAttributeCategory.ts create mode 100644 src/api/resources/contacts/types/DeleteContactRequestIdentifier.ts create mode 100644 src/api/resources/contacts/types/DeleteContactRequestIdentifierType.ts create mode 100644 src/api/resources/contacts/types/GetAttributesResponse.ts create mode 100644 src/api/resources/contacts/types/GetContactInfoRequestIdentifier.ts create mode 100644 src/api/resources/contacts/types/GetContactInfoRequestIdentifierType.ts create mode 100644 src/api/resources/contacts/types/GetContactInfoResponse.ts create mode 100644 src/api/resources/contacts/types/GetContactStatsRequestIdentifier.ts create mode 100644 src/api/resources/contacts/types/GetContactStatsResponse.ts create mode 100644 src/api/resources/contacts/types/GetContactsFromListRequestSort.ts create mode 100644 src/api/resources/contacts/types/GetContactsRequestSort.ts create mode 100644 src/api/resources/contacts/types/GetFolderListsRequestSort.ts create mode 100644 src/api/resources/contacts/types/GetFolderListsResponse.ts create mode 100644 src/api/resources/contacts/types/GetFoldersRequestSort.ts create mode 100644 src/api/resources/contacts/types/GetFoldersResponse.ts create mode 100644 src/api/resources/contacts/types/GetListResponse.ts create mode 100644 src/api/resources/contacts/types/GetListsRequestSort.ts create mode 100644 src/api/resources/contacts/types/GetListsResponse.ts create mode 100644 src/api/resources/contacts/types/GetSegmentsRequestSort.ts create mode 100644 src/api/resources/contacts/types/GetSegmentsResponse.ts create mode 100644 src/api/resources/contacts/types/ImportContactsResponse.ts create mode 100644 src/api/resources/contacts/types/RemoveContactFromListRequestBody.ts create mode 100644 src/api/resources/contacts/types/RequestContactExportResponse.ts create mode 100644 src/api/resources/contacts/types/UpdateAttributeRequestAttributeCategory.ts create mode 100644 src/api/resources/contacts/types/UpdateContactRequestIdentifier.ts create mode 100644 src/api/resources/contacts/types/UpdateContactRequestIdentifierType.ts create mode 100644 src/api/resources/contacts/types/index.ts create mode 100644 src/api/resources/conversations/client/Client.ts create mode 100644 src/api/resources/conversations/client/index.ts create mode 100644 src/api/resources/conversations/client/requests/DeleteConversationsMessagesIdRequest.ts create mode 100644 src/api/resources/conversations/client/requests/DeleteConversationsPushedMessagesIdRequest.ts create mode 100644 src/api/resources/conversations/client/requests/GetConversationsMessagesIdRequest.ts create mode 100644 src/api/resources/conversations/client/requests/GetConversationsPushedMessagesIdRequest.ts create mode 100644 src/api/resources/conversations/client/requests/PostConversationsAgentOnlinePingRequest.ts create mode 100644 src/api/resources/conversations/client/requests/PostConversationsMessagesRequest.ts create mode 100644 src/api/resources/conversations/client/requests/PostConversationsPushedMessagesRequest.ts create mode 100644 src/api/resources/conversations/client/requests/PutConversationsMessagesIdRequest.ts create mode 100644 src/api/resources/conversations/client/requests/PutConversationsPushedMessagesIdRequest.ts create mode 100644 src/api/resources/conversations/client/requests/PutConversationsVisitorGroupRequest.ts create mode 100644 src/api/resources/conversations/client/requests/index.ts create mode 100644 src/api/resources/conversations/index.ts create mode 100644 src/api/resources/conversations/types/PutConversationsVisitorGroupResponse.ts create mode 100644 src/api/resources/conversations/types/index.ts create mode 100644 src/api/resources/coupons/client/Client.ts create mode 100644 src/api/resources/coupons/client/index.ts create mode 100644 src/api/resources/coupons/client/requests/CreateCouponCollectionRequest.ts create mode 100644 src/api/resources/coupons/client/requests/CreateCouponsRequest.ts create mode 100644 src/api/resources/coupons/client/requests/GetCouponCollectionRequest.ts create mode 100644 src/api/resources/coupons/client/requests/GetCouponCollectionsRequest.ts create mode 100644 src/api/resources/coupons/client/requests/UpdateCouponCollectionRequest.ts create mode 100644 src/api/resources/coupons/client/requests/index.ts create mode 100644 src/api/resources/coupons/index.ts create mode 100644 src/api/resources/coupons/types/CreateCouponCollectionResponse.ts create mode 100644 src/api/resources/coupons/types/GetCouponCollectionsRequestSort.ts create mode 100644 src/api/resources/coupons/types/GetCouponCollectionsRequestSortBy.ts create mode 100644 src/api/resources/coupons/types/UpdateCouponCollectionResponse.ts create mode 100644 src/api/resources/coupons/types/index.ts create mode 100644 src/api/resources/customObjects/client/Client.ts create mode 100644 src/api/resources/customObjects/client/index.ts create mode 100644 src/api/resources/customObjects/client/requests/BatchDeleteObjectRecordsRequest.ts create mode 100644 src/api/resources/customObjects/client/requests/GetrecordsRequest.ts create mode 100644 src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts create mode 100644 src/api/resources/customObjects/client/requests/index.ts create mode 100644 src/api/resources/customObjects/index.ts create mode 100644 src/api/resources/customObjects/types/BatchDeleteObjectRecordsResponse.ts create mode 100644 src/api/resources/customObjects/types/GetrecordsRequestAssociation.ts create mode 100644 src/api/resources/customObjects/types/GetrecordsRequestSort.ts create mode 100644 src/api/resources/customObjects/types/GetrecordsResponse.ts create mode 100644 src/api/resources/customObjects/types/UpsertrecordsResponse.ts create mode 100644 src/api/resources/customObjects/types/index.ts create mode 100644 src/api/resources/deals/client/Client.ts create mode 100644 src/api/resources/deals/client/index.ts create mode 100644 src/api/resources/deals/client/requests/DeleteCrmDealsIdRequest.ts create mode 100644 src/api/resources/deals/client/requests/GetCrmDealsIdRequest.ts create mode 100644 src/api/resources/deals/client/requests/GetCrmDealsRequest.ts create mode 100644 src/api/resources/deals/client/requests/GetCrmPipelineDetailsPipelineIdRequest.ts create mode 100644 src/api/resources/deals/client/requests/PatchCrmDealsIdRequest.ts create mode 100644 src/api/resources/deals/client/requests/PatchCrmDealsLinkUnlinkIdRequest.ts create mode 100644 src/api/resources/deals/client/requests/PostCrmDealsImportRequest.ts create mode 100644 src/api/resources/deals/client/requests/PostCrmDealsRequest.ts create mode 100644 src/api/resources/deals/client/requests/index.ts create mode 100644 src/api/resources/deals/index.ts create mode 100644 src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts create mode 100644 src/api/resources/deals/types/GetCrmDealsRequestSort.ts create mode 100644 src/api/resources/deals/types/GetCrmDealsResponse.ts create mode 100644 src/api/resources/deals/types/PostCrmDealsImportResponse.ts create mode 100644 src/api/resources/deals/types/PostCrmDealsResponse.ts create mode 100644 src/api/resources/deals/types/index.ts create mode 100644 src/api/resources/domains/client/Client.ts create mode 100644 src/api/resources/domains/client/index.ts create mode 100644 src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts create mode 100644 src/api/resources/domains/client/requests/CreateDomainRequest.ts create mode 100644 src/api/resources/domains/client/requests/DeleteDomainRequest.ts create mode 100644 src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts create mode 100644 src/api/resources/domains/client/requests/index.ts create mode 100644 src/api/resources/domains/index.ts create mode 100644 src/api/resources/domains/types/AuthenticateDomainResponse.ts create mode 100644 src/api/resources/domains/types/CreateDomainResponse.ts create mode 100644 src/api/resources/domains/types/GetDomainConfigurationResponse.ts create mode 100644 src/api/resources/domains/types/GetDomainsResponse.ts create mode 100644 src/api/resources/domains/types/index.ts create mode 100644 src/api/resources/ecommerce/client/Client.ts create mode 100644 src/api/resources/ecommerce/client/index.ts create mode 100644 src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/CreateProductAlertRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/CreateUpdateBatchCategoryRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/CreateUpdateCategoryRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/GetCategoriesRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/GetCategoryInfoRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/GetOrdersRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/GetProductInfoRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/GetProductsRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/SetConfigDisplayCurrencyRequest.ts create mode 100644 src/api/resources/ecommerce/client/requests/index.ts create mode 100644 src/api/resources/ecommerce/index.ts create mode 100644 src/api/resources/ecommerce/types/CreateBatchOrderResponse.ts create mode 100644 src/api/resources/ecommerce/types/CreateUpdateBatchCategoryResponse.ts create mode 100644 src/api/resources/ecommerce/types/CreateUpdateBatchProductsResponse.ts create mode 100644 src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts create mode 100644 src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts create mode 100644 src/api/resources/ecommerce/types/GetCategoriesRequestSort.ts create mode 100644 src/api/resources/ecommerce/types/GetCategoriesResponse.ts create mode 100644 src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource.ts create mode 100644 src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse.ts create mode 100644 src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsResponse.ts create mode 100644 src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource.ts create mode 100644 src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.ts create mode 100644 src/api/resources/ecommerce/types/GetEcommerceConfigDisplayCurrencyResponse.ts create mode 100644 src/api/resources/ecommerce/types/GetOrdersRequestSort.ts create mode 100644 src/api/resources/ecommerce/types/GetProductsRequestSort.ts create mode 100644 src/api/resources/ecommerce/types/GetProductsResponse.ts create mode 100644 src/api/resources/ecommerce/types/SetConfigDisplayCurrencyResponse.ts create mode 100644 src/api/resources/ecommerce/types/index.ts create mode 100644 src/api/resources/emailCampaigns/client/Client.ts create mode 100644 src/api/resources/emailCampaigns/client/index.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/DeleteEmailCampaignRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/EmailExportRecipientsRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/GetAbTestCampaignResultRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/GetEmailCampaignsRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/GetSharedTemplateUrlRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/SendEmailCampaignNowRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/SendReportRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/SendTestEmailRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/UpdateCampaignStatusRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/UpdateEmailCampaignRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/UploadImageToGalleryRequest.ts create mode 100644 src/api/resources/emailCampaigns/client/requests/index.ts create mode 100644 src/api/resources/emailCampaigns/index.ts create mode 100644 src/api/resources/emailCampaigns/types/CreateEmailCampaignResponse.ts create mode 100644 src/api/resources/emailCampaigns/types/EmailExportRecipientsResponse.ts create mode 100644 src/api/resources/emailCampaigns/types/GetAbTestCampaignResultResponse.ts create mode 100644 src/api/resources/emailCampaigns/types/GetEmailCampaignRequestStatistics.ts create mode 100644 src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts create mode 100644 src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestSort.ts create mode 100644 src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatistics.ts create mode 100644 src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts create mode 100644 src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestType.ts create mode 100644 src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts create mode 100644 src/api/resources/emailCampaigns/types/GetSharedTemplateUrlResponse.ts create mode 100644 src/api/resources/emailCampaigns/types/UploadImageToGalleryResponse.ts create mode 100644 src/api/resources/emailCampaigns/types/index.ts create mode 100644 src/api/resources/event/client/Client.ts create mode 100644 src/api/resources/event/client/index.ts create mode 100644 src/api/resources/event/client/requests/CreateEventRequest.ts create mode 100644 src/api/resources/event/client/requests/index.ts create mode 100644 src/api/resources/event/index.ts create mode 100644 src/api/resources/externalFeeds/client/Client.ts create mode 100644 src/api/resources/externalFeeds/client/index.ts create mode 100644 src/api/resources/externalFeeds/client/requests/CreateExternalFeedRequest.ts create mode 100644 src/api/resources/externalFeeds/client/requests/DeleteExternalFeedRequest.ts create mode 100644 src/api/resources/externalFeeds/client/requests/GetAllExternalFeedsRequest.ts create mode 100644 src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts create mode 100644 src/api/resources/externalFeeds/client/requests/UpdateExternalFeedRequest.ts create mode 100644 src/api/resources/externalFeeds/client/requests/index.ts create mode 100644 src/api/resources/externalFeeds/index.ts create mode 100644 src/api/resources/externalFeeds/types/CreateExternalFeedResponse.ts create mode 100644 src/api/resources/externalFeeds/types/GetAllExternalFeedsRequestAuthType.ts create mode 100644 src/api/resources/externalFeeds/types/GetAllExternalFeedsRequestSort.ts create mode 100644 src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts create mode 100644 src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts create mode 100644 src/api/resources/externalFeeds/types/index.ts create mode 100644 src/api/resources/files/client/Client.ts create mode 100644 src/api/resources/files/client/index.ts create mode 100644 src/api/resources/files/client/requests/DeleteCrmFilesIdRequest.ts create mode 100644 src/api/resources/files/client/requests/GetCrmFilesIdDataRequest.ts create mode 100644 src/api/resources/files/client/requests/GetCrmFilesIdRequest.ts create mode 100644 src/api/resources/files/client/requests/GetCrmFilesRequest.ts create mode 100644 src/api/resources/files/client/requests/PostCrmFilesRequest.ts create mode 100644 src/api/resources/files/client/requests/index.ts create mode 100644 src/api/resources/files/index.ts create mode 100644 src/api/resources/files/types/GetCrmFilesIdResponse.ts create mode 100644 src/api/resources/files/types/GetCrmFilesRequestEntity.ts create mode 100644 src/api/resources/files/types/GetCrmFilesRequestSort.ts create mode 100644 src/api/resources/files/types/index.ts create mode 100644 src/api/resources/inboundParsing/client/Client.ts create mode 100644 src/api/resources/inboundParsing/client/index.ts create mode 100644 src/api/resources/inboundParsing/client/requests/GetInboundEmailAttachmentRequest.ts create mode 100644 src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsByUuidRequest.ts create mode 100644 src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsRequest.ts create mode 100644 src/api/resources/inboundParsing/client/requests/index.ts create mode 100644 src/api/resources/inboundParsing/index.ts create mode 100644 src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts create mode 100644 src/api/resources/inboundParsing/types/GetInboundEmailEventsRequestSort.ts create mode 100644 src/api/resources/inboundParsing/types/GetInboundEmailEventsResponse.ts create mode 100644 src/api/resources/inboundParsing/types/index.ts create mode 100644 src/api/resources/index.ts create mode 100644 src/api/resources/masterAccount/client/Client.ts create mode 100644 src/api/resources/masterAccount/client/index.ts create mode 100644 src/api/resources/masterAccount/client/requests/DeleteCorporateGroupIdRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/DeleteCorporateSubAccountIdRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/DeleteCorporateUserRevokeEmailRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/GetCorporateGroupIdRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/GetCorporateInvitedUsersListRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/GetCorporateSubAccountIdRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/GetCorporateSubAccountRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/GetCorporateUserPermissionRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/InviteAdminUserRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PostCorporateGroupRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PostCorporateSsoTokenRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PostCorporateSubAccountIpAssociateRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PostCorporateSubAccountKeyRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PostCorporateSubAccountRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PostCorporateSubAccountSsoTokenRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PutCorporateGroupIdRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PutCorporateGroupUnlinkGroupIdSubAccountsRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdApplicationsToggleRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdPlanRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIpDissociateRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PutCorporateSubAccountsPlanRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PutCorporateUserEmailPermissionsRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/PutCorporateUserInvitationActionEmailRequest.ts create mode 100644 src/api/resources/masterAccount/client/requests/index.ts create mode 100644 src/api/resources/masterAccount/index.ts create mode 100644 src/api/resources/masterAccount/types/GetCorporateGroupIdResponse.ts create mode 100644 src/api/resources/masterAccount/types/GetCorporateInvitedUsersListResponse.ts create mode 100644 src/api/resources/masterAccount/types/GetCorporateIpResponseItem.ts create mode 100644 src/api/resources/masterAccount/types/GetCorporateMasterAccountResponse.ts create mode 100644 src/api/resources/masterAccount/types/GetCorporateSubAccountIdResponse.ts create mode 100644 src/api/resources/masterAccount/types/GetCorporateSubAccountResponse.ts create mode 100644 src/api/resources/masterAccount/types/GetCorporateUserPermissionResponse.ts create mode 100644 src/api/resources/masterAccount/types/GetSubAccountGroupsResponseItem.ts create mode 100644 src/api/resources/masterAccount/types/InviteAdminUserResponse.ts create mode 100644 src/api/resources/masterAccount/types/PostCorporateGroupResponse.ts create mode 100644 src/api/resources/masterAccount/types/PostCorporateSubAccountKeyResponse.ts create mode 100644 src/api/resources/masterAccount/types/PostCorporateSubAccountResponse.ts create mode 100644 src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailRequestAction.ts create mode 100644 src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailResponse.ts create mode 100644 src/api/resources/masterAccount/types/index.ts create mode 100644 src/api/resources/notes/client/Client.ts create mode 100644 src/api/resources/notes/client/index.ts create mode 100644 src/api/resources/notes/client/requests/DeleteCrmNotesIdRequest.ts create mode 100644 src/api/resources/notes/client/requests/GetCrmNotesIdRequest.ts create mode 100644 src/api/resources/notes/client/requests/GetCrmNotesRequest.ts create mode 100644 src/api/resources/notes/client/requests/PatchCrmNotesIdRequest.ts create mode 100644 src/api/resources/notes/client/requests/index.ts create mode 100644 src/api/resources/notes/index.ts create mode 100644 src/api/resources/notes/types/GetCrmNotesRequestEntity.ts create mode 100644 src/api/resources/notes/types/GetCrmNotesRequestSort.ts create mode 100644 src/api/resources/notes/types/PostCrmNotesResponse.ts create mode 100644 src/api/resources/notes/types/index.ts create mode 100644 src/api/resources/payments/client/Client.ts create mode 100644 src/api/resources/payments/client/index.ts create mode 100644 src/api/resources/payments/client/requests/CreatePaymentRequestRequest.ts create mode 100644 src/api/resources/payments/client/requests/DeletePaymentRequestRequest.ts create mode 100644 src/api/resources/payments/client/requests/GetPaymentRequestRequest.ts create mode 100644 src/api/resources/payments/client/requests/index.ts create mode 100644 src/api/resources/payments/index.ts create mode 100644 src/api/resources/payments/types/CreatePaymentRequestResponse.ts create mode 100644 src/api/resources/payments/types/GetPaymentRequestResponse.ts create mode 100644 src/api/resources/payments/types/index.ts create mode 100644 src/api/resources/process/client/Client.ts create mode 100644 src/api/resources/process/client/index.ts create mode 100644 src/api/resources/process/client/requests/GetProcessRequest.ts create mode 100644 src/api/resources/process/client/requests/GetProcessesRequest.ts create mode 100644 src/api/resources/process/client/requests/index.ts create mode 100644 src/api/resources/process/index.ts create mode 100644 src/api/resources/process/types/GetProcessResponse.ts create mode 100644 src/api/resources/process/types/GetProcessesRequestSort.ts create mode 100644 src/api/resources/process/types/GetProcessesResponse.ts create mode 100644 src/api/resources/process/types/index.ts create mode 100644 src/api/resources/program/client/Client.ts create mode 100644 src/api/resources/program/client/index.ts create mode 100644 src/api/resources/program/client/requests/CreateNewLpRequest.ts create mode 100644 src/api/resources/program/client/requests/DeleteContactMembersRequest.ts create mode 100644 src/api/resources/program/client/requests/DeleteLoyaltyProgramRequest.ts create mode 100644 src/api/resources/program/client/requests/GetLoyaltyProgramInfoRequest.ts create mode 100644 src/api/resources/program/client/requests/GetLpListRequest.ts create mode 100644 src/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.ts create mode 100644 src/api/resources/program/client/requests/PartiallyUpdateLoyaltyProgramRequest.ts create mode 100644 src/api/resources/program/client/requests/PublishLoyaltyProgramRequest.ts create mode 100644 src/api/resources/program/client/requests/SubscribeMemberToASubscriptionRequest.ts create mode 100644 src/api/resources/program/client/requests/SubscribeToLoyaltyProgramRequest.ts create mode 100644 src/api/resources/program/client/requests/UpdateLoyaltyProgramRequest.ts create mode 100644 src/api/resources/program/client/requests/index.ts create mode 100644 src/api/resources/program/index.ts create mode 100644 src/api/resources/program/types/GetLpListRequestSortField.ts create mode 100644 src/api/resources/program/types/GetLpListResponse.ts create mode 100644 src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts create mode 100644 src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts create mode 100644 src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts create mode 100644 src/api/resources/program/types/index.ts create mode 100644 src/api/resources/reward/client/Client.ts create mode 100644 src/api/resources/reward/client/index.ts create mode 100644 src/api/resources/reward/client/requests/CompleteRedeemTransactionRequest.ts create mode 100644 src/api/resources/reward/client/requests/CreateRewardRequest.ts create mode 100644 src/api/resources/reward/client/requests/CreateVoucherRequest.ts create mode 100644 src/api/resources/reward/client/requests/GetCodeCountRequest.ts create mode 100644 src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidOffersRequest.ts create mode 100644 src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidRewardsRidRequest.ts create mode 100644 src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidVouchersRequest.ts create mode 100644 src/api/resources/reward/client/requests/RedeemVoucherRequest.ts create mode 100644 src/api/resources/reward/client/requests/RevokeVouchersRequest.ts create mode 100644 src/api/resources/reward/client/requests/ValidateRewardRequest.ts create mode 100644 src/api/resources/reward/client/requests/index.ts create mode 100644 src/api/resources/reward/index.ts create mode 100644 src/api/resources/reward/types/CreateRewardResponse.ts create mode 100644 src/api/resources/reward/types/CreateVoucherResponse.ts create mode 100644 src/api/resources/reward/types/GetCodeCountResponse.ts create mode 100644 src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersRequestVersion.ts create mode 100644 src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersResponse.ts create mode 100644 src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidRequestVersion.ts create mode 100644 src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidResponse.ts create mode 100644 src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersRequestSort.ts create mode 100644 src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersRequestSortField.ts create mode 100644 src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts create mode 100644 src/api/resources/reward/types/ValidateRewardResponse.ts create mode 100644 src/api/resources/reward/types/index.ts create mode 100644 src/api/resources/senders/client/Client.ts create mode 100644 src/api/resources/senders/client/index.ts create mode 100644 src/api/resources/senders/client/requests/CreateSenderRequest.ts create mode 100644 src/api/resources/senders/client/requests/DeleteSenderRequest.ts create mode 100644 src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts create mode 100644 src/api/resources/senders/client/requests/GetSendersRequest.ts create mode 100644 src/api/resources/senders/client/requests/UpdateSenderRequest.ts create mode 100644 src/api/resources/senders/client/requests/ValidateSenderByOtpRequest.ts create mode 100644 src/api/resources/senders/client/requests/index.ts create mode 100644 src/api/resources/senders/index.ts create mode 100644 src/api/resources/senders/types/CreateSenderResponse.ts create mode 100644 src/api/resources/senders/types/GetIpsFromSenderResponse.ts create mode 100644 src/api/resources/senders/types/GetIpsResponse.ts create mode 100644 src/api/resources/senders/types/GetSendersResponse.ts create mode 100644 src/api/resources/senders/types/index.ts create mode 100644 src/api/resources/smsCampaigns/client/Client.ts create mode 100644 src/api/resources/smsCampaigns/client/index.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/CreateSmsCampaignRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/DeleteSmsCampaignRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/GetSmsCampaignRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/GetSmsCampaignsRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/RequestSmsRecipientExportRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/SendSmsCampaignNowRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/SendSmsReportRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/SendTestSmsRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignStatusRequest.ts create mode 100644 src/api/resources/smsCampaigns/client/requests/index.ts create mode 100644 src/api/resources/smsCampaigns/index.ts create mode 100644 src/api/resources/smsCampaigns/types/CreateSmsCampaignResponse.ts create mode 100644 src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts create mode 100644 src/api/resources/smsCampaigns/types/GetSmsCampaignsRequestSort.ts create mode 100644 src/api/resources/smsCampaigns/types/GetSmsCampaignsRequestStatus.ts create mode 100644 src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts create mode 100644 src/api/resources/smsCampaigns/types/RequestSmsRecipientExportResponse.ts create mode 100644 src/api/resources/smsCampaigns/types/index.ts create mode 100644 src/api/resources/smsTemplates/client/Client.ts create mode 100644 src/api/resources/smsTemplates/client/index.ts create mode 100644 src/api/resources/smsTemplates/client/requests/GetSmsTemplatesRequest.ts create mode 100644 src/api/resources/smsTemplates/client/requests/index.ts create mode 100644 src/api/resources/smsTemplates/index.ts create mode 100644 src/api/resources/smsTemplates/types/GetSmsTemplatesRequestSort.ts create mode 100644 src/api/resources/smsTemplates/types/GetSmsTemplatesResponse.ts create mode 100644 src/api/resources/smsTemplates/types/index.ts create mode 100644 src/api/resources/tasks/client/Client.ts create mode 100644 src/api/resources/tasks/client/index.ts create mode 100644 src/api/resources/tasks/client/requests/DeleteCrmTasksIdRequest.ts create mode 100644 src/api/resources/tasks/client/requests/GetCrmTasksIdRequest.ts create mode 100644 src/api/resources/tasks/client/requests/GetCrmTasksRequest.ts create mode 100644 src/api/resources/tasks/client/requests/PatchCrmTasksIdRequest.ts create mode 100644 src/api/resources/tasks/client/requests/PostCrmTasksRequest.ts create mode 100644 src/api/resources/tasks/client/requests/index.ts create mode 100644 src/api/resources/tasks/index.ts create mode 100644 src/api/resources/tasks/types/GetCrmTasksRequestFilterDate.ts create mode 100644 src/api/resources/tasks/types/GetCrmTasksRequestFilterStatus.ts create mode 100644 src/api/resources/tasks/types/GetCrmTasksRequestSort.ts create mode 100644 src/api/resources/tasks/types/GetCrmTasksResponse.ts create mode 100644 src/api/resources/tasks/types/GetCrmTasktypesResponse.ts create mode 100644 src/api/resources/tasks/types/PostCrmTasksResponse.ts create mode 100644 src/api/resources/tasks/types/index.ts create mode 100644 src/api/resources/tier/client/Client.ts create mode 100644 src/api/resources/tier/client/index.ts create mode 100644 src/api/resources/tier/client/requests/AddSubscriptionToTierRequest.ts create mode 100644 src/api/resources/tier/client/requests/CreateTierForTierGroupRequest.ts create mode 100644 src/api/resources/tier/client/requests/CreateTierGroupRequest.ts create mode 100644 src/api/resources/tier/client/requests/DeleteTierGroupRequest.ts create mode 100644 src/api/resources/tier/client/requests/DeleteTierRequest.ts create mode 100644 src/api/resources/tier/client/requests/GetListOfTierGroupsRequest.ts create mode 100644 src/api/resources/tier/client/requests/GetLoyaltyProgramTierRequest.ts create mode 100644 src/api/resources/tier/client/requests/GetTierGroupRequest.ts create mode 100644 src/api/resources/tier/client/requests/UpdateTierGroupRequest.ts create mode 100644 src/api/resources/tier/client/requests/UpdateTierRequest.ts create mode 100644 src/api/resources/tier/client/requests/index.ts create mode 100644 src/api/resources/tier/index.ts create mode 100644 src/api/resources/tier/types/AddSubscriptionToTierResponse.ts create mode 100644 src/api/resources/tier/types/GetListOfTierGroupsRequestVersion.ts create mode 100644 src/api/resources/tier/types/GetListOfTierGroupsResponse.ts create mode 100644 src/api/resources/tier/types/GetLoyaltyProgramTierRequestVersion.ts create mode 100644 src/api/resources/tier/types/GetLoyaltyProgramTierResponse.ts create mode 100644 src/api/resources/tier/types/GetTierGroupRequestVersion.ts create mode 100644 src/api/resources/tier/types/index.ts create mode 100644 src/api/resources/transactionalEmails/client/Client.ts create mode 100644 src/api/resources/transactionalEmails/client/index.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/BlockNewDomainRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/CreateSmtpTemplateRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/DeleteBlockedDomainRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/DeleteHardbouncesRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/DeleteScheduledEmailByIdRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/DeleteSmtpBlockedContactsEmailRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/DeleteSmtpLogIdentifierRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/DeleteSmtpTemplateRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetAggregatedSmtpReportRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetEmailEventReportRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetSmtpReportRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetSmtpTemplateRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetSmtpTemplatesRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetTransacBlockedContactsRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetTransacEmailContentRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/GetTransacEmailsListRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/SendTestTemplateRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts create mode 100644 src/api/resources/transactionalEmails/client/requests/index.ts create mode 100644 src/api/resources/transactionalEmails/index.ts create mode 100644 src/api/resources/transactionalEmails/types/CreateSmtpTemplateResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetAggregatedSmtpReportResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetBlockedDomainsResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetEmailEventReportRequestEvent.ts create mode 100644 src/api/resources/transactionalEmails/types/GetEmailEventReportRequestSort.ts create mode 100644 src/api/resources/transactionalEmails/types/GetEmailEventReportResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetScheduledEmailByIdRequestSort.ts create mode 100644 src/api/resources/transactionalEmails/types/GetScheduledEmailByIdRequestStatus.ts create mode 100644 src/api/resources/transactionalEmails/types/GetScheduledEmailByIdResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetSmtpReportRequestSort.ts create mode 100644 src/api/resources/transactionalEmails/types/GetSmtpReportResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetSmtpTemplatesRequestSort.ts create mode 100644 src/api/resources/transactionalEmails/types/GetSmtpTemplatesResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetTransacBlockedContactsRequestSort.ts create mode 100644 src/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/GetTransacEmailsListRequestSort.ts create mode 100644 src/api/resources/transactionalEmails/types/GetTransacEmailsListResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/SendTransacEmailResponse.ts create mode 100644 src/api/resources/transactionalEmails/types/index.ts create mode 100644 src/api/resources/transactionalSms/client/Client.ts create mode 100644 src/api/resources/transactionalSms/client/index.ts create mode 100644 src/api/resources/transactionalSms/client/requests/GetSmsEventsRequest.ts create mode 100644 src/api/resources/transactionalSms/client/requests/GetTransacAggregatedSmsReportRequest.ts create mode 100644 src/api/resources/transactionalSms/client/requests/GetTransacSmsReportRequest.ts create mode 100644 src/api/resources/transactionalSms/client/requests/index.ts create mode 100644 src/api/resources/transactionalSms/index.ts create mode 100644 src/api/resources/transactionalSms/types/GetSmsEventsRequestEvent.ts create mode 100644 src/api/resources/transactionalSms/types/GetSmsEventsRequestSort.ts create mode 100644 src/api/resources/transactionalSms/types/GetSmsEventsResponse.ts create mode 100644 src/api/resources/transactionalSms/types/GetTransacAggregatedSmsReportResponse.ts create mode 100644 src/api/resources/transactionalSms/types/GetTransacSmsReportRequestSort.ts create mode 100644 src/api/resources/transactionalSms/types/GetTransacSmsReportResponse.ts create mode 100644 src/api/resources/transactionalSms/types/SendAsyncTransactionalSmsResponse.ts create mode 100644 src/api/resources/transactionalSms/types/SendTransacSmsResponse.ts create mode 100644 src/api/resources/transactionalSms/types/index.ts create mode 100644 src/api/resources/transactionalWhatsApp/client/Client.ts create mode 100644 src/api/resources/transactionalWhatsApp/client/index.ts create mode 100644 src/api/resources/transactionalWhatsApp/client/requests/GetWhatsappEventReportRequest.ts create mode 100644 src/api/resources/transactionalWhatsApp/client/requests/index.ts create mode 100644 src/api/resources/transactionalWhatsApp/index.ts create mode 100644 src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportRequestEvent.ts create mode 100644 src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportRequestSort.ts create mode 100644 src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportResponse.ts create mode 100644 src/api/resources/transactionalWhatsApp/types/SendWhatsappMessageRequest.ts create mode 100644 src/api/resources/transactionalWhatsApp/types/SendWhatsappMessageResponse.ts create mode 100644 src/api/resources/transactionalWhatsApp/types/index.ts create mode 100644 src/api/resources/user/client/Client.ts create mode 100644 src/api/resources/user/client/index.ts create mode 100644 src/api/resources/user/client/requests/GetUserPermissionRequest.ts create mode 100644 src/api/resources/user/client/requests/PutRevokeUserPermissionRequest.ts create mode 100644 src/api/resources/user/client/requests/PutresendcancelinvitationRequest.ts create mode 100644 src/api/resources/user/client/requests/index.ts create mode 100644 src/api/resources/user/index.ts create mode 100644 src/api/resources/user/types/EditUserPermissionResponse.ts create mode 100644 src/api/resources/user/types/GetInvitedUsersListResponse.ts create mode 100644 src/api/resources/user/types/GetUserPermissionResponse.ts create mode 100644 src/api/resources/user/types/InviteuserResponse.ts create mode 100644 src/api/resources/user/types/PutRevokeUserPermissionResponse.ts create mode 100644 src/api/resources/user/types/PutresendcancelinvitationRequestAction.ts create mode 100644 src/api/resources/user/types/PutresendcancelinvitationResponse.ts create mode 100644 src/api/resources/user/types/index.ts create mode 100644 src/api/resources/webhooks/client/Client.ts create mode 100644 src/api/resources/webhooks/client/index.ts create mode 100644 src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts create mode 100644 src/api/resources/webhooks/client/requests/DeleteWebhookRequest.ts create mode 100644 src/api/resources/webhooks/client/requests/ExportWebhooksHistoryRequest.ts create mode 100644 src/api/resources/webhooks/client/requests/GetWebhookRequest.ts create mode 100644 src/api/resources/webhooks/client/requests/GetWebhooksRequest.ts create mode 100644 src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts create mode 100644 src/api/resources/webhooks/client/requests/index.ts create mode 100644 src/api/resources/webhooks/index.ts create mode 100644 src/api/resources/webhooks/types/CreateWebhookResponse.ts create mode 100644 src/api/resources/webhooks/types/ExportWebhooksHistoryResponse.ts create mode 100644 src/api/resources/webhooks/types/GetWebhooksRequestSort.ts create mode 100644 src/api/resources/webhooks/types/GetWebhooksRequestType.ts create mode 100644 src/api/resources/webhooks/types/GetWebhooksResponse.ts create mode 100644 src/api/resources/webhooks/types/index.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/Client.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/index.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppCampaignRequest.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppTemplateRequest.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/DeleteWhatsAppCampaignRequest.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppCampaignRequest.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppCampaignsRequest.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppTemplatesRequest.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/SendWhatsAppTemplateApprovalRequest.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/UpdateWhatsAppCampaignRequest.ts create mode 100644 src/api/resources/whatsAppCampaigns/client/requests/index.ts create mode 100644 src/api/resources/whatsAppCampaigns/index.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/CreateWhatsAppCampaignResponse.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/CreateWhatsAppTemplateResponse.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsRequestSort.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsResponse.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/GetWhatsAppConfigResponse.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesRequestSort.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesRequestSource.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts create mode 100644 src/api/resources/whatsAppCampaigns/types/index.ts create mode 100644 src/api/types/AbTestVersionClicks.ts create mode 100644 src/api/types/AbTestVersionClicksItem.ts create mode 100644 src/api/types/AbTestVersionStats.ts create mode 100644 src/api/types/BadRequestErrorBody.ts create mode 100644 src/api/types/BalanceDefinition.ts create mode 100644 src/api/types/BalanceLimit.ts create mode 100644 src/api/types/Cart.ts create mode 100644 src/api/types/Company.ts create mode 100644 src/api/types/Configuration.ts create mode 100644 src/api/types/ContactErrorModel.ts create mode 100644 src/api/types/ConversationsMessage.ts create mode 100644 src/api/types/ConversionSourceMetrics.ts create mode 100644 src/api/types/CreateUpdateFolder.ts create mode 100644 src/api/types/Deal.ts create mode 100644 src/api/types/ErrorModel.ts create mode 100644 src/api/types/FileData.ts create mode 100644 src/api/types/ForbiddenErrorBody.ts create mode 100644 src/api/types/GetCampaignRecipients.ts create mode 100644 src/api/types/GetCampaignStats.ts create mode 100644 src/api/types/GetCategoryDetails.ts create mode 100644 src/api/types/GetContactDetails.ts create mode 100644 src/api/types/GetContacts.ts create mode 100644 src/api/types/GetCouponCollection.ts create mode 100644 src/api/types/GetDeviceBrowserStats.ts create mode 100644 src/api/types/GetExtendedCampaignOverview.ts create mode 100644 src/api/types/GetExtendedCampaignStats.ts create mode 100644 src/api/types/GetFolder.ts create mode 100644 src/api/types/GetList.ts create mode 100644 src/api/types/GetProductDetails.ts create mode 100644 src/api/types/GetSmsCampaignOverview.ts create mode 100644 src/api/types/GetSmsCampaignStats.ts create mode 100644 src/api/types/GetSmtpTemplateOverview.ts create mode 100644 src/api/types/GetSsoToken.ts create mode 100644 src/api/types/GetWebhook.ts create mode 100644 src/api/types/Inviteuser.ts create mode 100644 src/api/types/LoyaltyProgram.ts create mode 100644 src/api/types/NodeResponse.ts create mode 100644 src/api/types/NotFoundErrorBody.ts create mode 100644 src/api/types/Note.ts create mode 100644 src/api/types/NoteData.ts create mode 100644 src/api/types/Notification.ts create mode 100644 src/api/types/Order.ts create mode 100644 src/api/types/Pipeline.ts create mode 100644 src/api/types/Pipelines.ts create mode 100644 src/api/types/PostContactInfo.ts create mode 100644 src/api/types/PostSendFailed.ts create mode 100644 src/api/types/Redeem.ts create mode 100644 src/api/types/RuleConditionResponse.ts create mode 100644 src/api/types/SendReport.ts create mode 100644 src/api/types/SendTestEmail.ts create mode 100644 src/api/types/SendTransacSms.ts create mode 100644 src/api/types/Task.ts create mode 100644 src/api/types/TaskReminder.ts create mode 100644 src/api/types/Tier.ts create mode 100644 src/api/types/TierGroup.ts create mode 100644 src/api/types/Transaction.ts create mode 100644 src/api/types/UnauthorizedErrorBody.ts create mode 100644 src/api/types/UpdateCampaignStatus.ts create mode 100644 src/api/types/ValueResponse.ts create mode 100644 src/api/types/VariablesItems.ts create mode 100644 src/api/types/WhatsappCampStats.ts create mode 100644 src/api/types/index.ts create mode 100644 src/auth/HeaderAuthProvider.ts create mode 100644 src/auth/index.ts create mode 100644 src/core/auth/AuthProvider.ts create mode 100644 src/core/auth/AuthRequest.ts create mode 100644 src/core/auth/BasicAuth.ts create mode 100644 src/core/auth/BearerToken.ts create mode 100644 src/core/auth/NoOpAuthProvider.ts create mode 100644 src/core/auth/index.ts create mode 100644 src/core/base64.ts create mode 100644 src/core/exports.ts create mode 100644 src/core/fetcher/APIResponse.ts create mode 100644 src/core/fetcher/BinaryResponse.ts create mode 100644 src/core/fetcher/EndpointMetadata.ts create mode 100644 src/core/fetcher/EndpointSupplier.ts create mode 100644 src/core/fetcher/Fetcher.ts create mode 100644 src/core/fetcher/Headers.ts create mode 100644 src/core/fetcher/HttpResponsePromise.ts create mode 100644 src/core/fetcher/RawResponse.ts create mode 100644 src/core/fetcher/Supplier.ts create mode 100644 src/core/fetcher/createRequestUrl.ts create mode 100644 src/core/fetcher/getErrorResponseBody.ts create mode 100644 src/core/fetcher/getFetchFn.ts create mode 100644 src/core/fetcher/getHeader.ts create mode 100644 src/core/fetcher/getRequestBody.ts create mode 100644 src/core/fetcher/getResponseBody.ts create mode 100644 src/core/fetcher/index.ts create mode 100644 src/core/fetcher/makeRequest.ts create mode 100644 src/core/fetcher/requestWithRetries.ts create mode 100644 src/core/fetcher/signals.ts create mode 100644 src/core/file/exports.ts create mode 100644 src/core/file/file.ts create mode 100644 src/core/file/index.ts create mode 100644 src/core/file/types.ts create mode 100644 src/core/form-data-utils/FormDataWrapper.ts create mode 100644 src/core/form-data-utils/encodeAsFormParameter.ts create mode 100644 src/core/form-data-utils/index.ts create mode 100644 src/core/headers.ts create mode 100644 src/core/index.ts create mode 100644 src/core/json.ts create mode 100644 src/core/logging/exports.ts create mode 100644 src/core/logging/index.ts create mode 100644 src/core/logging/logger.ts create mode 100644 src/core/runtime/index.ts create mode 100644 src/core/runtime/runtime.ts create mode 100644 src/core/url/encodePathParam.ts create mode 100644 src/core/url/index.ts create mode 100644 src/core/url/join.ts create mode 100644 src/core/url/qs.ts create mode 100644 src/environments.ts create mode 100644 src/errors/BrevoError.ts create mode 100644 src/errors/BrevoTimeoutError.ts create mode 100644 src/errors/handleNonStatusCodeError.ts create mode 100644 src/errors/index.ts create mode 100644 src/exports.ts create mode 100644 src/index.ts create mode 100644 src/version.ts create mode 100644 tests/custom.test.ts create mode 100644 tests/mock-server/MockServer.ts create mode 100644 tests/mock-server/MockServerPool.ts create mode 100644 tests/mock-server/mockEndpointBuilder.ts create mode 100644 tests/mock-server/randomBaseUrl.ts create mode 100644 tests/mock-server/setup.ts create mode 100644 tests/mock-server/withFormUrlEncoded.ts create mode 100644 tests/mock-server/withHeaders.ts create mode 100644 tests/mock-server/withJson.ts create mode 100644 tests/setup.ts create mode 100644 tests/tsconfig.json create mode 100644 tests/unit/auth/BasicAuth.test.ts create mode 100644 tests/unit/auth/BearerToken.test.ts create mode 100644 tests/unit/base64.test.ts create mode 100644 tests/unit/fetcher/Fetcher.test.ts create mode 100644 tests/unit/fetcher/HttpResponsePromise.test.ts create mode 100644 tests/unit/fetcher/RawResponse.test.ts create mode 100644 tests/unit/fetcher/createRequestUrl.test.ts create mode 100644 tests/unit/fetcher/getRequestBody.test.ts create mode 100644 tests/unit/fetcher/getResponseBody.test.ts create mode 100644 tests/unit/fetcher/logging.test.ts create mode 100644 tests/unit/fetcher/makeRequest.test.ts create mode 100644 tests/unit/fetcher/redacting.test.ts create mode 100644 tests/unit/fetcher/requestWithRetries.test.ts create mode 100644 tests/unit/fetcher/signals.test.ts create mode 100644 tests/unit/fetcher/test-file.txt create mode 100644 tests/unit/file/file.test.ts create mode 100644 tests/unit/form-data-utils/encodeAsFormParameter.test.ts create mode 100644 tests/unit/form-data-utils/formDataWrapper.test.ts create mode 100644 tests/unit/logging/logger.test.ts create mode 100644 tests/unit/test-file.txt create mode 100644 tests/unit/url/join.test.ts create mode 100644 tests/unit/url/qs.test.ts create mode 100644 tests/wire/.gitkeep create mode 100644 tests/wire/account.test.ts create mode 100644 tests/wire/balance.test.ts create mode 100644 tests/wire/companies.test.ts create mode 100644 tests/wire/contacts.test.ts create mode 100644 tests/wire/conversations.test.ts create mode 100644 tests/wire/coupons.test.ts create mode 100644 tests/wire/customObjects.test.ts create mode 100644 tests/wire/deals.test.ts create mode 100644 tests/wire/domains.test.ts create mode 100644 tests/wire/ecommerce.test.ts create mode 100644 tests/wire/emailCampaigns.test.ts create mode 100644 tests/wire/event.test.ts create mode 100644 tests/wire/externalFeeds.test.ts create mode 100644 tests/wire/files.test.ts create mode 100644 tests/wire/inboundParsing.test.ts create mode 100644 tests/wire/masterAccount.test.ts create mode 100644 tests/wire/notes.test.ts create mode 100644 tests/wire/payments.test.ts create mode 100644 tests/wire/process.test.ts create mode 100644 tests/wire/program.test.ts create mode 100644 tests/wire/reward.test.ts create mode 100644 tests/wire/senders.test.ts create mode 100644 tests/wire/smsCampaigns.test.ts create mode 100644 tests/wire/smsTemplates.test.ts create mode 100644 tests/wire/tasks.test.ts create mode 100644 tests/wire/tier.test.ts create mode 100644 tests/wire/transactionalEmails.test.ts create mode 100644 tests/wire/transactionalSms.test.ts create mode 100644 tests/wire/transactionalWhatsApp.test.ts create mode 100644 tests/wire/user.test.ts create mode 100644 tests/wire/webhooks.test.ts create mode 100644 tests/wire/whatsAppCampaigns.test.ts create mode 100644 tsconfig.base.json create mode 100644 tsconfig.cjs.json create mode 100644 tsconfig.esm.json create mode 100644 vitest.config.mts delete mode 100644 yarn.lock diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 76add87..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -dist \ No newline at end of file diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 0da1e0a..0000000 --- a/.eslintrc +++ /dev/null @@ -1,22 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint", - "unused-imports" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "unused-imports/no-unused-imports-ts" : 2, - "@typescript-eslint/ban-types" : "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-namespace": "off", - "no-self-assign": "off", - "@typescript-eslint/adjacent-overload-signatures": "off", - "@typescript-eslint/explicit-module-boundary-types": "off" - } - } \ No newline at end of file diff --git a/.fern/metadata.json b/.fern/metadata.json new file mode 100644 index 0000000..415c736 --- /dev/null +++ b/.fern/metadata.json @@ -0,0 +1,19 @@ +{ + "cliVersion": "3.57.1", + "generatorName": "fernapi/fern-typescript-sdk", + "generatorVersion": "3.46.3", + "generatorConfig": { + "generateWireTests": true, + "namespaceExport": "Brevo", + "fetchSupport": "native", + "packageJson": { + "description": "Brevo SDK for Node.js with TypeScript support.", + "author": { + "name": "Brevo", + "url": "https://brevo.com", + "email": "support@brevo.com" + } + } + }, + "sdkVersion": "0.0.52" +} diff --git a/.fernignore b/.fernignore new file mode 100644 index 0000000..084a8eb --- /dev/null +++ b/.fernignore @@ -0,0 +1 @@ +# Specify files that shouldn't be modified by Fern diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 8927c3e..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @aayush-sib @ekta-slit \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a98d4d0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v6 + + - name: Set up node + uses: actions/setup-node@v6 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Compile + run: pnpm build + + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v6 + + - name: Set up node + uses: actions/setup-node@v6 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Test + run: pnpm test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4865f80..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Node.js Package -on: - release: - types: [created] -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v2 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v2 - with: - node-version: '14' - registry-url: 'https://registry.npmjs.org' - - run: npm install - # - run: npm publish --access public - # env: - # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - # # Setup .npmrc file to publish to GitHub Packages - # - uses: actions/setup-node@v2 - # with: - # registry-url: 'https://npm.pkg.github.com' - # scope: '@getbrevo' - # # Publish to GitHub Packages - # - run: npm publish - # env: - # NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 149b576..72271e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -wwwroot/*.js node_modules -typings -dist +.DS_Store +/dist \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore deleted file mode 100644 index c5fa491..0000000 --- a/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES deleted file mode 100644 index 6f01056..0000000 --- a/.openapi-generator/FILES +++ /dev/null @@ -1,408 +0,0 @@ -.gitignore -api.ts -api/accountApi.ts -api/apis.ts -api/companiesApi.ts -api/contactsApi.ts -api/conversationsApi.ts -api/couponsApi.ts -api/dealsApi.ts -api/domainsApi.ts -api/ecommerceApi.ts -api/emailCampaignsApi.ts -api/eventsApi.ts -api/externalFeedsApi.ts -api/filesApi.ts -api/inboundParsingApi.ts -api/masterAccountApi.ts -api/notesApi.ts -api/paymentsApi.ts -api/processApi.ts -api/resellerApi.ts -api/sMSCampaignsApi.ts -api/sendersApi.ts -api/tasksApi.ts -api/transactionalEmailsApi.ts -api/transactionalSMSApi.ts -api/transactionalWhatsAppApi.ts -api/userApi.ts -api/webhooksApi.ts -api/whatsAppCampaignsApi.ts -git_push.sh -model/abTestCampaignResult.ts -model/abTestCampaignResultClickedLinks.ts -model/abTestCampaignResultStatistics.ts -model/abTestVersionClicksInner.ts -model/abTestVersionStats.ts -model/addChildDomain.ts -model/addContactToList.ts -model/addCredits.ts -model/authenticateDomainModel.ts -model/blockDomain.ts -model/cart.ts -model/companiesIdPatchRequest.ts -model/companiesLinkUnlinkIdPatchRequest.ts -model/companiesList.ts -model/companiesPost200Response.ts -model/companiesPostRequest.ts -model/company.ts -model/companyAttributesInner.ts -model/componentItems.ts -model/configuration.ts -model/conversationsAgentOnlinePingPostRequest.ts -model/conversationsMessage.ts -model/conversationsMessageFile.ts -model/conversationsMessageFileImageInfo.ts -model/conversationsMessagesIdPutRequest.ts -model/conversationsMessagesPostRequest.ts -model/conversationsPushedMessagesIdPutRequest.ts -model/conversationsPushedMessagesPostRequest.ts -model/conversionSourceMetrics.ts -model/conversionSourceProduct.ts -model/corporateGroupDetailsResponse.ts -model/corporateGroupDetailsResponseGroup.ts -model/corporateGroupDetailsResponseSubAccountsInner.ts -model/corporateGroupDetailsResponseUsersInner.ts -model/corporateGroupPost201Response.ts -model/corporateGroupPostRequest.ts -model/corporateGroupUnlinkGroupIdSubAccountsPutRequest.ts -model/corporateSubAccountIpAssociatePostRequest.ts -model/corporateSubAccountIpDissociatePutRequest.ts -model/corporateUserInvitationActionEmailPut200Response.ts -model/createApiKeyRequest.ts -model/createApiKeyResponse.ts -model/createAttribute.ts -model/createAttributeEnumerationInner.ts -model/createCategoryModel.ts -model/createChild.ts -model/createContact.ts -model/createCouponCollection201Response.ts -model/createCouponCollectionRequest.ts -model/createCouponsRequest.ts -model/createDoiContact.ts -model/createDomain.ts -model/createDomainModel.ts -model/createDomainModelDnsRecords.ts -model/createDomainModelDnsRecordsDkimRecord.ts -model/createEmailCampaign.ts -model/createEmailCampaignRecipients.ts -model/createEmailCampaignSender.ts -model/createExternalFeed.ts -model/createExternalFeed201Response.ts -model/createList.ts -model/createModel.ts -model/createPaymentRequest.ts -model/createPaymentResponse.ts -model/createProductModel.ts -model/createReseller.ts -model/createSender.ts -model/createSenderIpsInner.ts -model/createSenderModel.ts -model/createSmsCampaign.ts -model/createSmsCampaignRecipients.ts -model/createSmtpEmail.ts -model/createSmtpTemplate.ts -model/createSmtpTemplateSender.ts -model/createSubAccount.ts -model/createSubAccountResponse.ts -model/createUpdateBatchCategory.ts -model/createUpdateBatchCategoryModel.ts -model/createUpdateBatchProducts.ts -model/createUpdateBatchProductsModel.ts -model/createUpdateCategories.ts -model/createUpdateCategory.ts -model/createUpdateContactModel.ts -model/createUpdateFolder.ts -model/createUpdateProduct.ts -model/createUpdateProducts.ts -model/createWebhook.ts -model/createWhatsAppCampaign.ts -model/createWhatsAppCampaignRecipients.ts -model/createWhatsAppTemplate.ts -model/createdBatchId.ts -model/createdProcessId.ts -model/crmDealsIdPatchRequest.ts -model/crmDealsLinkUnlinkIdPatchRequest.ts -model/crmDealsPost201Response.ts -model/crmDealsPostRequest.ts -model/crmTasksIdPatchRequest.ts -model/crmTasksPost201Response.ts -model/crmTasksPostRequest.ts -model/deal.ts -model/dealAttributesInner.ts -model/dealsList.ts -model/deleteHardbounces.ts -model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ts -model/ecommerceAttributionMetricsGet200Response.ts -model/ecommerceAttributionMetricsGet200ResponseTotals.ts -model/ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.ts -model/ecommerceConfigDisplayCurrencyGet200Response.ts -model/emailExportRecipients.ts -model/errorModel.ts -model/event.ts -model/eventIdentifiers.ts -model/exportWebhooksHistory.ts -model/fileData.ts -model/fileDownloadableLink.ts -model/getAccount.ts -model/getAccountActivity.ts -model/getAccountActivityLogsInner.ts -model/getAccountAllOfMarketingAutomation.ts -model/getAccountAllOfPlan.ts -model/getAccountAllOfRelay.ts -model/getAccountAllOfRelayData.ts -model/getAggregatedReport.ts -model/getAllExternalFeeds.ts -model/getAllExternalFeedsFeedsInner.ts -model/getAttributes.ts -model/getAttributesAttributesInner.ts -model/getAttributesAttributesInnerEnumerationInner.ts -model/getBlockedDomains.ts -model/getCampaignOverview.ts -model/getCampaignRecipients.ts -model/getCampaignStats.ts -model/getCategories.ts -model/getCategoryDetails.ts -model/getChildAccountCreationStatus.ts -model/getChildDomain.ts -model/getChildInfo.ts -model/getChildInfoAllOfApiKeys.ts -model/getChildInfoAllOfApiKeysV2.ts -model/getChildInfoAllOfApiKeysV3.ts -model/getChildInfoAllOfCredits.ts -model/getChildInfoAllOfStatistics.ts -model/getChildrenList.ts -model/getChildrenListChildrenInner.ts -model/getClient.ts -model/getContactCampaignStats.ts -model/getContactCampaignStatsClickedInner.ts -model/getContactCampaignStatsClickedInnerLinksInner.ts -model/getContactCampaignStatsMessagesSentInner.ts -model/getContactCampaignStatsOpenedInner.ts -model/getContactCampaignStatsTransacAttributesInner.ts -model/getContactCampaignStatsUnsubscriptions.ts -model/getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner.ts -model/getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner.ts -model/getContactDetails.ts -model/getContacts.ts -model/getCorporateInvitedUsersList.ts -model/getCorporateInvitedUsersListUsersInner.ts -model/getCorporateInvitedUsersListUsersInnerFeatureAccess.ts -model/getCorporateInvitedUsersListUsersInnerGroups.ts -model/getCorporateUserPermission.ts -model/getCorporateUserPermissionFeatureAccess.ts -model/getCorporateUserPermissionGroupsInner.ts -model/getCouponCollection.ts -model/getDeviceBrowserStats.ts -model/getDomainConfigurationModel.ts -model/getDomainsList.ts -model/getDomainsListDomainsInner.ts -model/getEmailCampaign.ts -model/getEmailCampaigns.ts -model/getEmailCampaignsCampaignsInner.ts -model/getEmailEventReport.ts -model/getEmailEventReportEventsInner.ts -model/getExtendedCampaignOverview.ts -model/getExtendedCampaignOverviewAllOfSender.ts -model/getExtendedCampaignStats.ts -model/getExtendedClient.ts -model/getExtendedClientAllOfAddress.ts -model/getExtendedContactDetails.ts -model/getExtendedContactDetailsAllOfStatistics.ts -model/getExtendedContactDetailsAllOfStatisticsClicked.ts -model/getExtendedContactDetailsAllOfStatisticsLinks.ts -model/getExtendedContactDetailsAllOfStatisticsMessagesSent.ts -model/getExtendedContactDetailsAllOfStatisticsOpened.ts -model/getExtendedContactDetailsAllOfStatisticsUnsubscriptions.ts -model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.ts -model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.ts -model/getExtendedList.ts -model/getExtendedListAllOfCampaignStats.ts -model/getExternalFeedByUUID.ts -model/getExternalFeedByUUIDHeadersInner.ts -model/getFolder.ts -model/getFolderLists.ts -model/getFolders.ts -model/getInboundEmailEvents.ts -model/getInboundEmailEventsByUuid.ts -model/getInboundEmailEventsByUuidAttachmentsInner.ts -model/getInboundEmailEventsByUuidLogsInner.ts -model/getInboundEmailEventsEventsInner.ts -model/getInvitedUsersList.ts -model/getInvitedUsersListUsersInner.ts -model/getInvitedUsersListUsersInnerFeatureAccess.ts -model/getIp.ts -model/getIpFromSender.ts -model/getIps.ts -model/getIpsFromSender.ts -model/getList.ts -model/getLists.ts -model/getListsListsInner.ts -model/getOrders.ts -model/getOrdersOrdersInner.ts -model/getPaymentRequest.ts -model/getProcess.ts -model/getProcesses.ts -model/getProductDetails.ts -model/getProducts.ts -model/getReports.ts -model/getReportsReportsInner.ts -model/getScheduledEmailByBatchId.ts -model/getScheduledEmailByBatchIdBatchesInner.ts -model/getScheduledEmailByMessageId.ts -model/getSegments.ts -model/getSegmentsSegments.ts -model/getSendersList.ts -model/getSendersListSendersInner.ts -model/getSendersListSendersInnerIpsInner.ts -model/getSharedTemplateUrl.ts -model/getSmsCampaign.ts -model/getSmsCampaignOverview.ts -model/getSmsCampaignStats.ts -model/getSmsCampaigns.ts -model/getSmsCampaignsCampaignsInner.ts -model/getSmsEventReport.ts -model/getSmsEventReportEventsInner.ts -model/getSmtpTemplateOverview.ts -model/getSmtpTemplateOverviewSender.ts -model/getSmtpTemplates.ts -model/getSsoToken.ts -model/getStatsByDevice.ts -model/getSubAccountGroups200ResponseInner.ts -model/getTransacAggregatedSmsReport.ts -model/getTransacBlockedContacts.ts -model/getTransacBlockedContactsContactsInner.ts -model/getTransacBlockedContactsContactsInnerReason.ts -model/getTransacEmailContent.ts -model/getTransacEmailContentEventsInner.ts -model/getTransacEmailsList.ts -model/getTransacEmailsListTransactionalEmailsInner.ts -model/getTransacSmsReport.ts -model/getTransacSmsReportReportsInner.ts -model/getUserPermission.ts -model/getUserPermissionPrivilegesInner.ts -model/getWATemplates.ts -model/getWATemplatesTemplatesInner.ts -model/getWebhook.ts -model/getWebhookAuth.ts -model/getWebhookHeadersInner.ts -model/getWebhooks.ts -model/getWhatsAppConfig.ts -model/getWhatsappCampaignOverview.ts -model/getWhatsappCampaigns.ts -model/getWhatsappCampaignsCampaignsInner.ts -model/getWhatsappEventReport.ts -model/getWhatsappEventReportEventsInner.ts -model/inviteAdminUser.ts -model/inviteAdminUserPrivilegesInner.ts -model/inviteuser.ts -model/inviteuserPrivilegesInner.ts -model/manageIp.ts -model/masterDetailsResponse.ts -model/masterDetailsResponseBillingInfo.ts -model/masterDetailsResponseBillingInfoAddress.ts -model/masterDetailsResponseBillingInfoName.ts -model/masterDetailsResponsePlanInfo.ts -model/masterDetailsResponsePlanInfoFeaturesInner.ts -model/models.ts -model/note.ts -model/noteData.ts -model/noteId.ts -model/notification.ts -model/order.ts -model/orderBatch.ts -model/orderBilling.ts -model/orderProductsInner.ts -model/otp.ts -model/pipeline.ts -model/pipelineStage.ts -model/postContactInfo.ts -model/postContactInfoContacts.ts -model/postSendFailed.ts -model/postSendSmsTestFailed.ts -model/putRevokeUserPermission.ts -model/putresendcancelinvitation.ts -model/remainingCreditModel.ts -model/remainingCreditModelChild.ts -model/remainingCreditModelReseller.ts -model/removeContactFromList.ts -model/removeCredits.ts -model/requestContactExport.ts -model/requestContactExportCustomContactFilter.ts -model/requestContactImport.ts -model/requestContactImportJsonBodyInner.ts -model/requestContactImportNewList.ts -model/requestSmsRecipientExport.ts -model/scheduleSmtpEmail.ts -model/sendReport.ts -model/sendReportEmail.ts -model/sendSms.ts -model/sendSmtpEmail.ts -model/sendSmtpEmailAttachmentInner.ts -model/sendSmtpEmailBccInner.ts -model/sendSmtpEmailCcInner.ts -model/sendSmtpEmailMessageVersionsInner.ts -model/sendSmtpEmailMessageVersionsInnerReplyTo.ts -model/sendSmtpEmailMessageVersionsInnerToInner.ts -model/sendSmtpEmailReplyTo.ts -model/sendSmtpEmailSender.ts -model/sendSmtpEmailToInner.ts -model/sendTestEmail.ts -model/sendTestSms.ts -model/sendTransacSms.ts -model/sendWhatsappMessage.ts -model/sendWhatsappMessage201Response.ts -model/ssoTokenRequest.ts -model/ssoTokenRequestCorporate.ts -model/subAccountAppsToggleRequest.ts -model/subAccountDetailsResponse.ts -model/subAccountDetailsResponseGroupsInner.ts -model/subAccountDetailsResponsePlanInfo.ts -model/subAccountDetailsResponsePlanInfoCredits.ts -model/subAccountDetailsResponsePlanInfoCreditsEmails.ts -model/subAccountDetailsResponsePlanInfoCreditsSms.ts -model/subAccountDetailsResponsePlanInfoCreditsWpSubscribers.ts -model/subAccountDetailsResponsePlanInfoFeatures.ts -model/subAccountDetailsResponsePlanInfoFeaturesInbox.ts -model/subAccountDetailsResponsePlanInfoFeaturesLandingPage.ts -model/subAccountDetailsResponsePlanInfoFeaturesUsers.ts -model/subAccountUpdatePlanRequest.ts -model/subAccountUpdatePlanRequestCredits.ts -model/subAccountUpdatePlanRequestFeatures.ts -model/subAccountsResponse.ts -model/subAccountsResponseSubAccountsInner.ts -model/subAccountsResponseSubAccountsInnerGroupsInner.ts -model/task.ts -model/taskList.ts -model/taskReminder.ts -model/taskTypes.ts -model/updateAttribute.ts -model/updateAttributeEnumerationInner.ts -model/updateBatchContacts.ts -model/updateBatchContactsContactsInner.ts -model/updateBatchContactsModel.ts -model/updateCampaignStatus.ts -model/updateChild.ts -model/updateChildAccountStatus.ts -model/updateChildDomain.ts -model/updateContact.ts -model/updateCouponCollection200Response.ts -model/updateCouponCollectionRequest.ts -model/updateEmailCampaign.ts -model/updateEmailCampaignRecipients.ts -model/updateEmailCampaignSender.ts -model/updateExternalFeed.ts -model/updateList.ts -model/updateSender.ts -model/updateSmsCampaign.ts -model/updateSmtpTemplate.ts -model/updateSmtpTemplateSender.ts -model/updateWebhook.ts -model/updateWhatsAppCampaign.ts -model/uploadImageModel.ts -model/uploadImageToGallery.ts -model/variablesItems.ts -model/whatsappCampStats.ts -model/whatsappCampTemplate.ts -package.json -tsconfig.json diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION deleted file mode 100644 index 3769235..0000000 --- a/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.1.0 \ No newline at end of file diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION deleted file mode 100644 index b0bea14..0000000 --- a/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.4.32 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fe5bc2f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,133 @@ +# Contributing + +Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project. + +## Getting Started + +### Prerequisites + +- Node.js 20 or higher +- pnpm package manager + +### Installation + +Install the project dependencies: + +```bash +pnpm install +``` + +### Building + +Build the project: + +```bash +pnpm build +``` + +### Testing + +Run the test suite: + +```bash +pnpm test +``` + +Run specific test types: +- `pnpm test:unit` - Run unit tests +- `pnpm test:wire` - Run wire/integration tests + +### Linting and Formatting + +Check code style: + +```bash +pnpm run lint +pnpm run format:check +``` + +Fix code style issues: + +```bash +pnpm run lint:fix +pnpm run format:fix +``` + +Or use the combined check command: + +```bash +pnpm run check:fix +``` + +## About Generated Code + +**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated. + +### Generated Files + +The following directories contain generated code: +- `src/api/` - API client classes and types +- `src/serialization/` - Serialization/deserialization logic +- Most TypeScript files in `src/` + +### How to Customize + +If you need to customize the SDK, you have two options: + +#### Option 1: Use `.fernignore` + +For custom code that should persist across SDK regenerations: + +1. Create a `.fernignore` file in the project root +2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax) +3. Add your custom code to those files + +Files listed in `.fernignore` will not be overwritten when the SDK is regenerated. + +For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code). + +#### Option 2: Contribute to the Generator + +If you want to change how code is generated for all users of this SDK: + +1. The TypeScript SDK generator lives in the [Fern repository](https://github.com/fern-api/fern) +2. Generator code is located at `generators/typescript/sdk/` +3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md) +4. Submit a pull request with your changes to the generator + +This approach is best for: +- Bug fixes in generated code +- New features that would benefit all users +- Improvements to code generation patterns + +## Making Changes + +### Workflow + +1. Create a new branch for your changes +2. Make your modifications +3. Run tests to ensure nothing breaks: `pnpm test` +4. Run linting and formatting: `pnpm run check:fix` +5. Build the project: `pnpm build` +6. Commit your changes with a clear commit message +7. Push your branch and create a pull request + +### Commit Messages + +Write clear, descriptive commit messages that explain what changed and why. + +### Code Style + +This project uses automated code formatting and linting. Run `pnpm run check:fix` before committing to ensure your code meets the project's style guidelines. + +## Questions or Issues? + +If you have questions or run into issues: + +1. Check the [Fern documentation](https://buildwithfern.com) +2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues) +3. Open a new issue if your question hasn't been addressed + +## License + +By contributing to this project, you agree that your contributions will be licensed under the same license as the project. diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index b7c41f7..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright (c) 2023, Brevo - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/README.md b/README.md index 8e18d58..1a50370 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,34 @@ -# Brevo Node SDK +# Brevo TypeScript Library -> ⚠️ **Important Notice**: This is the current stable version but we are currently working on rebuilding our Node library from scratch. +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fgetbrevo%2Fbrevo-node) +[![npm shield](https://img.shields.io/npm/v/)](https://www.npmjs.com/package/) + +The Brevo TypeScript library provides convenient access to the Brevo APIs from TypeScript. + +## Table of Contents + +- [Overview](#overview) +- [Node Js Implementation](#node-js-implementation) +- [Type Script Implementation](#type-script-implementation) +- [Support](#support) +- [License](#license) +- [Installation](#installation) +- [Reference](#reference) +- [Usage](#usage) +- [Request and Response Types](#request-and-response-types) +- [Exception Handling](#exception-handling) +- [File Uploads](#file-uploads) +- [Binary Response](#binary-response) +- [Advanced](#advanced) + - [Additional Headers](#additional-headers) + - [Additional Query String Parameters](#additional-query-string-parameters) + - [Retries](#retries) + - [Timeouts](#timeouts) + - [Aborting Requests](#aborting-requests) + - [Access Raw Response Data](#access-raw-response-data) + - [Logging](#logging) + - [Runtime Compatibility](#runtime-compatibility) +- [Contributing](#contributing) ## Overview @@ -10,17 +38,6 @@ Brevo's API matches the [OpenAPI v2 definition](https://www.openapis.org/). The Our current library is not fully compatible with all modern Node.js and TypeScript environments. To help you integrate Brevo into your applications, we're providing both plain Node.js and TypeScript-specific implementation approaches below while we work on the next generation of our SDK. -## Table of Contents - -- [Node.js Implementation](#nodejs-implementation) - - [Send Transactional Email](#send-transactional-email) - - [Create Contact](#create-contact) -- [TypeScript Implementation](#typescript-implementation) - - [Send Transactional Email](#send-transactional-email-1) - - [Create Contact](#create-contact-1) -- [Support](#support) -- [License](#license) - ## Node.js Implementation ### Send Transactional Email @@ -357,3 +374,679 @@ For questions and support, please refer to our [documentation](https://developer ## License This SDK is distributed under the MIT License. + +## Installation + +```sh +npm i -s +``` + +## Reference + +A full reference for this library is available [here](https://github.com/getbrevo/brevo-node/blob/HEAD/./reference.md). + +## Usage + +Instantiate and use the client with the following: + +```typescript +import { BrevoClient } from ""; + +const client = new BrevoClient({ apiKey: "YOUR_API_KEY" }); +await client.masterAccount.createANewGroupOfSubAccounts({ + groupName: "My group" +}); +``` + +## Request and Response Types + +The SDK exports all request and response types as TypeScript interfaces. Simply import them with the +following namespace: + +```typescript +import { Brevo } from "Brevo"; + +const request: Brevo.GetAccountActivityRequest = { + ... +}; +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error +will be thrown. + +```typescript +import { BrevoError } from "Brevo"; + +try { + await client.masterAccount.createANewGroupOfSubAccounts(...); +} catch (err) { + if (err instanceof BrevoError) { + console.log(err.statusCode); + console.log(err.message); + console.log(err.body); + console.log(err.rawResponse); + } +} +``` + +## File Uploads + +You can upload files using the client: + +```typescript +import { createReadStream } from "fs"; +import { BrevoClient } from ""; + +const client = new BrevoClient({ apiKey: "YOUR_API_KEY" }); +await client.companies.importCompaniesCreationAndUpdation({}); +``` +The client accepts a variety of types for file upload parameters: +* Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream` +* Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array` + +### Metadata + +You can configure metadata when uploading a file: +```typescript +const file: Uploadable.WithMetadata = { + data: createReadStream("path/to/file"), + filename: "my-file", // optional + contentType: "audio/mpeg", // optional + contentLength: 1949, // optional +}; +``` + +Alternatively, you can upload a file directly from a file path: +```typescript +const file : Uploadable.FromPath = { + path: "path/to/file", + filename: "my-file", // optional + contentType: "audio/mpeg", // optional + contentLength: 1949, // optional +}; +``` + +The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically. +For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory. + + +## Binary Response + +You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data: + +```typescript +const response = await client.inboundParsing.getInboundEmailAttachment(...); +const stream: ReadableStream = response.stream(); +// const arrayBuffer: ArrayBuffer = await response.arrayBuffer(); +// const blob: Blob = response.blob(); +// const bytes: Uint8Array = response.bytes(); +// You can only use the response body once, so you must choose one of the above methods. +// If you want to check if the response body has been used, you can use the following property. +const bodyUsed = response.bodyUsed; +``` +
+Save binary response to a file + +
+
+Node.js + +
+
+ReadableStream (most-efficient) + +```ts +import { createWriteStream } from 'fs'; +import { Readable } from 'stream'; +import { pipeline } from 'stream/promises'; + +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +const nodeStream = Readable.fromWeb(stream); +const writeStream = createWriteStream('path/to/file'); + +await pipeline(nodeStream, writeStream); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +await writeFile('path/to/file', Buffer.from(arrayBuffer)); +``` + +
+
+ +
+
+Blob + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +const arrayBuffer = await blob.arrayBuffer(); +await writeFile('output.bin', Buffer.from(arrayBuffer)); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +await writeFile('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Bun + +
+
+ReadableStream (most-efficient) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +await Bun.write('path/to/file', stream); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +await Bun.write('path/to/file', arrayBuffer); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +await Bun.write('path/to/file', blob); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +await Bun.write('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Deno + +
+
+ReadableStream (most-efficient) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +const file = await Deno.open('path/to/file', { write: true, create: true }); +await stream.pipeTo(file.writable); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +const arrayBuffer = await blob.arrayBuffer(); +await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +await Deno.writeFile('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Browser + +
+
+Blob (most-efficient) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ReadableStream + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +const reader = stream.getReader(); +const chunks = []; + +while (true) { + const { done, value } = await reader.read(); + if (done) break; + chunks.push(value); +} + +const blob = new Blob(chunks); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +const blob = new Blob([arrayBuffer]); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +const blob = new Blob([bytes]); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ +
+ + +
+Convert binary response to text + +
+
+ReadableStream + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +const text = await new Response(stream).text(); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +const text = new TextDecoder().decode(arrayBuffer); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +const text = await blob.text(); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +const text = new TextDecoder().decode(bytes); +``` + +
+
+ +
+ +## Advanced + +### Additional Headers + +If you would like to send additional headers as part of the request, use the `headers` request option. + +```typescript +import { BrevoClient } from "Brevo"; + +const client = new BrevoClient({ + ... + headers: { + 'X-Custom-Header': 'custom value' + } +}); + +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + headers: { + 'X-Custom-Header': 'custom value' + } +}); +``` + +### Additional Query String Parameters + +If you would like to send additional query string parameters as part of the request, use the `queryParams` request option. + +```typescript +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + queryParams: { + 'customQueryParamKey': 'custom query param value' + } +}); +``` + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retryable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retryable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `maxRetries` request option to configure this behavior. + +```typescript +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + maxRetries: 0 // override maxRetries at the request level +}); +``` + +### Timeouts + +The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior. + +```typescript +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + timeoutInSeconds: 30 // override timeout to 30s +}); +``` + +### Aborting Requests + +The SDK allows users to abort requests at any point by passing in an abort signal. + +```typescript +const controller = new AbortController(); +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + abortSignal: controller.signal +}); +controller.abort(); // aborts the request +``` + +### Access Raw Response Data + +The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method. +The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property. + +```typescript +const { data, rawResponse } = await client.masterAccount.createANewGroupOfSubAccounts(...).withRawResponse(); + +console.log(data); +console.log(rawResponse.headers['X-My-Header']); +``` + +### Logging + +The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options. + +```typescript +import { BrevoClient, logging } from "Brevo"; + +const client = new BrevoClient({ + ... + logging: { + level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info + logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger + silent: false, // defaults to true, set to false to enable logging + } +}); +``` +The `logging` object can have the following properties: +- `level`: The log level to use. Defaults to `logging.LogLevel.Info`. +- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`. +- `silent`: Whether to silence the logger. Defaults to `true`. + +The `level` property can be one of the following values: +- `logging.LogLevel.Debug` +- `logging.LogLevel.Info` +- `logging.LogLevel.Warn` +- `logging.LogLevel.Error` + +To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface. + +
+Custom logger examples + +Here's an example using the popular `winston` logging library. +```ts +import winston from 'winston'; + +const winstonLogger = winston.createLogger({...}); + +const logger: logging.ILogger = { + debug: (msg, ...args) => winstonLogger.debug(msg, ...args), + info: (msg, ...args) => winstonLogger.info(msg, ...args), + warn: (msg, ...args) => winstonLogger.warn(msg, ...args), + error: (msg, ...args) => winstonLogger.error(msg, ...args), +}; +``` + +Here's an example using the popular `pino` logging library. + +```ts +import pino from 'pino'; + +const pinoLogger = pino({...}); + +const logger: logging.ILogger = { + debug: (msg, ...args) => pinoLogger.debug(args, msg), + info: (msg, ...args) => pinoLogger.info(args, msg), + warn: (msg, ...args) => pinoLogger.warn(args, msg), + error: (msg, ...args) => pinoLogger.error(args, msg), +}; +``` +
+ + +### Runtime Compatibility + + +The SDK works in the following runtimes: + + + +- Node.js 18+ +- Vercel +- Cloudflare Workers +- Deno v1.25+ +- Bun 1.0+ +- React Native + +### Customizing Fetch Client + +The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an +unsupported environment, this provides a way for you to break glass and ensure the SDK works. + +```typescript +import { BrevoClient } from "Brevo"; + +const client = new BrevoClient({ + ... + fetcher: // provide your implementation here +}); +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! \ No newline at end of file diff --git a/api.ts b/api.ts deleted file mode 100644 index b1119f1..0000000 --- a/api.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This is the entrypoint for the package -export * from './api/apis'; -export * from './model/models'; diff --git a/api/accountApi.ts b/api/accountApi.ts deleted file mode 100644 index 4056b87..0000000 --- a/api/accountApi.ts +++ /dev/null @@ -1,252 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { GetAccount } from '../model/getAccount'; -import { GetAccountActivity } from '../model/getAccountActivity'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum AccountApiApiKeys { - apiKey, - partnerKey, -} - -export class AccountApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: AccountApiApiKeys, value: string) { - (this.authentications as any)[AccountApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Get your account information, plan and credits details - */ - public async getAccount (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAccount; }> { - const localVarPath = this.basePath + '/account'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetAccount; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetAccount"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get user activity logs - * @param startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. - * @param endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. - * @param limit Number of documents per page - * @param offset Index of the first document in the page. - */ - public async getAccountActivity (startDate?: string, endDate?: string, limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAccountActivity; }> { - const localVarPath = this.basePath + '/organization/activities'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetAccountActivity; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetAccountActivity"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/apis.ts b/api/apis.ts deleted file mode 100644 index f621d6a..0000000 --- a/api/apis.ts +++ /dev/null @@ -1,66 +0,0 @@ -export * from './accountApi'; -import { AccountApi } from './accountApi'; -export * from './companiesApi'; -import { CompaniesApi } from './companiesApi'; -export * from './contactsApi'; -import { ContactsApi } from './contactsApi'; -export * from './conversationsApi'; -import { ConversationsApi } from './conversationsApi'; -export * from './couponsApi'; -import { CouponsApi } from './couponsApi'; -export * from './dealsApi'; -import { DealsApi } from './dealsApi'; -export * from './domainsApi'; -import { DomainsApi } from './domainsApi'; -export * from './ecommerceApi'; -import { EcommerceApi } from './ecommerceApi'; -export * from './emailCampaignsApi'; -import { EmailCampaignsApi } from './emailCampaignsApi'; -export * from './eventsApi'; -import { EventsApi } from './eventsApi'; -export * from './externalFeedsApi'; -import { ExternalFeedsApi } from './externalFeedsApi'; -export * from './filesApi'; -import { FilesApi } from './filesApi'; -export * from './inboundParsingApi'; -import { InboundParsingApi } from './inboundParsingApi'; -export * from './masterAccountApi'; -import { MasterAccountApi } from './masterAccountApi'; -export * from './notesApi'; -import { NotesApi } from './notesApi'; -export * from './paymentsApi'; -import { PaymentsApi } from './paymentsApi'; -export * from './processApi'; -import { ProcessApi } from './processApi'; -export * from './resellerApi'; -import { ResellerApi } from './resellerApi'; -export * from './sMSCampaignsApi'; -import { SMSCampaignsApi } from './sMSCampaignsApi'; -export * from './sendersApi'; -import { SendersApi } from './sendersApi'; -export * from './tasksApi'; -import { TasksApi } from './tasksApi'; -export * from './transactionalEmailsApi'; -import { TransactionalEmailsApi } from './transactionalEmailsApi'; -export * from './transactionalSMSApi'; -import { TransactionalSMSApi } from './transactionalSMSApi'; -export * from './transactionalWhatsAppApi'; -import { TransactionalWhatsAppApi } from './transactionalWhatsAppApi'; -export * from './userApi'; -import { UserApi } from './userApi'; -export * from './webhooksApi'; -import { WebhooksApi } from './webhooksApi'; -export * from './whatsAppCampaignsApi'; -import { WhatsAppCampaignsApi } from './whatsAppCampaignsApi'; -import * as http from 'http'; - -export class HttpError extends Error { - constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) { - super('HTTP request failed'); - this.name = 'HttpError'; - } -} - -export { RequestFile } from '../model/models'; - -export const APIS = [AccountApi, CompaniesApi, ContactsApi, ConversationsApi, CouponsApi, DealsApi, DomainsApi, EcommerceApi, EmailCampaignsApi, EventsApi, ExternalFeedsApi, FilesApi, InboundParsingApi, MasterAccountApi, NotesApi, PaymentsApi, ProcessApi, ResellerApi, SMSCampaignsApi, SendersApi, TasksApi, TransactionalEmailsApi, TransactionalSMSApi, TransactionalWhatsAppApi, UserApi, WebhooksApi, WhatsAppCampaignsApi]; diff --git a/api/companiesApi.ts b/api/companiesApi.ts deleted file mode 100644 index ac964f1..0000000 --- a/api/companiesApi.ts +++ /dev/null @@ -1,659 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CompaniesIdPatchRequest } from '../model/companiesIdPatchRequest'; -import { CompaniesLinkUnlinkIdPatchRequest } from '../model/companiesLinkUnlinkIdPatchRequest'; -import { CompaniesList } from '../model/companiesList'; -import { CompaniesPost200Response } from '../model/companiesPost200Response'; -import { CompaniesPostRequest } from '../model/companiesPostRequest'; -import { Company } from '../model/company'; -import { CompanyAttributesInner } from '../model/companyAttributesInner'; -import { ErrorModel } from '../model/errorModel'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum CompaniesApiApiKeys { - apiKey, - partnerKey, -} - -export class CompaniesApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: CompaniesApiApiKeys, value: string) { - (this.authentications as any)[CompaniesApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Get company attributes - */ - public async companiesAttributesGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { - const localVarPath = this.basePath + '/companies/attributes'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all companies - * @param filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"} - * @param linkedContactsIds Filter by linked contacts ids - * @param linkedDealsIds Filter by linked deals ids - * @param page Index of the first document of the page - * @param limit Number of documents per page - * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed - * @param sortBy The field used to sort field names. - */ - public async companiesGet (filters?: string, linkedContactsIds?: number, linkedDealsIds?: string, page?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CompaniesList; }> { - const localVarPath = this.basePath + '/companies'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (filters !== undefined) { - localVarQueryParameters['filters'] = ObjectSerializer.serialize(filters, "string"); - } - - if (linkedContactsIds !== undefined) { - localVarQueryParameters['linkedContactsIds'] = ObjectSerializer.serialize(linkedContactsIds, "number"); - } - - if (linkedDealsIds !== undefined) { - localVarQueryParameters['linkedDealsIds'] = ObjectSerializer.serialize(linkedDealsIds, "string"); - } - - if (page !== undefined) { - localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (sortBy !== undefined) { - localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CompaniesList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CompaniesList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a company - * @param id - */ - public async companiesIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/companies/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling companiesIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a company - * @param id - */ - public async companiesIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Company; }> { - const localVarPath = this.basePath + '/companies/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling companiesIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Company; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Company"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a company - * @param id - * @param body Updated company details. - */ - public async companiesIdPatch (id: string, body: CompaniesIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Company; }> { - const localVarPath = this.basePath + '/companies/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling companiesIdPatch.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling companiesIdPatch.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PATCH', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CompaniesIdPatchRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Company; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Company"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Link and Unlink company with contacts and deals - * @param id - * @param body Linked / Unlinked contacts and deals ids. - */ - public async companiesLinkUnlinkIdPatch (id: string, body: CompaniesLinkUnlinkIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/companies/link-unlink/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling companiesLinkUnlinkIdPatch.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling companiesLinkUnlinkIdPatch.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PATCH', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CompaniesLinkUnlinkIdPatchRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a company - * @param body Company create data. - */ - public async companiesPost (body: CompaniesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CompaniesPost200Response; }> { - const localVarPath = this.basePath + '/companies'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling companiesPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CompaniesPostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CompaniesPost200Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CompaniesPost200Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/contactsApi.ts b/api/contactsApi.ts deleted file mode 100644 index bfcfdd5..0000000 --- a/api/contactsApi.ts +++ /dev/null @@ -1,2487 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions, IncomingMessage } from '../requestCompat'; -import { AddContactToList } from '../model/addContactToList'; -import { CreateAttribute } from '../model/createAttribute'; -import { CreateContact } from '../model/createContact'; -import { CreateDoiContact } from '../model/createDoiContact'; -import { CreateList } from '../model/createList'; -import { CreateModel } from '../model/createModel'; -import { CreateUpdateContactModel } from '../model/createUpdateContactModel'; -import { CreateUpdateFolder } from '../model/createUpdateFolder'; -import { CreatedProcessId } from '../model/createdProcessId'; -import { ErrorModel } from '../model/errorModel'; -import { GetAttributes } from '../model/getAttributes'; -import { GetContactCampaignStats } from '../model/getContactCampaignStats'; -import { GetContacts } from '../model/getContacts'; -import { GetExtendedContactDetails } from '../model/getExtendedContactDetails'; -import { GetExtendedList } from '../model/getExtendedList'; -import { GetFolder } from '../model/getFolder'; -import { GetFolderLists } from '../model/getFolderLists'; -import { GetFolders } from '../model/getFolders'; -import { GetLists } from '../model/getLists'; -import { GetSegments } from '../model/getSegments'; -import { PostContactInfo } from '../model/postContactInfo'; -import { RemoveContactFromList } from '../model/removeContactFromList'; -import { RequestContactExport } from '../model/requestContactExport'; -import { RequestContactImport } from '../model/requestContactImport'; -import { UpdateAttribute } from '../model/updateAttribute'; -import { UpdateBatchContacts } from '../model/updateBatchContacts'; -import { UpdateContact } from '../model/updateContact'; -import { UpdateList } from '../model/updateList'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum ContactsApiApiKeys { - apiKey, - partnerKey, -} - -export class ContactsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: ContactsApiApiKeys, value: string) { - (this.authentications as any)[ContactsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Add existing contacts to a list - * @param listId Id of the list - * @param contactEmails Emails addresses OR IDs of the contacts - */ - public async addContactToList (listId: number, contactEmails: AddContactToList, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: PostContactInfo; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/add' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling addContactToList.'); - } - - // verify required parameter 'contactEmails' is not null or undefined - if (contactEmails === null || contactEmails === undefined) { - throw new Error('Required parameter contactEmails was null or undefined when calling addContactToList.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(contactEmails, "AddContactToList") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "PostContactInfo"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create contact attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the attribute - * @param createAttribute Values to create an attribute - */ - public async createAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, createAttribute: CreateAttribute, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling createAttribute.'); - } - - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling createAttribute.'); - } - - // verify required parameter 'createAttribute' is not null or undefined - if (createAttribute === null || createAttribute === undefined) { - throw new Error('Required parameter createAttribute was null or undefined when calling createAttribute.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createAttribute, "CreateAttribute") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a contact - * @param createContact Values to create a contact - */ - public async createContact (createContact: CreateContact, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateUpdateContactModel; }> { - const localVarPath = this.basePath + '/contacts'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createContact' is not null or undefined - if (createContact === null || createContact === undefined) { - throw new Error('Required parameter createContact was null or undefined when calling createContact.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createContact, "CreateContact") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateUpdateContactModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateUpdateContactModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create Contact via DOI (Double-Opt-In) Flow - * @param createDoiContact Values to create the Double opt-in (DOI) contact - */ - public async createDoiContact (createDoiContact: CreateDoiContact, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/doubleOptinConfirmation'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createDoiContact' is not null or undefined - if (createDoiContact === null || createDoiContact === undefined) { - throw new Error('Required parameter createDoiContact was null or undefined when calling createDoiContact.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createDoiContact, "CreateDoiContact") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a folder - * @param createFolder Name of the folder - */ - public async createFolder (createFolder: CreateUpdateFolder, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/contacts/folders'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createFolder' is not null or undefined - if (createFolder === null || createFolder === undefined) { - throw new Error('Required parameter createFolder was null or undefined when calling createFolder.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createFolder, "CreateUpdateFolder") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a list - * @param createList Values to create a list - */ - public async createList (createList: CreateList, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/contacts/lists'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createList' is not null or undefined - if (createList === null || createList === undefined) { - throw new Error('Required parameter createList was null or undefined when calling createList.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createList, "CreateList") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete an attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the existing attribute - */ - public async deleteAttribute (attributeCategory: 'normal' | 'transactional' | 'category' | 'calculated' | 'global', attributeName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling deleteAttribute.'); - } - - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling deleteAttribute.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a contact - * @param identifier Email (urlencoded) OR ID of the contact - */ - public async deleteContact (identifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/{identifier}' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling deleteContact.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a folder (and all its lists) - * @param folderId Id of the folder - */ - public async deleteFolder (folderId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling deleteFolder.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a list - * @param listId Id of the list - */ - public async deleteList (listId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling deleteList.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary List all attributes - */ - public async getAttributes (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetAttributes; }> { - const localVarPath = this.basePath + '/contacts/attributes'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetAttributes; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetAttributes"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.brevo.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges. - * @summary Get a contact\'s details - * @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value - * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate - * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. - */ - public async getContactInfo (identifier: string, startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetExtendedContactDetails; }> { - const localVarPath = this.basePath + '/contacts/{identifier}' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling getContactInfo.'); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetExtendedContactDetails; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetExtendedContactDetails"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get email campaigns\' statistics for a contact - * @param identifier Email (urlencoded) OR ID of the contact - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days - */ - public async getContactStats (identifier: string, startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetContactCampaignStats; }> { - const localVarPath = this.basePath + '/contacts/{identifier}/campaignStats' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling getContactStats.'); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetContactCampaignStats; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetContactCampaignStats"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all the contacts - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - * @param createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param segmentId Id of the segment. **Either listIds or segmentId can be passed.** - * @param listIds Ids of the list. **Either listIds or segmentId can be passed.** - * @param filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))** - */ - public async getContacts (limit?: number, offset?: number, modifiedSince?: string, createdSince?: string, sort?: 'asc' | 'desc', segmentId?: number, listIds?: Array, filter?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetContacts; }> { - const localVarPath = this.basePath + '/contacts'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (modifiedSince !== undefined) { - localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); - } - - if (createdSince !== undefined) { - localVarQueryParameters['createdSince'] = ObjectSerializer.serialize(createdSince, "string"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (segmentId !== undefined) { - localVarQueryParameters['segmentId'] = ObjectSerializer.serialize(segmentId, "number"); - } - - if (listIds !== undefined) { - localVarQueryParameters['listIds'] = ObjectSerializer.serialize(listIds, "Array"); - } - - if (filter !== undefined) { - localVarQueryParameters['filter'] = ObjectSerializer.serialize(filter, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetContacts; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetContacts"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get contacts in a list - * @param listId Id of the list - * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getContactsFromList (listId: number, modifiedSince?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetContacts; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling getContactsFromList.'); - } - - if (modifiedSince !== undefined) { - localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetContacts; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetContacts"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Returns a folder\'s details - * @param folderId id of the folder - */ - public async getFolder (folderId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetFolder; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling getFolder.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetFolder; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetFolder"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get lists in a folder - * @param folderId Id of the folder - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getFolderLists (folderId: number, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetFolderLists; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}/lists' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling getFolderLists.'); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetFolderLists; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetFolderLists"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all folders - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getFolders (limit: number, offset: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetFolders; }> { - const localVarPath = this.basePath + '/contacts/folders'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'limit' is not null or undefined - if (limit === null || limit === undefined) { - throw new Error('Required parameter limit was null or undefined when calling getFolders.'); - } - - // verify required parameter 'offset' is not null or undefined - if (offset === null || offset === undefined) { - throw new Error('Required parameter offset was null or undefined when calling getFolders.'); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetFolders; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetFolders"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a list\'s details - * @param listId Id of the list - * @param startDate Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result - * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result - */ - public async getList (listId: number, startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetExtendedList; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling getList.'); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetExtendedList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetExtendedList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all the lists - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getLists (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetLists; }> { - const localVarPath = this.basePath + '/contacts/lists'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetLists; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetLists"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all the Segments - * @param limit Number of documents per page - * @param offset Index of the first document of the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getSegments (limit: number, offset: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetSegments; }> { - const localVarPath = this.basePath + '/contacts/segments'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'limit' is not null or undefined - if (limit === null || limit === undefined) { - throw new Error('Required parameter limit was null or undefined when calling getSegments.'); - } - - // verify required parameter 'offset' is not null or undefined - if (offset === null || offset === undefined) { - throw new Error('Required parameter offset was null or undefined when calling getSegments.'); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetSegments; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSegments"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * It returns the background process ID which on completion calls the notify URL that you have set in the input. **Note**: - Any contact attribute that doesn\'t exist in your account will be ignored at import end. - * @summary Import contacts - * @param requestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - */ - public async importContacts (requestContactImport: RequestContactImport, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/contacts/import'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'requestContactImport' is not null or undefined - if (requestContactImport === null || requestContactImport === undefined) { - throw new Error('Required parameter requestContactImport was null or undefined when calling importContacts.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - data: ObjectSerializer.serialize(requestContactImport, "RequestContactImport") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a contact from a list - * @param listId Id of the list - * @param contactEmails Emails addresses OR IDs of the contacts - */ - public async removeContactFromList (listId: number, contactEmails: RemoveContactFromList, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: PostContactInfo; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/remove' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling removeContactFromList.'); - } - - // verify required parameter 'contactEmails' is not null or undefined - if (contactEmails === null || contactEmails === undefined) { - throw new Error('Required parameter contactEmails was null or undefined when calling removeContactFromList.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(contactEmails, "RemoveContactFromList") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: PostContactInfo; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "PostContactInfo"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - * @summary Export contacts - * @param requestContactExport Values to request a contact export - */ - public async requestContactExport (requestContactExport: RequestContactExport, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/contacts/export'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'requestContactExport' is not null or undefined - if (requestContactExport === null || requestContactExport === undefined) { - throw new Error('Required parameter requestContactExport was null or undefined when calling requestContactExport.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - data: ObjectSerializer.serialize(requestContactExport, "RequestContactExport") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update contact attribute - * @param attributeCategory Category of the attribute - * @param attributeName Name of the existing attribute - * @param updateAttribute Values to update an attribute - */ - public async updateAttribute (attributeCategory: 'category' | 'calculated' | 'global', attributeName: string, updateAttribute: UpdateAttribute, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}' - .replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory))) - .replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'attributeCategory' is not null or undefined - if (attributeCategory === null || attributeCategory === undefined) { - throw new Error('Required parameter attributeCategory was null or undefined when calling updateAttribute.'); - } - - // verify required parameter 'attributeName' is not null or undefined - if (attributeName === null || attributeName === undefined) { - throw new Error('Required parameter attributeName was null or undefined when calling updateAttribute.'); - } - - // verify required parameter 'updateAttribute' is not null or undefined - if (updateAttribute === null || updateAttribute === undefined) { - throw new Error('Required parameter updateAttribute was null or undefined when calling updateAttribute.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateAttribute, "UpdateAttribute") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update multiple contacts - * @param updateBatchContacts Values to update multiple contacts - */ - public async updateBatchContacts (updateBatchContacts: UpdateBatchContacts, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/batch'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'updateBatchContacts' is not null or undefined - if (updateBatchContacts === null || updateBatchContacts === undefined) { - throw new Error('Required parameter updateBatchContacts was null or undefined when calling updateBatchContacts.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateBatchContacts, "UpdateBatchContacts") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a contact - * @param identifier Email (urlencoded) OR ID of the contact - * @param updateContact Values to update a contact - */ - public async updateContact (identifier: string, updateContact: UpdateContact, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/{identifier}' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling updateContact.'); - } - - // verify required parameter 'updateContact' is not null or undefined - if (updateContact === null || updateContact === undefined) { - throw new Error('Required parameter updateContact was null or undefined when calling updateContact.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateContact, "UpdateContact") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a folder - * @param folderId Id of the folder - * @param updateFolder Name of the folder - */ - public async updateFolder (folderId: number, updateFolder: CreateUpdateFolder, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/folders/{folderId}' - .replace('{' + 'folderId' + '}', encodeURIComponent(String(folderId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'folderId' is not null or undefined - if (folderId === null || folderId === undefined) { - throw new Error('Required parameter folderId was null or undefined when calling updateFolder.'); - } - - // verify required parameter 'updateFolder' is not null or undefined - if (updateFolder === null || updateFolder === undefined) { - throw new Error('Required parameter updateFolder was null or undefined when calling updateFolder.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateFolder, "CreateUpdateFolder") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a list - * @param listId Id of the list - * @param updateList Values to update a list - */ - public async updateList (listId: number, updateList: UpdateList, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/contacts/lists/{listId}' - .replace('{' + 'listId' + '}', encodeURIComponent(String(listId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'listId' is not null or undefined - if (listId === null || listId === undefined) { - throw new Error('Required parameter listId was null or undefined when calling updateList.'); - } - - // verify required parameter 'updateList' is not null or undefined - if (updateList === null || updateList === undefined) { - throw new Error('Required parameter updateList was null or undefined when calling updateList.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateList, "UpdateList") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/conversationsApi.ts b/api/conversationsApi.ts deleted file mode 100644 index 86e8247..0000000 --- a/api/conversationsApi.ts +++ /dev/null @@ -1,780 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions, IncomingMessage } from '../requestCompat'; - -/* tslint:disable:no-unused-locals */ -import { ConversationsAgentOnlinePingPostRequest } from '../model/conversationsAgentOnlinePingPostRequest'; -import { ConversationsMessage } from '../model/conversationsMessage'; -import { ConversationsMessagesIdPutRequest } from '../model/conversationsMessagesIdPutRequest'; -import { ConversationsMessagesPostRequest } from '../model/conversationsMessagesPostRequest'; -import { ConversationsPushedMessagesIdPutRequest } from '../model/conversationsPushedMessagesIdPutRequest'; -import { ConversationsPushedMessagesPostRequest } from '../model/conversationsPushedMessagesPostRequest'; -import { ErrorModel } from '../model/errorModel'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum ConversationsApiApiKeys { - apiKey, - partnerKey, -} - -export class ConversationsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: ConversationsApiApiKeys, value: string) { - (this.authentications as any)[ConversationsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * We recommend pinging this endpoint every minute for as long as the agent has to be considered online. - * @summary Sets agent’s status to online for 2-3 minutes - * @param body Agent fields. - */ - public async conversationsAgentOnlinePingPost (body: ConversationsAgentOnlinePingPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/conversations/agentOnlinePing'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling conversationsAgentOnlinePingPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "ConversationsAgentOnlinePingPostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Only agents’ messages can be deleted. - * @summary Delete a message sent by an agent - * @param id ID of the message - */ - public async conversationsMessagesIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/conversations/messages/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling conversationsMessagesIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a message - * @param id ID of the message - */ - public async conversationsMessagesIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: ConversationsMessage; }> { - const localVarPath = this.basePath + '/conversations/messages/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling conversationsMessagesIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "ConversationsMessage"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Only agents’ messages can be edited. - * @summary Update a message sent by an agent - * @param id ID of the message - * @param body - */ - public async conversationsMessagesIdPut (id: string, body?: ConversationsMessagesIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: ConversationsMessage; }> { - const localVarPath = this.basePath + '/conversations/messages/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling conversationsMessagesIdPut.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "ConversationsMessagesIdPutRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "ConversationsMessage"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send a message as an agent - * @param body Message fields. - */ - public async conversationsMessagesPost (body: ConversationsMessagesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: ConversationsMessage; }> { - const localVarPath = this.basePath + '/conversations/messages'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling conversationsMessagesPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "ConversationsMessagesPostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "ConversationsMessage"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete an automated message - * @param id ID of the message - */ - public async conversationsPushedMessagesIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/conversations/pushedMessages/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling conversationsPushedMessagesIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get an automated message - * @param id ID of the message sent previously - */ - public async conversationsPushedMessagesIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: ConversationsMessage; }> { - const localVarPath = this.basePath + '/conversations/pushedMessages/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling conversationsPushedMessagesIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "ConversationsMessage"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update an automated message - * @param id ID of the message - * @param body - */ - public async conversationsPushedMessagesIdPut (id: string, body: ConversationsPushedMessagesIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: ConversationsMessage; }> { - const localVarPath = this.basePath + '/conversations/pushedMessages/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling conversationsPushedMessagesIdPut.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling conversationsPushedMessagesIdPut.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "ConversationsPushedMessagesIdPutRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "ConversationsMessage"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Example of automated messages: order status, announce new features in your web app, etc. - * @summary Send an automated message to a visitor - * @param body - */ - public async conversationsPushedMessagesPost (body: ConversationsPushedMessagesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: ConversationsMessage; }> { - const localVarPath = this.basePath + '/conversations/pushedMessages'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling conversationsPushedMessagesPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "ConversationsPushedMessagesPostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: ConversationsMessage; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "ConversationsMessage"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/couponsApi.ts b/api/couponsApi.ts deleted file mode 100644 index 83bfd4a..0000000 --- a/api/couponsApi.ts +++ /dev/null @@ -1,489 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CreateCouponCollection201Response } from '../model/createCouponCollection201Response'; -import { CreateCouponCollectionRequest } from '../model/createCouponCollectionRequest'; -import { CreateCouponsRequest } from '../model/createCouponsRequest'; -import { ErrorModel } from '../model/errorModel'; -import { GetCouponCollection } from '../model/getCouponCollection'; -import { UpdateCouponCollection200Response } from '../model/updateCouponCollection200Response'; -import { UpdateCouponCollectionRequest } from '../model/updateCouponCollectionRequest'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum CouponsApiApiKeys { - apiKey, - partnerKey, -} - -export class CouponsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: CouponsApiApiKeys, value: string) { - (this.authentications as any)[CouponsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Create а coupon collection - * @param createCouponCollection Values to create a coupon collection - */ - public async createCouponCollection (createCouponCollection: CreateCouponCollectionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateCouponCollection201Response; }> { - const localVarPath = this.basePath + '/couponCollections'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createCouponCollection' is not null or undefined - if (createCouponCollection === null || createCouponCollection === undefined) { - throw new Error('Required parameter createCouponCollection was null or undefined when calling createCouponCollection.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createCouponCollection, "CreateCouponCollectionRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateCouponCollection201Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateCouponCollection201Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create coupons for a coupon collection - * @param createCoupons Values to create coupons - */ - public async createCoupons (createCoupons: CreateCouponsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/coupons'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createCoupons' is not null or undefined - if (createCoupons === null || createCoupons === undefined) { - throw new Error('Required parameter createCoupons was null or undefined when calling createCoupons.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createCoupons, "CreateCouponsRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a coupon collection by id - * @param id Id of the collection to return - */ - public async getCouponCollection (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetCouponCollection; }> { - const localVarPath = this.basePath + '/couponCollections/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getCouponCollection.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetCouponCollection; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetCouponCollection"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all your coupon collections - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - * @param sort Sort the results by creation time in ascending/descending order - * @param sortBy The field used to sort coupon collections - */ - public async getCouponCollections (limit?: number, offset?: number, sort?: 'asc' | 'desc', sortBy?: 'createdAt' | 'remainingCoupons' | 'expirationDate', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetCouponCollection; }> { - const localVarPath = this.basePath + '/couponCollections'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (sortBy !== undefined) { - localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "'createdAt' | 'remainingCoupons' | 'expirationDate'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetCouponCollection; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetCouponCollection"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a coupon collection by id - * @param id Id of the collection to update - * @param updateCouponCollection Values to update the coupon collection - */ - public async updateCouponCollection (id: string, updateCouponCollection?: UpdateCouponCollectionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: UpdateCouponCollection200Response; }> { - const localVarPath = this.basePath + '/couponCollections/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling updateCouponCollection.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PATCH', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateCouponCollection, "UpdateCouponCollectionRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: UpdateCouponCollection200Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "UpdateCouponCollection200Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/dealsApi.ts b/api/dealsApi.ts deleted file mode 100644 index ccf6195..0000000 --- a/api/dealsApi.ts +++ /dev/null @@ -1,869 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions, IncomingMessage } from '../requestCompat'; - -/* tslint:disable:no-unused-locals */ -import { CrmDealsIdPatchRequest } from '../model/crmDealsIdPatchRequest'; -import { CrmDealsLinkUnlinkIdPatchRequest } from '../model/crmDealsLinkUnlinkIdPatchRequest'; -import { CrmDealsPost201Response } from '../model/crmDealsPost201Response'; -import { CrmDealsPostRequest } from '../model/crmDealsPostRequest'; -import { Deal } from '../model/deal'; -import { DealAttributesInner } from '../model/dealAttributesInner'; -import { DealsList } from '../model/dealsList'; -import { ErrorModel } from '../model/errorModel'; -import { Pipeline } from '../model/pipeline'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum DealsApiApiKeys { - apiKey, - partnerKey, -} - -export class DealsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: DealsApiApiKeys, value: string) { - (this.authentications as any)[DealsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Get deal attributes - */ - public async crmAttributesDealsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: Array; }> { - const localVarPath = this.basePath + '/crm/attributes/deals'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all deals - * @param filtersAttributesDealName Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. - * @param filtersLinkedCompaniesIds Filter by linked companies ids - * @param filtersLinkedContactsIds Filter by linked companies ids - * @param offset Index of the first document of the page - * @param limit Number of documents per page - * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed - * @param sortBy The field used to sort field names. - */ - public async crmDealsGet (filtersAttributesDealName?: string, filtersLinkedCompaniesIds?: string, filtersLinkedContactsIds?: string, offset?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: DealsList; }> { - const localVarPath = this.basePath + '/crm/deals'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (filtersAttributesDealName !== undefined) { - localVarQueryParameters['filters[attributes.deal_name]'] = ObjectSerializer.serialize(filtersAttributesDealName, "string"); - } - - if (filtersLinkedCompaniesIds !== undefined) { - localVarQueryParameters['filters[linkedCompaniesIds]'] = ObjectSerializer.serialize(filtersLinkedCompaniesIds, "string"); - } - - if (filtersLinkedContactsIds !== undefined) { - localVarQueryParameters['filters[linkedContactsIds]'] = ObjectSerializer.serialize(filtersLinkedContactsIds, "string"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (sortBy !== undefined) { - localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: DealsList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "DealsList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a deal - * @param id - */ - public async crmDealsIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/deals/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmDealsIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a deal - * @param id - */ - public async crmDealsIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: Deal; }> { - const localVarPath = this.basePath + '/crm/deals/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmDealsIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: Deal; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Deal"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a deal - * @param id - * @param body Updated deal details. - */ - public async crmDealsIdPatch (id: string, body: CrmDealsIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/deals/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmDealsIdPatch.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmDealsIdPatch.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PATCH', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CrmDealsIdPatchRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Link and Unlink a deal with contacts and companies - * @param id - * @param body Linked / Unlinked contacts and companies ids. - */ - public async crmDealsLinkUnlinkIdPatch (id: string, body: CrmDealsLinkUnlinkIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/deals/link-unlink/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmDealsLinkUnlinkIdPatch.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmDealsLinkUnlinkIdPatch.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PATCH', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CrmDealsLinkUnlinkIdPatchRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a deal - * @param body Deal create data. - */ - public async crmDealsPost (body: CrmDealsPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CrmDealsPost201Response; }> { - const localVarPath = this.basePath + '/crm/deals'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmDealsPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CrmDealsPostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CrmDealsPost201Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CrmDealsPost201Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all pipelines - */ - public async crmPipelineDetailsAllGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: Array; }> { - const localVarPath = this.basePath + '/crm/pipeline/details/all'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. - * @summary Get pipeline stages - */ - public async crmPipelineDetailsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: Pipeline; }> { - const localVarPath = this.basePath + '/crm/pipeline/details'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: Pipeline; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Pipeline"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a pipeline - * @param pipelineID - */ - public async crmPipelineDetailsPipelineIDGet (pipelineID: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: Array; }> { - const localVarPath = this.basePath + '/crm/pipeline/details/{pipelineID}' - .replace('{' + 'pipelineID' + '}', encodeURIComponent(String(pipelineID))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'pipelineID' is not null or undefined - if (pipelineID === null || pipelineID === undefined) { - throw new Error('Required parameter pipelineID was null or undefined when calling crmPipelineDetailsPipelineIDGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/domainsApi.ts b/api/domainsApi.ts deleted file mode 100644 index 067fd2c..0000000 --- a/api/domainsApi.ts +++ /dev/null @@ -1,461 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { AuthenticateDomainModel } from '../model/authenticateDomainModel'; -import { CreateDomain } from '../model/createDomain'; -import { CreateDomainModel } from '../model/createDomainModel'; -import { ErrorModel } from '../model/errorModel'; -import { GetDomainConfigurationModel } from '../model/getDomainConfigurationModel'; -import { GetDomainsList } from '../model/getDomainsList'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum DomainsApiApiKeys { - apiKey, - partnerKey, -} - -export class DomainsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: DomainsApiApiKeys, value: string) { - (this.authentications as any)[DomainsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Authenticate a domain - * @param domainName Domain name - */ - public async authenticateDomain (domainName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: AuthenticateDomainModel; }> { - const localVarPath = this.basePath + '/senders/domains/{domainName}/authenticate' - .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'domainName' is not null or undefined - if (domainName === null || domainName === undefined) { - throw new Error('Required parameter domainName was null or undefined when calling authenticateDomain.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: AuthenticateDomainModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "AuthenticateDomainModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a new domain - * @param domainName domain\'s name - */ - public async createDomain (domainName?: CreateDomain, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateDomainModel; }> { - const localVarPath = this.basePath + '/senders/domains'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(domainName, "CreateDomain") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateDomainModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateDomainModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a domain - * @param domainName Domain name - */ - public async deleteDomain (domainName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/senders/domains/{domainName}' - .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'domainName' is not null or undefined - if (domainName === null || domainName === undefined) { - throw new Error('Required parameter domainName was null or undefined when calling deleteDomain.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Validate domain configuration - * @param domainName Domain name - */ - public async getDomainConfiguration (domainName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetDomainConfigurationModel; }> { - const localVarPath = this.basePath + '/senders/domains/{domainName}' - .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'domainName' is not null or undefined - if (domainName === null || domainName === undefined) { - throw new Error('Required parameter domainName was null or undefined when calling getDomainConfiguration.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetDomainConfigurationModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetDomainConfigurationModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the list of all your domains - */ - public async getDomains (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetDomainsList; }> { - const localVarPath = this.basePath + '/senders/domains'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetDomainsList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetDomainsList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/ecommerceApi.ts b/api/ecommerceApi.ts deleted file mode 100644 index 1248079..0000000 --- a/api/ecommerceApi.ts +++ /dev/null @@ -1,1501 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions, IncomingMessage } from '../requestCompat'; - -/* tslint:disable:no-unused-locals */ -import { CreateCategoryModel } from '../model/createCategoryModel'; -import { CreateProductModel } from '../model/createProductModel'; -import { CreateUpdateBatchCategory } from '../model/createUpdateBatchCategory'; -import { CreateUpdateBatchCategoryModel } from '../model/createUpdateBatchCategoryModel'; -import { CreateUpdateBatchProducts } from '../model/createUpdateBatchProducts'; -import { CreateUpdateBatchProductsModel } from '../model/createUpdateBatchProductsModel'; -import { CreateUpdateCategory } from '../model/createUpdateCategory'; -import { CreateUpdateProduct } from '../model/createUpdateProduct'; -import { EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response } from '../model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response'; -import { EcommerceAttributionMetricsGet200Response } from '../model/ecommerceAttributionMetricsGet200Response'; -import { EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response } from '../model/ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response'; -import { EcommerceConfigDisplayCurrencyGet200Response } from '../model/ecommerceConfigDisplayCurrencyGet200Response'; -import { ErrorModel } from '../model/errorModel'; -import { GetCategories } from '../model/getCategories'; -import { GetCategoryDetails } from '../model/getCategoryDetails'; -import { GetOrders } from '../model/getOrders'; -import { GetProductDetails } from '../model/getProductDetails'; -import { GetProducts } from '../model/getProducts'; -import { Order } from '../model/order'; -import { OrderBatch } from '../model/orderBatch'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum EcommerceApiApiKeys { - apiKey, - partnerKey, -} - -export class EcommerceApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: EcommerceApiApiKeys, value: string) { - (this.authentications as any)[EcommerceApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * Create multiple orders at one time instead of one order at a time - * @summary Create orders in batch - * @param orderBatch - */ - public async createBatchOrder (orderBatch: OrderBatch, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/orders/status/batch'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'orderBatch' is not null or undefined - if (orderBatch === null || orderBatch === undefined) { - throw new Error('Required parameter orderBatch was null or undefined when calling createBatchOrder.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(orderBatch, "OrderBatch") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Manages the transactional status of the order - * @summary Managing the status of the order - * @param order - */ - public async createOrder (order: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/orders/status'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'order' is not null or undefined - if (order === null || order === undefined) { - throw new Error('Required parameter order was null or undefined when calling createOrder.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(order, "Order") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create categories in batch - * @param createUpdateBatchCategory Values to create a batch of categories - */ - public async createUpdateBatchCategory (createUpdateBatchCategory: CreateUpdateBatchCategory, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateUpdateBatchCategoryModel; }> { - const localVarPath = this.basePath + '/categories/batch'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createUpdateBatchCategory' is not null or undefined - if (createUpdateBatchCategory === null || createUpdateBatchCategory === undefined) { - throw new Error('Required parameter createUpdateBatchCategory was null or undefined when calling createUpdateBatchCategory.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createUpdateBatchCategory, "CreateUpdateBatchCategory") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateUpdateBatchCategoryModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateUpdateBatchCategoryModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create products in batch - * @param createUpdateBatchProducts Values to create a batch of products - */ - public async createUpdateBatchProducts (createUpdateBatchProducts: CreateUpdateBatchProducts, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateUpdateBatchProductsModel; }> { - const localVarPath = this.basePath + '/products/batch'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createUpdateBatchProducts' is not null or undefined - if (createUpdateBatchProducts === null || createUpdateBatchProducts === undefined) { - throw new Error('Required parameter createUpdateBatchProducts was null or undefined when calling createUpdateBatchProducts.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createUpdateBatchProducts, "CreateUpdateBatchProducts") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateUpdateBatchProductsModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateUpdateBatchProductsModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create/Update a category - * @param createUpdateCategory Values to create/update a category - */ - public async createUpdateCategory (createUpdateCategory: CreateUpdateCategory, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateCategoryModel; }> { - const localVarPath = this.basePath + '/categories'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createUpdateCategory' is not null or undefined - if (createUpdateCategory === null || createUpdateCategory === undefined) { - throw new Error('Required parameter createUpdateCategory was null or undefined when calling createUpdateCategory.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createUpdateCategory, "CreateUpdateCategory") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateCategoryModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateCategoryModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create/Update a product - * @param createUpdateProduct Values to create/update a product - */ - public async createUpdateProduct (createUpdateProduct: CreateUpdateProduct, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateProductModel; }> { - const localVarPath = this.basePath + '/products'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createUpdateProduct' is not null or undefined - if (createUpdateProduct === null || createUpdateProduct === undefined) { - throw new Error('Required parameter createUpdateProduct was null or undefined when calling createUpdateProduct.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createUpdateProduct, "CreateUpdateProduct") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateProductModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateProductModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Getting access to Brevo eCommerce. - * @summary Activate the eCommerce app - */ - public async ecommerceActivatePost (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/ecommerce/activate'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get detailed attribution metrics for a single Brevo campaign - * @param conversionSource The Brevo campaign type for which data will be retrieved - * @param conversionSourceId The Brevo campaign id for which data will be retrieved - */ - public async ecommerceAttributionMetricsConversionSourceConversionSourceIdGet (conversionSource: 'email_campaign', conversionSourceId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response; }> { - const localVarPath = this.basePath + '/ecommerce/attribution/metrics/{conversionSource}/{conversionSourceId}' - .replace('{' + 'conversionSource' + '}', encodeURIComponent(String(conversionSource))) - .replace('{' + 'conversionSourceId' + '}', encodeURIComponent(String(conversionSourceId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'conversionSource' is not null or undefined - if (conversionSource === null || conversionSource === undefined) { - throw new Error('Required parameter conversionSource was null or undefined when calling ecommerceAttributionMetricsConversionSourceConversionSourceIdGet.'); - } - - // verify required parameter 'conversionSourceId' is not null or undefined - if (conversionSourceId === null || conversionSourceId === undefined) { - throw new Error('Required parameter conversionSourceId was null or undefined when calling ecommerceAttributionMetricsConversionSourceConversionSourceIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get attribution metrics for one or more Brevo campaigns - * @param periodFrom When getting metrics for a specific period, define the starting datetime in RFC3339 format - * @param periodTo When getting metrics for a specific period, define the end datetime in RFC3339 format - * @param emailCampaignId The email campaign id(s) to get metrics for - */ - public async ecommerceAttributionMetricsGet (periodFrom?: Date, periodTo?: Date, emailCampaignId?: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: EcommerceAttributionMetricsGet200Response; }> { - const localVarPath = this.basePath + '/ecommerce/attribution/metrics'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (periodFrom !== undefined) { - localVarQueryParameters['periodFrom'] = ObjectSerializer.serialize(periodFrom, "Date"); - } - - if (periodTo !== undefined) { - localVarQueryParameters['periodTo'] = ObjectSerializer.serialize(periodTo, "Date"); - } - - if (emailCampaignId !== undefined) { - localVarQueryParameters['emailCampaignId[]'] = ObjectSerializer.serialize(emailCampaignId, "Array"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: EcommerceAttributionMetricsGet200Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "EcommerceAttributionMetricsGet200Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get attributed product sales for a single Brevo campaign - * @param conversionSource The Brevo campaign type for which data will be retrieved - * @param conversionSourceId The Brevo campaign id for which data will be retrieved - */ - public async ecommerceAttributionProductsConversionSourceConversionSourceIdGet (conversionSource: 'email_campaign', conversionSourceId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response; }> { - const localVarPath = this.basePath + '/ecommerce/attribution/products/{conversionSource}/{conversionSourceId}' - .replace('{' + 'conversionSource' + '}', encodeURIComponent(String(conversionSource))) - .replace('{' + 'conversionSourceId' + '}', encodeURIComponent(String(conversionSourceId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'conversionSource' is not null or undefined - if (conversionSource === null || conversionSource === undefined) { - throw new Error('Required parameter conversionSource was null or undefined when calling ecommerceAttributionProductsConversionSourceConversionSourceIdGet.'); - } - - // verify required parameter 'conversionSourceId' is not null or undefined - if (conversionSourceId === null || conversionSourceId === undefined) { - throw new Error('Required parameter conversionSourceId was null or undefined when calling ecommerceAttributionProductsConversionSourceConversionSourceIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the ISO 4217 compliant display currency code for your Brevo account - */ - public async ecommerceConfigDisplayCurrencyGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: EcommerceConfigDisplayCurrencyGet200Response; }> { - const localVarPath = this.basePath + '/ecommerce/config/displayCurrency'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: EcommerceConfigDisplayCurrencyGet200Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "EcommerceConfigDisplayCurrencyGet200Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Return all your categories - * @param limit Number of documents per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param ids Filter by category ids - * @param name Filter by category name - * @param modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** - * @param createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** - */ - public async getCategories (limit?: number, offset?: number, sort?: 'asc' | 'desc', ids?: Array, name?: string, modifiedSince?: string, createdSince?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetCategories; }> { - const localVarPath = this.basePath + '/categories'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (ids !== undefined) { - localVarQueryParameters['ids'] = ObjectSerializer.serialize(ids, "Array"); - } - - if (name !== undefined) { - localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); - } - - if (modifiedSince !== undefined) { - localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); - } - - if (createdSince !== undefined) { - localVarQueryParameters['createdSince'] = ObjectSerializer.serialize(createdSince, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetCategories; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetCategories"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a category details - * @param id Category ID - */ - public async getCategoryInfo (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetCategoryDetails; }> { - const localVarPath = this.basePath + '/categories/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getCategoryInfo.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetCategoryDetails; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetCategoryDetails"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Get all the orders - * @summary Get order details - * @param limit Number of documents per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** - * @param createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** - */ - public async getOrders (limit?: number, offset?: number, sort?: 'asc' | 'desc', modifiedSince?: string, createdSince?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetOrders; }> { - const localVarPath = this.basePath + '/orders'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (modifiedSince !== undefined) { - localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); - } - - if (createdSince !== undefined) { - localVarQueryParameters['createdSince'] = ObjectSerializer.serialize(createdSince, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetOrders; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetOrders"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a product\'s details - * @param id Product ID - */ - public async getProductInfo (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetProductDetails; }> { - const localVarPath = this.basePath + '/products/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getProductInfo.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetProductDetails; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetProductDetails"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Return all your products - * @param limit Number of documents per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param ids Filter by product ids - * @param name Filter by product name, minimum 3 characters should be present for search - * @param priceLte Price filter for products less than and equals to particular amount - * @param priceGte Price filter for products greater than and equals to particular amount - * @param priceLt Price filter for products less than particular amount - * @param priceGt Price filter for products greater than particular amount - * @param priceEq Price filter for products equals to particular amount - * @param priceNe Price filter for products not equals to particular amount - * @param categories Filter by category ids - * @param modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** - * @param createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** - */ - public async getProducts (limit?: number, offset?: number, sort?: 'asc' | 'desc', ids?: Array, name?: string, priceLte?: number, priceGte?: number, priceLt?: number, priceGt?: number, priceEq?: number, priceNe?: number, categories?: Array, modifiedSince?: string, createdSince?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetProducts; }> { - const localVarPath = this.basePath + '/products'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (ids !== undefined) { - localVarQueryParameters['ids'] = ObjectSerializer.serialize(ids, "Array"); - } - - if (name !== undefined) { - localVarQueryParameters['name'] = ObjectSerializer.serialize(name, "string"); - } - - if (priceLte !== undefined) { - localVarQueryParameters['price[lte]'] = ObjectSerializer.serialize(priceLte, "number"); - } - - if (priceGte !== undefined) { - localVarQueryParameters['price[gte]'] = ObjectSerializer.serialize(priceGte, "number"); - } - - if (priceLt !== undefined) { - localVarQueryParameters['price[lt]'] = ObjectSerializer.serialize(priceLt, "number"); - } - - if (priceGt !== undefined) { - localVarQueryParameters['price[gt]'] = ObjectSerializer.serialize(priceGt, "number"); - } - - if (priceEq !== undefined) { - localVarQueryParameters['price[eq]'] = ObjectSerializer.serialize(priceEq, "number"); - } - - if (priceNe !== undefined) { - localVarQueryParameters['price[ne]'] = ObjectSerializer.serialize(priceNe, "number"); - } - - if (categories !== undefined) { - localVarQueryParameters['categories'] = ObjectSerializer.serialize(categories, "Array"); - } - - if (modifiedSince !== undefined) { - localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string"); - } - - if (createdSince !== undefined) { - localVarQueryParameters['createdSince'] = ObjectSerializer.serialize(createdSince, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetProducts; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetProducts"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Set the ISO 4217 compliant display currency code for your Brevo account - * @param setConfigDisplayCurrency set ISO 4217 compliant display currency code payload - */ - public async setConfigDisplayCurrency (setConfigDisplayCurrency: EcommerceConfigDisplayCurrencyGet200Response, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: EcommerceConfigDisplayCurrencyGet200Response; }> { - const localVarPath = this.basePath + '/ecommerce/config/displayCurrency'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'setConfigDisplayCurrency' is not null or undefined - if (setConfigDisplayCurrency === null || setConfigDisplayCurrency === undefined) { - throw new Error('Required parameter setConfigDisplayCurrency was null or undefined when calling setConfigDisplayCurrency.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(setConfigDisplayCurrency, "EcommerceConfigDisplayCurrencyGet200Response") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: EcommerceConfigDisplayCurrencyGet200Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "EcommerceConfigDisplayCurrencyGet200Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/emailCampaignsApi.ts b/api/emailCampaignsApi.ts deleted file mode 100644 index 15b387e..0000000 --- a/api/emailCampaignsApi.ts +++ /dev/null @@ -1,1128 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions, IncomingMessage } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { AbTestCampaignResult } from '../model/abTestCampaignResult'; -import { CreateEmailCampaign } from '../model/createEmailCampaign'; -import { CreateModel } from '../model/createModel'; -import { CreatedProcessId } from '../model/createdProcessId'; -import { EmailExportRecipients } from '../model/emailExportRecipients'; -import { ErrorModel } from '../model/errorModel'; -import { GetEmailCampaign } from '../model/getEmailCampaign'; -import { GetEmailCampaigns } from '../model/getEmailCampaigns'; -import { GetSharedTemplateUrl } from '../model/getSharedTemplateUrl'; -import { PostSendFailed } from '../model/postSendFailed'; -import { SendReport } from '../model/sendReport'; -import { SendTestEmail } from '../model/sendTestEmail'; -import { UpdateCampaignStatus } from '../model/updateCampaignStatus'; -import { UpdateEmailCampaign } from '../model/updateEmailCampaign'; -import { UploadImageModel } from '../model/uploadImageModel'; -import { UploadImageToGallery } from '../model/uploadImageToGallery'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum EmailCampaignsApiApiKeys { - apiKey, - partnerKey, -} - -export class EmailCampaignsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: EmailCampaignsApiApiKeys, value: string) { - (this.authentications as any)[EmailCampaignsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Create an email campaign - * @param emailCampaigns Values to create a campaign - */ - public async createEmailCampaign (emailCampaigns: CreateEmailCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/emailCampaigns'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'emailCampaigns' is not null or undefined - if (emailCampaigns === null || emailCampaigns === undefined) { - throw new Error('Required parameter emailCampaigns was null or undefined when calling createEmailCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(emailCampaigns, "CreateEmailCampaign") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else if (response && response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateModel"); - resolve({ response: response, body: body }); - } else if (response) { - reject(new HttpError(response, body, response.statusCode)); - } else { - reject(new Error('No response received')); - } - }); - }); - }); - } - /** - * - * @summary Delete an email campaign - * @param campaignId id of the campaign - */ - public async deleteEmailCampaign (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling deleteEmailCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Export the recipients of an email campaign - * @param campaignId Id of the campaign - * @param recipientExport Values to send for a recipient export request - */ - public async emailExportRecipients (campaignId: number, recipientExport?: EmailExportRecipients, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/exportRecipients' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling emailExportRecipients.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(recipientExport, "EmailExportRecipients") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Obtain winning version of an A/B test email campaign - * @summary Get an A/B test email campaign results - * @param campaignId Id of the A/B test campaign - */ - public async getAbTestCampaignResult (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: AbTestCampaignResult; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/abTestCampaignResult' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getAbTestCampaignResult.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(campaignId, "number") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: AbTestCampaignResult; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "AbTestCampaignResult"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get an email campaign report - * @param campaignId Id of the campaign - * @param statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. - */ - public async getEmailCampaign (campaignId: number, statistics?: 'globalStats' | 'linksStats' | 'statsByDomain' | 'statsByDevice' | 'statsByBrowser', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetEmailCampaign; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getEmailCampaign.'); - } - - if (statistics !== undefined) { - localVarQueryParameters['statistics'] = ObjectSerializer.serialize(statistics, "'globalStats' | 'linksStats' | 'statsByDomain' | 'statsByDevice' | 'statsByBrowser'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(campaignId, "number") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetEmailCampaign; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetEmailCampaign"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Return all your created email campaigns - * @param type Filter on the type of the campaigns - * @param status Filter on the status of the campaign - * @param statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. - * @param startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either \'status\' not passed and if passed is set to \'sent\' ) - * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either \'status\' not passed and if passed is set to \'sent\' ) - * @param limit Number of documents per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body - */ - public async getEmailCampaigns (type?: 'classic' | 'trigger', status?: 'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess', statistics?: 'globalStats' | 'linksStats' | 'statsByDomain', startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', excludeHtmlContent?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetEmailCampaigns; }> { - const localVarPath = this.basePath + '/emailCampaigns'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'applications/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (type !== undefined) { - localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'classic' | 'trigger'"); - } - - if (status !== undefined) { - localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess'"); - } - - if (statistics !== undefined) { - localVarQueryParameters['statistics'] = ObjectSerializer.serialize(statistics, "'globalStats' | 'linksStats' | 'statsByDomain'"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (excludeHtmlContent !== undefined) { - localVarQueryParameters['excludeHtmlContent'] = ObjectSerializer.serialize(excludeHtmlContent, "boolean"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetEmailCampaigns; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetEmailCampaigns"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Get a unique URL to share & import an email template from one Brevo account to another. - * @summary Get a shared template url - * @param campaignId Id of the campaign or template - */ - public async getSharedTemplateUrl (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetSharedTemplateUrl; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sharedUrl' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getSharedTemplateUrl.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetSharedTemplateUrl; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSharedTemplateUrl"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send an email campaign immediately, based on campaignId - * @param campaignId Id of the campaign - */ - public async sendEmailCampaignNow (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendNow' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendEmailCampaignNow.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(campaignId, "number") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * A PDF will be sent to the specified email addresses - * @summary Send the report of a campaign - * @param campaignId Id of the campaign - * @param sendReport Values for send a report - */ - public async sendReport (campaignId: number, sendReport: SendReport, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendReport' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendReport.'); - } - - // verify required parameter 'sendReport' is not null or undefined - if (sendReport === null || sendReport === undefined) { - throw new Error('Required parameter sendReport was null or undefined when calling sendReport.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(sendReport, "SendReport") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send an email campaign to your test list - * @param campaignId Id of the campaign - * @param emailTo - */ - public async sendTestEmail (campaignId: number, emailTo: SendTestEmail, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendTest' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendTestEmail.'); - } - - // verify required parameter 'emailTo' is not null or undefined - if (emailTo === null || emailTo === undefined) { - throw new Error('Required parameter emailTo was null or undefined when calling sendTestEmail.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(emailTo, "SendTestEmail") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update an email campaign status - * @param campaignId Id of the campaign - * @param status Status of the campaign - */ - public async updateCampaignStatus (campaignId: number, status: UpdateCampaignStatus, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/status' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateCampaignStatus.'); - } - - // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new Error('Required parameter status was null or undefined when calling updateCampaignStatus.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(status, "UpdateCampaignStatus") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update an email campaign - * @param campaignId Id of the campaign - * @param emailCampaign Values to update a campaign - */ - public async updateEmailCampaign (campaignId: number, emailCampaign: UpdateEmailCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/emailCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateEmailCampaign.'); - } - - // verify required parameter 'emailCampaign' is not null or undefined - if (emailCampaign === null || emailCampaign === undefined) { - throw new Error('Required parameter emailCampaign was null or undefined when calling updateEmailCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(emailCampaign, "UpdateEmailCampaign") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Upload an image to your account\'s image gallery - * @param uploadImage Parameters to upload an image - */ - public async uploadImageToGallery (uploadImage: UploadImageToGallery, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: UploadImageModel; }> { - const localVarPath = this.basePath + '/emailCampaigns/images'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'uploadImage' is not null or undefined - if (uploadImage === null || uploadImage === undefined) { - throw new Error('Required parameter uploadImage was null or undefined when calling uploadImageToGallery.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - data: ObjectSerializer.serialize(uploadImage, "UploadImageToGallery") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: UploadImageModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "UploadImageModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/eventsApi.ts b/api/eventsApi.ts deleted file mode 100644 index bf600ce..0000000 --- a/api/eventsApi.ts +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { Event } from '../model/event'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum EventsApiApiKeys { - apiKey, - partnerKey, -} - -export class EventsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: EventsApiApiKeys, value: string) { - (this.authentications as any)[EventsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * Create an event to track a contact\'s interaction. - * @summary Create an event - * @param event - */ - public async createEvent (event: Event, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/events'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'event' is not null or undefined - if (event === null || event === undefined) { - throw new Error('Required parameter event was null or undefined when calling createEvent.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(event, "Event") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/externalFeedsApi.ts b/api/externalFeedsApi.ts deleted file mode 100644 index a0e0b79..0000000 --- a/api/externalFeedsApi.ts +++ /dev/null @@ -1,507 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CreateExternalFeed } from '../model/createExternalFeed'; -import { CreateExternalFeed201Response } from '../model/createExternalFeed201Response'; -import { ErrorModel } from '../model/errorModel'; -import { GetAllExternalFeeds } from '../model/getAllExternalFeeds'; -import { GetExternalFeedByUUID } from '../model/getExternalFeedByUUID'; -import { UpdateExternalFeed } from '../model/updateExternalFeed'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum ExternalFeedsApiApiKeys { - apiKey, - partnerKey, -} - -export class ExternalFeedsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: ExternalFeedsApiApiKeys, value: string) { - (this.authentications as any)[ExternalFeedsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * This endpoint will create an external feed. - * @summary Create an external feed - * @param createExternalFeed Values to create a feed - */ - public async createExternalFeed (createExternalFeed: CreateExternalFeed, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateExternalFeed201Response; }> { - const localVarPath = this.basePath + '/feeds'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createExternalFeed' is not null or undefined - if (createExternalFeed === null || createExternalFeed === undefined) { - throw new Error('Required parameter createExternalFeed was null or undefined when calling createExternalFeed.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createExternalFeed, "CreateExternalFeed") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateExternalFeed201Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateExternalFeed201Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will delete an external feed. - * @summary Delete an external feed - * @param uuid UUID of the feed to delete - */ - public async deleteExternalFeed (uuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/feeds/{uuid}' - .replace('{' + 'uuid' + '}', encodeURIComponent(String(uuid))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'uuid' is not null or undefined - if (uuid === null || uuid === undefined) { - throw new Error('Required parameter uuid was null or undefined when calling deleteExternalFeed.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint can fetch all created external feeds. - * @summary Fetch all external feeds - * @param search Can be used to filter records by search keyword on feed name - * @param startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older than current date. - * @param endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. - * @param authType Filter the records by `authType` of the feed. - * @param limit Number of documents returned per page. - * @param offset Index of the first document on the page. - */ - public async getAllExternalFeeds (search?: string, startDate?: string, endDate?: string, sort?: 'asc' | 'desc', authType?: 'basic' | 'token' | 'noAuth', limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAllExternalFeeds; }> { - const localVarPath = this.basePath + '/feeds'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (search !== undefined) { - localVarQueryParameters['search'] = ObjectSerializer.serialize(search, "string"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (authType !== undefined) { - localVarQueryParameters['authType'] = ObjectSerializer.serialize(authType, "'basic' | 'token' | 'noAuth'"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetAllExternalFeeds; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetAllExternalFeeds"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will update an external feed. - * @summary Get an external feed by UUID - * @param uuid UUID of the feed to fetch - */ - public async getExternalFeedByUUID (uuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetExternalFeedByUUID; }> { - const localVarPath = this.basePath + '/feeds/{uuid}' - .replace('{' + 'uuid' + '}', encodeURIComponent(String(uuid))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'uuid' is not null or undefined - if (uuid === null || uuid === undefined) { - throw new Error('Required parameter uuid was null or undefined when calling getExternalFeedByUUID.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetExternalFeedByUUID; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetExternalFeedByUUID"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will update an external feed. - * @summary Update an external feed - * @param uuid UUID of the feed to update - * @param updateExternalFeed Values to update a feed - */ - public async updateExternalFeed (uuid: string, updateExternalFeed: UpdateExternalFeed, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/feeds/{uuid}' - .replace('{' + 'uuid' + '}', encodeURIComponent(String(uuid))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'uuid' is not null or undefined - if (uuid === null || uuid === undefined) { - throw new Error('Required parameter uuid was null or undefined when calling updateExternalFeed.'); - } - - // verify required parameter 'updateExternalFeed' is not null or undefined - if (updateExternalFeed === null || updateExternalFeed === undefined) { - throw new Error('Required parameter updateExternalFeed was null or undefined when calling updateExternalFeed.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateExternalFeed, "UpdateExternalFeed") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/filesApi.ts b/api/filesApi.ts deleted file mode 100644 index bb3159c..0000000 --- a/api/filesApi.ts +++ /dev/null @@ -1,517 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { FileData } from '../model/fileData'; -import { FileDownloadableLink } from '../model/fileDownloadableLink'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum FilesApiApiKeys { - apiKey, - partnerKey, -} - -export class FilesApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: FilesApiApiKeys, value: string) { - (this.authentications as any)[FilesApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Get all files - * @param entity Filter by file entity type - * @param entityIds Filter by file entity IDs - * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) - * @param dateTo dateTo to date range filter type (timestamp in milliseconds) - * @param offset Index of the first document of the page - * @param limit Number of documents per page - * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed - */ - public async crmFilesGet (entity?: 'companies' | 'deals' | 'contacts', entityIds?: string, dateFrom?: number, dateTo?: number, offset?: number, limit?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { - const localVarPath = this.basePath + '/crm/files'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (entity !== undefined) { - localVarQueryParameters['entity'] = ObjectSerializer.serialize(entity, "'companies' | 'deals' | 'contacts'"); - } - - if (entityIds !== undefined) { - localVarQueryParameters['entityIds'] = ObjectSerializer.serialize(entityIds, "string"); - } - - if (dateFrom !== undefined) { - localVarQueryParameters['dateFrom'] = ObjectSerializer.serialize(dateFrom, "number"); - } - - if (dateTo !== undefined) { - localVarQueryParameters['dateTo'] = ObjectSerializer.serialize(dateTo, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get file details - * @param id File id to get file data. - */ - public async crmFilesIdDataGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FileData; }> { - const localVarPath = this.basePath + '/crm/files/{id}/data' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmFilesIdDataGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: FileData; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "FileData"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a file - * @param id File id to delete. - */ - public async crmFilesIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/files/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmFilesIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Download a file - * @param id File id to download. - */ - public async crmFilesIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FileDownloadableLink; }> { - const localVarPath = this.basePath + '/crm/files/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmFilesIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: FileDownloadableLink; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "FileDownloadableLink"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Upload a file - * @param file File data to create a file. - * @param dealId Deal id linked to a file - * @param contactId Contact id linked to a file - * @param companyId Company id linked to a file - */ - public async crmFilesPost (file: RequestFile, dealId?: string, contactId?: number, companyId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FileData; }> { - const localVarPath = this.basePath + '/crm/files'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'file' is not null or undefined - if (file === null || file === undefined) { - throw new Error('Required parameter file was null or undefined when calling crmFilesPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - if (file !== undefined) { - localVarFormParams['file'] = file; - } - localVarUseFormData = true; - - if (dealId !== undefined) { - localVarFormParams['dealId'] = ObjectSerializer.serialize(dealId, "string"); - } - - if (contactId !== undefined) { - localVarFormParams['contactId'] = ObjectSerializer.serialize(contactId, "number"); - } - - if (companyId !== undefined) { - localVarFormParams['companyId'] = ObjectSerializer.serialize(companyId, "string"); - } - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: FileData; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "FileData"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/inboundParsingApi.ts b/api/inboundParsingApi.ts deleted file mode 100644 index e0ee2b1..0000000 --- a/api/inboundParsingApi.ts +++ /dev/null @@ -1,344 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { GetInboundEmailEvents } from '../model/getInboundEmailEvents'; -import { GetInboundEmailEventsByUuid } from '../model/getInboundEmailEventsByUuid'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum InboundParsingApiApiKeys { - apiKey, - partnerKey, -} - -export class InboundParsingApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: InboundParsingApiApiKeys, value: string) { - (this.authentications as any)[InboundParsingApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * This endpoint will retrieve inbound attachment with download token. - * @summary Retrieve inbound attachment with download token. - * @param downloadToken Token to fetch a particular attachment - */ - public async getInboundEmailAttachment (downloadToken: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Buffer; }> { - const localVarPath = this.basePath + '/inbound/attachments/{downloadToken}' - .replace('{' + 'downloadToken' + '}', encodeURIComponent(String(downloadToken))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'downloadToken' is not null or undefined - if (downloadToken === null || downloadToken === undefined) { - throw new Error('Required parameter downloadToken was null or undefined when calling getInboundEmailAttachment.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - encoding: null, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Buffer; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Buffer"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will show the list of all the events for the received emails. - * @summary Get the list of all the events for the received emails. - * @param sender Email address of the sender. - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - * @param sort Sort the results in the ascending/descending order of record creation - */ - public async getInboundEmailEvents (sender?: string, startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetInboundEmailEvents; }> { - const localVarPath = this.basePath + '/inbound/events'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (sender !== undefined) { - localVarQueryParameters['sender'] = ObjectSerializer.serialize(sender, "string"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetInboundEmailEvents; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetInboundEmailEvents"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will show the list of all events history for one particular received email. - * @summary Fetch all events history for one particular received email. - * @param uuid UUID to fetch events specific to recieved email - */ - public async getInboundEmailEventsByUuid (uuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetInboundEmailEventsByUuid; }> { - const localVarPath = this.basePath + '/inbound/events/{uuid}' - .replace('{' + 'uuid' + '}', encodeURIComponent(String(uuid))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'uuid' is not null or undefined - if (uuid === null || uuid === undefined) { - throw new Error('Required parameter uuid was null or undefined when calling getInboundEmailEventsByUuid.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetInboundEmailEventsByUuid; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetInboundEmailEventsByUuid"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/masterAccountApi.ts b/api/masterAccountApi.ts deleted file mode 100644 index 11c9bbb..0000000 --- a/api/masterAccountApi.ts +++ /dev/null @@ -1,1950 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CorporateGroupDetailsResponse } from '../model/corporateGroupDetailsResponse'; -import { CorporateGroupPost201Response } from '../model/corporateGroupPost201Response'; -import { CorporateGroupPostRequest } from '../model/corporateGroupPostRequest'; -import { CorporateGroupUnlinkGroupIdSubAccountsPutRequest } from '../model/corporateGroupUnlinkGroupIdSubAccountsPutRequest'; -import { CorporateSubAccountIpAssociatePostRequest } from '../model/corporateSubAccountIpAssociatePostRequest'; -import { CorporateSubAccountIpDissociatePutRequest } from '../model/corporateSubAccountIpDissociatePutRequest'; -import { CorporateUserInvitationActionEmailPut200Response } from '../model/corporateUserInvitationActionEmailPut200Response'; -import { CreateApiKeyRequest } from '../model/createApiKeyRequest'; -import { CreateApiKeyResponse } from '../model/createApiKeyResponse'; -import { CreateSubAccount } from '../model/createSubAccount'; -import { CreateSubAccountResponse } from '../model/createSubAccountResponse'; -import { ErrorModel } from '../model/errorModel'; -import { GetAccountActivity } from '../model/getAccountActivity'; -import { GetCorporateInvitedUsersList } from '../model/getCorporateInvitedUsersList'; -import { GetCorporateUserPermission } from '../model/getCorporateUserPermission'; -import { GetSsoToken } from '../model/getSsoToken'; -import { GetSubAccountGroups200ResponseInner } from '../model/getSubAccountGroups200ResponseInner'; -import { InviteAdminUser } from '../model/inviteAdminUser'; -import { MasterDetailsResponse } from '../model/masterDetailsResponse'; -import { SsoTokenRequest } from '../model/ssoTokenRequest'; -import { SsoTokenRequestCorporate } from '../model/ssoTokenRequestCorporate'; -import { SubAccountAppsToggleRequest } from '../model/subAccountAppsToggleRequest'; -import { SubAccountDetailsResponse } from '../model/subAccountDetailsResponse'; -import { SubAccountUpdatePlanRequest } from '../model/subAccountUpdatePlanRequest'; -import { SubAccountsResponse } from '../model/subAccountsResponse'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum MasterAccountApiApiKeys { - apiKey, - partnerKey, -} - -export class MasterAccountApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: MasterAccountApiApiKeys, value: string) { - (this.authentications as any)[MasterAccountApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * This endpoint allows you to delete a group of sub-organizations. When a group is deleted, the sub-organizations are no longer part of this group. The users associated with the group are no longer associated with the group once deleted. - * @summary Delete a group - * @param id Id of the group - */ - public async corporateGroupIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/group/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateGroupIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows you to retrieve a specific group’s information such as the list of sub-organizations and the user associated with the group. - * @summary GET a group details - * @param id Id of the group of sub-organization - */ - public async corporateGroupIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CorporateGroupDetailsResponse; }> { - const localVarPath = this.basePath + '/corporate/group/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateGroupIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CorporateGroupDetailsResponse; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CorporateGroupDetailsResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows you to update a group of sub-accounts - * @summary Update a group of sub-accounts - * @param id Id of the group - * @param body Group details to be updated. - */ - public async corporateGroupIdPut (id: string, body: CorporateGroupPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/group/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateGroupIdPut.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling corporateGroupIdPut.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CorporateGroupPostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows to create a group of sub-accounts - * @summary Create a new group of sub-accounts - * @param body Group details to be created. - */ - public async corporateGroupPost (body: CorporateGroupPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CorporateGroupPost201Response; }> { - const localVarPath = this.basePath + '/corporate/group'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling corporateGroupPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CorporateGroupPostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CorporateGroupPost201Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CorporateGroupPost201Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows you to remove a sub-organization from a group. - * @summary Delete sub-account from group - * @param groupId Id of the group - * @param body List of sub-account ids - */ - public async corporateGroupUnlinkGroupIdSubAccountsPut (groupId: string, body: CorporateGroupUnlinkGroupIdSubAccountsPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/group/unlink/{groupId}/subAccounts' - .replace('{' + 'groupId' + '}', encodeURIComponent(String(groupId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'groupId' is not null or undefined - if (groupId === null || groupId === undefined) { - throw new Error('Required parameter groupId was null or undefined when calling corporateGroupUnlinkGroupIdSubAccountsPut.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling corporateGroupUnlinkGroupIdSubAccountsPut.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CorporateGroupUnlinkGroupIdSubAccountsPutRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will provide the details of the master account. - * @summary Get the details of requested master account - */ - public async corporateMasterAccountGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MasterDetailsResponse; }> { - const localVarPath = this.basePath + '/corporate/masterAccount'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: MasterDetailsResponse; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "MasterDetailsResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint generates an SSO token to authenticate and access the admin account using the endpoint https://account-app.brevo.com/account/login/corporate/sso/[token], where [token] will be replaced by the actual token. - * @summary Generate SSO token to access admin account - * @param ssoTokenRequestCorporate User email of admin account - */ - public async corporateSsoTokenPost (ssoTokenRequestCorporate: SsoTokenRequestCorporate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> { - const localVarPath = this.basePath + '/corporate/ssoToken'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'ssoTokenRequestCorporate' is not null or undefined - if (ssoTokenRequestCorporate === null || ssoTokenRequestCorporate === undefined) { - throw new Error('Required parameter ssoTokenRequestCorporate was null or undefined when calling corporateSsoTokenPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(ssoTokenRequestCorporate, "SsoTokenRequestCorporate") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetSsoToken; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSsoToken"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will provide the list all the sub-accounts of the master account. - * @summary Get the list of all the sub-accounts of the master account. - * @param offset Index of the first sub-account in the page - * @param limit Number of sub-accounts to be displayed on each page - */ - public async corporateSubAccountGet (offset: number, limit: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SubAccountsResponse; }> { - const localVarPath = this.basePath + '/corporate/subAccount'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'offset' is not null or undefined - if (offset === null || offset === undefined) { - throw new Error('Required parameter offset was null or undefined when calling corporateSubAccountGet.'); - } - - // verify required parameter 'limit' is not null or undefined - if (limit === null || limit === undefined) { - throw new Error('Required parameter limit was null or undefined when calling corporateSubAccountGet.'); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: SubAccountsResponse; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "SubAccountsResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * API endpoint for the Corporate owner to enable/disable applications on the sub-account - * @summary Enable/disable sub-account application(s) - * @param id Id of the sub-account organization (mandatory) - * @param toggleApplications List of applications to activate or deactivate on a sub-account - */ - public async corporateSubAccountIdApplicationsTogglePut (id: number, toggleApplications: SubAccountAppsToggleRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/subAccount/{id}/applications/toggle' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdApplicationsTogglePut.'); - } - - // verify required parameter 'toggleApplications' is not null or undefined - if (toggleApplications === null || toggleApplications === undefined) { - throw new Error('Required parameter toggleApplications was null or undefined when calling corporateSubAccountIdApplicationsTogglePut.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(toggleApplications, "SubAccountAppsToggleRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a sub-account - * @param id Id of the sub-account organization to be deleted - */ - public async corporateSubAccountIdDelete (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/subAccount/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will provide the details for the specified sub-account company - * @summary Get sub-account details - * @param id Id of the sub-account organization - */ - public async corporateSubAccountIdGet (id: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SubAccountDetailsResponse; }> { - const localVarPath = this.basePath + '/corporate/subAccount/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: SubAccountDetailsResponse; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "SubAccountDetailsResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will update the sub-account plan. On the Corporate solution new version v2, you can set an unlimited number of credits in your sub-organization. Please pass the value “-1\" to set the consumable in unlimited mode. - * @summary Update sub-account plan - * @param id Id of the sub-account organization - * @param updatePlanDetails Values to update a sub-account plan - */ - public async corporateSubAccountIdPlanPut (id: number, updatePlanDetails: SubAccountUpdatePlanRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/subAccount/{id}/plan' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdPlanPut.'); - } - - // verify required parameter 'updatePlanDetails' is not null or undefined - if (updatePlanDetails === null || updatePlanDetails === undefined) { - throw new Error('Required parameter updatePlanDetails was null or undefined when calling corporateSubAccountIdPlanPut.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updatePlanDetails, "SubAccountUpdatePlanRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows to associate an IP to sub-accounts - * @summary Associate an IP to sub-accounts - * @param body Ip address association details - */ - public async corporateSubAccountIpAssociatePost (body: CorporateSubAccountIpAssociatePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> { - const localVarPath = this.basePath + '/corporate/subAccount/ip/associate'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling corporateSubAccountIpAssociatePost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CorporateSubAccountIpAssociatePostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "object"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows to dissociate an IP from sub-accounts - * @summary Dissociate an IP from sub-accounts - * @param body Ip address dissociation details - */ - public async corporateSubAccountIpDissociatePut (body: CorporateSubAccountIpDissociatePutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/subAccount/ip/dissociate'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling corporateSubAccountIpDissociatePut.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CorporateSubAccountIpDissociatePutRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will generate an API v3 key for a sub account - * @summary Create an API key for a sub-account - * @param createApiKeyRequest Values to generate API key for sub-account - */ - public async corporateSubAccountKeyPost (createApiKeyRequest: CreateApiKeyRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateApiKeyResponse; }> { - const localVarPath = this.basePath + '/corporate/subAccount/key'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createApiKeyRequest' is not null or undefined - if (createApiKeyRequest === null || createApiKeyRequest === undefined) { - throw new Error('Required parameter createApiKeyRequest was null or undefined when calling corporateSubAccountKeyPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createApiKeyRequest, "CreateApiKeyRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateApiKeyResponse; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateApiKeyResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will create a new sub-account under a master account - * @summary Create a new sub-account under a master account. - * @param subAccountCreate values to create new sub-account - */ - public async corporateSubAccountPost (subAccountCreate: CreateSubAccount, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateSubAccountResponse; }> { - const localVarPath = this.basePath + '/corporate/subAccount'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'subAccountCreate' is not null or undefined - if (subAccountCreate === null || subAccountCreate === undefined) { - throw new Error('Required parameter subAccountCreate was null or undefined when calling corporateSubAccountPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(subAccountCreate, "CreateSubAccount") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateSubAccountResponse; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateSubAccountResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.brevo.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token. - * @summary Generate SSO token to access sub-account - * @param ssoTokenRequest Values to generate SSO token for sub-account - */ - public async corporateSubAccountSsoTokenPost (ssoTokenRequest: SsoTokenRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> { - const localVarPath = this.basePath + '/corporate/subAccount/ssoToken'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'ssoTokenRequest' is not null or undefined - if (ssoTokenRequest === null || ssoTokenRequest === undefined) { - throw new Error('Required parameter ssoTokenRequest was null or undefined when calling corporateSubAccountSsoTokenPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(ssoTokenRequest, "SsoTokenRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetSsoToken; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSsoToken"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will allow the user to: - Resend an admin user invitation - Cancel an admin user invitation - * @summary Resend / cancel admin user invitation - * @param action Action to be performed (cancel / resend) - * @param email Email address of the recipient - */ - public async corporateUserInvitationActionEmailPut (action: string, email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CorporateUserInvitationActionEmailPut200Response; }> { - const localVarPath = this.basePath + '/corporate/user/invitation/{action}/{email}' - .replace('{' + 'action' + '}', encodeURIComponent(String(action))) - .replace('{' + 'email' + '}', encodeURIComponent(String(email))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'action' is not null or undefined - if (action === null || action === undefined) { - throw new Error('Required parameter action was null or undefined when calling corporateUserInvitationActionEmailPut.'); - } - - // verify required parameter 'email' is not null or undefined - if (email === null || email === undefined) { - throw new Error('Required parameter email was null or undefined when calling corporateUserInvitationActionEmailPut.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CorporateUserInvitationActionEmailPut200Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CorporateUserInvitationActionEmailPut200Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows to revoke/remove an invited member of your Admin account - * @summary Revoke an admin user - * @param email Email of the invited user - */ - public async corporateUserRevokeEmailDelete (email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/corporate/user/revoke/{email}' - .replace('{' + 'email' + '}', encodeURIComponent(String(email))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'email' is not null or undefined - if (email === null || email === undefined) { - throw new Error('Required parameter email was null or undefined when calling corporateUserRevokeEmailDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get user activity logs - * @param startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search. - * @param endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. - * @param limit Number of documents per page - * @param offset Index of the first document in the page. - */ - public async getAccountActivity (startDate?: string, endDate?: string, limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAccountActivity; }> { - const localVarPath = this.basePath + '/organization/activities'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetAccountActivity; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetAccountActivity"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows you to list all Admin users of your Admin account - * @summary Get the list of all admin users - */ - public async getCorporateInvitedUsersList (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetCorporateInvitedUsersList; }> { - const localVarPath = this.basePath + '/corporate/invited/users'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetCorporateInvitedUsersList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetCorporateInvitedUsersList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Check admin user permissions - * @param email Email of the invited user - */ - public async getCorporateUserPermission (email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetCorporateUserPermission; }> { - const localVarPath = this.basePath + '/corporate/user/{email}/permissions' - .replace('{' + 'email' + '}', encodeURIComponent(String(email))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'email' is not null or undefined - if (email === null || email === undefined) { - throw new Error('Required parameter email was null or undefined when calling getCorporateUserPermission.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetCorporateUserPermission; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetCorporateUserPermission"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint allows you to list all groups created on your Admin account. - * @summary Get the list of groups - */ - public async getSubAccountGroups (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { - const localVarPath = this.basePath + '/corporate/groups'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * `This endpoint allows you to invite a member to manage the Admin account Features and their respective permissions are as below: - `my_plan`: - \"all\" - `api`: - \"none\" - `user_management`: - \"all\" - `app_management` | Not available in ENTv2: - \"all\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it\'s assumed that all permissions will be there for the invited admin user. - * @summary Send invitation to an admin user - * @param sendInvitation Payload to send an invitation - */ - public async inviteAdminUser (sendInvitation: InviteAdminUser, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InviteAdminUser; }> { - const localVarPath = this.basePath + '/corporate/user/invitation/send'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'sendInvitation' is not null or undefined - if (sendInvitation === null || sendInvitation === undefined) { - throw new Error('Required parameter sendInvitation was null or undefined when calling inviteAdminUser.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sendInvitation, "InviteAdminUser") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: InviteAdminUser; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "InviteAdminUser"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/notesApi.ts b/api/notesApi.ts deleted file mode 100644 index 557cd07..0000000 --- a/api/notesApi.ts +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { Note } from '../model/note'; -import { NoteData } from '../model/noteData'; -import { NoteId } from '../model/noteId'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum NotesApiApiKeys { - apiKey, - partnerKey, -} - -export class NotesApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: NotesApiApiKeys, value: string) { - (this.authentications as any)[NotesApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Get all notes - * @param entity Filter by note entity type - * @param entityIds Filter by note entity IDs - * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) - * @param dateTo dateTo to date range filter type (timestamp in milliseconds) - * @param offset Index of the first document of the page - * @param limit Number of documents per page - * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed - */ - public async crmNotesGet (entity?: 'companies' | 'deals' | 'contacts', entityIds?: string, dateFrom?: number, dateTo?: number, offset?: number, limit?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { - const localVarPath = this.basePath + '/crm/notes'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (entity !== undefined) { - localVarQueryParameters['entity'] = ObjectSerializer.serialize(entity, "'companies' | 'deals' | 'contacts'"); - } - - if (entityIds !== undefined) { - localVarQueryParameters['entityIds'] = ObjectSerializer.serialize(entityIds, "string"); - } - - if (dateFrom !== undefined) { - localVarQueryParameters['dateFrom'] = ObjectSerializer.serialize(dateFrom, "number"); - } - - if (dateTo !== undefined) { - localVarQueryParameters['dateTo'] = ObjectSerializer.serialize(dateTo, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a note - * @param id Note ID to delete - */ - public async crmNotesIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/notes/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmNotesIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a note - * @param id Note ID to get - */ - public async crmNotesIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Note; }> { - const localVarPath = this.basePath + '/crm/notes/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmNotesIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Note; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Note"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a note - * @param id Note ID to update - * @param body Note data to update a note - */ - public async crmNotesIdPatch (id: string, body: NoteData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/notes/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmNotesIdPatch.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmNotesIdPatch.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PATCH', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "NoteData") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a note - * @param body Note data to create a note. - */ - public async crmNotesPost (body: NoteData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NoteId; }> { - const localVarPath = this.basePath + '/crm/notes'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmNotesPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "NoteData") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: NoteId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "NoteId"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/paymentsApi.ts b/api/paymentsApi.ts deleted file mode 100644 index 028be28..0000000 --- a/api/paymentsApi.ts +++ /dev/null @@ -1,321 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CreatePaymentRequest } from '../model/createPaymentRequest'; -import { CreatePaymentResponse } from '../model/createPaymentResponse'; -import { ErrorModel } from '../model/errorModel'; -import { GetPaymentRequest } from '../model/getPaymentRequest'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum PaymentsApiApiKeys { - apiKey, - partnerKey, -} - -export class PaymentsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: PaymentsApiApiKeys, value: string) { - (this.authentications as any)[PaymentsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Create a payment request - * @param createPaymentRquest Create a payment request - */ - public async createPaymentRequest (createPaymentRquest: CreatePaymentRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatePaymentResponse; }> { - const localVarPath = this.basePath + '/payments/requests'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createPaymentRquest' is not null or undefined - if (createPaymentRquest === null || createPaymentRquest === undefined) { - throw new Error('Required parameter createPaymentRquest was null or undefined when calling createPaymentRequest.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createPaymentRquest, "CreatePaymentRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreatePaymentResponse; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreatePaymentResponse"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a payment request. - * @param id ID of the payment request. - */ - public async deletePaymentRequest (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/payments/requests/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling deletePaymentRequest.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get payment request details - * @param id Id of the payment Request - */ - public async getPaymentRequest (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetPaymentRequest; }> { - const localVarPath = this.basePath + '/payments/requests/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPaymentRequest.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetPaymentRequest; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetPaymentRequest"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/processApi.ts b/api/processApi.ts deleted file mode 100644 index 8b00a24..0000000 --- a/api/processApi.ts +++ /dev/null @@ -1,254 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { GetProcess } from '../model/getProcess'; -import { GetProcesses } from '../model/getProcesses'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum ProcessApiApiKeys { - apiKey, - partnerKey, -} - -export class ProcessApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: ProcessApiApiKeys, value: string) { - (this.authentications as any)[ProcessApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Return the informations for a process - * @param processId Id of the process - */ - public async getProcess (processId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetProcess; }> { - const localVarPath = this.basePath + '/processes/{processId}' - .replace('{' + 'processId' + '}', encodeURIComponent(String(processId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'processId' is not null or undefined - if (processId === null || processId === undefined) { - throw new Error('Required parameter processId was null or undefined when calling getProcess.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetProcess; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetProcess"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Return all the processes for your account - * @param limit Number limitation for the result returned - * @param offset Beginning point in the list to retrieve from. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getProcesses (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetProcesses; }> { - const localVarPath = this.basePath + '/processes'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetProcesses; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetProcesses"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/resellerApi.ts b/api/resellerApi.ts deleted file mode 100644 index 904375a..0000000 --- a/api/resellerApi.ts +++ /dev/null @@ -1,1369 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { AddChildDomain } from '../model/addChildDomain'; -import { AddCredits } from '../model/addCredits'; -import { CreateChild } from '../model/createChild'; -import { CreateReseller } from '../model/createReseller'; -import { ErrorModel } from '../model/errorModel'; -import { GetChildAccountCreationStatus } from '../model/getChildAccountCreationStatus'; -import { GetChildDomain } from '../model/getChildDomain'; -import { GetChildInfo } from '../model/getChildInfo'; -import { GetChildrenList } from '../model/getChildrenList'; -import { GetSsoToken } from '../model/getSsoToken'; -import { ManageIp } from '../model/manageIp'; -import { RemainingCreditModel } from '../model/remainingCreditModel'; -import { RemoveCredits } from '../model/removeCredits'; -import { UpdateChild } from '../model/updateChild'; -import { UpdateChildAccountStatus } from '../model/updateChildAccountStatus'; -import { UpdateChildDomain } from '../model/updateChildDomain'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum ResellerApiApiKeys { - apiKey, - partnerKey, -} - -export class ResellerApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: ResellerApiApiKeys, value: string) { - (this.authentications as any)[ResellerApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Add Email and/or SMS credits to a specific child account - * @param childIdentifier Either auth key or id of reseller\'s child - * @param addCredits Values to post to add credit to a specific child account - */ - public async addCredits (childIdentifier: string, addCredits: AddCredits, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/credits/add' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling addCredits.'); - } - - // verify required parameter 'addCredits' is not null or undefined - if (addCredits === null || addCredits === undefined) { - throw new Error('Required parameter addCredits was null or undefined when calling addCredits.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(addCredits, "AddCredits") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "RemainingCreditModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Associate a dedicated IP to the child - * @param childIdentifier Either auth key or id of reseller\'s child - * @param ip IP to associate - */ - public async associateIpToChild (childIdentifier: string, ip: ManageIp, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/ips/associate' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling associateIpToChild.'); - } - - // verify required parameter 'ip' is not null or undefined - if (ip === null || ip === undefined) { - throw new Error('Required parameter ip was null or undefined when calling associateIpToChild.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(ip, "ManageIp") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a domain for a child account - * @param childIdentifier Either auth key or id of reseller\'s child - * @param addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. - */ - public async createChildDomain (childIdentifier: string, addChildDomain: AddChildDomain, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling createChildDomain.'); - } - - // verify required parameter 'addChildDomain' is not null or undefined - if (addChildDomain === null || addChildDomain === undefined) { - throw new Error('Required parameter addChildDomain was null or undefined when calling createChildDomain.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(addChildDomain, "AddChildDomain") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Creates a reseller child - * @param resellerChild reseller child to add - */ - public async createResellerChild (resellerChild?: CreateChild, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateReseller; }> { - const localVarPath = this.basePath + '/reseller/children'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(resellerChild, "CreateChild") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateReseller; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateReseller"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - * @param childIdentifier Either auth key or id of reseller\'s child - * @param domainName Pass the existing domain that needs to be deleted - */ - public async deleteChildDomain (childIdentifier: string, domainName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains/{domainName}' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))) - .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling deleteChildDomain.'); - } - - // verify required parameter 'domainName' is not null or undefined - if (domainName === null || domainName === undefined) { - throw new Error('Required parameter domainName was null or undefined when calling deleteChildDomain.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a single reseller child based on the child identifier supplied - * @param childIdentifier Either auth key or child id of reseller\'s child - */ - public async deleteResellerChild (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling deleteResellerChild.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Dissociate a dedicated IP to the child - * @param childIdentifier Either auth key or id of reseller\'s child - * @param ip IP to dissociate - */ - public async dissociateIpFromChild (childIdentifier: string, ip: ManageIp, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/ips/dissociate' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling dissociateIpFromChild.'); - } - - // verify required parameter 'ip' is not null or undefined - if (ip === null || ip === undefined) { - throw new Error('Required parameter ip was null or undefined when calling dissociateIpFromChild.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(ip, "ManageIp") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the status of a reseller\'s child account creation, whether it is successfully created (exists) or not based on the identifier supplied - * @param childIdentifier Either auth key or id of reseller\'s child - */ - public async getChildAccountCreationStatus (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetChildAccountCreationStatus; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/accountCreationStatus' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling getChildAccountCreationStatus.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetChildAccountCreationStatus; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetChildAccountCreationStatus"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all sender domains for a specific child account - * @param childIdentifier Either auth key or id of reseller\'s child - */ - public async getChildDomains (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling getChildDomains.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a child account\'s details - * @param childIdentifier Either auth key or id of reseller\'s child - */ - public async getChildInfo (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetChildInfo; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling getChildInfo.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetChildInfo; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetChildInfo"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the list of all children accounts - * @param limit Number of documents for child accounts information per page - * @param offset Index of the first document in the page - */ - public async getResellerChilds (limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetChildrenList; }> { - const localVarPath = this.basePath + '/reseller/children'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetChildrenList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetChildrenList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - * @summary Get session token to access Brevo (SSO) - * @param childIdentifier Either auth key or id of reseller\'s child - */ - public async getSsoToken (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/auth' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling getSsoToken.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetSsoToken; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSsoToken"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Remove Email and/or SMS credits from a specific child account - * @param childIdentifier Either auth key or id of reseller\'s child - * @param removeCredits Values to post to remove email or SMS credits from a specific child account - */ - public async removeCredits (childIdentifier: string, removeCredits: RemoveCredits, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/credits/remove' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling removeCredits.'); - } - - // verify required parameter 'removeCredits' is not null or undefined - if (removeCredits === null || removeCredits === undefined) { - throw new Error('Required parameter removeCredits was null or undefined when calling removeCredits.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(removeCredits, "RemoveCredits") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "RemainingCreditModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update info of reseller\'s child account status based on the childIdentifier supplied - * @param childIdentifier Either auth key or id of reseller\'s child - * @param updateChildAccountStatus values to update in child account status - */ - public async updateChildAccountStatus (childIdentifier: string, updateChildAccountStatus: UpdateChildAccountStatus, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/accountStatus' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling updateChildAccountStatus.'); - } - - // verify required parameter 'updateChildAccountStatus' is not null or undefined - if (updateChildAccountStatus === null || updateChildAccountStatus === undefined) { - throw new Error('Required parameter updateChildAccountStatus was null or undefined when calling updateChildAccountStatus.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateChildAccountStatus, "UpdateChildAccountStatus") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update the sender domain of reseller\'s child based on the childIdentifier and domainName passed - * @param childIdentifier Either auth key or id of reseller\'s child - * @param domainName Pass the existing domain that needs to be updated - * @param updateChildDomain value to update for sender domain - */ - public async updateChildDomain (childIdentifier: string, domainName: string, updateChildDomain: UpdateChildDomain, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains/{domainName}' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))) - .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling updateChildDomain.'); - } - - // verify required parameter 'domainName' is not null or undefined - if (domainName === null || domainName === undefined) { - throw new Error('Required parameter domainName was null or undefined when calling updateChildDomain.'); - } - - // verify required parameter 'updateChildDomain' is not null or undefined - if (updateChildDomain === null || updateChildDomain === undefined) { - throw new Error('Required parameter updateChildDomain was null or undefined when calling updateChildDomain.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateChildDomain, "UpdateChildDomain") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update info of reseller\'s child based on the child identifier supplied - * @param childIdentifier Either auth key or id of reseller\'s child - * @param resellerChild values to update in child profile - */ - public async updateResellerChild (childIdentifier: string, resellerChild: UpdateChild, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/reseller/children/{childIdentifier}' - .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'childIdentifier' is not null or undefined - if (childIdentifier === null || childIdentifier === undefined) { - throw new Error('Required parameter childIdentifier was null or undefined when calling updateResellerChild.'); - } - - // verify required parameter 'resellerChild' is not null or undefined - if (resellerChild === null || resellerChild === undefined) { - throw new Error('Required parameter resellerChild was null or undefined when calling updateResellerChild.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(resellerChild, "UpdateChild") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/sMSCampaignsApi.ts b/api/sMSCampaignsApi.ts deleted file mode 100644 index 60dc71e..0000000 --- a/api/sMSCampaignsApi.ts +++ /dev/null @@ -1,901 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions, IncomingMessage } from '../requestCompat'; - -/* tslint:disable:no-unused-locals */ -import { CreateModel } from '../model/createModel'; -import { CreateSmsCampaign } from '../model/createSmsCampaign'; -import { CreatedProcessId } from '../model/createdProcessId'; -import { ErrorModel } from '../model/errorModel'; -import { GetSmsCampaign } from '../model/getSmsCampaign'; -import { GetSmsCampaigns } from '../model/getSmsCampaigns'; -import { PostSendSmsTestFailed } from '../model/postSendSmsTestFailed'; -import { RequestSmsRecipientExport } from '../model/requestSmsRecipientExport'; -import { SendReport } from '../model/sendReport'; -import { SendTestSms } from '../model/sendTestSms'; -import { UpdateCampaignStatus } from '../model/updateCampaignStatus'; -import { UpdateSmsCampaign } from '../model/updateSmsCampaign'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum SMSCampaignsApiApiKeys { - apiKey, - partnerKey, -} - -export class SMSCampaignsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: SMSCampaignsApiApiKeys, value: string) { - (this.authentications as any)[SMSCampaignsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Creates an SMS campaign - * @param createSmsCampaign Values to create an SMS Campaign - */ - public async createSmsCampaign (createSmsCampaign: CreateSmsCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/smsCampaigns'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createSmsCampaign' is not null or undefined - if (createSmsCampaign === null || createSmsCampaign === undefined) { - throw new Error('Required parameter createSmsCampaign was null or undefined when calling createSmsCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createSmsCampaign, "CreateSmsCampaign") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreateModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete an SMS campaign - * @param campaignId id of the SMS campaign - */ - public async deleteSmsCampaign (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling deleteSmsCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get an SMS campaign - * @param campaignId id of the SMS campaign - */ - public async getSmsCampaign (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetSmsCampaign; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getSmsCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetSmsCampaign; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSmsCampaign"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Returns the information for all your created SMS campaigns - * @param status Status of campaign. - * @param startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either \'status\' not passed and if passed is set to \'sent\' ) - * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either \'status\' not passed and if passed is set to \'sent\' ) - * @param limit Number limitation for the result returned - * @param offset Beginning point in the list to retrieve from. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getSmsCampaigns (status?: 'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess', startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: GetSmsCampaigns; }> { - const localVarPath = this.basePath + '/smsCampaigns'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (status !== undefined) { - localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'suspended' | 'archive' | 'sent' | 'queued' | 'draft' | 'inProcess'"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: GetSmsCampaigns; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSmsCampaigns"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * It returns the background process ID which on completion calls the notify URL that you have set in the input. - * @summary Export an SMS campaign\'s recipients - * @param campaignId id of the campaign - * @param recipientExport Values to send for a recipient export request - */ - public async requestSmsRecipientExport (campaignId: number, recipientExport?: RequestSmsRecipientExport, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/exportRecipients' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling requestSmsRecipientExport.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(recipientExport, "RequestSmsRecipientExport") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send your SMS campaign immediately - * @param campaignId id of the campaign - */ - public async sendSmsCampaignNow (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendNow' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendSmsCampaignNow.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - * @summary Send an SMS campaign\'s report - * @param campaignId id of the campaign - * @param sendReport Values for send a report - */ - public async sendSmsReport (campaignId: number, sendReport: SendReport, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendReport' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendSmsReport.'); - } - - // verify required parameter 'sendReport' is not null or undefined - if (sendReport === null || sendReport === undefined) { - throw new Error('Required parameter sendReport was null or undefined when calling sendSmsReport.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sendReport, "SendReport") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send a test SMS campaign - * @param campaignId Id of the SMS campaign - * @param phoneNumber Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted - */ - public async sendTestSms (campaignId: number, phoneNumber: SendTestSms, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/sendTest' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling sendTestSms.'); - } - - // verify required parameter 'phoneNumber' is not null or undefined - if (phoneNumber === null || phoneNumber === undefined) { - throw new Error('Required parameter phoneNumber was null or undefined when calling sendTestSms.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(phoneNumber, "SendTestSms") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update an SMS campaign - * @param campaignId id of the SMS campaign - * @param updateSmsCampaign Values to update an SMS Campaign - */ - public async updateSmsCampaign (campaignId: number, updateSmsCampaign: UpdateSmsCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateSmsCampaign.'); - } - - // verify required parameter 'updateSmsCampaign' is not null or undefined - if (updateSmsCampaign === null || updateSmsCampaign === undefined) { - throw new Error('Required parameter updateSmsCampaign was null or undefined when calling updateSmsCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateSmsCampaign, "UpdateSmsCampaign") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a campaign\'s status - * @param campaignId id of the campaign - * @param status Status of the campaign. - */ - public async updateSmsCampaignStatus (campaignId: number, status: UpdateCampaignStatus, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smsCampaigns/{campaignId}/status' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateSmsCampaignStatus.'); - } - - // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new Error('Required parameter status was null or undefined when calling updateSmsCampaignStatus.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - params: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(status, "UpdateCampaignStatus") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/sendersApi.ts b/api/sendersApi.ts deleted file mode 100644 index e16390b..0000000 --- a/api/sendersApi.ts +++ /dev/null @@ -1,618 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CreateSender } from '../model/createSender'; -import { CreateSenderModel } from '../model/createSenderModel'; -import { ErrorModel } from '../model/errorModel'; -import { GetIps } from '../model/getIps'; -import { GetIpsFromSender } from '../model/getIpsFromSender'; -import { GetSendersList } from '../model/getSendersList'; -import { Otp } from '../model/otp'; -import { UpdateSender } from '../model/updateSender'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum SendersApiApiKeys { - apiKey, - partnerKey, -} - -export class SendersApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: SendersApiApiKeys, value: string) { - (this.authentications as any)[SendersApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Create a new sender - * @param sender sender\'s name - */ - public async createSender (sender?: CreateSender, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateSenderModel; }> { - const localVarPath = this.basePath + '/senders'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sender, "CreateSender") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateSenderModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateSenderModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a sender - * @param senderId Id of the sender - */ - public async deleteSender (senderId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/senders/{senderId}' - .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'senderId' is not null or undefined - if (senderId === null || senderId === undefined) { - throw new Error('Required parameter senderId was null or undefined when calling deleteSender.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all the dedicated IPs for your account - */ - public async getIps (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetIps; }> { - const localVarPath = this.basePath + '/senders/ips'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetIps; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetIps"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all the dedicated IPs for a sender - * @param senderId Id of the sender - */ - public async getIpsFromSender (senderId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetIpsFromSender; }> { - const localVarPath = this.basePath + '/senders/{senderId}/ips' - .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'senderId' is not null or undefined - if (senderId === null || senderId === undefined) { - throw new Error('Required parameter senderId was null or undefined when calling getIpsFromSender.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetIpsFromSender; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetIpsFromSender"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the list of all your senders - * @param ip Filter your senders for a specific ip (available for dedicated IP usage only) - * @param domain Filter your senders for a specific domain - */ - public async getSenders (ip?: string, domain?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSendersList; }> { - const localVarPath = this.basePath + '/senders'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (ip !== undefined) { - localVarQueryParameters['ip'] = ObjectSerializer.serialize(ip, "string"); - } - - if (domain !== undefined) { - localVarQueryParameters['domain'] = ObjectSerializer.serialize(domain, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetSendersList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSendersList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a sender - * @param senderId Id of the sender - * @param sender sender\'s name - */ - public async updateSender (senderId: number, sender?: UpdateSender, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/senders/{senderId}' - .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'senderId' is not null or undefined - if (senderId === null || senderId === undefined) { - throw new Error('Required parameter senderId was null or undefined when calling updateSender.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sender, "UpdateSender") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a sender - * @param senderId Id of the sender - * @param otp otp - */ - public async validateSenderByOTP (senderId: number, otp?: Otp, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/senders/{senderId}/validate' - .replace('{' + 'senderId' + '}', encodeURIComponent(String(senderId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'senderId' is not null or undefined - if (senderId === null || senderId === undefined) { - throw new Error('Required parameter senderId was null or undefined when calling validateSenderByOTP.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(otp, "Otp") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/tasksApi.ts b/api/tasksApi.ts deleted file mode 100644 index 3cc455d..0000000 --- a/api/tasksApi.ts +++ /dev/null @@ -1,606 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CrmTasksIdPatchRequest } from '../model/crmTasksIdPatchRequest'; -import { CrmTasksPost201Response } from '../model/crmTasksPost201Response'; -import { CrmTasksPostRequest } from '../model/crmTasksPostRequest'; -import { ErrorModel } from '../model/errorModel'; -import { Task } from '../model/task'; -import { TaskList } from '../model/taskList'; -import { TaskTypes } from '../model/taskTypes'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum TasksApiApiKeys { - apiKey, - partnerKey, -} - -export class TasksApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: TasksApiApiKeys, value: string) { - (this.authentications as any)[TasksApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Get all tasks - * @param filterType Filter by task type (ID) - * @param filterStatus Filter by task status - * @param filterDate Filter by date - * @param filterAssignTo Filter by the \"assignTo\" ID. You can utilize account emails for the \"assignTo\" attribute. - * @param filterContacts Filter by contact ids - * @param filterDeals Filter by deals ids - * @param filterCompanies Filter by companies ids - * @param dateFrom dateFrom to date range filter type (timestamp in milliseconds) - * @param dateTo dateTo to date range filter type (timestamp in milliseconds) - * @param offset Index of the first document of the page - * @param limit Number of documents per page - * @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed - * @param sortBy The field used to sort field names. - */ - public async crmTasksGet (filterType?: string, filterStatus?: 'done' | 'undone', filterDate?: 'overdue' | 'today' | 'tomorrow' | 'week' | 'range', filterAssignTo?: string, filterContacts?: string, filterDeals?: string, filterCompanies?: string, dateFrom?: number, dateTo?: number, offset?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TaskList; }> { - const localVarPath = this.basePath + '/crm/tasks'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json', 'response']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (filterType !== undefined) { - localVarQueryParameters['filter[type]'] = ObjectSerializer.serialize(filterType, "string"); - } - - if (filterStatus !== undefined) { - localVarQueryParameters['filter[status]'] = ObjectSerializer.serialize(filterStatus, "'done' | 'undone'"); - } - - if (filterDate !== undefined) { - localVarQueryParameters['filter[date]'] = ObjectSerializer.serialize(filterDate, "'overdue' | 'today' | 'tomorrow' | 'week' | 'range'"); - } - - if (filterAssignTo !== undefined) { - localVarQueryParameters['filter[assignTo]'] = ObjectSerializer.serialize(filterAssignTo, "string"); - } - - if (filterContacts !== undefined) { - localVarQueryParameters['filter[contacts]'] = ObjectSerializer.serialize(filterContacts, "string"); - } - - if (filterDeals !== undefined) { - localVarQueryParameters['filter[deals]'] = ObjectSerializer.serialize(filterDeals, "string"); - } - - if (filterCompanies !== undefined) { - localVarQueryParameters['filter[companies]'] = ObjectSerializer.serialize(filterCompanies, "string"); - } - - if (dateFrom !== undefined) { - localVarQueryParameters['dateFrom'] = ObjectSerializer.serialize(dateFrom, "number"); - } - - if (dateTo !== undefined) { - localVarQueryParameters['dateTo'] = ObjectSerializer.serialize(dateTo, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (sortBy !== undefined) { - localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: TaskList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "TaskList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a task - * @param id - */ - public async crmTasksIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/tasks/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmTasksIdDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a task - * @param id - */ - public async crmTasksIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Task; }> { - const localVarPath = this.basePath + '/crm/tasks/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmTasksIdGet.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Task; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Task"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a task - * @param id - * @param body Updated task details. - */ - public async crmTasksIdPatch (id: string, body: CrmTasksIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/crm/tasks/{id}' - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling crmTasksIdPatch.'); - } - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmTasksIdPatch.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PATCH', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CrmTasksIdPatchRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a task - * @param body Task name. - */ - public async crmTasksPost (body: CrmTasksPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CrmTasksPost201Response; }> { - const localVarPath = this.basePath + '/crm/tasks'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling crmTasksPost.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(body, "CrmTasksPostRequest") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CrmTasksPost201Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CrmTasksPost201Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all task types - */ - public async crmTasktypesGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TaskTypes; }> { - const localVarPath = this.basePath + '/crm/tasktypes'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: TaskTypes; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "TaskTypes"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/transactionalEmailsApi.ts b/api/transactionalEmailsApi.ts deleted file mode 100644 index d3b16c2..0000000 --- a/api/transactionalEmailsApi.ts +++ /dev/null @@ -1,1956 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { BlockDomain } from '../model/blockDomain'; -import { CreateModel } from '../model/createModel'; -import { CreateSmtpEmail } from '../model/createSmtpEmail'; -import { CreateSmtpTemplate } from '../model/createSmtpTemplate'; -import { DeleteHardbounces } from '../model/deleteHardbounces'; -import { ErrorModel } from '../model/errorModel'; -import { GetAggregatedReport } from '../model/getAggregatedReport'; -import { GetBlockedDomains } from '../model/getBlockedDomains'; -import { GetEmailEventReport } from '../model/getEmailEventReport'; -import { GetReports } from '../model/getReports'; -import { GetScheduledEmailByBatchId } from '../model/getScheduledEmailByBatchId'; -import { GetScheduledEmailByMessageId } from '../model/getScheduledEmailByMessageId'; -import { GetSmtpTemplateOverview } from '../model/getSmtpTemplateOverview'; -import { GetSmtpTemplates } from '../model/getSmtpTemplates'; -import { GetTransacBlockedContacts } from '../model/getTransacBlockedContacts'; -import { GetTransacEmailContent } from '../model/getTransacEmailContent'; -import { GetTransacEmailsList } from '../model/getTransacEmailsList'; -import { PostSendFailed } from '../model/postSendFailed'; -import { ScheduleSmtpEmail } from '../model/scheduleSmtpEmail'; -import { SendSmtpEmail } from '../model/sendSmtpEmail'; -import { SendTestEmail } from '../model/sendTestEmail'; -import { UpdateSmtpTemplate } from '../model/updateSmtpTemplate'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum TransactionalEmailsApiApiKeys { - apiKey, - partnerKey, -} - -export class TransactionalEmailsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: TransactionalEmailsApiApiKeys, value: string) { - (this.authentications as any)[TransactionalEmailsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * Blocks a new domain in order to avoid messages being sent to the same - * @summary Add a new domain to the list of blocked domains - * @param blockDomain - */ - public async blockNewDomain (blockDomain: BlockDomain, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/blockedDomains'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'blockDomain' is not null or undefined - if (blockDomain === null || blockDomain === undefined) { - throw new Error('Required parameter blockDomain was null or undefined when calling blockNewDomain.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(blockDomain, "BlockDomain") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create an email template - * @param smtpTemplate values to update in transactional email template - */ - public async createSmtpTemplate (smtpTemplate: CreateSmtpTemplate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/smtp/templates'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'smtpTemplate' is not null or undefined - if (smtpTemplate === null || smtpTemplate === undefined) { - throw new Error('Required parameter smtpTemplate was null or undefined when calling createSmtpTemplate.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(smtpTemplate, "CreateSmtpTemplate") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Unblocks an existing domain from the list of blocked domains - * @summary Unblock an existing domain from the list of blocked domains - * @param domain The name of the domain to be deleted - */ - public async deleteBlockedDomain (domain: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/blockedDomains/{domain}' - .replace('{' + 'domain' + '}', encodeURIComponent(String(domain))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'domain' is not null or undefined - if (domain === null || domain === undefined) { - throw new Error('Required parameter domain was null or undefined when calling deleteBlockedDomain.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) - * @summary Delete hardbounces - * @param deleteHardbounces values to delete hardbounces - */ - public async deleteHardbounces (deleteHardbounces?: DeleteHardbounces, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/deleteHardbounces'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(deleteHardbounces, "DeleteHardbounces") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Delete scheduled batch of emails by batchId or single scheduled email by messageId - * @summary Delete scheduled emails by batchId or messageId - * @param identifier The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. - */ - public async deleteScheduledEmailById (identifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/email/{identifier}' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling deleteScheduledEmailById.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete an inactive email template - * @param templateId id of the template - */ - public async deleteSmtpTemplate (templateId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/templates/{templateId}' - .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'templateId' is not null or undefined - if (templateId === null || templateId === undefined) { - throw new Error('Required parameter templateId was null or undefined when calling deleteSmtpTemplate.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - * @summary Get your transactional email activity aggregated over a period of time - * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - * @param days Number of days in the past including today (positive integer). Not compatible with \'startDate\' and \'endDate\' - * @param tag Tag of the emails - */ - public async getAggregatedSmtpReport (startDate?: string, endDate?: string, days?: number, tag?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAggregatedReport; }> { - const localVarPath = this.basePath + '/smtp/statistics/aggregatedReport'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (days !== undefined) { - localVarQueryParameters['days'] = ObjectSerializer.serialize(days, "number"); - } - - if (tag !== undefined) { - localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetAggregatedReport; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetAggregatedReport"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Get the list of blocked domains - * @summary Get the list of blocked domains - */ - public async getBlockedDomains (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetBlockedDomains; }> { - const localVarPath = this.basePath + '/smtp/blockedDomains'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetBlockedDomains; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetBlockedDomains"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days - * @summary Get all your transactional email activity (unaggregated events) - * @param limit Number limitation for the result returned - * @param offset Beginning point in the list to retrieve from. - * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - * @param days Number of days in the past including today (positive integer). Not compatible with \'startDate\' and \'endDate\' - * @param email Filter the report for a specific email addresses - * @param event Filter the report for a specific event type - * @param tags Filter the report for tags (serialized and urlencoded array) - * @param messageId Filter on a specific message id - * @param templateId Filter on a specific template id - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getEmailEventReport (limit?: number, offset?: number, startDate?: string, endDate?: string, days?: number, email?: string, event?: 'bounces' | 'hardBounces' | 'softBounces' | 'delivered' | 'spam' | 'requests' | 'opened' | 'clicks' | 'invalid' | 'deferred' | 'blocked' | 'unsubscribed' | 'error' | 'loadedByProxy', tags?: string, messageId?: string, templateId?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetEmailEventReport; }> { - const localVarPath = this.basePath + '/smtp/statistics/events'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (days !== undefined) { - localVarQueryParameters['days'] = ObjectSerializer.serialize(days, "number"); - } - - if (email !== undefined) { - localVarQueryParameters['email'] = ObjectSerializer.serialize(email, "string"); - } - - if (event !== undefined) { - localVarQueryParameters['event'] = ObjectSerializer.serialize(event, "'bounces' | 'hardBounces' | 'softBounces' | 'delivered' | 'spam' | 'requests' | 'opened' | 'clicks' | 'invalid' | 'deferred' | 'blocked' | 'unsubscribed' | 'error' | 'loadedByProxy'"); - } - - if (tags !== undefined) { - localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "string"); - } - - if (messageId !== undefined) { - localVarQueryParameters['messageId'] = ObjectSerializer.serialize(messageId, "string"); - } - - if (templateId !== undefined) { - localVarQueryParameters['templateId'] = ObjectSerializer.serialize(templateId, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetEmailEventReport; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetEmailEventReport"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Fetch scheduled batch of emails by batchId (Can retrieve data upto 30 days old) - * @summary Fetch scheduled emails by batchId - * @param batchId The batchId of scheduled emails batch (Should be a valid UUIDv4) - * @param startDate Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. - * @param endDate Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param status Filter the records by `status` of the scheduled email batch or message. - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - */ - public async getScheduledEmailByBatchId (batchId: string, startDate?: string, endDate?: string, sort?: 'asc' | 'desc', status?: 'processed' | 'inProgress' | 'queued', limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetScheduledEmailByBatchId; }> { - const localVarPath = this.basePath + '/smtp/emailStatus/{batchId}' - .replace('{' + 'batchId' + '}', encodeURIComponent(String(batchId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'batchId' is not null or undefined - if (batchId === null || batchId === undefined) { - throw new Error('Required parameter batchId was null or undefined when calling getScheduledEmailByBatchId.'); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (status !== undefined) { - localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'processed' | 'inProgress' | 'queued'"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetScheduledEmailByBatchId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetScheduledEmailByBatchId"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * Fetch scheduled email by messageId (Can retrieve data upto 30 days old) - * @summary Fetch scheduled email by messageId - * @param messageId The messageId of scheduled email - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - */ - public async getScheduledEmailByMessageId (messageId: string, startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetScheduledEmailByMessageId; }> { - const localVarPath = this.basePath + '/smtp/emailStatus/{messageId}' - .replace('{' + 'messageId' + '}', encodeURIComponent(String(messageId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'messageId' is not null or undefined - if (messageId === null || messageId === undefined) { - throw new Error('Required parameter messageId was null or undefined when calling getScheduledEmailByMessageId.'); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetScheduledEmailByMessageId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetScheduledEmailByMessageId"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get your transactional email activity aggregated per day - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - * @param startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) - * @param endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) - * @param days Number of days in the past including today (positive integer). Not compatible with \'startDate\' and \'endDate\' - * @param tag Tag of the emails - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getSmtpReport (limit?: number, offset?: number, startDate?: string, endDate?: string, days?: number, tag?: string, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetReports; }> { - const localVarPath = this.basePath + '/smtp/statistics/reports'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (days !== undefined) { - localVarQueryParameters['days'] = ObjectSerializer.serialize(days, "number"); - } - - if (tag !== undefined) { - localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetReports; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetReports"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Returns the template information - * @param templateId id of the template - */ - public async getSmtpTemplate (templateId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSmtpTemplateOverview; }> { - const localVarPath = this.basePath + '/smtp/templates/{templateId}' - .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'templateId' is not null or undefined - if (templateId === null || templateId === undefined) { - throw new Error('Required parameter templateId was null or undefined when calling getSmtpTemplate.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetSmtpTemplateOverview; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSmtpTemplateOverview"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the list of email templates - * @param templateStatus Filter on the status of the template. Active = true, inactive = false - * @param limit Number of documents returned per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getSmtpTemplates (templateStatus?: boolean, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSmtpTemplates; }> { - const localVarPath = this.basePath + '/smtp/templates'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (templateStatus !== undefined) { - localVarQueryParameters['templateStatus'] = ObjectSerializer.serialize(templateStatus, "boolean"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetSmtpTemplates; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSmtpTemplates"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the list of blocked or unsubscribed transactional contacts - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts - * @param limit Number of documents returned per page - * @param offset Index of the first document on the page - * @param senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getTransacBlockedContacts (startDate?: string, endDate?: string, limit?: number, offset?: number, senders?: Array, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetTransacBlockedContacts; }> { - const localVarPath = this.basePath + '/smtp/blockedContacts'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (senders !== undefined) { - localVarQueryParameters['senders'] = ObjectSerializer.serialize(senders, "Array"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetTransacBlockedContacts; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetTransacBlockedContacts"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the personalized content of a sent transactional email - * @param uuid Unique id of the transactional email that has been sent to a particular contact - */ - public async getTransacEmailContent (uuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetTransacEmailContent; }> { - const localVarPath = this.basePath + '/smtp/emails/{uuid}' - .replace('{' + 'uuid' + '}', encodeURIComponent(String(uuid))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'uuid' is not null or undefined - if (uuid === null || uuid === undefined) { - throw new Error('Required parameter uuid was null or undefined when calling getTransacEmailContent.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetTransacEmailContent; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetTransacEmailContent"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. - * @summary Get the list of transactional emails on the basis of allowed filters - * @param email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. - * @param templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. - * @param messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - * @param limit Number of documents returned per page - * @param offset Index of the first document in the page - */ - public async getTransacEmailsList (email?: string, templateId?: number, messageId?: string, startDate?: string, endDate?: string, sort?: 'asc' | 'desc', limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetTransacEmailsList; }> { - const localVarPath = this.basePath + '/smtp/emails'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (email !== undefined) { - localVarQueryParameters['email'] = ObjectSerializer.serialize(email, "string"); - } - - if (templateId !== undefined) { - localVarQueryParameters['templateId'] = ObjectSerializer.serialize(templateId, "number"); - } - - if (messageId !== undefined) { - localVarQueryParameters['messageId'] = ObjectSerializer.serialize(messageId, "string"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetTransacEmailsList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetTransacEmailsList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send a template to your test list - * @param templateId Id of the template - * @param sendTestEmail - */ - public async sendTestTemplate (templateId: number, sendTestEmail: SendTestEmail, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/templates/{templateId}/sendTest' - .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'templateId' is not null or undefined - if (templateId === null || templateId === undefined) { - throw new Error('Required parameter templateId was null or undefined when calling sendTestTemplate.'); - } - - // verify required parameter 'sendTestEmail' is not null or undefined - if (sendTestEmail === null || sendTestEmail === undefined) { - throw new Error('Required parameter sendTestEmail was null or undefined when calling sendTestTemplate.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sendTestEmail, "SendTestEmail") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send a transactional email - * @param sendSmtpEmail Values to send a transactional email - */ - public async sendTransacEmail (sendSmtpEmail: SendSmtpEmail, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateSmtpEmail; }> { - const localVarPath = this.basePath + '/smtp/email'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'sendSmtpEmail' is not null or undefined - if (sendSmtpEmail === null || sendSmtpEmail === undefined) { - throw new Error('Required parameter sendSmtpEmail was null or undefined when calling sendTransacEmail.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sendSmtpEmail, "SendSmtpEmail") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateSmtpEmail; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateSmtpEmail"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Unblock or resubscribe a transactional contact - * @param email contact email (urlencoded) to unblock. - */ - public async smtpBlockedContactsEmailDelete (email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/blockedContacts/{email}' - .replace('{' + 'email' + '}', encodeURIComponent(String(email))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'email' is not null or undefined - if (email === null || email === undefined) { - throw new Error('Required parameter email was null or undefined when calling smtpBlockedContactsEmailDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete an SMTP transactional log - * @param identifier MessageId or Email of the transactional log(s) to delete - */ - public async smtpLogIdentifierDelete (identifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/log/{identifier}' - .replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'identifier' is not null or undefined - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling smtpLogIdentifierDelete.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update an email template - * @param templateId id of the template - * @param smtpTemplate values to update in transactional email template - */ - public async updateSmtpTemplate (templateId: number, smtpTemplate: UpdateSmtpTemplate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/smtp/templates/{templateId}' - .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'templateId' is not null or undefined - if (templateId === null || templateId === undefined) { - throw new Error('Required parameter templateId was null or undefined when calling updateSmtpTemplate.'); - } - - // verify required parameter 'smtpTemplate' is not null or undefined - if (smtpTemplate === null || smtpTemplate === undefined) { - throw new Error('Required parameter smtpTemplate was null or undefined when calling updateSmtpTemplate.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(smtpTemplate, "UpdateSmtpTemplate") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/transactionalSMSApi.ts b/api/transactionalSMSApi.ts deleted file mode 100644 index c387226..0000000 --- a/api/transactionalSMSApi.ts +++ /dev/null @@ -1,468 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { GetSmsEventReport } from '../model/getSmsEventReport'; -import { GetTransacAggregatedSmsReport } from '../model/getTransacAggregatedSmsReport'; -import { GetTransacSmsReport } from '../model/getTransacSmsReport'; -import { SendSms } from '../model/sendSms'; -import { SendTransacSms } from '../model/sendTransacSms'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum TransactionalSMSApiApiKeys { - apiKey, - partnerKey, -} - -export class TransactionalSMSApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: TransactionalSMSApiApiKeys, value: string) { - (this.authentications as any)[TransactionalSMSApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Get all your SMS activity (unaggregated events) - * @param limit Number of documents per page - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report - * @param offset Index of the first document of the page - * @param days Number of days in the past including today (positive integer). Not compatible with \'startDate\' and \'endDate\' - * @param phoneNumber Filter the report for a specific phone number - * @param event Filter the report for specific events - * @param tags Filter the report for specific tags passed as a serialized urlencoded array - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getSmsEvents (limit?: number, startDate?: string, endDate?: string, offset?: number, days?: number, phoneNumber?: string, event?: 'bounces' | 'hardBounces' | 'softBounces' | 'delivered' | 'sent' | 'accepted' | 'unsubscription' | 'replies' | 'blocked' | 'rejected' | 'skipped', tags?: string, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSmsEventReport; }> { - const localVarPath = this.basePath + '/transactionalSMS/statistics/events'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (days !== undefined) { - localVarQueryParameters['days'] = ObjectSerializer.serialize(days, "number"); - } - - if (phoneNumber !== undefined) { - localVarQueryParameters['phoneNumber'] = ObjectSerializer.serialize(phoneNumber, "string"); - } - - if (event !== undefined) { - localVarQueryParameters['event'] = ObjectSerializer.serialize(event, "'bounces' | 'hardBounces' | 'softBounces' | 'delivered' | 'sent' | 'accepted' | 'unsubscription' | 'replies' | 'blocked' | 'rejected' | 'skipped'"); - } - - if (tags !== undefined) { - localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "string"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetSmsEventReport; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetSmsEventReport"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get your SMS activity aggregated over a period of time - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report - * @param days Number of days in the past including today (positive integer). Not compatible with startDate and endDate - * @param tag Filter on a tag - */ - public async getTransacAggregatedSmsReport (startDate?: string, endDate?: string, days?: number, tag?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetTransacAggregatedSmsReport; }> { - const localVarPath = this.basePath + '/transactionalSMS/statistics/aggregatedReport'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (days !== undefined) { - localVarQueryParameters['days'] = ObjectSerializer.serialize(days, "number"); - } - - if (tag !== undefined) { - localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetTransacAggregatedSmsReport; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetTransacAggregatedSmsReport"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get your SMS activity aggregated per day - * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report - * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report - * @param days Number of days in the past including today (positive integer). Not compatible with \'startDate\' and \'endDate\' - * @param tag Filter on a tag - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getTransacSmsReport (startDate?: string, endDate?: string, days?: number, tag?: string, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetTransacSmsReport; }> { - const localVarPath = this.basePath + '/transactionalSMS/statistics/reports'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (days !== undefined) { - localVarQueryParameters['days'] = ObjectSerializer.serialize(days, "number"); - } - - if (tag !== undefined) { - localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "string"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetTransacSmsReport; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetTransacSmsReport"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send SMS message to a mobile number - * @param sendTransacSms Values to send a transactional SMS - */ - public async sendTransacSms (sendTransacSms: SendTransacSms, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SendSms; }> { - const localVarPath = this.basePath + '/transactionalSMS/sms'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'sendTransacSms' is not null or undefined - if (sendTransacSms === null || sendTransacSms === undefined) { - throw new Error('Required parameter sendTransacSms was null or undefined when calling sendTransacSms.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sendTransacSms, "SendTransacSms") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: SendSms; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "SendSms"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/transactionalWhatsAppApi.ts b/api/transactionalWhatsAppApi.ts deleted file mode 100644 index 56f68bc..0000000 --- a/api/transactionalWhatsAppApi.ts +++ /dev/null @@ -1,280 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { GetWhatsappEventReport } from '../model/getWhatsappEventReport'; -import { SendWhatsappMessage } from '../model/sendWhatsappMessage'; -import { SendWhatsappMessage201Response } from '../model/sendWhatsappMessage201Response'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum TransactionalWhatsAppApiApiKeys { - apiKey, - partnerKey, -} - -export class TransactionalWhatsAppApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: TransactionalWhatsAppApiApiKeys, value: string) { - (this.authentications as any)[TransactionalWhatsAppApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * This endpoint will show the unaggregated statistics for WhatsApp activity (30 days by default if `startDate` and `endDate` or `days` is not passed. The date range can not exceed 90 days) - * @summary Get all your WhatsApp activity (unaggregated events) - * @param limit Number limitation for the result returned - * @param offset Beginning point in the list to retrieve from - * @param startDate **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate - * @param endDate **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - * @param days Number of days in the past including today (positive integer). _Not compatible with \'startDate\' and \'endDate\'_ - * @param contactNumber Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) - * @param event Filter the report for a specific event type - * @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - */ - public async getWhatsappEventReport (limit?: number, offset?: number, startDate?: string, endDate?: string, days?: number, contactNumber?: string, event?: 'sent' | 'delivered' | 'read' | 'error' | 'unsubscribe' | 'reply' | 'soft-bounce', sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetWhatsappEventReport; }> { - const localVarPath = this.basePath + '/whatsapp/statistics/events'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (days !== undefined) { - localVarQueryParameters['days'] = ObjectSerializer.serialize(days, "number"); - } - - if (contactNumber !== undefined) { - localVarQueryParameters['contactNumber'] = ObjectSerializer.serialize(contactNumber, "string"); - } - - if (event !== undefined) { - localVarQueryParameters['event'] = ObjectSerializer.serialize(event, "'sent' | 'delivered' | 'read' | 'error' | 'unsubscribe' | 'reply' | 'soft-bounce'"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetWhatsappEventReport; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetWhatsappEventReport"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) - * @summary Send a WhatsApp message - * @param sendWhatsappMessage Values to send WhatsApp message - */ - public async sendWhatsappMessage (sendWhatsappMessage: SendWhatsappMessage, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SendWhatsappMessage201Response; }> { - const localVarPath = this.basePath + '/whatsapp/sendMessage'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'sendWhatsappMessage' is not null or undefined - if (sendWhatsappMessage === null || sendWhatsappMessage === undefined) { - throw new Error('Required parameter sendWhatsappMessage was null or undefined when calling sendWhatsappMessage.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sendWhatsappMessage, "SendWhatsappMessage") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: SendWhatsappMessage201Response; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "SendWhatsappMessage201Response"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/userApi.ts b/api/userApi.ts deleted file mode 100644 index b14b2c8..0000000 --- a/api/userApi.ts +++ /dev/null @@ -1,549 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { ErrorModel } from '../model/errorModel'; -import { GetInvitedUsersList } from '../model/getInvitedUsersList'; -import { GetUserPermission } from '../model/getUserPermission'; -import { Inviteuser } from '../model/inviteuser'; -import { PutRevokeUserPermission } from '../model/putRevokeUserPermission'; -import { Putresendcancelinvitation } from '../model/putresendcancelinvitation'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum UserApiApiKeys { - apiKey, - partnerKey, -} - -export class UserApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: UserApiApiKeys, value: string) { - (this.authentications as any)[UserApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * `Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"create_edit_delete\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"manage_owned_deals_tasks_companies\" - \"manage_others_deals_tasks_companies\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" **Note**: - The privileges array remains the same as in the send invitation; the user simply needs to provide the permissions that need to be updated. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly. - * @summary Update permission for a user - * @param updatePermissions Values to update permissions for an invited user - */ - public async editUserPermission (updatePermissions: Inviteuser, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Inviteuser; }> { - const localVarPath = this.basePath + '/organization/user/update/permissions'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'updatePermissions' is not null or undefined - if (updatePermissions === null || updatePermissions === undefined) { - throw new Error('Required parameter updatePermissions was null or undefined when calling editUserPermission.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updatePermissions, "Inviteuser") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Inviteuser; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Inviteuser"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get the list of all your users - */ - public async getInvitedUsersList (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetInvitedUsersList; }> { - const localVarPath = this.basePath + '/organization/invited/users'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetInvitedUsersList; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetInvitedUsersList"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Check user permission - * @param email Email of the invited user. - */ - public async getUserPermission (email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetUserPermission; }> { - const localVarPath = this.basePath + '/organization/user/{email}/permissions' - .replace('{' + 'email' + '}', encodeURIComponent(String(email))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'email' is not null or undefined - if (email === null || email === undefined) { - throw new Error('Required parameter email was null or undefined when calling getUserPermission.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetUserPermission; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetUserPermission"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * `Feature` - A Feature represents a specific functionality like Email campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, determine which feature you want to manage access to. You must specify the feature accurately to avoid errors. `Permission` - A Permission defines the level of access or control a user has over a specific feature. While inviting user, decide on the permission level required for the selected feature. Make sure the chosen permission is related to the selected feature. Features and their respective permissions are as below: - `email_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `sms_campaigns`: - \"create_edit_delete\" - \"send_schedule_suspend\" - `contacts`: - \"view\" - \"create_edit_delete\" - \"import\" - \"export\" - \"list_and_attributes\" - \"forms\" - `templates`: - \"create_edit_delete\" - \"activate_deactivate\" - `workflows`: - \"create_edit_delete\" - \"activate_deactivate_pause\" - \"settings\" - `facebook_ads`: - \"create_edit_delete\" - \"schedule_pause\" - `landing_pages`: - \"all\" - `transactional_emails`: - \"settings\" - \"logs\" - `smtp_api`: - \"smtp\" - \"api_keys\" - \"authorized_ips\" - `user_management`: - \"all\" - `sales_platform`: - \"manage_owned_deals_tasks_companies\" - \"manage_others_deals_tasks_companies\" - \"reports\" - \"settings\" - `phone`: - \"all\" - `conversations`: - \"access\" - \"assign\" - \"configure\" - `senders_domains_dedicated_ips`: - \"senders_management\" - \"domains_management\" - \"dedicated_ips_management\" - `push_notifications`: - \"view\" - \"create_edit_delete\" - \"send\" - \"settings\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it\'s assumed that all permissions will be there for the invited user. - The availability of feature and its permission depends on your current plan. Please select the features and permissions accordingly. - * @summary Send invitation to user - * @param sendInvitation Values to create an invitation - */ - public async inviteuser (sendInvitation: Inviteuser, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Inviteuser; }> { - const localVarPath = this.basePath + '/organization/user/invitation/send'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'sendInvitation' is not null or undefined - if (sendInvitation === null || sendInvitation === undefined) { - throw new Error('Required parameter sendInvitation was null or undefined when calling inviteuser.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(sendInvitation, "Inviteuser") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Inviteuser; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Inviteuser"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Revoke user permission - * @param email Email of the invited user. - */ - public async putRevokeUserPermission (email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PutRevokeUserPermission; }> { - const localVarPath = this.basePath + '/organization/user/invitation/revoke/{email}' - .replace('{' + 'email' + '}', encodeURIComponent(String(email))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'email' is not null or undefined - if (email === null || email === undefined) { - throw new Error('Required parameter email was null or undefined when calling putRevokeUserPermission.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: PutRevokeUserPermission; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "PutRevokeUserPermission"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Resend / Cancel invitation - * @param action action - * @param email Email of the invited user. - */ - public async putresendcancelinvitation (action: 'resend' | 'cancel', email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Putresendcancelinvitation; }> { - const localVarPath = this.basePath + '/organization/user/invitation/{action}/{email}' - .replace('{' + 'action' + '}', encodeURIComponent(String(action))) - .replace('{' + 'email' + '}', encodeURIComponent(String(email))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'action' is not null or undefined - if (action === null || action === undefined) { - throw new Error('Required parameter action was null or undefined when calling putresendcancelinvitation.'); - } - - // verify required parameter 'email' is not null or undefined - if (email === null || email === undefined) { - throw new Error('Required parameter email was null or undefined when calling putresendcancelinvitation.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: Putresendcancelinvitation; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Putresendcancelinvitation"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/webhooksApi.ts b/api/webhooksApi.ts deleted file mode 100644 index 6631bc6..0000000 --- a/api/webhooksApi.ts +++ /dev/null @@ -1,559 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CreateModel } from '../model/createModel'; -import { CreateWebhook } from '../model/createWebhook'; -import { CreatedProcessId } from '../model/createdProcessId'; -import { ErrorModel } from '../model/errorModel'; -import { ExportWebhooksHistory } from '../model/exportWebhooksHistory'; -import { GetWebhook } from '../model/getWebhook'; -import { GetWebhooks } from '../model/getWebhooks'; -import { UpdateWebhook } from '../model/updateWebhook'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum WebhooksApiApiKeys { - apiKey, - partnerKey, -} - -export class WebhooksApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: WebhooksApiApiKeys, value: string) { - (this.authentications as any)[WebhooksApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Create a webhook - * @param createWebhook Values to create a webhook - */ - public async createWebhook (createWebhook: CreateWebhook, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/webhooks'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'createWebhook' is not null or undefined - if (createWebhook === null || createWebhook === undefined) { - throw new Error('Required parameter createWebhook was null or undefined when calling createWebhook.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(createWebhook, "CreateWebhook") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a webhook - * @param webhookId Id of the webhook - */ - public async deleteWebhook (webhookId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/webhooks/{webhookId}' - .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'webhookId' is not null or undefined - if (webhookId === null || webhookId === undefined) { - throw new Error('Required parameter webhookId was null or undefined when calling deleteWebhook.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * This endpoint will submit a request to get the history of webhooks in the CSV file. The link to download the CSV file will be sent to the webhook that was provided in the notifyURL. - * @summary Export all webhook events - * @param exportWebhookHistory Values to submit for webhooks history - */ - public async exportWebhooksHistory (exportWebhookHistory: ExportWebhooksHistory, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> { - const localVarPath = this.basePath + '/webhooks/export'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'exportWebhookHistory' is not null or undefined - if (exportWebhookHistory === null || exportWebhookHistory === undefined) { - throw new Error('Required parameter exportWebhookHistory was null or undefined when calling exportWebhooksHistory.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(exportWebhookHistory, "ExportWebhooksHistory") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreatedProcessId"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a webhook details - * @param webhookId Id of the webhook - */ - public async getWebhook (webhookId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetWebhook; }> { - const localVarPath = this.basePath + '/webhooks/{webhookId}' - .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'webhookId' is not null or undefined - if (webhookId === null || webhookId === undefined) { - throw new Error('Required parameter webhookId was null or undefined when calling getWebhook.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetWebhook; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetWebhook"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get all webhooks - * @param type Filter on webhook type - * @param sort Sort the results in the ascending/descending order of webhook creation - */ - public async getWebhooks (type?: 'marketing' | 'transactional' | 'inbound', sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetWebhooks; }> { - const localVarPath = this.basePath + '/webhooks'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (type !== undefined) { - localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'marketing' | 'transactional' | 'inbound'"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetWebhooks; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetWebhooks"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a webhook - * @param webhookId Id of the webhook - * @param updateWebhook Values to update a webhook - */ - public async updateWebhook (webhookId: number, updateWebhook: UpdateWebhook, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/webhooks/{webhookId}' - .replace('{' + 'webhookId' + '}', encodeURIComponent(String(webhookId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'webhookId' is not null or undefined - if (webhookId === null || webhookId === undefined) { - throw new Error('Required parameter webhookId was null or undefined when calling updateWebhook.'); - } - - // verify required parameter 'updateWebhook' is not null or undefined - if (updateWebhook === null || updateWebhook === undefined) { - throw new Error('Required parameter updateWebhook was null or undefined when calling updateWebhook.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(updateWebhook, "UpdateWebhook") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/api/whatsAppCampaignsApi.ts b/api/whatsAppCampaignsApi.ts deleted file mode 100644 index 21013aa..0000000 --- a/api/whatsAppCampaignsApi.ts +++ /dev/null @@ -1,810 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import localVarRequest, { RequestOptions } from '../requestCompat'; -import http from 'http'; - -/* tslint:disable:no-unused-locals */ -import { CreateModel } from '../model/createModel'; -import { CreateWhatsAppCampaign } from '../model/createWhatsAppCampaign'; -import { CreateWhatsAppTemplate } from '../model/createWhatsAppTemplate'; -import { ErrorModel } from '../model/errorModel'; -import { GetWATemplates } from '../model/getWATemplates'; -import { GetWhatsAppConfig } from '../model/getWhatsAppConfig'; -import { GetWhatsappCampaignOverview } from '../model/getWhatsappCampaignOverview'; -import { GetWhatsappCampaigns } from '../model/getWhatsappCampaigns'; -import { UpdateWhatsAppCampaign } from '../model/updateWhatsAppCampaign'; - -import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; -import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; - -import { HttpError, RequestFile } from './apis'; - -let defaultBasePath = 'https://api.brevo.com/v3'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum WhatsAppCampaignsApiApiKeys { - apiKey, - partnerKey, -} - -export class WhatsAppCampaignsApi { - protected _basePath = defaultBasePath; - protected _defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - 'apiKey': new ApiKeyAuth('header', 'api-key'), - 'partnerKey': new ApiKeyAuth('header', 'partner-key'), - } - - protected interceptors: Interceptor[] = []; - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - set defaultHeaders(defaultHeaders: any) { - this._defaultHeaders = defaultHeaders; - } - - get defaultHeaders() { - return this._defaultHeaders; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: WhatsAppCampaignsApiApiKeys, value: string) { - (this.authentications as any)[WhatsAppCampaignsApiApiKeys[key]].apiKey = value; - } - - public addInterceptor(interceptor: Interceptor) { - this.interceptors.push(interceptor); - } - - /** - * - * @summary Create and Send a WhatsApp campaign - * @param whatsAppCampaigns Values to create a campaign - */ - public async createWhatsAppCampaign (whatsAppCampaigns: CreateWhatsAppCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/whatsappCampaigns'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'whatsAppCampaigns' is not null or undefined - if (whatsAppCampaigns === null || whatsAppCampaigns === undefined) { - throw new Error('Required parameter whatsAppCampaigns was null or undefined when calling createWhatsAppCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(whatsAppCampaigns, "CreateWhatsAppCampaign") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Create a WhatsApp template - * @param whatsAppTemplates Values to create a template - */ - public async createWhatsAppTemplate (whatsAppTemplates: CreateWhatsAppTemplate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> { - const localVarPath = this.basePath + '/whatsppCampaigns/template'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'whatsAppTemplates' is not null or undefined - if (whatsAppTemplates === null || whatsAppTemplates === undefined) { - throw new Error('Required parameter whatsAppTemplates was null or undefined when calling createWhatsAppTemplate.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(whatsAppTemplates, "CreateWhatsAppTemplate") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: CreateModel; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "CreateModel"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Delete a WhatsApp campaign - * @param campaignId id of the campaign - */ - public async deleteWhatsAppCampaign (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/whatsappCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling deleteWhatsAppCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'DELETE', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get a WhatsApp campaign - * @param campaignId Id of the campaign - */ - public async getWhatsAppCampaign (campaignId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetWhatsappCampaignOverview; }> { - const localVarPath = this.basePath + '/whatsappCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling getWhatsAppCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetWhatsappCampaignOverview; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetWhatsappCampaignOverview"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Return all your created WhatsApp campaigns - * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** - * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the campaigns created. **Prefer to pass your timezone in date-time format for accurate result** - * @param limit Number of documents per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed - */ - public async getWhatsAppCampaigns (startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetWhatsappCampaigns; }> { - const localVarPath = this.basePath + '/whatsappCampaigns'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetWhatsappCampaigns; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetWhatsappCampaigns"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Get your WhatsApp API account information - */ - public async getWhatsAppConfig (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetWhatsAppConfig; }> { - const localVarPath = this.basePath + '/whatsappCampaigns/config'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetWhatsAppConfig; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetWhatsAppConfig"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Return all your created WhatsApp templates - * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** - * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** - * @param limit Number of documents per page - * @param offset Index of the first document in the page - * @param sort Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed - * @param source source of the template - */ - public async getWhatsAppTemplates (startDate?: string, endDate?: string, limit?: number, offset?: number, sort?: 'asc' | 'desc', source?: 'Automation' | 'Conversations', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetWATemplates; }> { - const localVarPath = this.basePath + '/whatsappCampaigns/template-list'; - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - if (startDate !== undefined) { - localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string"); - } - - if (endDate !== undefined) { - localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string"); - } - - if (limit !== undefined) { - localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number"); - } - - if (offset !== undefined) { - localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number"); - } - - if (sort !== undefined) { - localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'"); - } - - if (source !== undefined) { - localVarQueryParameters['source'] = ObjectSerializer.serialize(source, "'Automation' | 'Conversations'"); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body: GetWATemplates; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "GetWATemplates"); - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Send your WhatsApp template for approval - * @param templateId id of the campaign - */ - public async sendWhatsAppTemplateApproval (templateId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/whatsappCampaigns/template/approval/{templateId}' - .replace('{' + 'templateId' + '}', encodeURIComponent(String(templateId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'templateId' is not null or undefined - if (templateId === null || templateId === undefined) { - throw new Error('Required parameter templateId was null or undefined when calling sendWhatsAppTemplateApproval.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'POST', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } - /** - * - * @summary Update a WhatsApp campaign - * @param campaignId Id of the campaign - * @param whatsAppCampaign values to update WhatsApp Campaign - */ - public async updateWhatsAppCampaign (campaignId: number, whatsAppCampaign?: UpdateWhatsAppCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { - const localVarPath = this.basePath + '/whatsappCampaigns/{campaignId}' - .replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); - const produces = ['application/json']; - // give precedence to 'application/json' - if (produces.indexOf('application/json') >= 0) { - localVarHeaderParams.Accept = 'application/json'; - } else { - localVarHeaderParams.Accept = produces.join(','); - } - let localVarFormParams: any = {}; - - // verify required parameter 'campaignId' is not null or undefined - if (campaignId === null || campaignId === undefined) { - throw new Error('Required parameter campaignId was null or undefined when calling updateWhatsAppCampaign.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: RequestOptions = { - method: 'PUT', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - url: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - body: ObjectSerializer.serialize(whatsAppCampaign, "UpdateWhatsAppCampaign") - }; - - let authenticationPromise = Promise.resolve(); - if (this.authentications.apiKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions)); - } - if (this.authentications.partnerKey.apiKey) { - authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions)); - } - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - - let interceptorPromise = authenticationPromise; - for (const interceptor of this.interceptors) { - interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); - } - - return interceptorPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject(new HttpError(response, body, response.statusCode)); - } - } - }); - }); - }); - } -} diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..371d365 --- /dev/null +++ b/biome.json @@ -0,0 +1,74 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", + "root": true, + "vcs": { + "enabled": false + }, + "files": { + "ignoreUnknown": true, + "includes": [ + "**", + "!!dist", + "!!**/dist", + "!!lib", + "!!**/lib", + "!!_tmp_*", + "!!**/_tmp_*", + "!!*.tmp", + "!!**/*.tmp", + "!!.tmp/", + "!!**/.tmp/", + "!!*.log", + "!!**/*.log", + "!!**/.DS_Store", + "!!**/Thumbs.db" + ] + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 4, + "lineWidth": 120 + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + }, + "linter": { + "rules": { + "style": { + "useNodejsImportProtocol": "off" + }, + "suspicious": { + "noAssignInExpressions": "warn", + "noUselessEscapeInString": { + "level": "warn", + "fix": "none", + "options": {} + }, + "noThenProperty": "warn", + "useIterableCallbackReturn": "warn", + "noShadowRestrictedNames": "warn", + "noTsIgnore": { + "level": "warn", + "fix": "none", + "options": {} + }, + "noConfusingVoidType": { + "level": "warn", + "fix": "none", + "options": {} + } + } + } + } +} diff --git a/git_push.sh b/git_push.sh deleted file mode 100644 index f53a75d..0000000 --- a/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/model/abTestCampaignResult.ts b/model/abTestCampaignResult.ts deleted file mode 100644 index ea7c8cd..0000000 --- a/model/abTestCampaignResult.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { AbTestCampaignResultClickedLinks } from './abTestCampaignResultClickedLinks'; -import { AbTestCampaignResultStatistics } from './abTestCampaignResultStatistics'; - -export class AbTestCampaignResult { - /** - * Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. - */ - 'winningVersion'?: AbTestCampaignResult.WinningVersionEnum; - /** - * Criteria choosen for winning version (Open/Click) - */ - 'winningCriteria'?: AbTestCampaignResult.WinningCriteriaEnum; - /** - * Subject Line of current winning version - */ - 'winningSubjectLine'?: string; - /** - * Open rate for current winning version - */ - 'openRate'?: string; - /** - * Click rate for current winning version - */ - 'clickRate'?: string; - /** - * Open/Click rate for the winner version - */ - 'winningVersionRate'?: string; - 'statistics'?: AbTestCampaignResultStatistics; - 'clickedLinks'?: AbTestCampaignResultClickedLinks; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "winningVersion", - "baseName": "winningVersion", - "type": "AbTestCampaignResult.WinningVersionEnum" - }, - { - "name": "winningCriteria", - "baseName": "winningCriteria", - "type": "AbTestCampaignResult.WinningCriteriaEnum" - }, - { - "name": "winningSubjectLine", - "baseName": "winningSubjectLine", - "type": "string" - }, - { - "name": "openRate", - "baseName": "openRate", - "type": "string" - }, - { - "name": "clickRate", - "baseName": "clickRate", - "type": "string" - }, - { - "name": "winningVersionRate", - "baseName": "winningVersionRate", - "type": "string" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "AbTestCampaignResultStatistics" - }, - { - "name": "clickedLinks", - "baseName": "clickedLinks", - "type": "AbTestCampaignResultClickedLinks" - } ]; - - static getAttributeTypeMap() { - return AbTestCampaignResult.attributeTypeMap; - } -} - -export namespace AbTestCampaignResult { - export enum WinningVersionEnum { - NotAvailable = 'notAvailable', - Pending = 'pending', - Tie = 'tie', - A = 'A', - B = 'B' - } - export enum WinningCriteriaEnum { - Open = 'Open', - Click = 'Click' - } -} diff --git a/model/abTestCampaignResultClickedLinks.ts b/model/abTestCampaignResultClickedLinks.ts deleted file mode 100644 index 08b3455..0000000 --- a/model/abTestCampaignResultClickedLinks.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { AbTestVersionClicksInner } from './abTestVersionClicksInner'; - -export class AbTestCampaignResultClickedLinks { - /** - * Information on clicked links for a particular version - */ - 'versionA': Array; - /** - * Information on clicked links for a particular version - */ - 'versionB': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "versionA", - "baseName": "Version A", - "type": "Array" - }, - { - "name": "versionB", - "baseName": "Version B", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return AbTestCampaignResultClickedLinks.attributeTypeMap; - } -} - diff --git a/model/abTestCampaignResultStatistics.ts b/model/abTestCampaignResultStatistics.ts deleted file mode 100644 index b6c191e..0000000 --- a/model/abTestCampaignResultStatistics.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { AbTestVersionStats } from './abTestVersionStats'; - -export class AbTestCampaignResultStatistics { - 'openers': AbTestVersionStats; - 'clicks': AbTestVersionStats; - 'unsubscribed': AbTestVersionStats; - 'hardBounces': AbTestVersionStats; - 'softBounces': AbTestVersionStats; - 'complaints': AbTestVersionStats; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "openers", - "baseName": "openers", - "type": "AbTestVersionStats" - }, - { - "name": "clicks", - "baseName": "clicks", - "type": "AbTestVersionStats" - }, - { - "name": "unsubscribed", - "baseName": "unsubscribed", - "type": "AbTestVersionStats" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "AbTestVersionStats" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "AbTestVersionStats" - }, - { - "name": "complaints", - "baseName": "complaints", - "type": "AbTestVersionStats" - } ]; - - static getAttributeTypeMap() { - return AbTestCampaignResultStatistics.attributeTypeMap; - } -} - diff --git a/model/abTestVersionClicksInner.ts b/model/abTestVersionClicksInner.ts deleted file mode 100644 index 3842032..0000000 --- a/model/abTestVersionClicksInner.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class AbTestVersionClicksInner { - /** - * URL of the link - */ - 'link': string; - /** - * Number of times a link is clicked - */ - 'clicksCount': number; - /** - * Percentage of clicks of link with respect to total clicks - */ - 'clickRate': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "link", - "baseName": "link", - "type": "string" - }, - { - "name": "clicksCount", - "baseName": "clicksCount", - "type": "number" - }, - { - "name": "clickRate", - "baseName": "clickRate", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return AbTestVersionClicksInner.attributeTypeMap; - } -} - diff --git a/model/abTestVersionStats.ts b/model/abTestVersionStats.ts deleted file mode 100644 index b3f6c66..0000000 --- a/model/abTestVersionStats.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Percentage of a particular event for both versions -*/ -export class AbTestVersionStats { - /** - * percentage of an event for version A - */ - 'versionA': string; - /** - * percentage of an event for version B - */ - 'versionB': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "versionA", - "baseName": "Version A", - "type": "string" - }, - { - "name": "versionB", - "baseName": "Version B", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return AbTestVersionStats.attributeTypeMap; - } -} - diff --git a/model/addChildDomain.ts b/model/addChildDomain.ts deleted file mode 100644 index 481d325..0000000 --- a/model/addChildDomain.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class AddChildDomain { - /** - * Sender domain to add for a specific child account - */ - 'domain'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "domain", - "baseName": "domain", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return AddChildDomain.attributeTypeMap; - } -} - diff --git a/model/addContactToList.ts b/model/addContactToList.ts deleted file mode 100644 index a70528b..0000000 --- a/model/addContactToList.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class AddContactToList { - /** - * Mandatory if IDs are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. - */ - 'emails'?: Array; - /** - * Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. - */ - 'ids'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "emails", - "baseName": "emails", - "type": "Array" - }, - { - "name": "ids", - "baseName": "ids", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return AddContactToList.attributeTypeMap; - } -} - diff --git a/model/addCredits.ts b/model/addCredits.ts deleted file mode 100644 index 58eb8fa..0000000 --- a/model/addCredits.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class AddCredits { - /** - * Required if email credits are empty. SMS credits to be added to the child account - */ - 'sms'?: number; - /** - * Required if sms credits are empty. Email credits to be added to the child account - */ - 'email'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sms", - "baseName": "sms", - "type": "number" - }, - { - "name": "email", - "baseName": "email", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return AddCredits.attributeTypeMap; - } -} - diff --git a/model/authenticateDomainModel.ts b/model/authenticateDomainModel.ts deleted file mode 100644 index 9f374d4..0000000 --- a/model/authenticateDomainModel.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class AuthenticateDomainModel { - /** - * Domain - */ - 'domainName': string; - /** - * Success message - */ - 'message': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "domainName", - "baseName": "domain_name", - "type": "string" - }, - { - "name": "message", - "baseName": "message", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return AuthenticateDomainModel.attributeTypeMap; - } -} - diff --git a/model/blockDomain.ts b/model/blockDomain.ts deleted file mode 100644 index dec9806..0000000 --- a/model/blockDomain.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class BlockDomain { - /** - * name of the domain to be blocked - */ - 'domain': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "domain", - "baseName": "domain", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return BlockDomain.attributeTypeMap; - } -} - diff --git a/model/cart.ts b/model/cart.ts deleted file mode 100644 index 8ea6cff..0000000 --- a/model/cart.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Specify the payment currency and amount. -*/ -export class Cart { - /** - * Currency code for the payment amount. - */ - 'currency': Cart.CurrencyEnum; - /** - * Payment amount, in cents. e.g. if you want to request €12.00, then the amount in cents is 1200. - */ - 'specificAmount': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "currency", - "baseName": "currency", - "type": "Cart.CurrencyEnum" - }, - { - "name": "specificAmount", - "baseName": "specificAmount", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return Cart.attributeTypeMap; - } -} - -export namespace Cart { - export enum CurrencyEnum { - Eur = 'EUR' - } -} diff --git a/model/companiesIdPatchRequest.ts b/model/companiesIdPatchRequest.ts deleted file mode 100644 index 6020179..0000000 --- a/model/companiesIdPatchRequest.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CompaniesIdPatchRequest { - /** - * Name of company - */ - 'name'?: string; - /** - * Attributes for company update - */ - 'attributes'?: object; - /** - * Country code if phone_number is passed in attributes. - */ - 'countryCode'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "countryCode", - "baseName": "countryCode", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CompaniesIdPatchRequest.attributeTypeMap; - } -} - diff --git a/model/companiesLinkUnlinkIdPatchRequest.ts b/model/companiesLinkUnlinkIdPatchRequest.ts deleted file mode 100644 index 347579a..0000000 --- a/model/companiesLinkUnlinkIdPatchRequest.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CompaniesLinkUnlinkIdPatchRequest { - /** - * Contact ids for contacts to be linked with company - */ - 'linkContactIds'?: Array; - /** - * Contact ids for contacts to be unlinked from company - */ - 'unlinkContactIds'?: Array; - /** - * Deals ids for deals to be linked with company - */ - 'linkDealsIds'?: Array; - /** - * Deals ids for deals to be unlinked from company - */ - 'unlinkDealsIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "linkContactIds", - "baseName": "linkContactIds", - "type": "Array" - }, - { - "name": "unlinkContactIds", - "baseName": "unlinkContactIds", - "type": "Array" - }, - { - "name": "linkDealsIds", - "baseName": "linkDealsIds", - "type": "Array" - }, - { - "name": "unlinkDealsIds", - "baseName": "unlinkDealsIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CompaniesLinkUnlinkIdPatchRequest.attributeTypeMap; - } -} - diff --git a/model/companiesList.ts b/model/companiesList.ts deleted file mode 100644 index 9bc37f0..0000000 --- a/model/companiesList.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { Company } from './company'; - -/** -* List of companies -*/ -export class CompaniesList { - /** - * List of compaies - */ - 'items'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "items", - "baseName": "items", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CompaniesList.attributeTypeMap; - } -} - diff --git a/model/companiesPost200Response.ts b/model/companiesPost200Response.ts deleted file mode 100644 index c1dfbec..0000000 --- a/model/companiesPost200Response.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Created company id -*/ -export class CompaniesPost200Response { - /** - * Unique company id - */ - 'id': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CompaniesPost200Response.attributeTypeMap; - } -} - diff --git a/model/companiesPostRequest.ts b/model/companiesPostRequest.ts deleted file mode 100644 index 65bdfce..0000000 --- a/model/companiesPostRequest.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CompaniesPostRequest { - /** - * Name of company - */ - 'name': string; - /** - * Attributes for company creation - */ - 'attributes'?: object; - /** - * Country code if phone_number is passed in attributes. - */ - 'countryCode'?: number; - /** - * Contact ids to be linked with company - */ - 'linkedContactsIds'?: Array; - /** - * Deal ids to be linked with company - */ - 'linkedDealsIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "countryCode", - "baseName": "countryCode", - "type": "number" - }, - { - "name": "linkedContactsIds", - "baseName": "linkedContactsIds", - "type": "Array" - }, - { - "name": "linkedDealsIds", - "baseName": "linkedDealsIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CompaniesPostRequest.attributeTypeMap; - } -} - diff --git a/model/company.ts b/model/company.ts deleted file mode 100644 index 9ea1a9a..0000000 --- a/model/company.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Company Details -*/ -export class Company { - /** - * Unique company id - */ - 'id'?: string; - /** - * Company attributes with values - */ - 'attributes'?: object; - /** - * Contact ids for contacts linked to this company - */ - 'linkedContactsIds'?: Array; - /** - * Deals ids for companies linked to this company - */ - 'linkedDealsIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "linkedContactsIds", - "baseName": "linkedContactsIds", - "type": "Array" - }, - { - "name": "linkedDealsIds", - "baseName": "linkedDealsIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return Company.attributeTypeMap; - } -} - diff --git a/model/companyAttributesInner.ts b/model/companyAttributesInner.ts deleted file mode 100644 index f39a931..0000000 --- a/model/companyAttributesInner.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* List of attributes -*/ -export class CompanyAttributesInner { - 'internalName'?: string; - 'label'?: string; - 'attributeTypeName'?: string; - 'attributeOptions'?: Array; - 'isRequired'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "internalName", - "baseName": "internalName", - "type": "string" - }, - { - "name": "label", - "baseName": "label", - "type": "string" - }, - { - "name": "attributeTypeName", - "baseName": "attributeTypeName", - "type": "string" - }, - { - "name": "attributeOptions", - "baseName": "attributeOptions", - "type": "Array" - }, - { - "name": "isRequired", - "baseName": "isRequired", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CompanyAttributesInner.attributeTypeMap; - } -} - diff --git a/model/componentItems.ts b/model/componentItems.ts deleted file mode 100644 index de2dee0..0000000 --- a/model/componentItems.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ComponentItems { - 'type'?: string; - 'text'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "type", - "baseName": "type", - "type": "string" - }, - { - "name": "text", - "baseName": "text", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ComponentItems.attributeTypeMap; - } -} - diff --git a/model/configuration.ts b/model/configuration.ts deleted file mode 100644 index 210e7f4..0000000 --- a/model/configuration.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Optional. Redirect contact to a custom success page once payment is successful. If empty the default Brevo page will be displayed once a payment is validated -*/ -export class Configuration { - /** - * Absolute URL of the custom success page. - */ - 'customSuccessUrl': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "customSuccessUrl", - "baseName": "customSuccessUrl", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return Configuration.attributeTypeMap; - } -} - diff --git a/model/conversationsAgentOnlinePingPostRequest.ts b/model/conversationsAgentOnlinePingPostRequest.ts deleted file mode 100644 index 67a4066..0000000 --- a/model/conversationsAgentOnlinePingPostRequest.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ConversationsAgentOnlinePingPostRequest { - /** - * agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). - */ - 'agentId'?: string; - /** - * mark your messages to distinguish messages created by you from the others. - */ - 'receivedFrom'?: string; - /** - * agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. - */ - 'agentEmail'?: string; - /** - * agent name. - */ - 'agentName'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "agentId", - "baseName": "agentId", - "type": "string" - }, - { - "name": "receivedFrom", - "baseName": "receivedFrom", - "type": "string" - }, - { - "name": "agentEmail", - "baseName": "agentEmail", - "type": "string" - }, - { - "name": "agentName", - "baseName": "agentName", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ConversationsAgentOnlinePingPostRequest.attributeTypeMap; - } -} - diff --git a/model/conversationsMessage.ts b/model/conversationsMessage.ts deleted file mode 100644 index 5c1133f..0000000 --- a/model/conversationsMessage.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { ConversationsMessageFile } from './conversationsMessageFile'; - -/** -* a Conversations message -*/ -export class ConversationsMessage { - /** - * Message ID. It can be used for further manipulations with the message. - */ - 'id'?: string; - /** - * `\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages. - */ - 'type'?: ConversationsMessage.TypeEnum; - /** - * Message text or name of the attached file - */ - 'text'?: string; - /** - * visitor’s ID - */ - 'visitorId'?: string; - /** - * ID of the agent on whose behalf the message was sent (only in messages sent by an agent). - */ - 'agentId'?: string; - /** - * Agent’s name as displayed to the visitor. Only in the messages sent by an agent. - */ - 'agentName'?: string; - /** - * Timestamp in milliseconds. - */ - 'createdAt'?: number; - /** - * `true` for pushed messages - */ - 'isPushed'?: boolean; - /** - * In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop. - */ - 'receivedFrom'?: string; - 'file'?: ConversationsMessageFile; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "type", - "baseName": "type", - "type": "ConversationsMessage.TypeEnum" - }, - { - "name": "text", - "baseName": "text", - "type": "string" - }, - { - "name": "visitorId", - "baseName": "visitorId", - "type": "string" - }, - { - "name": "agentId", - "baseName": "agentId", - "type": "string" - }, - { - "name": "agentName", - "baseName": "agentName", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "number" - }, - { - "name": "isPushed", - "baseName": "isPushed", - "type": "boolean" - }, - { - "name": "receivedFrom", - "baseName": "receivedFrom", - "type": "string" - }, - { - "name": "file", - "baseName": "file", - "type": "ConversationsMessageFile" - } ]; - - static getAttributeTypeMap() { - return ConversationsMessage.attributeTypeMap; - } -} - -export namespace ConversationsMessage { - export enum TypeEnum { - Agent = 'agent', - Visitor = 'visitor' - } -} diff --git a/model/conversationsMessageFile.ts b/model/conversationsMessageFile.ts deleted file mode 100644 index bb9e2f3..0000000 --- a/model/conversationsMessageFile.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { ConversationsMessageFileImageInfo } from './conversationsMessageFileImageInfo'; - -export class ConversationsMessageFile { - /** - * Name of the file - */ - 'filename'?: string; - /** - * Size in bytes - */ - 'size'?: number; - /** - * Whether the file is an image - */ - 'isImage'?: boolean; - /** - * URL of the file - */ - 'url'?: string; - 'imageInfo'?: ConversationsMessageFileImageInfo; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "filename", - "baseName": "filename", - "type": "string" - }, - { - "name": "size", - "baseName": "size", - "type": "number" - }, - { - "name": "isImage", - "baseName": "isImage", - "type": "boolean" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "imageInfo", - "baseName": "imageInfo", - "type": "ConversationsMessageFileImageInfo" - } ]; - - static getAttributeTypeMap() { - return ConversationsMessageFile.attributeTypeMap; - } -} - diff --git a/model/conversationsMessageFileImageInfo.ts b/model/conversationsMessageFileImageInfo.ts deleted file mode 100644 index b34d498..0000000 --- a/model/conversationsMessageFileImageInfo.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* image info is passed in case the file is an image -*/ -export class ConversationsMessageFileImageInfo { - /** - * Width of the image - */ - 'width'?: number; - /** - * height of the image - */ - 'height'?: number; - /** - * URL of the preview - */ - 'previewUrl'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "width", - "baseName": "width", - "type": "number" - }, - { - "name": "height", - "baseName": "height", - "type": "number" - }, - { - "name": "previewUrl", - "baseName": "previewUrl", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ConversationsMessageFileImageInfo.attributeTypeMap; - } -} - diff --git a/model/conversationsMessagesIdPutRequest.ts b/model/conversationsMessagesIdPutRequest.ts deleted file mode 100644 index 1316875..0000000 --- a/model/conversationsMessagesIdPutRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ConversationsMessagesIdPutRequest { - /** - * edited message text - */ - 'text': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "text", - "baseName": "text", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ConversationsMessagesIdPutRequest.attributeTypeMap; - } -} - diff --git a/model/conversationsMessagesPostRequest.ts b/model/conversationsMessagesPostRequest.ts deleted file mode 100644 index a14b1ea..0000000 --- a/model/conversationsMessagesPostRequest.ts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ConversationsMessagesPostRequest { - /** - * visitor’s ID received from a webhook or generated by you to bind existing user account to Conversations - */ - 'visitorId': string; - /** - * message text - */ - 'text': string; - /** - * agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). - */ - 'agentId'?: string; - /** - * mark your messages to distinguish messages created by you from the others. - */ - 'receivedFrom'?: string; - /** - * agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. - */ - 'agentEmail'?: string; - /** - * agent name - */ - 'agentName'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "visitorId", - "baseName": "visitorId", - "type": "string" - }, - { - "name": "text", - "baseName": "text", - "type": "string" - }, - { - "name": "agentId", - "baseName": "agentId", - "type": "string" - }, - { - "name": "receivedFrom", - "baseName": "receivedFrom", - "type": "string" - }, - { - "name": "agentEmail", - "baseName": "agentEmail", - "type": "string" - }, - { - "name": "agentName", - "baseName": "agentName", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ConversationsMessagesPostRequest.attributeTypeMap; - } -} - diff --git a/model/conversationsPushedMessagesIdPutRequest.ts b/model/conversationsPushedMessagesIdPutRequest.ts deleted file mode 100644 index 56f828f..0000000 --- a/model/conversationsPushedMessagesIdPutRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ConversationsPushedMessagesIdPutRequest { - /** - * edited message text - */ - 'text': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "text", - "baseName": "text", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ConversationsPushedMessagesIdPutRequest.attributeTypeMap; - } -} - diff --git a/model/conversationsPushedMessagesPostRequest.ts b/model/conversationsPushedMessagesPostRequest.ts deleted file mode 100644 index ea2c79c..0000000 --- a/model/conversationsPushedMessagesPostRequest.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ConversationsPushedMessagesPostRequest { - /** - * visitor’s ID received from a webhook or generated by you to bind existing user account to Conversations - */ - 'visitorId': string; - /** - * message text - */ - 'text': string; - /** - * agent ID. It can be found on agent’s page or received from a webhook. Optional if `groupId` is set. - */ - 'agentId'?: string; - /** - * group ID. It can be found on group’s page. Optional if `agentId` is set. - */ - 'groupId'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "visitorId", - "baseName": "visitorId", - "type": "string" - }, - { - "name": "text", - "baseName": "text", - "type": "string" - }, - { - "name": "agentId", - "baseName": "agentId", - "type": "string" - }, - { - "name": "groupId", - "baseName": "groupId", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ConversationsPushedMessagesPostRequest.attributeTypeMap; - } -} - diff --git a/model/conversionSourceMetrics.ts b/model/conversionSourceMetrics.ts deleted file mode 100644 index e7bdb7a..0000000 --- a/model/conversionSourceMetrics.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ConversionSourceMetrics { - 'id': number; - 'conversionSource': ConversionSourceMetrics.ConversionSourceEnum; - 'ordersCount': number; - 'revenue': number; - 'averageBasket': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "conversionSource", - "baseName": "conversionSource", - "type": "ConversionSourceMetrics.ConversionSourceEnum" - }, - { - "name": "ordersCount", - "baseName": "ordersCount", - "type": "number" - }, - { - "name": "revenue", - "baseName": "revenue", - "type": "number" - }, - { - "name": "averageBasket", - "baseName": "averageBasket", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return ConversionSourceMetrics.attributeTypeMap; - } -} - -export namespace ConversionSourceMetrics { - export enum ConversionSourceEnum { - EmailCampaign = 'email_campaign' - } -} diff --git a/model/conversionSourceProduct.ts b/model/conversionSourceProduct.ts deleted file mode 100644 index 0d55c90..0000000 --- a/model/conversionSourceProduct.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ConversionSourceProduct { - 'id': string; - 'name'?: string; - 'sku'?: string; - 'price'?: number; - 'url'?: string; - 'imageUrl'?: string; - 'ordersCount'?: number; - 'revenue'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "sku", - "baseName": "sku", - "type": "string" - }, - { - "name": "price", - "baseName": "price", - "type": "number" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "imageUrl", - "baseName": "imageUrl", - "type": "string" - }, - { - "name": "ordersCount", - "baseName": "ordersCount", - "type": "number" - }, - { - "name": "revenue", - "baseName": "revenue", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return ConversionSourceProduct.attributeTypeMap; - } -} - diff --git a/model/corporateGroupDetailsResponse.ts b/model/corporateGroupDetailsResponse.ts deleted file mode 100644 index f04df28..0000000 --- a/model/corporateGroupDetailsResponse.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CorporateGroupDetailsResponseGroup } from './corporateGroupDetailsResponseGroup'; -import { CorporateGroupDetailsResponseSubAccountsInner } from './corporateGroupDetailsResponseSubAccountsInner'; -import { CorporateGroupDetailsResponseUsersInner } from './corporateGroupDetailsResponseUsersInner'; - -export class CorporateGroupDetailsResponse { - 'group'?: CorporateGroupDetailsResponseGroup; - 'subAccounts'?: Array; - 'users'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "group", - "baseName": "group", - "type": "CorporateGroupDetailsResponseGroup" - }, - { - "name": "subAccounts", - "baseName": "sub-accounts", - "type": "Array" - }, - { - "name": "users", - "baseName": "users", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CorporateGroupDetailsResponse.attributeTypeMap; - } -} - diff --git a/model/corporateGroupDetailsResponseGroup.ts b/model/corporateGroupDetailsResponseGroup.ts deleted file mode 100644 index e3f084e..0000000 --- a/model/corporateGroupDetailsResponseGroup.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateGroupDetailsResponseGroup { - /** - * Group id - */ - 'id'?: string; - /** - * Name of the group - */ - 'groupName'?: string; - /** - * Group creation date - */ - 'createdAt'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "groupName", - "baseName": "groupName", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CorporateGroupDetailsResponseGroup.attributeTypeMap; - } -} - diff --git a/model/corporateGroupDetailsResponseSubAccountsInner.ts b/model/corporateGroupDetailsResponseSubAccountsInner.ts deleted file mode 100644 index 56d5ea0..0000000 --- a/model/corporateGroupDetailsResponseSubAccountsInner.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateGroupDetailsResponseSubAccountsInner { - /** - * Id of the sub-account organzation - */ - 'id'?: number; - /** - * Name of the sub-account organzation - */ - 'companyName'?: string; - /** - * Creation date of the sub-account organzation - */ - 'createdAt'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CorporateGroupDetailsResponseSubAccountsInner.attributeTypeMap; - } -} - diff --git a/model/corporateGroupDetailsResponseUsersInner.ts b/model/corporateGroupDetailsResponseUsersInner.ts deleted file mode 100644 index c6a52bb..0000000 --- a/model/corporateGroupDetailsResponseUsersInner.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateGroupDetailsResponseUsersInner { - /** - * Email address of the user - */ - 'email'?: string; - /** - * Last name of the user - */ - 'lastName'?: string; - /** - * First name of the user - */ - 'firstName'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CorporateGroupDetailsResponseUsersInner.attributeTypeMap; - } -} - diff --git a/model/corporateGroupPost201Response.ts b/model/corporateGroupPost201Response.ts deleted file mode 100644 index 8cfc440..0000000 --- a/model/corporateGroupPost201Response.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateGroupPost201Response { - 'id'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CorporateGroupPost201Response.attributeTypeMap; - } -} - diff --git a/model/corporateGroupPostRequest.ts b/model/corporateGroupPostRequest.ts deleted file mode 100644 index 7bc9f70..0000000 --- a/model/corporateGroupPostRequest.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateGroupPostRequest { - /** - * The name of the group of sub-accounts - */ - 'groupName': string; - /** - * Pass the list of sub-account Ids to be included in the group - */ - 'subAccountIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "groupName", - "baseName": "groupName", - "type": "string" - }, - { - "name": "subAccountIds", - "baseName": "subAccountIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CorporateGroupPostRequest.attributeTypeMap; - } -} - diff --git a/model/corporateGroupUnlinkGroupIdSubAccountsPutRequest.ts b/model/corporateGroupUnlinkGroupIdSubAccountsPutRequest.ts deleted file mode 100644 index c0cce00..0000000 --- a/model/corporateGroupUnlinkGroupIdSubAccountsPutRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateGroupUnlinkGroupIdSubAccountsPutRequest { - /** - * List of sub-account ids - */ - 'subAccountIds': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "subAccountIds", - "baseName": "subAccountIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CorporateGroupUnlinkGroupIdSubAccountsPutRequest.attributeTypeMap; - } -} - diff --git a/model/corporateSubAccountIpAssociatePostRequest.ts b/model/corporateSubAccountIpAssociatePostRequest.ts deleted file mode 100644 index 03bdc59..0000000 --- a/model/corporateSubAccountIpAssociatePostRequest.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateSubAccountIpAssociatePostRequest { - /** - * IP Address - */ - 'ip': string; - /** - * Pass the list of sub-account Ids to be associated with the IP address - */ - 'ids': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "ids", - "baseName": "ids", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CorporateSubAccountIpAssociatePostRequest.attributeTypeMap; - } -} - diff --git a/model/corporateSubAccountIpDissociatePutRequest.ts b/model/corporateSubAccountIpDissociatePutRequest.ts deleted file mode 100644 index 1dbd18b..0000000 --- a/model/corporateSubAccountIpDissociatePutRequest.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateSubAccountIpDissociatePutRequest { - /** - * IP Address - */ - 'ip': string; - /** - * Pass the list of sub-account Ids to be dissociated from the IP address - */ - 'ids': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "ids", - "baseName": "ids", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CorporateSubAccountIpDissociatePutRequest.attributeTypeMap; - } -} - diff --git a/model/corporateUserInvitationActionEmailPut200Response.ts b/model/corporateUserInvitationActionEmailPut200Response.ts deleted file mode 100644 index 90f9483..0000000 --- a/model/corporateUserInvitationActionEmailPut200Response.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CorporateUserInvitationActionEmailPut200Response { - 'message'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "message", - "baseName": "message", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CorporateUserInvitationActionEmailPut200Response.attributeTypeMap; - } -} - diff --git a/model/createApiKeyRequest.ts b/model/createApiKeyRequest.ts deleted file mode 100644 index 1146e63..0000000 --- a/model/createApiKeyRequest.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateApiKeyRequest { - /** - * Id of the sub-account organization - */ - 'id': number; - /** - * Name of the API key - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateApiKeyRequest.attributeTypeMap; - } -} - diff --git a/model/createApiKeyResponse.ts b/model/createApiKeyResponse.ts deleted file mode 100644 index e764f2e..0000000 --- a/model/createApiKeyResponse.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateApiKeyResponse { - /** - * Status of the API operation. - */ - 'status'?: string; - /** - * API Key - */ - 'key'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "status", - "baseName": "status", - "type": "string" - }, - { - "name": "key", - "baseName": "key", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateApiKeyResponse.attributeTypeMap; - } -} - diff --git a/model/createAttribute.ts b/model/createAttribute.ts deleted file mode 100644 index b16bb11..0000000 --- a/model/createAttribute.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateAttributeEnumerationInner } from './createAttributeEnumerationInner'; - -export class CreateAttribute { - /** - * Value of the attribute. Use only if the attribute\'s category is \'calculated\' or \'global\' - */ - 'value'?: string; - /** - * Type of the attribute. Use only if the attribute\'s category is \'calculated\' or \'global\' - */ - 'isRecurring'?: boolean; - /** - * List of values and labels that the attribute can take. Use only if the attribute\'s category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] - */ - 'enumeration'?: Array; - /** - * Type of the attribute. Use only if the attribute\'s category is \'normal\', \'category\' or \'transactional\' ( type \'boolean\' is only available if the category is \'normal\' attribute, type \'id\' is only available if the category is \'transactional\' attribute & type \'category\' is only available if the category is \'category\' attribute ) - */ - 'type'?: CreateAttribute.TypeEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "value", - "baseName": "value", - "type": "string" - }, - { - "name": "isRecurring", - "baseName": "isRecurring", - "type": "boolean" - }, - { - "name": "enumeration", - "baseName": "enumeration", - "type": "Array" - }, - { - "name": "type", - "baseName": "type", - "type": "CreateAttribute.TypeEnum" - } ]; - - static getAttributeTypeMap() { - return CreateAttribute.attributeTypeMap; - } -} - -export namespace CreateAttribute { - export enum TypeEnum { - Text = 'text', - Date = 'date', - Float = 'float', - Boolean = 'boolean', - Id = 'id', - Category = 'category' - } -} diff --git a/model/createAttributeEnumerationInner.ts b/model/createAttributeEnumerationInner.ts deleted file mode 100644 index 9116156..0000000 --- a/model/createAttributeEnumerationInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateAttributeEnumerationInner { - /** - * Id of the value - */ - 'value': number; - /** - * Label of the value - */ - 'label': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "value", - "baseName": "value", - "type": "number" - }, - { - "name": "label", - "baseName": "label", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateAttributeEnumerationInner.attributeTypeMap; - } -} - diff --git a/model/createCategoryModel.ts b/model/createCategoryModel.ts deleted file mode 100644 index 00573eb..0000000 --- a/model/createCategoryModel.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateCategoryModel { - /** - * ID of the category when a new category is created - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateCategoryModel.attributeTypeMap; - } -} - diff --git a/model/createChild.ts b/model/createChild.ts deleted file mode 100644 index 67ebccb..0000000 --- a/model/createChild.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateChild { - /** - * Email address to create the child account - */ - 'email': string; - /** - * First name to use to create the child account - */ - 'firstName': string; - /** - * Last name to use to create the child account - */ - 'lastName': string; - /** - * Company name to use to create the child account - */ - 'companyName': string; - /** - * Password for the child account to login - */ - 'password': string; - /** - * Language of the child account - */ - 'language'?: CreateChild.LanguageEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "password", - "baseName": "password", - "type": "string" - }, - { - "name": "language", - "baseName": "language", - "type": "CreateChild.LanguageEnum" - } ]; - - static getAttributeTypeMap() { - return CreateChild.attributeTypeMap; - } -} - -export namespace CreateChild { - export enum LanguageEnum { - Fr = 'fr', - Es = 'es', - Pt = 'pt', - It = 'it', - De = 'de', - En = 'en' - } -} diff --git a/model/createContact.ts b/model/createContact.ts deleted file mode 100644 index 2369ca3..0000000 --- a/model/createContact.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateContact { - /** - * Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} - */ - 'email'?: string; - /** - * Pass your own Id to create a contact. - */ - 'extId'?: string; - /** - * Pass the set of attributes and their values. The attribute\'s parameter should be passed in capital letter while creating a contact. Values that don\'t match the attribute type (e.g. text or string in a date attribute) will be ignored.These attributes must be present in your Brevo account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"} - */ - 'attributes'?: object; - /** - * Set this field to blacklist the contact for emails (emailBlacklisted = true) - */ - 'emailBlacklisted'?: boolean; - /** - * Set this field to blacklist the contact for SMS (smsBlacklisted = true) - */ - 'smsBlacklisted'?: boolean; - /** - * Ids of the lists to add the contact to - */ - 'listIds'?: Array; - /** - * Facilitate to update the existing contact in the same request (updateEnabled = true) - */ - 'updateEnabled'?: boolean = false; - /** - * transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) - */ - 'smtpBlacklistSender'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "extId", - "baseName": "ext_id", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" - }, - { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "updateEnabled", - "baseName": "updateEnabled", - "type": "boolean" - }, - { - "name": "smtpBlacklistSender", - "baseName": "smtpBlacklistSender", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateContact.attributeTypeMap; - } -} - diff --git a/model/createCouponCollection201Response.ts b/model/createCouponCollection201Response.ts deleted file mode 100644 index ad484f8..0000000 --- a/model/createCouponCollection201Response.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateCouponCollection201Response { - /** - * The id of the created collection - */ - 'id': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateCouponCollection201Response.attributeTypeMap; - } -} - diff --git a/model/createCouponCollectionRequest.ts b/model/createCouponCollectionRequest.ts deleted file mode 100644 index 9efba70..0000000 --- a/model/createCouponCollectionRequest.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateCouponCollectionRequest { - /** - * Name of the coupons collection - */ - 'name': string; - /** - * Default coupons collection name - */ - 'defaultCoupon': string; - /** - * Specify an expiration date for the coupon collection in RFC3339 format. Use null to remove the expiration date. - */ - 'expirationDate'?: Date; - /** - * Send a notification alert (email) when the remaining days until the expiration date are equal or fall bellow this number. Use null to disable alerts. - */ - 'remainingDaysAlert'?: number; - /** - * Send a notification alert (email) when the remaining coupons count is equal or fall bellow this number. Use null to disable alerts. - */ - 'remainingCouponsAlert'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "defaultCoupon", - "baseName": "defaultCoupon", - "type": "string" - }, - { - "name": "expirationDate", - "baseName": "expirationDate", - "type": "Date" - }, - { - "name": "remainingDaysAlert", - "baseName": "remainingDaysAlert", - "type": "number" - }, - { - "name": "remainingCouponsAlert", - "baseName": "remainingCouponsAlert", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateCouponCollectionRequest.attributeTypeMap; - } -} - diff --git a/model/createCouponsRequest.ts b/model/createCouponsRequest.ts deleted file mode 100644 index 89bfc7c..0000000 --- a/model/createCouponsRequest.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateCouponsRequest { - /** - * The id of the coupon collection for which the coupons will be created - */ - 'collectionId': string; - 'coupons': Set; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "collectionId", - "baseName": "collectionId", - "type": "string" - }, - { - "name": "coupons", - "baseName": "coupons", - "type": "Set" - } ]; - - static getAttributeTypeMap() { - return CreateCouponsRequest.attributeTypeMap; - } -} - diff --git a/model/createDoiContact.ts b/model/createDoiContact.ts deleted file mode 100644 index 15a0e73..0000000 --- a/model/createDoiContact.ts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateDoiContact { - /** - * Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. - */ - 'email': string; - /** - * Pass the set of attributes and their values. These attributes must be present in your Brevo account. For eg. {\'FNAME\':\'Elly\', \'LNAME\':\'Roger\'} - */ - 'attributes'?: object; - /** - * Lists under user account where contact should be added - */ - 'includeListIds': Array; - /** - * Lists under user account where contact should not be added - */ - 'excludeListIds'?: Array; - /** - * Id of the Double opt-in (DOI) template - */ - 'templateId': number; - /** - * URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}. - */ - 'redirectionUrl': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "includeListIds", - "baseName": "includeListIds", - "type": "Array" - }, - { - "name": "excludeListIds", - "baseName": "excludeListIds", - "type": "Array" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "redirectionUrl", - "baseName": "redirectionUrl", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateDoiContact.attributeTypeMap; - } -} - diff --git a/model/createDomain.ts b/model/createDomain.ts deleted file mode 100644 index 54ecf76..0000000 --- a/model/createDomain.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateDomain { - /** - * Domain name - */ - 'name': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateDomain.attributeTypeMap; - } -} - diff --git a/model/createDomainModel.ts b/model/createDomainModel.ts deleted file mode 100644 index 14aecf3..0000000 --- a/model/createDomainModel.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateDomainModelDnsRecords } from './createDomainModelDnsRecords'; - -export class CreateDomainModel { - /** - * ID of the Domain created - */ - 'id': number; - /** - * Domain - */ - 'domainName'?: string; - /** - * Domain Provider - */ - 'domainProvider'?: string; - /** - * Success message - */ - 'message'?: string; - 'dnsRecords'?: CreateDomainModelDnsRecords; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "domainName", - "baseName": "domain_name", - "type": "string" - }, - { - "name": "domainProvider", - "baseName": "domain_provider", - "type": "string" - }, - { - "name": "message", - "baseName": "message", - "type": "string" - }, - { - "name": "dnsRecords", - "baseName": "dns_records", - "type": "CreateDomainModelDnsRecords" - } ]; - - static getAttributeTypeMap() { - return CreateDomainModel.attributeTypeMap; - } -} - diff --git a/model/createDomainModelDnsRecords.ts b/model/createDomainModelDnsRecords.ts deleted file mode 100644 index ed5d536..0000000 --- a/model/createDomainModelDnsRecords.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateDomainModelDnsRecordsDkimRecord } from './createDomainModelDnsRecordsDkimRecord'; - -export class CreateDomainModelDnsRecords { - 'dkimRecord'?: CreateDomainModelDnsRecordsDkimRecord; - 'brevoCode'?: CreateDomainModelDnsRecordsDkimRecord; - 'dmarcRecord'?: CreateDomainModelDnsRecordsDkimRecord; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "dkimRecord", - "baseName": "dkim_record", - "type": "CreateDomainModelDnsRecordsDkimRecord" - }, - { - "name": "brevoCode", - "baseName": "brevo_code", - "type": "CreateDomainModelDnsRecordsDkimRecord" - }, - { - "name": "dmarcRecord", - "baseName": "dmarc_record", - "type": "CreateDomainModelDnsRecordsDkimRecord" - } ]; - - static getAttributeTypeMap() { - return CreateDomainModelDnsRecords.attributeTypeMap; - } -} - diff --git a/model/createDomainModelDnsRecordsDkimRecord.ts b/model/createDomainModelDnsRecordsDkimRecord.ts deleted file mode 100644 index bd6ce2d..0000000 --- a/model/createDomainModelDnsRecordsDkimRecord.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateDomainModelDnsRecordsDkimRecord { - 'type'?: string; - 'value'?: string; - 'hostName'?: string; - 'status'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "type", - "baseName": "type", - "type": "string" - }, - { - "name": "value", - "baseName": "value", - "type": "string" - }, - { - "name": "hostName", - "baseName": "host_name", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateDomainModelDnsRecordsDkimRecord.attributeTypeMap; - } -} - diff --git a/model/createEmailCampaign.ts b/model/createEmailCampaign.ts deleted file mode 100644 index c9ddb50..0000000 --- a/model/createEmailCampaign.ts +++ /dev/null @@ -1,306 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateEmailCampaignRecipients } from './createEmailCampaignRecipients'; -import { CreateEmailCampaignSender } from './createEmailCampaignSender'; - -export class CreateEmailCampaign { - /** - * Tag of the campaign - */ - 'tag'?: string; - 'sender': CreateEmailCampaignSender; - /** - * Name of the campaign - */ - 'name': string; - /** - * Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) - */ - 'htmlContent'?: string; - /** - * Mandatory if htmlContent and templateId are empty. Url to the message (HTML) - */ - 'htmlUrl'?: string; - /** - * Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status \'active\'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. - */ - 'templateId'?: number; - /** - * Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). - */ - 'scheduledAt'?: string; - /** - * Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true. - */ - 'subject'?: string; - /** - * Preview text or preheader of the email campaign - */ - 'previewText'?: string; - /** - * Email on which the campaign recipients will be able to reply to - */ - 'replyTo'?: string; - /** - * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter \'params\' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization - */ - 'toField'?: string; - 'recipients'?: CreateEmailCampaignRecipients; - /** - * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps - */ - 'attachmentUrl'?: string; - /** - * Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts - */ - 'inlineImageActivation'?: boolean = false; - /** - * Use true to enable the mirror link - */ - 'mirrorActive'?: boolean; - /** - * Footer of the email campaign - */ - 'footer'?: string; - /** - * Header of the email campaign - */ - 'header'?: string; - /** - * Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed - */ - 'utmCampaign'?: string; - /** - * Pass the set of attributes to customize the type classic campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. Only available if \'type\' is \'classic\'. It\'s considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of \'subject\', \'htmlContent/htmlUrl\', \'sender.name\' & \'toField\' - */ - 'params'?: object; - /** - * Set this to true if you want to send your campaign at best time. - */ - 'sendAtBestTime'?: boolean = false; - /** - * Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. \'subjectA\', \'subjectB\', \'splitRule\', \'winnerCriteria\' & \'winnerDelay\' will be considered when abTesting is set to true. \'subjectA\' & \'subjectB\' are mandatory together & \'subject\' if passed is ignored. Can be set to true only if \'sendAtBestTime\' is \'false\'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B - */ - 'abTesting'?: boolean = false; - /** - * Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value - */ - 'subjectA'?: string; - /** - * Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value - */ - 'subjectB'?: string; - /** - * Add the size of your test groups. Mandatory if abTesting = true & \'recipients\' is passed. We\'ll send version A and B to a random sample of recipients, and then the winning version to everyone else - */ - 'splitRule'?: number; - /** - * Choose the metrics that will determinate the winning version. Mandatory if \'splitRule\' >= 1 and < 50. If splitRule = 50, \'winnerCriteria\' is ignored if passed - */ - 'winnerCriteria'?: CreateEmailCampaign.WinnerCriteriaEnum; - /** - * Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if \'splitRule\' >= 1 and < 50. If splitRule = 50, \'winnerDelay\' is ignored if passed - */ - 'winnerDelay'?: number; - /** - * Available for dedicated ip clients. Set this to true if you wish to warm up your ip. - */ - 'ipWarmupEnable'?: boolean = false; - /** - * Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. - */ - 'initialQuota'?: number; - /** - * Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. - */ - 'increaseRate'?: number; - /** - * Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used. - */ - 'unsubscriptionPageId'?: string; - /** - * Mandatory if templateId is used containing the {{ update_profile }} tag. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used. - */ - 'updateFormId'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "CreateEmailCampaignSender" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "htmlUrl", - "baseName": "htmlUrl", - "type": "string" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "previewText", - "baseName": "previewText", - "type": "string" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "CreateEmailCampaignRecipients" - }, - { - "name": "attachmentUrl", - "baseName": "attachmentUrl", - "type": "string" - }, - { - "name": "inlineImageActivation", - "baseName": "inlineImageActivation", - "type": "boolean" - }, - { - "name": "mirrorActive", - "baseName": "mirrorActive", - "type": "boolean" - }, - { - "name": "footer", - "baseName": "footer", - "type": "string" - }, - { - "name": "header", - "baseName": "header", - "type": "string" - }, - { - "name": "utmCampaign", - "baseName": "utmCampaign", - "type": "string" - }, - { - "name": "params", - "baseName": "params", - "type": "object" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" - }, - { - "name": "subjectB", - "baseName": "subjectB", - "type": "string" - }, - { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "CreateEmailCampaign.WinnerCriteriaEnum" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", - "type": "number" - }, - { - "name": "ipWarmupEnable", - "baseName": "ipWarmupEnable", - "type": "boolean" - }, - { - "name": "initialQuota", - "baseName": "initialQuota", - "type": "number" - }, - { - "name": "increaseRate", - "baseName": "increaseRate", - "type": "number" - }, - { - "name": "unsubscriptionPageId", - "baseName": "unsubscriptionPageId", - "type": "string" - }, - { - "name": "updateFormId", - "baseName": "updateFormId", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateEmailCampaign.attributeTypeMap; - } -} - -export namespace CreateEmailCampaign { - export enum WinnerCriteriaEnum { - Open = 'open', - Click = 'click' - } -} diff --git a/model/createEmailCampaignRecipients.ts b/model/createEmailCampaignRecipients.ts deleted file mode 100644 index b6e208c..0000000 --- a/model/createEmailCampaignRecipients.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Segment ids and List ids to include/exclude from campaign -*/ -export class CreateEmailCampaignRecipients { - /** - * List ids to exclude from the campaign - */ - 'exclusionListIds'?: Array; - /** - * Mandatory if scheduledAt is not empty. List Ids to send the campaign to - */ - 'listIds'?: Array; - /** - * Mandatory if listIds are not used. Segment ids to send the campaign to. - */ - 'segmentIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "exclusionListIds", - "baseName": "exclusionListIds", - "type": "Array" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "segmentIds", - "baseName": "segmentIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateEmailCampaignRecipients.attributeTypeMap; - } -} - diff --git a/model/createEmailCampaignSender.ts b/model/createEmailCampaignSender.ts deleted file mode 100644 index 5357654..0000000 --- a/model/createEmailCampaignSender.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Sender details including id or email and name (optional). Only one of either Sender\'s email or Sender\'s ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` -*/ -export class CreateEmailCampaignSender { - /** - * Sender Name - */ - 'name'?: string; - /** - * Sender email - */ - 'email': string; - /** - * Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateEmailCampaignSender.attributeTypeMap; - } -} - diff --git a/model/createExternalFeed.ts b/model/createExternalFeed.ts deleted file mode 100644 index 28938be..0000000 --- a/model/createExternalFeed.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExternalFeedByUUIDHeadersInner } from './getExternalFeedByUUIDHeadersInner'; - -export class CreateExternalFeed { - /** - * Name of the feed - */ - 'name': string; - /** - * URL of the feed - */ - 'url': string; - /** - * Auth type of the feed: * `basic` * `token` * `noAuth` - */ - 'authType'?: CreateExternalFeed.AuthTypeEnum = CreateExternalFeed.AuthTypeEnum.NoAuth; - /** - * Username for authType `basic` - */ - 'username'?: string; - /** - * Password for authType `basic` - */ - 'password'?: string; - /** - * Token for authType `token` - */ - 'token'?: string; - /** - * Custom headers for the feed - */ - 'headers'?: Array; - /** - * Maximum number of retries on the feed url - */ - 'maxRetries'?: number; - /** - * Toggle caching of feed url response - */ - 'cache'?: boolean = false; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "authType", - "baseName": "authType", - "type": "CreateExternalFeed.AuthTypeEnum" - }, - { - "name": "username", - "baseName": "username", - "type": "string" - }, - { - "name": "password", - "baseName": "password", - "type": "string" - }, - { - "name": "token", - "baseName": "token", - "type": "string" - }, - { - "name": "headers", - "baseName": "headers", - "type": "Array" - }, - { - "name": "maxRetries", - "baseName": "maxRetries", - "type": "number" - }, - { - "name": "cache", - "baseName": "cache", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateExternalFeed.attributeTypeMap; - } -} - -export namespace CreateExternalFeed { - export enum AuthTypeEnum { - Basic = 'basic', - Token = 'token', - NoAuth = 'noAuth' - } -} diff --git a/model/createExternalFeed201Response.ts b/model/createExternalFeed201Response.ts deleted file mode 100644 index 759aec9..0000000 --- a/model/createExternalFeed201Response.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateExternalFeed201Response { - /** - * ID of the object created - */ - 'id': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateExternalFeed201Response.attributeTypeMap; - } -} - diff --git a/model/createList.ts b/model/createList.ts deleted file mode 100644 index 3cb851b..0000000 --- a/model/createList.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateList { - /** - * Name of the list - */ - 'name': string; - /** - * Id of the parent folder in which this list is to be created - */ - 'folderId': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "folderId", - "baseName": "folderId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateList.attributeTypeMap; - } -} - diff --git a/model/createModel.ts b/model/createModel.ts deleted file mode 100644 index 12e5fe6..0000000 --- a/model/createModel.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateModel { - /** - * ID of the object created - */ - 'id': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateModel.attributeTypeMap; - } -} - diff --git a/model/createPaymentRequest.ts b/model/createPaymentRequest.ts deleted file mode 100644 index eb26ffa..0000000 --- a/model/createPaymentRequest.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { Cart } from './cart'; -import { Configuration } from './configuration'; -import { Notification } from './notification'; - -export class CreatePaymentRequest { - /** - * Reference of the payment request, it will appear on the payment page. - */ - 'reference': string; - 'cart': Cart; - /** - * Brevo ID of the contact requested to pay. - */ - 'contactId': number; - /** - * description of payment request. - */ - 'description'?: string; - 'notification'?: Notification; - 'configuration'?: Configuration; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "reference", - "baseName": "reference", - "type": "string" - }, - { - "name": "cart", - "baseName": "cart", - "type": "Cart" - }, - { - "name": "contactId", - "baseName": "contactId", - "type": "number" - }, - { - "name": "description", - "baseName": "description", - "type": "string" - }, - { - "name": "notification", - "baseName": "notification", - "type": "Notification" - }, - { - "name": "configuration", - "baseName": "configuration", - "type": "Configuration" - } ]; - - static getAttributeTypeMap() { - return CreatePaymentRequest.attributeTypeMap; - } -} - diff --git a/model/createPaymentResponse.ts b/model/createPaymentResponse.ts deleted file mode 100644 index 3d6a63a..0000000 --- a/model/createPaymentResponse.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreatePaymentResponse { - /** - * ID of the object created - */ - 'id': string; - /** - * URL of the payment request created - */ - 'url'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreatePaymentResponse.attributeTypeMap; - } -} - diff --git a/model/createProductModel.ts b/model/createProductModel.ts deleted file mode 100644 index b6d4d84..0000000 --- a/model/createProductModel.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateProductModel { - /** - * ID of the Product when a new product is created - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateProductModel.attributeTypeMap; - } -} - diff --git a/model/createReseller.ts b/model/createReseller.ts deleted file mode 100644 index d745c97..0000000 --- a/model/createReseller.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateReseller { - /** - * AuthKey of Reseller child created - */ - 'authKey': string; - /** - * Id of Reseller child created - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "authKey", - "baseName": "authKey", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateReseller.attributeTypeMap; - } -} - diff --git a/model/createSender.ts b/model/createSender.ts deleted file mode 100644 index ac5d084..0000000 --- a/model/createSender.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateSenderIpsInner } from './createSenderIpsInner'; - -export class CreateSender { - /** - * From Name to use for the sender - */ - 'name': string; - /** - * From email to use for the sender. A verification email will be sent to this address. - */ - 'email': string; - /** - * Mandatory in case of dedicated IP, IPs to associate to the sender - */ - 'ips'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "ips", - "baseName": "ips", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateSender.attributeTypeMap; - } -} - diff --git a/model/createSenderIpsInner.ts b/model/createSenderIpsInner.ts deleted file mode 100644 index 0a935b9..0000000 --- a/model/createSenderIpsInner.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateSenderIpsInner { - /** - * Dedicated IP available in your account - */ - 'ip': string; - /** - * Domain of the IP - */ - 'domain': string; - /** - * Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it\'s not passed, the sending will be equally balanced on all IPs. - */ - 'weight'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "domain", - "baseName": "domain", - "type": "string" - }, - { - "name": "weight", - "baseName": "weight", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateSenderIpsInner.attributeTypeMap; - } -} - diff --git a/model/createSenderModel.ts b/model/createSenderModel.ts deleted file mode 100644 index 64127df..0000000 --- a/model/createSenderModel.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateSenderModel { - /** - * ID of the Sender created - */ - 'id': number; - /** - * Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) - */ - 'spfError'?: boolean; - /** - * Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) - */ - 'dkimError'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "spfError", - "baseName": "spfError", - "type": "boolean" - }, - { - "name": "dkimError", - "baseName": "dkimError", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateSenderModel.attributeTypeMap; - } -} - diff --git a/model/createSmsCampaign.ts b/model/createSmsCampaign.ts deleted file mode 100644 index fac3add..0000000 --- a/model/createSmsCampaign.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateSmsCampaignRecipients } from './createSmsCampaignRecipients'; - -export class CreateSmsCampaign { - /** - * Name of the campaign - */ - 'name': string; - /** - * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** - */ - 'sender': string; - /** - * Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS - */ - 'content': string; - 'recipients'?: CreateSmsCampaignRecipients; - /** - * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - */ - 'scheduledAt'?: string; - /** - * Format of the message. It indicates whether the content should be treated as unicode or not. - */ - 'unicodeEnabled'?: boolean = false; - /** - * A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** - */ - 'organisationPrefix'?: string; - /** - * Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** - */ - 'unsubscribeInstruction'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "CreateSmsCampaignRecipients" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "unicodeEnabled", - "baseName": "unicodeEnabled", - "type": "boolean" - }, - { - "name": "organisationPrefix", - "baseName": "organisationPrefix", - "type": "string" - }, - { - "name": "unsubscribeInstruction", - "baseName": "unsubscribeInstruction", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateSmsCampaign.attributeTypeMap; - } -} - diff --git a/model/createSmsCampaignRecipients.ts b/model/createSmsCampaignRecipients.ts deleted file mode 100644 index f516914..0000000 --- a/model/createSmsCampaignRecipients.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateSmsCampaignRecipients { - /** - * Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty - */ - 'listIds': Array; - /** - * List ids which have to be excluded from a campaign - */ - 'exclusionListIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "exclusionListIds", - "baseName": "exclusionListIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateSmsCampaignRecipients.attributeTypeMap; - } -} - diff --git a/model/createSmtpEmail.ts b/model/createSmtpEmail.ts deleted file mode 100644 index d89236b..0000000 --- a/model/createSmtpEmail.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateSmtpEmail { - /** - * Message ID of the transactional email sent - */ - 'messageId'?: string; - 'messageIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - }, - { - "name": "messageIds", - "baseName": "messageIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateSmtpEmail.attributeTypeMap; - } -} - diff --git a/model/createSmtpTemplate.ts b/model/createSmtpTemplate.ts deleted file mode 100644 index 1eb9961..0000000 --- a/model/createSmtpTemplate.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateSmtpTemplateSender } from './createSmtpTemplateSender'; - -export class CreateSmtpTemplate { - /** - * Tag of the template - */ - 'tag'?: string; - 'sender': CreateSmtpTemplateSender; - /** - * Name of the template - */ - 'templateName': string; - /** - * Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty - */ - 'htmlContent'?: string; - /** - * Url which contents the body of the email message. REQUIRED if htmlContent is empty - */ - 'htmlUrl'?: string; - /** - * Subject of the template - */ - 'subject': string; - /** - * Email on which campaign recipients will be able to reply to - */ - 'replyTo'?: string; - /** - * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter \'params\' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization - */ - 'toField'?: string; - /** - * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps - */ - 'attachmentUrl'?: string; - /** - * Status of template. isActive = true means template is active and isActive = false means template is inactive - */ - 'isActive'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "CreateSmtpTemplateSender" - }, - { - "name": "templateName", - "baseName": "templateName", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "htmlUrl", - "baseName": "htmlUrl", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "attachmentUrl", - "baseName": "attachmentUrl", - "type": "string" - }, - { - "name": "isActive", - "baseName": "isActive", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateSmtpTemplate.attributeTypeMap; - } -} - diff --git a/model/createSmtpTemplateSender.ts b/model/createSmtpTemplateSender.ts deleted file mode 100644 index 50ce357..0000000 --- a/model/createSmtpTemplateSender.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Sender details including id or email and name (optional). Only one of either Sender\'s email or Sender\'s ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` -*/ -export class CreateSmtpTemplateSender { - /** - * Name of the sender. If not passed, will be set to default - */ - 'name'?: string; - /** - * Email of the sender - */ - 'email'?: string; - /** - * Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateSmtpTemplateSender.attributeTypeMap; - } -} - diff --git a/model/createSubAccount.ts b/model/createSubAccount.ts deleted file mode 100644 index 5bfa721..0000000 --- a/model/createSubAccount.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateSubAccount { - /** - * Set the name of the sub-account company - */ - 'companyName': string; - /** - * Email address for the organization - */ - 'email': string; - /** - * Set the language of the sub-account - */ - 'language'?: CreateSubAccount.LanguageEnum; - /** - * Set the timezone of the sub-account - */ - 'timezone'?: string; - /** - * Set the group(s) for the sub-account - */ - 'groupIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "language", - "baseName": "language", - "type": "CreateSubAccount.LanguageEnum" - }, - { - "name": "timezone", - "baseName": "timezone", - "type": "string" - }, - { - "name": "groupIds", - "baseName": "groupIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateSubAccount.attributeTypeMap; - } -} - -export namespace CreateSubAccount { - export enum LanguageEnum { - En = 'en', - Fr = 'fr', - It = 'it', - Es = 'es', - Pt = 'pt', - De = 'de' - } -} diff --git a/model/createSubAccountResponse.ts b/model/createSubAccountResponse.ts deleted file mode 100644 index a318ac0..0000000 --- a/model/createSubAccountResponse.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateSubAccountResponse { - /** - * ID of the sub-account created - */ - 'id': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateSubAccountResponse.attributeTypeMap; - } -} - diff --git a/model/createUpdateBatchCategory.ts b/model/createUpdateBatchCategory.ts deleted file mode 100644 index 4ad9bcf..0000000 --- a/model/createUpdateBatchCategory.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateUpdateCategories } from './createUpdateCategories'; - -export class CreateUpdateBatchCategory { - /** - * array of categories objects - */ - 'categories': Array; - /** - * Facilitate to update the existing categories in the same request (updateEnabled = true) - */ - 'updateEnabled'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "categories", - "baseName": "categories", - "type": "Array" - }, - { - "name": "updateEnabled", - "baseName": "updateEnabled", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateBatchCategory.attributeTypeMap; - } -} - diff --git a/model/createUpdateBatchCategoryModel.ts b/model/createUpdateBatchCategoryModel.ts deleted file mode 100644 index 59a5e18..0000000 --- a/model/createUpdateBatchCategoryModel.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateUpdateBatchCategoryModel { - /** - * Number of the new created categories - */ - 'createdCount'?: number; - /** - * Number of the existing categories updated - */ - 'updatedCount'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "createdCount", - "baseName": "createdCount", - "type": "number" - }, - { - "name": "updatedCount", - "baseName": "updatedCount", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateBatchCategoryModel.attributeTypeMap; - } -} - diff --git a/model/createUpdateBatchProducts.ts b/model/createUpdateBatchProducts.ts deleted file mode 100644 index b62a933..0000000 --- a/model/createUpdateBatchProducts.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateUpdateProducts } from './createUpdateProducts'; - -export class CreateUpdateBatchProducts { - /** - * array of products objects - */ - 'products': Array; - /** - * Facilitate to update the existing categories in the same request (updateEnabled = true) - */ - 'updateEnabled'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "products", - "baseName": "products", - "type": "Array" - }, - { - "name": "updateEnabled", - "baseName": "updateEnabled", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateBatchProducts.attributeTypeMap; - } -} - diff --git a/model/createUpdateBatchProductsModel.ts b/model/createUpdateBatchProductsModel.ts deleted file mode 100644 index 3605f61..0000000 --- a/model/createUpdateBatchProductsModel.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateUpdateBatchProductsModel { - /** - * Number of the new created products - */ - 'createdCount'?: number; - /** - * Number of the existing products updated - */ - 'updatedCount'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "createdCount", - "baseName": "createdCount", - "type": "number" - }, - { - "name": "updatedCount", - "baseName": "updatedCount", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateBatchProductsModel.attributeTypeMap; - } -} - diff --git a/model/createUpdateCategories.ts b/model/createUpdateCategories.ts deleted file mode 100644 index 9142b25..0000000 --- a/model/createUpdateCategories.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateUpdateCategories { - /** - * Unique Category ID as saved in the shop - */ - 'id': string; - /** - * **Mandatory in case of creation**. Name of the Category, as displayed in the shop - */ - 'name'?: string; - /** - * URL to the category - */ - 'url'?: string; - /** - * UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop\'s database - */ - 'deletedAt'?: string; - /** - * category deleted from the shop\'s database - */ - 'isDeleted'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "deletedAt", - "baseName": "deletedAt", - "type": "string" - }, - { - "name": "isDeleted", - "baseName": "isDeleted", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateCategories.attributeTypeMap; - } -} - diff --git a/model/createUpdateCategory.ts b/model/createUpdateCategory.ts deleted file mode 100644 index b8e89ab..0000000 --- a/model/createUpdateCategory.ts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateUpdateCategory { - /** - * Unique Category ID as saved in the shop - */ - 'id': string; - /** - * **Mandatory in case of creation**. Name of the Category, as displayed in the shop - */ - 'name'?: string; - /** - * URL to the category - */ - 'url'?: string; - /** - * Facilitate to update the existing category in the same request (updateEnabled = true) - */ - 'updateEnabled'?: boolean = false; - /** - * UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop\'s database - */ - 'deletedAt'?: string; - /** - * category deleted from the shop\'s database - */ - 'isDeleted'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "updateEnabled", - "baseName": "updateEnabled", - "type": "boolean" - }, - { - "name": "deletedAt", - "baseName": "deletedAt", - "type": "string" - }, - { - "name": "isDeleted", - "baseName": "isDeleted", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateCategory.attributeTypeMap; - } -} - diff --git a/model/createUpdateContactModel.ts b/model/createUpdateContactModel.ts deleted file mode 100644 index 75ee9a3..0000000 --- a/model/createUpdateContactModel.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateUpdateContactModel { - /** - * ID of the contact when a new contact is created - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateContactModel.attributeTypeMap; - } -} - diff --git a/model/createUpdateFolder.ts b/model/createUpdateFolder.ts deleted file mode 100644 index 878a2d6..0000000 --- a/model/createUpdateFolder.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateUpdateFolder { - /** - * Name of the folder - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateFolder.attributeTypeMap; - } -} - diff --git a/model/createUpdateProduct.ts b/model/createUpdateProduct.ts deleted file mode 100644 index c3b7889..0000000 --- a/model/createUpdateProduct.ts +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateUpdateProduct { - /** - * Product ID for which you requested the details - */ - 'id': string; - /** - * Mandatory in case of creation**. Name of the product for which you requested the details - */ - 'name': string; - /** - * URL to the product - */ - 'url'?: string; - /** - * Absolute URL to the cover image of the product - */ - 'imageUrl'?: string; - /** - * Product identifier from the shop - */ - 'sku'?: string; - /** - * Price of the product - */ - 'price'?: number; - /** - * Category ID-s of the product - */ - 'categories'?: Array; - /** - * Parent product id of the product - */ - 'parentId'?: string; - /** - * Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. - */ - 'metaInfo'?: { [key: string]: string; }; - /** - * Facilitate to update the existing category in the same request (updateEnabled = true) - */ - 'updateEnabled'?: boolean = false; - /** - * UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop\'s database - */ - 'deletedAt'?: string; - /** - * product deleted from the shop\'s database - */ - 'isDeleted'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "imageUrl", - "baseName": "imageUrl", - "type": "string" - }, - { - "name": "sku", - "baseName": "sku", - "type": "string" - }, - { - "name": "price", - "baseName": "price", - "type": "number" - }, - { - "name": "categories", - "baseName": "categories", - "type": "Array" - }, - { - "name": "parentId", - "baseName": "parentId", - "type": "string" - }, - { - "name": "metaInfo", - "baseName": "metaInfo", - "type": "{ [key: string]: string; }" - }, - { - "name": "updateEnabled", - "baseName": "updateEnabled", - "type": "boolean" - }, - { - "name": "deletedAt", - "baseName": "deletedAt", - "type": "string" - }, - { - "name": "isDeleted", - "baseName": "isDeleted", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateProduct.attributeTypeMap; - } -} - diff --git a/model/createUpdateProducts.ts b/model/createUpdateProducts.ts deleted file mode 100644 index ac477a0..0000000 --- a/model/createUpdateProducts.ts +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateUpdateProducts { - /** - * Product ID for which you requested the details - */ - 'id': string; - /** - * Mandatory in case of creation**. Name of the product for which you requested the details - */ - 'name': string; - /** - * URL to the product - */ - 'url'?: string; - /** - * Absolute URL to the cover image of the product - */ - 'imageUrl'?: string; - /** - * Product identifier from the shop - */ - 'sku'?: string; - /** - * Price of the product - */ - 'price'?: number; - /** - * Category ID-s of the product - */ - 'categories'?: Array; - /** - * Parent product id of the product - */ - 'parentId'?: string; - /** - * Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 10. - */ - 'metaInfo'?: { [key: string]: string; }; - /** - * UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop\'s database - */ - 'deletedAt'?: string; - /** - * product deleted from the shop\'s database - */ - 'isDeleted'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "imageUrl", - "baseName": "imageUrl", - "type": "string" - }, - { - "name": "sku", - "baseName": "sku", - "type": "string" - }, - { - "name": "price", - "baseName": "price", - "type": "number" - }, - { - "name": "categories", - "baseName": "categories", - "type": "Array" - }, - { - "name": "parentId", - "baseName": "parentId", - "type": "string" - }, - { - "name": "metaInfo", - "baseName": "metaInfo", - "type": "{ [key: string]: string; }" - }, - { - "name": "deletedAt", - "baseName": "deletedAt", - "type": "string" - }, - { - "name": "isDeleted", - "baseName": "isDeleted", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return CreateUpdateProducts.attributeTypeMap; - } -} - diff --git a/model/createWebhook.ts b/model/createWebhook.ts deleted file mode 100644 index 1839c8b..0000000 --- a/model/createWebhook.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetWebhookAuth } from './getWebhookAuth'; -import { GetWebhookHeadersInner } from './getWebhookHeadersInner'; - -export class CreateWebhook { - /** - * URL of the webhook - */ - 'url': string; - /** - * Description of the webhook - */ - 'description'?: string; - /** - * - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` - */ - 'events': Array; - /** - * Type of the webhook - */ - 'type'?: CreateWebhook.TypeEnum = CreateWebhook.TypeEnum.Transactional; - /** - * Inbound domain of webhook, required in case of event type `inbound` - */ - 'domain'?: string; - /** - * To send batched webhooks - */ - 'batched'?: boolean; - 'auth'?: GetWebhookAuth; - /** - * Custom headers to be send with webhooks - */ - 'headers'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "description", - "baseName": "description", - "type": "string" - }, - { - "name": "events", - "baseName": "events", - "type": "Array" - }, - { - "name": "type", - "baseName": "type", - "type": "CreateWebhook.TypeEnum" - }, - { - "name": "domain", - "baseName": "domain", - "type": "string" - }, - { - "name": "batched", - "baseName": "batched", - "type": "boolean" - }, - { - "name": "auth", - "baseName": "auth", - "type": "GetWebhookAuth" - }, - { - "name": "headers", - "baseName": "headers", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateWebhook.attributeTypeMap; - } -} - -export namespace CreateWebhook { - export enum EventsEnum { - Sent = 'sent', - HardBounce = 'hardBounce', - SoftBounce = 'softBounce', - Blocked = 'blocked', - Spam = 'spam', - Delivered = 'delivered', - Request = 'request', - Click = 'click', - Invalid = 'invalid', - Deferred = 'deferred', - Opened = 'opened', - UniqueOpened = 'uniqueOpened', - Unsubscribed = 'unsubscribed', - ListAddition = 'listAddition', - ContactUpdated = 'contactUpdated', - ContactDeleted = 'contactDeleted', - InboundEmailProcessed = 'inboundEmailProcessed' - } - export enum TypeEnum { - Transactional = 'transactional', - Marketing = 'marketing', - Inbound = 'inbound' - } -} diff --git a/model/createWhatsAppCampaign.ts b/model/createWhatsAppCampaign.ts deleted file mode 100644 index 8f7c523..0000000 --- a/model/createWhatsAppCampaign.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateWhatsAppCampaignRecipients } from './createWhatsAppCampaignRecipients'; - -export class CreateWhatsAppCampaign { - /** - * Name of the WhatsApp campaign creation - */ - 'name': string; - /** - * Id of the WhatsApp template in **approved** state - */ - 'templateId': number; - /** - * Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** - */ - 'scheduledAt': string; - 'recipients': CreateWhatsAppCampaignRecipients; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "CreateWhatsAppCampaignRecipients" - } ]; - - static getAttributeTypeMap() { - return CreateWhatsAppCampaign.attributeTypeMap; - } -} - diff --git a/model/createWhatsAppCampaignRecipients.ts b/model/createWhatsAppCampaignRecipients.ts deleted file mode 100644 index b8ef862..0000000 --- a/model/createWhatsAppCampaignRecipients.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Segment ids and List ids to include/exclude from campaign -*/ -export class CreateWhatsAppCampaignRecipients { - /** - * List ids to exclude from the campaign - */ - 'excludedListIds'?: Array; - /** - * **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to - */ - 'listIds'?: Array; - /** - * **Mandatory if listIds are not used**. Segment ids to send the campaign to. - */ - 'segments'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "excludedListIds", - "baseName": "excludedListIds", - "type": "Array" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "segments", - "baseName": "segments", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CreateWhatsAppCampaignRecipients.attributeTypeMap; - } -} - diff --git a/model/createWhatsAppTemplate.ts b/model/createWhatsAppTemplate.ts deleted file mode 100644 index 93fa8b7..0000000 --- a/model/createWhatsAppTemplate.ts +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreateWhatsAppTemplate { - /** - * Name of the template - */ - 'name': string; - /** - * Language of the template. For Example : **en** for English - */ - 'language': string; - /** - * Category of the template - */ - 'category': CreateWhatsAppTemplate.CategoryEnum; - /** - * Absolute url of the media file **(no local file)** for the header. **Use this field in you want to add media in Template header and headerText is empty.** Allowed extensions for media files are: #### jpeg | png | mp4 | pdf - */ - 'mediaUrl'?: string; - /** - * Body of the template. **Maximum allowed characters are 1024** - */ - 'bodyText': string; - /** - * Text content of the header in the template. **Maximum allowed characters are 45** **Use this field to add text content in template header and if mediaUrl is empty** - */ - 'headerText'?: string; - /** - * source of the template - */ - 'source'?: CreateWhatsAppTemplate.SourceEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "language", - "baseName": "language", - "type": "string" - }, - { - "name": "category", - "baseName": "category", - "type": "CreateWhatsAppTemplate.CategoryEnum" - }, - { - "name": "mediaUrl", - "baseName": "mediaUrl", - "type": "string" - }, - { - "name": "bodyText", - "baseName": "bodyText", - "type": "string" - }, - { - "name": "headerText", - "baseName": "headerText", - "type": "string" - }, - { - "name": "source", - "baseName": "source", - "type": "CreateWhatsAppTemplate.SourceEnum" - } ]; - - static getAttributeTypeMap() { - return CreateWhatsAppTemplate.attributeTypeMap; - } -} - -export namespace CreateWhatsAppTemplate { - export enum CategoryEnum { - Marketing = 'MARKETING', - Utility = 'UTILITY' - } - export enum SourceEnum { - Automation = 'Automation', - Conversations = 'Conversations' - } -} diff --git a/model/createdBatchId.ts b/model/createdBatchId.ts deleted file mode 100644 index fabe7d9..0000000 --- a/model/createdBatchId.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreatedBatchId { - /** - * Batch ID of the request - */ - 'batchId': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "batchId", - "baseName": "batchId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreatedBatchId.attributeTypeMap; - } -} - diff --git a/model/createdProcessId.ts b/model/createdProcessId.ts deleted file mode 100644 index cb2d77d..0000000 --- a/model/createdProcessId.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CreatedProcessId { - /** - * Id of the process created - */ - 'processId': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "processId", - "baseName": "processId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return CreatedProcessId.attributeTypeMap; - } -} - diff --git a/model/crmDealsIdPatchRequest.ts b/model/crmDealsIdPatchRequest.ts deleted file mode 100644 index 1b57108..0000000 --- a/model/crmDealsIdPatchRequest.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CrmDealsIdPatchRequest { - /** - * Name of deal - */ - 'name'?: string; - /** - * Attributes for deal update To assign owner of a Deal you can send attributes.deal_owner and utilize the account email or ID. If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` - */ - 'attributes'?: object; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - } ]; - - static getAttributeTypeMap() { - return CrmDealsIdPatchRequest.attributeTypeMap; - } -} - diff --git a/model/crmDealsLinkUnlinkIdPatchRequest.ts b/model/crmDealsLinkUnlinkIdPatchRequest.ts deleted file mode 100644 index 1b9b357..0000000 --- a/model/crmDealsLinkUnlinkIdPatchRequest.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CrmDealsLinkUnlinkIdPatchRequest { - /** - * Contact ids for contacts to be linked with deal - */ - 'linkContactIds'?: Array; - /** - * Contact ids for contacts to be unlinked from deal - */ - 'unlinkContactIds'?: Array; - /** - * Company ids to be linked with deal - */ - 'linkCompanyIds'?: Array; - /** - * Company ids to be unlinked from deal - */ - 'unlinkCompanyIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "linkContactIds", - "baseName": "linkContactIds", - "type": "Array" - }, - { - "name": "unlinkContactIds", - "baseName": "unlinkContactIds", - "type": "Array" - }, - { - "name": "linkCompanyIds", - "baseName": "linkCompanyIds", - "type": "Array" - }, - { - "name": "unlinkCompanyIds", - "baseName": "unlinkCompanyIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CrmDealsLinkUnlinkIdPatchRequest.attributeTypeMap; - } -} - diff --git a/model/crmDealsPost201Response.ts b/model/crmDealsPost201Response.ts deleted file mode 100644 index 912c110..0000000 --- a/model/crmDealsPost201Response.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Created deal id -*/ -export class CrmDealsPost201Response { - /** - * Unique deal id - */ - 'id': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CrmDealsPost201Response.attributeTypeMap; - } -} - diff --git a/model/crmDealsPostRequest.ts b/model/crmDealsPostRequest.ts deleted file mode 100644 index 129b40a..0000000 --- a/model/crmDealsPostRequest.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CrmDealsPostRequest { - /** - * Name of deal - */ - 'name': string; - /** - * Attributes for deal creation To assign owner of a Deal you can send attributes.deal_owner and utilize the account email or ID. If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` - */ - 'attributes'?: object; - /** - * Contact ids to be linked with deal - */ - 'linkedContactsIds'?: Array; - /** - * Company ids to be linked with deal - */ - 'linkedCompaniesIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "linkedContactsIds", - "baseName": "linkedContactsIds", - "type": "Array" - }, - { - "name": "linkedCompaniesIds", - "baseName": "linkedCompaniesIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CrmDealsPostRequest.attributeTypeMap; - } -} - diff --git a/model/crmTasksIdPatchRequest.ts b/model/crmTasksIdPatchRequest.ts deleted file mode 100644 index 6b8992d..0000000 --- a/model/crmTasksIdPatchRequest.ts +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class CrmTasksIdPatchRequest { - /** - * Name of task - */ - 'name'?: string; - /** - * Duration of task in milliseconds [1 minute = 60000 ms] - */ - 'duration'?: number; - /** - * Id for type of task e.g Call / Email / Meeting etc. - */ - 'taskTypeId'?: string; - /** - * Task date/time - */ - 'date'?: Date; - /** - * Notes added to a task - */ - 'notes'?: string; - /** - * Task marked as done - */ - 'done'?: boolean; - /** - * To assign a task to a user you can use either the account email or ID. - */ - 'assignToId'?: string; - /** - * Contact ids for contacts linked to this task - */ - 'contactsIds'?: Array; - /** - * Deal ids for deals a task is linked to - */ - 'dealsIds'?: Array; - /** - * Companies ids for companies a task is linked to - */ - 'companiesIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "duration", - "baseName": "duration", - "type": "number" - }, - { - "name": "taskTypeId", - "baseName": "taskTypeId", - "type": "string" - }, - { - "name": "date", - "baseName": "date", - "type": "Date" - }, - { - "name": "notes", - "baseName": "notes", - "type": "string" - }, - { - "name": "done", - "baseName": "done", - "type": "boolean" - }, - { - "name": "assignToId", - "baseName": "assignToId", - "type": "string" - }, - { - "name": "contactsIds", - "baseName": "contactsIds", - "type": "Array" - }, - { - "name": "dealsIds", - "baseName": "dealsIds", - "type": "Array" - }, - { - "name": "companiesIds", - "baseName": "companiesIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CrmTasksIdPatchRequest.attributeTypeMap; - } -} - diff --git a/model/crmTasksPost201Response.ts b/model/crmTasksPost201Response.ts deleted file mode 100644 index c11fabb..0000000 --- a/model/crmTasksPost201Response.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Task Details -*/ -export class CrmTasksPost201Response { - /** - * Unique task id - */ - 'id': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return CrmTasksPost201Response.attributeTypeMap; - } -} - diff --git a/model/crmTasksPostRequest.ts b/model/crmTasksPostRequest.ts deleted file mode 100644 index b3a3358..0000000 --- a/model/crmTasksPostRequest.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { TaskReminder } from './taskReminder'; - -export class CrmTasksPostRequest { - /** - * Name of task - */ - 'name': string; - /** - * Duration of task in milliseconds [1 minute = 60000 ms] - */ - 'duration'?: number; - /** - * Id for type of task e.g Call / Email / Meeting etc. - */ - 'taskTypeId': string; - /** - * Task due date and time - */ - 'date': Date; - /** - * Notes added to a task - */ - 'notes'?: string; - /** - * Task marked as done - */ - 'done'?: boolean; - /** - * To assign a task to a user you can use either the account email or ID. - */ - 'assignToId'?: string; - /** - * Contact ids for contacts linked to this task - */ - 'contactsIds'?: Array; - /** - * Deal ids for deals a task is linked to - */ - 'dealsIds'?: Array; - /** - * Companies ids for companies a task is linked to - */ - 'companiesIds'?: Array; - 'reminder'?: TaskReminder; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "duration", - "baseName": "duration", - "type": "number" - }, - { - "name": "taskTypeId", - "baseName": "taskTypeId", - "type": "string" - }, - { - "name": "date", - "baseName": "date", - "type": "Date" - }, - { - "name": "notes", - "baseName": "notes", - "type": "string" - }, - { - "name": "done", - "baseName": "done", - "type": "boolean" - }, - { - "name": "assignToId", - "baseName": "assignToId", - "type": "string" - }, - { - "name": "contactsIds", - "baseName": "contactsIds", - "type": "Array" - }, - { - "name": "dealsIds", - "baseName": "dealsIds", - "type": "Array" - }, - { - "name": "companiesIds", - "baseName": "companiesIds", - "type": "Array" - }, - { - "name": "reminder", - "baseName": "reminder", - "type": "TaskReminder" - } ]; - - static getAttributeTypeMap() { - return CrmTasksPostRequest.attributeTypeMap; - } -} - diff --git a/model/deal.ts b/model/deal.ts deleted file mode 100644 index 9386716..0000000 --- a/model/deal.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Deal Details -*/ -export class Deal { - /** - * Unique deal id - */ - 'id'?: string; - /** - * Deal attributes with values - */ - 'attributes'?: object; - /** - * Contact ids for contacts linked to this deal - */ - 'linkedContactsIds'?: Array; - /** - * Companies ids for companies linked to this deal - */ - 'linkedCompaniesIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "linkedContactsIds", - "baseName": "linkedContactsIds", - "type": "Array" - }, - { - "name": "linkedCompaniesIds", - "baseName": "linkedCompaniesIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return Deal.attributeTypeMap; - } -} - diff --git a/model/dealAttributesInner.ts b/model/dealAttributesInner.ts deleted file mode 100644 index cad46fe..0000000 --- a/model/dealAttributesInner.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* List of attributes -*/ -export class DealAttributesInner { - 'internalName'?: string; - 'label'?: string; - 'attributeTypeName'?: string; - 'attributeOptions'?: Array; - 'isRequired'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "internalName", - "baseName": "internalName", - "type": "string" - }, - { - "name": "label", - "baseName": "label", - "type": "string" - }, - { - "name": "attributeTypeName", - "baseName": "attributeTypeName", - "type": "string" - }, - { - "name": "attributeOptions", - "baseName": "attributeOptions", - "type": "Array" - }, - { - "name": "isRequired", - "baseName": "isRequired", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return DealAttributesInner.attributeTypeMap; - } -} - diff --git a/model/dealsList.ts b/model/dealsList.ts deleted file mode 100644 index a41b95b..0000000 --- a/model/dealsList.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { Deal } from './deal'; - -/** -* List of Deals -*/ -export class DealsList { - /** - * List of deals - */ - 'items'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "items", - "baseName": "items", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return DealsList.attributeTypeMap; - } -} - diff --git a/model/deleteHardbounces.ts b/model/deleteHardbounces.ts deleted file mode 100644 index 59430b9..0000000 --- a/model/deleteHardbounces.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class DeleteHardbounces { - /** - * Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate - */ - 'startDate'?: string; - /** - * Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate - */ - 'endDate'?: string; - /** - * Target a specific email address - */ - 'contactEmail'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "startDate", - "baseName": "startDate", - "type": "string" - }, - { - "name": "endDate", - "baseName": "endDate", - "type": "string" - }, - { - "name": "contactEmail", - "baseName": "contactEmail", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return DeleteHardbounces.attributeTypeMap; - } -} - diff --git a/model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ts b/model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ts deleted file mode 100644 index 0a08e57..0000000 --- a/model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response { - 'id': number; - 'conversionSource': EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ConversionSourceEnum; - 'ordersCount': number; - 'revenue': number; - 'averageBasket': number; - 'newCustomersCount': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "conversionSource", - "baseName": "conversionSource", - "type": "EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ConversionSourceEnum" - }, - { - "name": "ordersCount", - "baseName": "ordersCount", - "type": "number" - }, - { - "name": "revenue", - "baseName": "revenue", - "type": "number" - }, - { - "name": "averageBasket", - "baseName": "averageBasket", - "type": "number" - }, - { - "name": "newCustomersCount", - "baseName": "newCustomersCount", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.attributeTypeMap; - } -} - -export namespace EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response { - export enum ConversionSourceEnum { - EmailCampaign = 'email_campaign' - } -} diff --git a/model/ecommerceAttributionMetricsGet200Response.ts b/model/ecommerceAttributionMetricsGet200Response.ts deleted file mode 100644 index 00cbe77..0000000 --- a/model/ecommerceAttributionMetricsGet200Response.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { ConversionSourceMetrics } from './conversionSourceMetrics'; -import { EcommerceAttributionMetricsGet200ResponseTotals } from './ecommerceAttributionMetricsGet200ResponseTotals'; - -export class EcommerceAttributionMetricsGet200Response { - /** - * List of conversion attribution metrics - */ - 'results': Array; - 'totals': EcommerceAttributionMetricsGet200ResponseTotals; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "results", - "baseName": "results", - "type": "Array" - }, - { - "name": "totals", - "baseName": "totals", - "type": "EcommerceAttributionMetricsGet200ResponseTotals" - } ]; - - static getAttributeTypeMap() { - return EcommerceAttributionMetricsGet200Response.attributeTypeMap; - } -} - diff --git a/model/ecommerceAttributionMetricsGet200ResponseTotals.ts b/model/ecommerceAttributionMetricsGet200ResponseTotals.ts deleted file mode 100644 index 0b9da2f..0000000 --- a/model/ecommerceAttributionMetricsGet200ResponseTotals.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Attribution list aggregated totals -*/ -export class EcommerceAttributionMetricsGet200ResponseTotals { - 'ordersCount': number; - 'revenue': number; - 'averageBasket': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ordersCount", - "baseName": "ordersCount", - "type": "number" - }, - { - "name": "revenue", - "baseName": "revenue", - "type": "number" - }, - { - "name": "averageBasket", - "baseName": "averageBasket", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return EcommerceAttributionMetricsGet200ResponseTotals.attributeTypeMap; - } -} - diff --git a/model/ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.ts b/model/ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.ts deleted file mode 100644 index 78f2541..0000000 --- a/model/ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { ConversionSourceProduct } from './conversionSourceProduct'; - -export class EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response { - /** - * List of attributed products - */ - 'products': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "products", - "baseName": "products", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response.attributeTypeMap; - } -} - diff --git a/model/ecommerceConfigDisplayCurrencyGet200Response.ts b/model/ecommerceConfigDisplayCurrencyGet200Response.ts deleted file mode 100644 index 9b32052..0000000 --- a/model/ecommerceConfigDisplayCurrencyGet200Response.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class EcommerceConfigDisplayCurrencyGet200Response { - /** - * ISO 4217 compliant display currency code - */ - 'code': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "code", - "baseName": "code", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return EcommerceConfigDisplayCurrencyGet200Response.attributeTypeMap; - } -} - diff --git a/model/emailExportRecipients.ts b/model/emailExportRecipients.ts deleted file mode 100644 index cafa3d1..0000000 --- a/model/emailExportRecipients.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class EmailExportRecipients { - /** - * Webhook called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 - */ - 'notifyURL'?: string; - /** - * Type of recipients to export for a campaign - */ - 'recipientsType': EmailExportRecipients.RecipientsTypeEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "notifyURL", - "baseName": "notifyURL", - "type": "string" - }, - { - "name": "recipientsType", - "baseName": "recipientsType", - "type": "EmailExportRecipients.RecipientsTypeEnum" - } ]; - - static getAttributeTypeMap() { - return EmailExportRecipients.attributeTypeMap; - } -} - -export namespace EmailExportRecipients { - export enum RecipientsTypeEnum { - All = 'all', - NonClickers = 'nonClickers', - NonOpeners = 'nonOpeners', - Clickers = 'clickers', - Openers = 'openers', - SoftBounces = 'softBounces', - HardBounces = 'hardBounces', - Unsubscribed = 'unsubscribed' - } -} diff --git a/model/errorModel.ts b/model/errorModel.ts deleted file mode 100644 index fce7753..0000000 --- a/model/errorModel.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ErrorModel { - /** - * Error code displayed in case of a failure - */ - 'code': ErrorModel.CodeEnum; - /** - * Readable message associated to the failure - */ - 'message': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "code", - "baseName": "code", - "type": "ErrorModel.CodeEnum" - }, - { - "name": "message", - "baseName": "message", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ErrorModel.attributeTypeMap; - } -} - -export namespace ErrorModel { - export enum CodeEnum { - InvalidParameter = 'invalid_parameter', - MissingParameter = 'missing_parameter', - OutOfRange = 'out_of_range', - CampaignProcessing = 'campaign_processing', - CampaignSent = 'campaign_sent', - DocumentNotFound = 'document_not_found', - ResellerPermissionDenied = 'reseller_permission_denied', - NotEnoughCredits = 'not_enough_credits', - PermissionDenied = 'permission_denied', - DuplicateParameter = 'duplicate_parameter', - DuplicateRequest = 'duplicate_request', - MethodNotAllowed = 'method_not_allowed', - Unauthorized = 'unauthorized', - AccountUnderValidation = 'account_under_validation', - NotAcceptable = 'not_acceptable', - BadRequest = 'bad_request', - UnprocessableEntity = 'unprocessable_entity' - } -} diff --git a/model/event.ts b/model/event.ts deleted file mode 100644 index c527ae9..0000000 --- a/model/event.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { EventIdentifiers } from './eventIdentifiers'; - -export class Event { - /** - * The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. - */ - 'eventName': string; - /** - * Timestamp of when the event occurred (e.g. \"2024-01-24T17:39:57+01:00\"). If no value is passed, the timestamp of the event creation is used. - */ - 'eventDate'?: string; - 'identifiers': EventIdentifiers; - /** - * Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **\"FIRSTNAME\": \"Jane\" , \"AGE\": 37** - */ - 'contactProperties'?: object; - /** - * Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. \"2024-01-24T17:39:57+01:00\"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. - */ - 'eventProperties'?: object; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "eventName", - "baseName": "event_name", - "type": "string" - }, - { - "name": "eventDate", - "baseName": "event_date", - "type": "string" - }, - { - "name": "identifiers", - "baseName": "identifiers", - "type": "EventIdentifiers" - }, - { - "name": "contactProperties", - "baseName": "contact_properties", - "type": "object" - }, - { - "name": "eventProperties", - "baseName": "event_properties", - "type": "object" - } ]; - - static getAttributeTypeMap() { - return Event.attributeTypeMap; - } -} - diff --git a/model/eventIdentifiers.ts b/model/eventIdentifiers.ts deleted file mode 100644 index 29a3c0f..0000000 --- a/model/eventIdentifiers.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Identifies the contact associated with the event. At least one identifier is required. -*/ -export class EventIdentifiers { - /** - * Email Id associated with the event - */ - 'emailId'?: string; - /** - * SMS associated with the event - */ - 'phoneId'?: string; - /** - * whatsapp associated with the event - */ - 'whatsappId'?: string; - /** - * landline_number associated with the event - */ - 'landlineNumberId'?: string; - /** - * ext_id associated with the event - */ - 'extId'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "emailId", - "baseName": "email_id", - "type": "string" - }, - { - "name": "phoneId", - "baseName": "phone_id", - "type": "string" - }, - { - "name": "whatsappId", - "baseName": "whatsapp_id", - "type": "string" - }, - { - "name": "landlineNumberId", - "baseName": "landline_number_id", - "type": "string" - }, - { - "name": "extId", - "baseName": "ext_id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return EventIdentifiers.attributeTypeMap; - } -} - diff --git a/model/exportWebhooksHistory.ts b/model/exportWebhooksHistory.ts deleted file mode 100644 index 7337361..0000000 --- a/model/exportWebhooksHistory.ts +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ExportWebhooksHistory { - /** - * Number of days in the past including today (positive integer). _Not compatible with \'startDate\' and \'endDate\'_ - */ - 'days'?: number; - /** - * Mandatory if endDate is used. Starting date of the history (YYYY-MM-DD). Must be lower than equal to endDate - */ - 'startDate'?: string; - /** - * Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate - */ - 'endDate'?: string; - /** - * Sorting order of records (asc or desc) - */ - 'sort'?: string; - /** - * Filter the history based on webhook type - */ - 'type': ExportWebhooksHistory.TypeEnum; - /** - * Filter the history for a specific event type - */ - 'event': ExportWebhooksHistory.EventEnum; - /** - * Webhook URL to receive CSV file link - */ - 'notifyURL': string; - /** - * Filter the history for a specific webhook id - */ - 'webhookId'?: number; - /** - * Filter the history for a specific email - */ - 'email'?: string; - /** - * Filter the history for a specific message id. Applicable only for transactional webhooks. - */ - 'messageId'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "days", - "baseName": "days", - "type": "number" - }, - { - "name": "startDate", - "baseName": "startDate", - "type": "string" - }, - { - "name": "endDate", - "baseName": "endDate", - "type": "string" - }, - { - "name": "sort", - "baseName": "sort", - "type": "string" - }, - { - "name": "type", - "baseName": "type", - "type": "ExportWebhooksHistory.TypeEnum" - }, - { - "name": "event", - "baseName": "event", - "type": "ExportWebhooksHistory.EventEnum" - }, - { - "name": "notifyURL", - "baseName": "notifyURL", - "type": "string" - }, - { - "name": "webhookId", - "baseName": "webhookId", - "type": "number" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "messageId", - "baseName": "messageId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return ExportWebhooksHistory.attributeTypeMap; - } -} - -export namespace ExportWebhooksHistory { - export enum TypeEnum { - Transactional = 'transactional', - Marketing = 'marketing' - } - export enum EventEnum { - InvalidParameter = 'invalid_parameter', - MissingParameter = 'missing_parameter', - HardBounce = 'hardBounce', - SoftBounce = 'softBounce', - Delivered = 'delivered', - Spam = 'spam', - Request = 'request', - Opened = 'opened', - Click = 'click', - Invalid = 'invalid', - Deferred = 'deferred', - Blocked = 'blocked', - Unsubscribed = 'unsubscribed', - Error = 'error', - UniqueOpened = 'uniqueOpened', - LoadedByProxy = 'loadedByProxy', - AllEvents = 'allEvents' - } -} diff --git a/model/fileData.ts b/model/fileData.ts deleted file mode 100644 index 68ffe55..0000000 --- a/model/fileData.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* File data that is uploaded -*/ -export class FileData { - /** - * Name of uploaded file - */ - 'name'?: string; - /** - * Account id of user which created the file - */ - 'authorId'?: string; - /** - * Contact id of contact on which file is uploaded - */ - 'contactId'?: number; - /** - * Deal id linked to a file - */ - 'dealId'?: string; - /** - * Company id linked to a file - */ - 'companyId'?: string; - /** - * Size of file in bytes - */ - 'size'?: number; - /** - * File created date/time - */ - 'createdAt'?: Date; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "authorId", - "baseName": "authorId", - "type": "string" - }, - { - "name": "contactId", - "baseName": "contactId", - "type": "number" - }, - { - "name": "dealId", - "baseName": "dealId", - "type": "string" - }, - { - "name": "companyId", - "baseName": "companyId", - "type": "string" - }, - { - "name": "size", - "baseName": "size", - "type": "number" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" - } ]; - - static getAttributeTypeMap() { - return FileData.attributeTypeMap; - } -} - diff --git a/model/fileDownloadableLink.ts b/model/fileDownloadableLink.ts deleted file mode 100644 index 52850b7..0000000 --- a/model/fileDownloadableLink.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class FileDownloadableLink { - /** - * A unique link to download the requested file. - */ - 'fileUrl': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "fileUrl", - "baseName": "fileUrl", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return FileDownloadableLink.attributeTypeMap; - } -} - diff --git a/model/getAccount.ts b/model/getAccount.ts deleted file mode 100644 index b985aed..0000000 --- a/model/getAccount.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetAccountAllOfMarketingAutomation } from './getAccountAllOfMarketingAutomation'; -import { GetAccountAllOfPlan } from './getAccountAllOfPlan'; -import { GetAccountAllOfRelay } from './getAccountAllOfRelay'; -import { GetExtendedClientAllOfAddress } from './getExtendedClientAllOfAddress'; - -export class GetAccount { - /** - * Login Email - */ - 'email': string; - /** - * First Name - */ - 'firstName': string; - /** - * Last Name - */ - 'lastName': string; - /** - * Name of the company - */ - 'companyName': string; - 'address': GetExtendedClientAllOfAddress; - /** - * Information about your plans and credits - */ - 'plan': Array; - 'relay': GetAccountAllOfRelay; - 'marketingAutomation'?: GetAccountAllOfMarketingAutomation; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "address", - "baseName": "address", - "type": "GetExtendedClientAllOfAddress" - }, - { - "name": "plan", - "baseName": "plan", - "type": "Array" - }, - { - "name": "relay", - "baseName": "relay", - "type": "GetAccountAllOfRelay" - }, - { - "name": "marketingAutomation", - "baseName": "marketingAutomation", - "type": "GetAccountAllOfMarketingAutomation" - } ]; - - static getAttributeTypeMap() { - return GetAccount.attributeTypeMap; - } -} - diff --git a/model/getAccountActivity.ts b/model/getAccountActivity.ts deleted file mode 100644 index 3797af4..0000000 --- a/model/getAccountActivity.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetAccountActivityLogsInner } from './getAccountActivityLogsInner'; - -export class GetAccountActivity { - /** - * Get user activity logs - */ - 'logs'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "logs", - "baseName": "logs", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetAccountActivity.attributeTypeMap; - } -} - diff --git a/model/getAccountActivityLogsInner.ts b/model/getAccountActivityLogsInner.ts deleted file mode 100644 index b6a8dc1..0000000 --- a/model/getAccountActivityLogsInner.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetAccountActivityLogsInner { - /** - * Type of activity in the account. - */ - 'action': string; - /** - * Time of the activity. - */ - 'date': string; - /** - * Email address of the user who performed activity in the account. - */ - 'userEmail': string; - /** - * IP address of the user who performed activity in the account. - */ - 'userIp': string; - /** - * Browser details of the user who performed the activity. - */ - 'userAgent': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "action", - "baseName": "action", - "type": "string" - }, - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "userEmail", - "baseName": "user_email", - "type": "string" - }, - { - "name": "userIp", - "baseName": "user_ip", - "type": "string" - }, - { - "name": "userAgent", - "baseName": "user_agent", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetAccountActivityLogsInner.attributeTypeMap; - } -} - diff --git a/model/getAccountAllOfMarketingAutomation.ts b/model/getAccountAllOfMarketingAutomation.ts deleted file mode 100644 index c5680b6..0000000 --- a/model/getAccountAllOfMarketingAutomation.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetAccountAllOfMarketingAutomation { - /** - * Marketing Automation Tracker ID - */ - 'key'?: string; - /** - * Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) - */ - 'enabled': boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "key", - "baseName": "key", - "type": "string" - }, - { - "name": "enabled", - "baseName": "enabled", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetAccountAllOfMarketingAutomation.attributeTypeMap; - } -} - diff --git a/model/getAccountAllOfPlan.ts b/model/getAccountAllOfPlan.ts deleted file mode 100644 index e9ddf61..0000000 --- a/model/getAccountAllOfPlan.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetAccountAllOfPlan { - /** - * Displays the plan type of the user - */ - 'type': GetAccountAllOfPlan.TypeEnum; - /** - * This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. - */ - 'creditsType': GetAccountAllOfPlan.CreditsTypeEnum; - /** - * Remaining credits of the user - */ - 'credits': number; - /** - * Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) - */ - 'startDate'?: string; - /** - * Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) - */ - 'endDate'?: string; - /** - * Only in case of reseller account. It implies the total number of child accounts you can add to your account. - */ - 'userLimit'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "type", - "baseName": "type", - "type": "GetAccountAllOfPlan.TypeEnum" - }, - { - "name": "creditsType", - "baseName": "creditsType", - "type": "GetAccountAllOfPlan.CreditsTypeEnum" - }, - { - "name": "credits", - "baseName": "credits", - "type": "number" - }, - { - "name": "startDate", - "baseName": "startDate", - "type": "string" - }, - { - "name": "endDate", - "baseName": "endDate", - "type": "string" - }, - { - "name": "userLimit", - "baseName": "userLimit", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetAccountAllOfPlan.attributeTypeMap; - } -} - -export namespace GetAccountAllOfPlan { - export enum TypeEnum { - PayAsYouGo = 'payAsYouGo', - Free = 'free', - Subscription = 'subscription', - Sms = 'sms', - Reseller = 'reseller' - } - export enum CreditsTypeEnum { - SendLimit = 'sendLimit' - } -} diff --git a/model/getAccountAllOfRelay.ts b/model/getAccountAllOfRelay.ts deleted file mode 100644 index 06c4cc0..0000000 --- a/model/getAccountAllOfRelay.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetAccountAllOfRelayData } from './getAccountAllOfRelayData'; - -/** -* Information about your transactional email account -*/ -export class GetAccountAllOfRelay { - /** - * Status of your transactional email Account (true=Enabled, false=Disabled) - */ - 'enabled': boolean; - 'data': GetAccountAllOfRelayData; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "enabled", - "baseName": "enabled", - "type": "boolean" - }, - { - "name": "data", - "baseName": "data", - "type": "GetAccountAllOfRelayData" - } ]; - - static getAttributeTypeMap() { - return GetAccountAllOfRelay.attributeTypeMap; - } -} - diff --git a/model/getAccountAllOfRelayData.ts b/model/getAccountAllOfRelayData.ts deleted file mode 100644 index e634967..0000000 --- a/model/getAccountAllOfRelayData.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Data regarding the transactional email account -*/ -export class GetAccountAllOfRelayData { - /** - * Email to use as login on transactional platform - */ - 'userName': string; - /** - * URL of the SMTP Relay - */ - 'relay': string; - /** - * Port used for SMTP Relay - */ - 'port': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "userName", - "baseName": "userName", - "type": "string" - }, - { - "name": "relay", - "baseName": "relay", - "type": "string" - }, - { - "name": "port", - "baseName": "port", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetAccountAllOfRelayData.attributeTypeMap; - } -} - diff --git a/model/getAggregatedReport.ts b/model/getAggregatedReport.ts deleted file mode 100644 index 3da519e..0000000 --- a/model/getAggregatedReport.ts +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetAggregatedReport { - /** - * Time frame of the report - */ - 'range'?: string; - /** - * Number of requests for the timeframe - */ - 'requests'?: number; - /** - * Number of delivered emails for the timeframe - */ - 'delivered'?: number; - /** - * Number of hardbounces for the timeframe - */ - 'hardBounces'?: number; - /** - * Number of softbounces for the timeframe - */ - 'softBounces'?: number; - /** - * Number of clicks for the timeframe - */ - 'clicks'?: number; - /** - * Number of unique clicks for the timeframe - */ - 'uniqueClicks'?: number; - /** - * Number of openings for the timeframe - */ - 'opens'?: number; - /** - * Number of unique openings for the timeframe - */ - 'uniqueOpens'?: number; - /** - * Number of complaint (spam report) for the timeframe - */ - 'spamReports'?: number; - /** - * Number of blocked contact emails for the timeframe - */ - 'blocked'?: number; - /** - * Number of invalid emails for the timeframe - */ - 'invalid'?: number; - /** - * Number of unsubscribed emails for the timeframe - */ - 'unsubscribed'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "range", - "baseName": "range", - "type": "string" - }, - { - "name": "requests", - "baseName": "requests", - "type": "number" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "number" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" - }, - { - "name": "clicks", - "baseName": "clicks", - "type": "number" - }, - { - "name": "uniqueClicks", - "baseName": "uniqueClicks", - "type": "number" - }, - { - "name": "opens", - "baseName": "opens", - "type": "number" - }, - { - "name": "uniqueOpens", - "baseName": "uniqueOpens", - "type": "number" - }, - { - "name": "spamReports", - "baseName": "spamReports", - "type": "number" - }, - { - "name": "blocked", - "baseName": "blocked", - "type": "number" - }, - { - "name": "invalid", - "baseName": "invalid", - "type": "number" - }, - { - "name": "unsubscribed", - "baseName": "unsubscribed", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetAggregatedReport.attributeTypeMap; - } -} - diff --git a/model/getAllExternalFeeds.ts b/model/getAllExternalFeeds.ts deleted file mode 100644 index d2305b8..0000000 --- a/model/getAllExternalFeeds.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetAllExternalFeedsFeedsInner } from './getAllExternalFeedsFeedsInner'; - -export class GetAllExternalFeeds { - /** - * Total number of batches - */ - 'count'?: number; - 'feeds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "feeds", - "baseName": "feeds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetAllExternalFeeds.attributeTypeMap; - } -} - diff --git a/model/getAllExternalFeedsFeedsInner.ts b/model/getAllExternalFeedsFeedsInner.ts deleted file mode 100644 index c2f4143..0000000 --- a/model/getAllExternalFeedsFeedsInner.ts +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExternalFeedByUUIDHeadersInner } from './getExternalFeedByUUIDHeadersInner'; - -export class GetAllExternalFeedsFeedsInner { - /** - * ID of the feed - */ - 'id': string; - /** - * Name of the feed - */ - 'name': string; - /** - * URL of the feed - */ - 'url': string; - /** - * Auth type of the feed: * `basic` * `token` * `noAuth` - */ - 'authType': GetAllExternalFeedsFeedsInner.AuthTypeEnum; - /** - * Username for authType `basic` - */ - 'username'?: string; - /** - * Password for authType `basic` - */ - 'password'?: string; - /** - * Token for authType `token` - */ - 'token'?: string; - /** - * Custom headers for the feed - */ - 'headers': Array; - /** - * Maximum number of retries on the feed url - */ - 'maxRetries': number; - /** - * Toggle caching of feed url response - */ - 'cache': boolean; - /** - * Datetime on which the feed was created - */ - 'createdAt': Date; - /** - * Datetime on which the feed was modified - */ - 'modifiedAt': Date; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "authType", - "baseName": "authType", - "type": "GetAllExternalFeedsFeedsInner.AuthTypeEnum" - }, - { - "name": "username", - "baseName": "username", - "type": "string" - }, - { - "name": "password", - "baseName": "password", - "type": "string" - }, - { - "name": "token", - "baseName": "token", - "type": "string" - }, - { - "name": "headers", - "baseName": "headers", - "type": "Array" - }, - { - "name": "maxRetries", - "baseName": "maxRetries", - "type": "number" - }, - { - "name": "cache", - "baseName": "cache", - "type": "boolean" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "Date" - } ]; - - static getAttributeTypeMap() { - return GetAllExternalFeedsFeedsInner.attributeTypeMap; - } -} - -export namespace GetAllExternalFeedsFeedsInner { - export enum AuthTypeEnum { - Basic = 'basic', - Token = 'token', - NoAuth = 'noAuth' - } -} diff --git a/model/getAttributes.ts b/model/getAttributes.ts deleted file mode 100644 index d55c507..0000000 --- a/model/getAttributes.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetAttributesAttributesInner } from './getAttributesAttributesInner'; - -export class GetAttributes { - /** - * Listing of available contact attributes in your account - */ - 'attributes': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "attributes", - "baseName": "attributes", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetAttributes.attributeTypeMap; - } -} - diff --git a/model/getAttributesAttributesInner.ts b/model/getAttributesAttributesInner.ts deleted file mode 100644 index 4af7246..0000000 --- a/model/getAttributesAttributesInner.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetAttributesAttributesInnerEnumerationInner } from './getAttributesAttributesInnerEnumerationInner'; - -export class GetAttributesAttributesInner { - /** - * Name of the attribute - */ - 'name': string; - /** - * Category of the attribute - */ - 'category': GetAttributesAttributesInner.CategoryEnum; - /** - * Type of the attribute - */ - 'type'?: GetAttributesAttributesInner.TypeEnum; - /** - * Parameter only available for \"category\" type attributes. - */ - 'enumeration'?: Array; - /** - * Calculated value formula - */ - 'calculatedValue'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "category", - "baseName": "category", - "type": "GetAttributesAttributesInner.CategoryEnum" - }, - { - "name": "type", - "baseName": "type", - "type": "GetAttributesAttributesInner.TypeEnum" - }, - { - "name": "enumeration", - "baseName": "enumeration", - "type": "Array" - }, - { - "name": "calculatedValue", - "baseName": "calculatedValue", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetAttributesAttributesInner.attributeTypeMap; - } -} - -export namespace GetAttributesAttributesInner { - export enum CategoryEnum { - Normal = 'normal', - Transactional = 'transactional', - Category = 'category', - Calculated = 'calculated', - Global = 'global' - } - export enum TypeEnum { - Text = 'text', - Date = 'date', - Float = 'float', - Id = 'id', - Boolean = 'boolean' - } -} diff --git a/model/getAttributesAttributesInnerEnumerationInner.ts b/model/getAttributesAttributesInnerEnumerationInner.ts deleted file mode 100644 index 2919c23..0000000 --- a/model/getAttributesAttributesInnerEnumerationInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetAttributesAttributesInnerEnumerationInner { - /** - * ID of Value of the \"category\" type attribute - */ - 'value': number; - /** - * Label of the \"category\" type attribute - */ - 'label': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "value", - "baseName": "value", - "type": "number" - }, - { - "name": "label", - "baseName": "label", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetAttributesAttributesInnerEnumerationInner.attributeTypeMap; - } -} - diff --git a/model/getBlockedDomains.ts b/model/getBlockedDomains.ts deleted file mode 100644 index 64f2303..0000000 --- a/model/getBlockedDomains.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* list of blocked domains -*/ -export class GetBlockedDomains { - /** - * List of all blocked domains - */ - 'domains': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "domains", - "baseName": "domains", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetBlockedDomains.attributeTypeMap; - } -} - diff --git a/model/getCampaignOverview.ts b/model/getCampaignOverview.ts deleted file mode 100644 index a1b2e96..0000000 --- a/model/getCampaignOverview.ts +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetCampaignOverview { - /** - * ID of the campaign - */ - 'id': number; - /** - * Name of the campaign - */ - 'name': string; - /** - * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` - */ - 'subject'?: string; - /** - * Preview text or preheader of the email campaign - */ - 'previewText'?: string; - /** - * Type of campaign - */ - 'type': GetCampaignOverview.TypeEnum; - /** - * Status of the campaign - */ - 'status': GetCampaignOverview.StatusEnum; - /** - * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'scheduledAt'?: string; - /** - * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. - */ - 'abTesting'?: boolean; - /** - * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectA'?: string; - /** - * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectB'?: string; - /** - * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` - */ - 'splitRule'?: number; - /** - * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerCriteria'?: string; - /** - * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerDelay'?: number; - /** - * It is true if you have chosen to send your campaign at best time, otherwise it is false - */ - 'sendAtBestTime'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "previewText", - "baseName": "previewText", - "type": "string" - }, - { - "name": "type", - "baseName": "type", - "type": "GetCampaignOverview.TypeEnum" - }, - { - "name": "status", - "baseName": "status", - "type": "GetCampaignOverview.StatusEnum" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" - }, - { - "name": "subjectB", - "baseName": "subjectB", - "type": "string" - }, - { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "string" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", - "type": "number" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetCampaignOverview.attributeTypeMap; - } -} - -export namespace GetCampaignOverview { - export enum TypeEnum { - Classic = 'classic', - Trigger = 'trigger' - } - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'in_process' - } -} diff --git a/model/getCampaignRecipients.ts b/model/getCampaignRecipients.ts deleted file mode 100644 index bacfcb6..0000000 --- a/model/getCampaignRecipients.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetCampaignRecipients { - 'lists': Array; - 'exclusionLists': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "lists", - "baseName": "lists", - "type": "Array" - }, - { - "name": "exclusionLists", - "baseName": "exclusionLists", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetCampaignRecipients.attributeTypeMap; - } -} - diff --git a/model/getCampaignStats.ts b/model/getCampaignStats.ts deleted file mode 100644 index e9a57d1..0000000 --- a/model/getCampaignStats.ts +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetCampaignStats { - /** - * List Id of email campaign (only in case of get email campaign(s)(not for global stats)) - */ - 'listId'?: number; - /** - * Number of unique clicks for the campaign - */ - 'uniqueClicks': number; - /** - * Number of total clicks for the campaign - */ - 'clickers': number; - /** - * Number of complaints (Spam reports) for the campaign - */ - 'complaints': number; - /** - * Number of delivered emails for the campaign - */ - 'delivered': number; - /** - * Number of sent emails for the campaign - */ - 'sent': number; - /** - * Number of softbounce for the campaign - */ - 'softBounces': number; - /** - * Number of harbounce for the campaign - */ - 'hardBounces': number; - /** - * Number of unique openings for the campaign - */ - 'uniqueViews': number; - /** - * Recipients without any privacy protection option enabled in their email client - */ - 'trackableViews': number; - /** - * Rate of recipients without any privacy protection option enabled in their email client - */ - 'trackableViewsRate'?: number; - /** - * Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails - */ - 'estimatedViews'?: number; - /** - * Number of unsubscription for the campaign - */ - 'unsubscriptions': number; - /** - * Number of openings for the campaign - */ - 'viewed': number; - /** - * Number of deferred emails for the campaign - */ - 'deferred'?: number; - /** - * Total number of non-delivered campaigns for a particular campaign id. - */ - 'returnBounce'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "listId", - "baseName": "listId", - "type": "number" - }, - { - "name": "uniqueClicks", - "baseName": "uniqueClicks", - "type": "number" - }, - { - "name": "clickers", - "baseName": "clickers", - "type": "number" - }, - { - "name": "complaints", - "baseName": "complaints", - "type": "number" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "number" - }, - { - "name": "sent", - "baseName": "sent", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "uniqueViews", - "baseName": "uniqueViews", - "type": "number" - }, - { - "name": "trackableViews", - "baseName": "trackableViews", - "type": "number" - }, - { - "name": "trackableViewsRate", - "baseName": "trackableViewsRate", - "type": "number" - }, - { - "name": "estimatedViews", - "baseName": "estimatedViews", - "type": "number" - }, - { - "name": "unsubscriptions", - "baseName": "unsubscriptions", - "type": "number" - }, - { - "name": "viewed", - "baseName": "viewed", - "type": "number" - }, - { - "name": "deferred", - "baseName": "deferred", - "type": "number" - }, - { - "name": "returnBounce", - "baseName": "returnBounce", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetCampaignStats.attributeTypeMap; - } -} - diff --git a/model/getCategories.ts b/model/getCategories.ts deleted file mode 100644 index 287e82f..0000000 --- a/model/getCategories.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCategoryDetails } from './getCategoryDetails'; - -export class GetCategories { - 'categories': Array; - /** - * Number of categories - */ - 'count': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "categories", - "baseName": "categories", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetCategories.attributeTypeMap; - } -} - diff --git a/model/getCategoryDetails.ts b/model/getCategoryDetails.ts deleted file mode 100644 index 3aa2679..0000000 --- a/model/getCategoryDetails.ts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetCategoryDetails { - /** - * Category ID for which you requested the details - */ - 'id': string; - /** - * Name of the category for which you requested the details - */ - 'name': string; - /** - * Creation UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * Last modification UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - /** - * URL to the category - */ - 'url'?: string; - /** - * category deleted from the shop\'s database - */ - 'isDeleted'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "isDeleted", - "baseName": "isDeleted", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetCategoryDetails.attributeTypeMap; - } -} - diff --git a/model/getChildAccountCreationStatus.ts b/model/getChildAccountCreationStatus.ts deleted file mode 100644 index 1d53824..0000000 --- a/model/getChildAccountCreationStatus.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetChildAccountCreationStatus { - /** - * Status of child account creation whether it is successfully created (exists) or not. - */ - 'childAccountCreated': boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "childAccountCreated", - "baseName": "childAccountCreated", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetChildAccountCreationStatus.attributeTypeMap; - } -} - diff --git a/model/getChildDomain.ts b/model/getChildDomain.ts deleted file mode 100644 index c011c01..0000000 --- a/model/getChildDomain.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetChildDomain { - /** - * Sender domain - */ - 'domain'?: string; - /** - * indicates whether a domain is verified or not - */ - 'active'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "domain", - "baseName": "domain", - "type": "string" - }, - { - "name": "active", - "baseName": "active", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetChildDomain.attributeTypeMap; - } -} - diff --git a/model/getChildInfo.ts b/model/getChildInfo.ts deleted file mode 100644 index 3f3ccfa..0000000 --- a/model/getChildInfo.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetChildInfoAllOfApiKeys } from './getChildInfoAllOfApiKeys'; -import { GetChildInfoAllOfCredits } from './getChildInfoAllOfCredits'; -import { GetChildInfoAllOfStatistics } from './getChildInfoAllOfStatistics'; - -export class GetChildInfo { - /** - * Login Email - */ - 'email': string; - /** - * First Name - */ - 'firstName': string; - /** - * Last Name - */ - 'lastName': string; - /** - * Name of the company - */ - 'companyName': string; - 'credits'?: GetChildInfoAllOfCredits; - 'statistics'?: GetChildInfoAllOfStatistics; - /** - * The encrypted password of child account - */ - 'password': string; - /** - * IP(s) associated to a child account user - */ - 'ips'?: Array; - 'apiKeys'?: GetChildInfoAllOfApiKeys; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "credits", - "baseName": "credits", - "type": "GetChildInfoAllOfCredits" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetChildInfoAllOfStatistics" - }, - { - "name": "password", - "baseName": "password", - "type": "string" - }, - { - "name": "ips", - "baseName": "ips", - "type": "Array" - }, - { - "name": "apiKeys", - "baseName": "apiKeys", - "type": "GetChildInfoAllOfApiKeys" - } ]; - - static getAttributeTypeMap() { - return GetChildInfo.attributeTypeMap; - } -} - diff --git a/model/getChildInfoAllOfApiKeys.ts b/model/getChildInfoAllOfApiKeys.ts deleted file mode 100644 index 3bc11c8..0000000 --- a/model/getChildInfoAllOfApiKeys.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetChildInfoAllOfApiKeysV2 } from './getChildInfoAllOfApiKeysV2'; -import { GetChildInfoAllOfApiKeysV3 } from './getChildInfoAllOfApiKeysV3'; - -/** -* API Keys associated to child account -*/ -export class GetChildInfoAllOfApiKeys { - 'v2': Array; - 'v3'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "v2", - "baseName": "v2", - "type": "Array" - }, - { - "name": "v3", - "baseName": "v3", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetChildInfoAllOfApiKeys.attributeTypeMap; - } -} - diff --git a/model/getChildInfoAllOfApiKeysV2.ts b/model/getChildInfoAllOfApiKeysV2.ts deleted file mode 100644 index 5b8c930..0000000 --- a/model/getChildInfoAllOfApiKeysV2.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetChildInfoAllOfApiKeysV2 { - /** - * Name of the key for version 2 - */ - 'name': string; - /** - * API Key for version 2 - */ - 'key': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "key", - "baseName": "key", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetChildInfoAllOfApiKeysV2.attributeTypeMap; - } -} - diff --git a/model/getChildInfoAllOfApiKeysV3.ts b/model/getChildInfoAllOfApiKeysV3.ts deleted file mode 100644 index 9e3b2e2..0000000 --- a/model/getChildInfoAllOfApiKeysV3.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetChildInfoAllOfApiKeysV3 { - /** - * Name of the key for version 3 - */ - 'name': string; - /** - * API Key for version 3 - */ - 'key': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "key", - "baseName": "key", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetChildInfoAllOfApiKeysV3.attributeTypeMap; - } -} - diff --git a/model/getChildInfoAllOfCredits.ts b/model/getChildInfoAllOfCredits.ts deleted file mode 100644 index 80ac307..0000000 --- a/model/getChildInfoAllOfCredits.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Credits available for your child -*/ -export class GetChildInfoAllOfCredits { - /** - * Email credits available for your child - */ - 'emailCredits'?: number; - /** - * SMS credits available for your child - */ - 'smsCredits'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "emailCredits", - "baseName": "emailCredits", - "type": "number" - }, - { - "name": "smsCredits", - "baseName": "smsCredits", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetChildInfoAllOfCredits.attributeTypeMap; - } -} - diff --git a/model/getChildInfoAllOfStatistics.ts b/model/getChildInfoAllOfStatistics.ts deleted file mode 100644 index f7f62dc..0000000 --- a/model/getChildInfoAllOfStatistics.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Statistics about your child account activity -*/ -export class GetChildInfoAllOfStatistics { - /** - * Overall emails sent for the previous month - */ - 'previousMonthTotalSent'?: number; - /** - * Overall emails sent for current month - */ - 'currentMonthTotalSent'?: number; - /** - * Overall emails sent for since the account exists - */ - 'totalSent'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "previousMonthTotalSent", - "baseName": "previousMonthTotalSent", - "type": "number" - }, - { - "name": "currentMonthTotalSent", - "baseName": "currentMonthTotalSent", - "type": "number" - }, - { - "name": "totalSent", - "baseName": "totalSent", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetChildInfoAllOfStatistics.attributeTypeMap; - } -} - diff --git a/model/getChildrenList.ts b/model/getChildrenList.ts deleted file mode 100644 index 0901921..0000000 --- a/model/getChildrenList.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetChildrenListChildrenInner } from './getChildrenListChildrenInner'; - -export class GetChildrenList { - /** - * Your children\'s account information - */ - 'children'?: Array; - /** - * Number of child accounts - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "children", - "baseName": "children", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetChildrenList.attributeTypeMap; - } -} - diff --git a/model/getChildrenListChildrenInner.ts b/model/getChildrenListChildrenInner.ts deleted file mode 100644 index b1eadc0..0000000 --- a/model/getChildrenListChildrenInner.ts +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetChildInfoAllOfApiKeys } from './getChildInfoAllOfApiKeys'; -import { GetChildInfoAllOfCredits } from './getChildInfoAllOfCredits'; -import { GetChildInfoAllOfStatistics } from './getChildInfoAllOfStatistics'; - -export class GetChildrenListChildrenInner { - /** - * Login Email - */ - 'email': string; - /** - * First Name - */ - 'firstName': string; - /** - * Last Name - */ - 'lastName': string; - /** - * Name of the company - */ - 'companyName': string; - 'credits'?: GetChildInfoAllOfCredits; - 'statistics'?: GetChildInfoAllOfStatistics; - /** - * The encrypted password of child account - */ - 'password': string; - /** - * IP(s) associated to a child account user - */ - 'ips'?: Array; - 'apiKeys'?: GetChildInfoAllOfApiKeys; - /** - * ID of the child - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "credits", - "baseName": "credits", - "type": "GetChildInfoAllOfCredits" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetChildInfoAllOfStatistics" - }, - { - "name": "password", - "baseName": "password", - "type": "string" - }, - { - "name": "ips", - "baseName": "ips", - "type": "Array" - }, - { - "name": "apiKeys", - "baseName": "apiKeys", - "type": "GetChildInfoAllOfApiKeys" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetChildrenListChildrenInner.attributeTypeMap; - } -} - diff --git a/model/getClient.ts b/model/getClient.ts deleted file mode 100644 index d7d6792..0000000 --- a/model/getClient.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetClient { - /** - * Login Email - */ - 'email': string; - /** - * First Name - */ - 'firstName': string; - /** - * Last Name - */ - 'lastName': string; - /** - * Name of the company - */ - 'companyName': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetClient.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStats.ts b/model/getContactCampaignStats.ts deleted file mode 100644 index 02baa25..0000000 --- a/model/getContactCampaignStats.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetContactCampaignStatsClickedInner } from './getContactCampaignStatsClickedInner'; -import { GetContactCampaignStatsMessagesSentInner } from './getContactCampaignStatsMessagesSentInner'; -import { GetContactCampaignStatsOpenedInner } from './getContactCampaignStatsOpenedInner'; -import { GetContactCampaignStatsTransacAttributesInner } from './getContactCampaignStatsTransacAttributesInner'; -import { GetContactCampaignStatsUnsubscriptions } from './getContactCampaignStatsUnsubscriptions'; - -/** -* Campaign Statistics for the contact -*/ -export class GetContactCampaignStats { - 'messagesSent'?: Array; - 'hardBounces'?: Array; - 'softBounces'?: Array; - 'complaints'?: Array; - 'unsubscriptions'?: GetContactCampaignStatsUnsubscriptions; - 'opened'?: Array; - 'clicked'?: Array; - 'transacAttributes'?: Array; - 'delivered'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "messagesSent", - "baseName": "messagesSent", - "type": "Array" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "Array" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "Array" - }, - { - "name": "complaints", - "baseName": "complaints", - "type": "Array" - }, - { - "name": "unsubscriptions", - "baseName": "unsubscriptions", - "type": "GetContactCampaignStatsUnsubscriptions" - }, - { - "name": "opened", - "baseName": "opened", - "type": "Array" - }, - { - "name": "clicked", - "baseName": "clicked", - "type": "Array" - }, - { - "name": "transacAttributes", - "baseName": "transacAttributes", - "type": "Array" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStats.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStatsClickedInner.ts b/model/getContactCampaignStatsClickedInner.ts deleted file mode 100644 index 461218a..0000000 --- a/model/getContactCampaignStatsClickedInner.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetContactCampaignStatsClickedInnerLinksInner } from './getContactCampaignStatsClickedInnerLinksInner'; - -export class GetContactCampaignStatsClickedInner { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - 'links': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "links", - "baseName": "links", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStatsClickedInner.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStatsClickedInnerLinksInner.ts b/model/getContactCampaignStatsClickedInnerLinksInner.ts deleted file mode 100644 index e44adf1..0000000 --- a/model/getContactCampaignStatsClickedInnerLinksInner.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetContactCampaignStatsClickedInnerLinksInner { - /** - * Number of clicks on this link for the campaign - */ - 'count': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; - /** - * IP from which the user has clicked on the link - */ - 'ip': string; - /** - * URL of the clicked link - */ - 'url': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStatsClickedInnerLinksInner.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStatsMessagesSentInner.ts b/model/getContactCampaignStatsMessagesSentInner.ts deleted file mode 100644 index dc060ef..0000000 --- a/model/getContactCampaignStatsMessagesSentInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetContactCampaignStatsMessagesSentInner { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStatsMessagesSentInner.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStatsOpenedInner.ts b/model/getContactCampaignStatsOpenedInner.ts deleted file mode 100644 index a724112..0000000 --- a/model/getContactCampaignStatsOpenedInner.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetContactCampaignStatsOpenedInner { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - /** - * Number of openings of the campaign - */ - 'count': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; - /** - * IP from which the user has opened the campaign - */ - 'ip': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStatsOpenedInner.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStatsTransacAttributesInner.ts b/model/getContactCampaignStatsTransacAttributesInner.ts deleted file mode 100644 index d26af23..0000000 --- a/model/getContactCampaignStatsTransacAttributesInner.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetContactCampaignStatsTransacAttributesInner { - /** - * Date of the order - */ - 'orderDate': string; - /** - * Price of the order - */ - 'orderPrice': number; - /** - * ID of the order - */ - 'orderId': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "orderDate", - "baseName": "orderDate", - "type": "string" - }, - { - "name": "orderPrice", - "baseName": "orderPrice", - "type": "number" - }, - { - "name": "orderId", - "baseName": "orderId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStatsTransacAttributesInner.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStatsUnsubscriptions.ts b/model/getContactCampaignStatsUnsubscriptions.ts deleted file mode 100644 index dc437fa..0000000 --- a/model/getContactCampaignStatsUnsubscriptions.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner } from './getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner'; -import { GetContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner } from './getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner'; - -export class GetContactCampaignStatsUnsubscriptions { - /** - * Contact has unsubscribed via the unsubscription link in the email - */ - 'userUnsubscription': Array; - /** - * Contact has been unsubscribed from the administrator - */ - 'adminUnsubscription': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "userUnsubscription", - "baseName": "userUnsubscription", - "type": "Array" - }, - { - "name": "adminUnsubscription", - "baseName": "adminUnsubscription", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStatsUnsubscriptions.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner.ts b/model/getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner.ts deleted file mode 100644 index 2b6b04e..0000000 --- a/model/getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner { - /** - * UTC date-time of the event - */ - 'eventTime': string; - /** - * IP from which the user has been unsubscribed - */ - 'ip'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner.attributeTypeMap; - } -} - diff --git a/model/getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner.ts b/model/getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner.ts deleted file mode 100644 index 8f4e9d4..0000000 --- a/model/getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; - /** - * IP from which the user has unsubscribed - */ - 'ip'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner.attributeTypeMap; - } -} - diff --git a/model/getContactDetails.ts b/model/getContactDetails.ts deleted file mode 100644 index 193e8f8..0000000 --- a/model/getContactDetails.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetContactDetails { - /** - * Email address of the contact for which you requested the details - */ - 'email'?: string; - /** - * ID of the contact for which you requested the details - */ - 'id': number; - /** - * Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) - */ - 'emailBlacklisted': boolean; - /** - * Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) - */ - 'smsBlacklisted': boolean; - /** - * Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - 'listIds': Array; - 'listUnsubscribed'?: Array; - /** - * Set of attributes of the contact - */ - 'attributes': object; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" - }, - { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "listUnsubscribed", - "baseName": "listUnsubscribed", - "type": "Array" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - } ]; - - static getAttributeTypeMap() { - return GetContactDetails.attributeTypeMap; - } -} - diff --git a/model/getContacts.ts b/model/getContacts.ts deleted file mode 100644 index 9dc5d1a..0000000 --- a/model/getContacts.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetContactDetails } from './getContactDetails'; - -export class GetContacts { - 'contacts': Array; - /** - * Number of contacts - */ - 'count': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "contacts", - "baseName": "contacts", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetContacts.attributeTypeMap; - } -} - diff --git a/model/getCorporateInvitedUsersList.ts b/model/getCorporateInvitedUsersList.ts deleted file mode 100644 index 5734be3..0000000 --- a/model/getCorporateInvitedUsersList.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCorporateInvitedUsersListUsersInner } from './getCorporateInvitedUsersListUsersInner'; - -export class GetCorporateInvitedUsersList { - /** - * Get invited users list - */ - 'users'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "users", - "baseName": "users", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetCorporateInvitedUsersList.attributeTypeMap; - } -} - diff --git a/model/getCorporateInvitedUsersListUsersInner.ts b/model/getCorporateInvitedUsersListUsersInner.ts deleted file mode 100644 index f7cf871..0000000 --- a/model/getCorporateInvitedUsersListUsersInner.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCorporateInvitedUsersListUsersInnerFeatureAccess } from './getCorporateInvitedUsersListUsersInnerFeatureAccess'; -import { GetCorporateInvitedUsersListUsersInnerGroups } from './getCorporateInvitedUsersListUsersInnerGroups'; - -export class GetCorporateInvitedUsersListUsersInner { - 'groups': GetCorporateInvitedUsersListUsersInnerGroups; - /** - * Email address of the user. - */ - 'email': string; - /** - * Flag for indicating is user owner of the organization. - */ - 'isOwner': string; - /** - * Status of the invited user. - */ - 'status': string; - 'featureAccess': GetCorporateInvitedUsersListUsersInnerFeatureAccess; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "groups", - "baseName": "groups", - "type": "GetCorporateInvitedUsersListUsersInnerGroups" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "isOwner", - "baseName": "is_owner", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "string" - }, - { - "name": "featureAccess", - "baseName": "feature_access", - "type": "GetCorporateInvitedUsersListUsersInnerFeatureAccess" - } ]; - - static getAttributeTypeMap() { - return GetCorporateInvitedUsersListUsersInner.attributeTypeMap; - } -} - diff --git a/model/getCorporateInvitedUsersListUsersInnerFeatureAccess.ts b/model/getCorporateInvitedUsersListUsersInnerFeatureAccess.ts deleted file mode 100644 index 8cf7f51..0000000 --- a/model/getCorporateInvitedUsersListUsersInnerFeatureAccess.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Feature accessiblity given to the user. (Required only if status is active) -*/ -export class GetCorporateInvitedUsersListUsersInnerFeatureAccess { - /** - * User management accessiblity. - */ - 'userManagement'?: Array; - /** - * Api keys accessiblity. - */ - 'apiKeys'?: Array; - /** - * My plan accessiblity. - */ - 'myPlan'?: Array; - /** - * Apps management accessiblity | Not available in ENTv2 - */ - 'appsManagement'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "userManagement", - "baseName": "user_management", - "type": "Array" - }, - { - "name": "apiKeys", - "baseName": "api_keys", - "type": "Array" - }, - { - "name": "myPlan", - "baseName": "my_plan", - "type": "Array" - }, - { - "name": "appsManagement", - "baseName": "apps_management", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetCorporateInvitedUsersListUsersInnerFeatureAccess.attributeTypeMap; - } -} - diff --git a/model/getCorporateInvitedUsersListUsersInnerGroups.ts b/model/getCorporateInvitedUsersListUsersInnerGroups.ts deleted file mode 100644 index 105b70f..0000000 --- a/model/getCorporateInvitedUsersListUsersInnerGroups.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Admin user groups list -*/ -export class GetCorporateInvitedUsersListUsersInnerGroups { - /** - * group id - */ - 'id'?: string; - /** - * group name - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetCorporateInvitedUsersListUsersInnerGroups.attributeTypeMap; - } -} - diff --git a/model/getCorporateUserPermission.ts b/model/getCorporateUserPermission.ts deleted file mode 100644 index 037b489..0000000 --- a/model/getCorporateUserPermission.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCorporateUserPermissionFeatureAccess } from './getCorporateUserPermissionFeatureAccess'; -import { GetCorporateUserPermissionGroupsInner } from './getCorporateUserPermissionGroupsInner'; - -/** -* Check admin user permissions -*/ -export class GetCorporateUserPermission { - /** - * Email address of the user. - */ - 'email': string; - /** - * Status of the invited user. - */ - 'status': string; - 'groups': Array; - 'featureAccess': GetCorporateUserPermissionFeatureAccess; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "string" - }, - { - "name": "groups", - "baseName": "groups", - "type": "Array" - }, - { - "name": "featureAccess", - "baseName": "feature_access", - "type": "GetCorporateUserPermissionFeatureAccess" - } ]; - - static getAttributeTypeMap() { - return GetCorporateUserPermission.attributeTypeMap; - } -} - diff --git a/model/getCorporateUserPermissionFeatureAccess.ts b/model/getCorporateUserPermissionFeatureAccess.ts deleted file mode 100644 index f3da71d..0000000 --- a/model/getCorporateUserPermissionFeatureAccess.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Granular feature permissions given to the user. -*/ -export class GetCorporateUserPermissionFeatureAccess { - /** - * Permission on api keys - */ - 'apiKeys'?: Array; - /** - * Permission on my plan - */ - 'myPlan'?: Array; - /** - * Permission on user management - */ - 'userManagement'?: Array; - /** - * Permission on apps management - */ - 'appsManagement'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "apiKeys", - "baseName": "api_keys", - "type": "Array" - }, - { - "name": "myPlan", - "baseName": "my_plan", - "type": "Array" - }, - { - "name": "userManagement", - "baseName": "user_management", - "type": "Array" - }, - { - "name": "appsManagement", - "baseName": "apps_management", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetCorporateUserPermissionFeatureAccess.attributeTypeMap; - } -} - diff --git a/model/getCorporateUserPermissionGroupsInner.ts b/model/getCorporateUserPermissionGroupsInner.ts deleted file mode 100644 index a9312c5..0000000 --- a/model/getCorporateUserPermissionGroupsInner.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Groups details -*/ -export class GetCorporateUserPermissionGroupsInner { - /** - * group identifier - */ - 'id'?: string; - /** - * Group name - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetCorporateUserPermissionGroupsInner.attributeTypeMap; - } -} - diff --git a/model/getCouponCollection.ts b/model/getCouponCollection.ts deleted file mode 100644 index 4edbda7..0000000 --- a/model/getCouponCollection.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetCouponCollection { - /** - * The id of the collection. - */ - 'id': string; - /** - * The name of the collection. - */ - 'name': string; - /** - * The default coupon of the collection. - */ - 'defaultCoupon': string; - /** - * Datetime on which the collection was created. - */ - 'createdAt': Date; - /** - * Total number of coupons in the collection. - */ - 'totalCoupons': number; - /** - * Number of coupons that have not been sent yet. - */ - 'remainingCoupons': number; - /** - * Expiration date for the coupon collection in RFC3339 format. - */ - 'expirationDate'?: Date; - /** - * If present, an email notification is going to be sent the defined amount of days before the expiration date. - */ - 'remainingDaysAlert'?: number; - /** - * If present, an email notification is going to be sent when the total number of available coupons falls below the defined threshold. - */ - 'remainingCouponsAlert'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "defaultCoupon", - "baseName": "defaultCoupon", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" - }, - { - "name": "totalCoupons", - "baseName": "totalCoupons", - "type": "number" - }, - { - "name": "remainingCoupons", - "baseName": "remainingCoupons", - "type": "number" - }, - { - "name": "expirationDate", - "baseName": "expirationDate", - "type": "Date" - }, - { - "name": "remainingDaysAlert", - "baseName": "remainingDaysAlert", - "type": "number" - }, - { - "name": "remainingCouponsAlert", - "baseName": "remainingCouponsAlert", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetCouponCollection.attributeTypeMap; - } -} - diff --git a/model/getDeviceBrowserStats.ts b/model/getDeviceBrowserStats.ts deleted file mode 100644 index c4008c0..0000000 --- a/model/getDeviceBrowserStats.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetDeviceBrowserStats { - /** - * Number of total clicks for the campaign using the particular browser - */ - 'clickers': number; - /** - * Number of unique clicks for the campaign using the particular browser - */ - 'uniqueClicks': number; - /** - * Number of openings for the campaign using the particular browser - */ - 'viewed': number; - /** - * Number of unique openings for the campaign using the particular browser - */ - 'uniqueViews': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "clickers", - "baseName": "clickers", - "type": "number" - }, - { - "name": "uniqueClicks", - "baseName": "uniqueClicks", - "type": "number" - }, - { - "name": "viewed", - "baseName": "viewed", - "type": "number" - }, - { - "name": "uniqueViews", - "baseName": "uniqueViews", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetDeviceBrowserStats.attributeTypeMap; - } -} - diff --git a/model/getDomainConfigurationModel.ts b/model/getDomainConfigurationModel.ts deleted file mode 100644 index 2ae4354..0000000 --- a/model/getDomainConfigurationModel.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateDomainModelDnsRecords } from './createDomainModelDnsRecords'; - -export class GetDomainConfigurationModel { - /** - * Domain - */ - 'domain': string; - /** - * Status of domain verification (true=verified, false=non verified) - */ - 'verified': boolean; - /** - * Status of domain authentication (true=authenticated, false=non authenticated) - */ - 'authenticated': boolean; - 'dnsRecords': CreateDomainModelDnsRecords; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "domain", - "baseName": "domain", - "type": "string" - }, - { - "name": "verified", - "baseName": "verified", - "type": "boolean" - }, - { - "name": "authenticated", - "baseName": "authenticated", - "type": "boolean" - }, - { - "name": "dnsRecords", - "baseName": "dns_records", - "type": "CreateDomainModelDnsRecords" - } ]; - - static getAttributeTypeMap() { - return GetDomainConfigurationModel.attributeTypeMap; - } -} - diff --git a/model/getDomainsList.ts b/model/getDomainsList.ts deleted file mode 100644 index 11fc87d..0000000 --- a/model/getDomainsList.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetDomainsListDomainsInner } from './getDomainsListDomainsInner'; - -export class GetDomainsList { - /** - * List of the domains available in your account - */ - 'domains'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "domains", - "baseName": "domains", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetDomainsList.attributeTypeMap; - } -} - diff --git a/model/getDomainsListDomainsInner.ts b/model/getDomainsListDomainsInner.ts deleted file mode 100644 index d713e89..0000000 --- a/model/getDomainsListDomainsInner.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetDomainsListDomainsInner { - /** - * Id of the domain - */ - 'id': number; - /** - * Domain name - */ - 'domainName': string; - /** - * Status of domain authentication (true=authenticated, false=non authenticated) - */ - 'authenticated': boolean; - /** - * Status of domain verification (true=verified, false=non verified) - */ - 'verified': boolean; - /** - * Dedicated IP associated with domain - */ - 'ip'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "domainName", - "baseName": "domain_name", - "type": "string" - }, - { - "name": "authenticated", - "baseName": "authenticated", - "type": "boolean" - }, - { - "name": "verified", - "baseName": "verified", - "type": "boolean" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetDomainsListDomainsInner.attributeTypeMap; - } -} - diff --git a/model/getEmailCampaign.ts b/model/getEmailCampaign.ts deleted file mode 100644 index 0bf6008..0000000 --- a/model/getEmailCampaign.ts +++ /dev/null @@ -1,357 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCampaignRecipients } from './getCampaignRecipients'; -import { GetExtendedCampaignOverviewAllOfSender } from './getExtendedCampaignOverviewAllOfSender'; -import { GetExtendedCampaignStats } from './getExtendedCampaignStats'; - -export class GetEmailCampaign { - /** - * ID of the campaign - */ - 'id': number; - /** - * Name of the campaign - */ - 'name': string; - /** - * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` - */ - 'subject'?: string; - /** - * Preview text or preheader of the email campaign - */ - 'previewText'?: string; - /** - * Type of campaign - */ - 'type': GetEmailCampaign.TypeEnum; - /** - * Status of the campaign - */ - 'status': GetEmailCampaign.StatusEnum; - /** - * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'scheduledAt'?: string; - /** - * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. - */ - 'abTesting'?: boolean; - /** - * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectA'?: string; - /** - * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectB'?: string; - /** - * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` - */ - 'splitRule'?: number; - /** - * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerCriteria'?: string; - /** - * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerDelay'?: number; - /** - * It is true if you have chosen to send your campaign at best time, otherwise it is false - */ - 'sendAtBestTime'?: boolean; - /** - * utm parameter associated with campaign - */ - 'utmCampaignValue'?: string; - /** - * source of utm parameter - */ - 'utmSource'?: string; - /** - * medium parameter - */ - 'utmMedium'?: string; - /** - * utm id - */ - 'utmID'?: number; - /** - * Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) - */ - 'testSent': boolean; - /** - * Header of the campaign - */ - 'header': string; - /** - * Footer of the campaign - */ - 'footer': string; - 'sender': GetExtendedCampaignOverviewAllOfSender; - /** - * Email defined as the \"Reply to\" of the campaign - */ - 'replyTo': string; - /** - * Customisation of the \"to\" field of the campaign - */ - 'toField'?: string; - /** - * HTML content of the campaign - */ - 'htmlContent': string; - /** - * Link to share the campaign on social medias - */ - 'shareLink'?: string; - /** - * Tag of the campaign - */ - 'tag'?: string; - /** - * Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - /** - * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. - */ - 'inlineImageActivation'?: boolean; - /** - * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign - */ - 'mirrorActive'?: boolean; - /** - * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times - */ - 'recurring'?: boolean; - /** - * Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if \'status\' of the campaign is \'sent\' - */ - 'sentDate'?: string; - /** - * Total number of non-delivered campaigns for a particular campaign id. - */ - 'returnBounce'?: number; - 'recipients': GetCampaignRecipients; - 'statistics': GetExtendedCampaignStats; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "previewText", - "baseName": "previewText", - "type": "string" - }, - { - "name": "type", - "baseName": "type", - "type": "GetEmailCampaign.TypeEnum" - }, - { - "name": "status", - "baseName": "status", - "type": "GetEmailCampaign.StatusEnum" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" - }, - { - "name": "subjectB", - "baseName": "subjectB", - "type": "string" - }, - { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "string" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", - "type": "number" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" - }, - { - "name": "utmCampaignValue", - "baseName": "utmCampaignValue", - "type": "string" - }, - { - "name": "utmSource", - "baseName": "utmSource", - "type": "string" - }, - { - "name": "utmMedium", - "baseName": "utmMedium", - "type": "string" - }, - { - "name": "utmID", - "baseName": "utmID", - "type": "number" - }, - { - "name": "testSent", - "baseName": "testSent", - "type": "boolean" - }, - { - "name": "header", - "baseName": "header", - "type": "string" - }, - { - "name": "footer", - "baseName": "footer", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "GetExtendedCampaignOverviewAllOfSender" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "shareLink", - "baseName": "shareLink", - "type": "string" - }, - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "inlineImageActivation", - "baseName": "inlineImageActivation", - "type": "boolean" - }, - { - "name": "mirrorActive", - "baseName": "mirrorActive", - "type": "boolean" - }, - { - "name": "recurring", - "baseName": "recurring", - "type": "boolean" - }, - { - "name": "sentDate", - "baseName": "sentDate", - "type": "string" - }, - { - "name": "returnBounce", - "baseName": "returnBounce", - "type": "number" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "GetCampaignRecipients" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetExtendedCampaignStats" - } ]; - - static getAttributeTypeMap() { - return GetEmailCampaign.attributeTypeMap; - } -} - -export namespace GetEmailCampaign { - export enum TypeEnum { - Classic = 'classic', - Trigger = 'trigger' - } - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'in_process' - } -} diff --git a/model/getEmailCampaigns.ts b/model/getEmailCampaigns.ts deleted file mode 100644 index cfede52..0000000 --- a/model/getEmailCampaigns.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetEmailCampaignsCampaignsInner } from './getEmailCampaignsCampaignsInner'; - -export class GetEmailCampaigns { - 'campaigns'?: Array; - /** - * Number of Email campaigns retrieved - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaigns", - "baseName": "campaigns", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetEmailCampaigns.attributeTypeMap; - } -} - diff --git a/model/getEmailCampaignsCampaignsInner.ts b/model/getEmailCampaignsCampaignsInner.ts deleted file mode 100644 index 409a6bc..0000000 --- a/model/getEmailCampaignsCampaignsInner.ts +++ /dev/null @@ -1,357 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCampaignRecipients } from './getCampaignRecipients'; -import { GetExtendedCampaignOverviewAllOfSender } from './getExtendedCampaignOverviewAllOfSender'; -import { GetExtendedCampaignStats } from './getExtendedCampaignStats'; - -export class GetEmailCampaignsCampaignsInner { - /** - * ID of the campaign - */ - 'id': number; - /** - * Name of the campaign - */ - 'name': string; - /** - * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` - */ - 'subject'?: string; - /** - * Preview text or preheader of the email campaign - */ - 'previewText'?: string; - /** - * Type of campaign - */ - 'type': GetEmailCampaignsCampaignsInner.TypeEnum; - /** - * Status of the campaign - */ - 'status': GetEmailCampaignsCampaignsInner.StatusEnum; - /** - * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'scheduledAt'?: string; - /** - * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. - */ - 'abTesting'?: boolean; - /** - * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectA'?: string; - /** - * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectB'?: string; - /** - * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` - */ - 'splitRule'?: number; - /** - * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerCriteria'?: string; - /** - * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerDelay'?: number; - /** - * It is true if you have chosen to send your campaign at best time, otherwise it is false - */ - 'sendAtBestTime'?: boolean; - /** - * utm parameter associated with campaign - */ - 'utmCampaignValue'?: string; - /** - * source of utm parameter - */ - 'utmSource'?: string; - /** - * medium parameter - */ - 'utmMedium'?: string; - /** - * utm id - */ - 'utmID'?: number; - /** - * Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) - */ - 'testSent': boolean; - /** - * Header of the campaign - */ - 'header': string; - /** - * Footer of the campaign - */ - 'footer': string; - 'sender': GetExtendedCampaignOverviewAllOfSender; - /** - * Email defined as the \"Reply to\" of the campaign - */ - 'replyTo': string; - /** - * Customisation of the \"to\" field of the campaign - */ - 'toField'?: string; - /** - * HTML content of the campaign - */ - 'htmlContent': string; - /** - * Link to share the campaign on social medias - */ - 'shareLink'?: string; - /** - * Tag of the campaign - */ - 'tag'?: string; - /** - * Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - /** - * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. - */ - 'inlineImageActivation'?: boolean; - /** - * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign - */ - 'mirrorActive'?: boolean; - /** - * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times - */ - 'recurring'?: boolean; - /** - * Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if \'status\' of the campaign is \'sent\' - */ - 'sentDate'?: string; - /** - * Total number of non-delivered campaigns for a particular campaign id. - */ - 'returnBounce'?: number; - 'recipients': GetCampaignRecipients; - 'statistics': GetExtendedCampaignStats; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "previewText", - "baseName": "previewText", - "type": "string" - }, - { - "name": "type", - "baseName": "type", - "type": "GetEmailCampaignsCampaignsInner.TypeEnum" - }, - { - "name": "status", - "baseName": "status", - "type": "GetEmailCampaignsCampaignsInner.StatusEnum" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" - }, - { - "name": "subjectB", - "baseName": "subjectB", - "type": "string" - }, - { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "string" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", - "type": "number" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" - }, - { - "name": "utmCampaignValue", - "baseName": "utmCampaignValue", - "type": "string" - }, - { - "name": "utmSource", - "baseName": "utmSource", - "type": "string" - }, - { - "name": "utmMedium", - "baseName": "utmMedium", - "type": "string" - }, - { - "name": "utmID", - "baseName": "utmID", - "type": "number" - }, - { - "name": "testSent", - "baseName": "testSent", - "type": "boolean" - }, - { - "name": "header", - "baseName": "header", - "type": "string" - }, - { - "name": "footer", - "baseName": "footer", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "GetExtendedCampaignOverviewAllOfSender" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "shareLink", - "baseName": "shareLink", - "type": "string" - }, - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "inlineImageActivation", - "baseName": "inlineImageActivation", - "type": "boolean" - }, - { - "name": "mirrorActive", - "baseName": "mirrorActive", - "type": "boolean" - }, - { - "name": "recurring", - "baseName": "recurring", - "type": "boolean" - }, - { - "name": "sentDate", - "baseName": "sentDate", - "type": "string" - }, - { - "name": "returnBounce", - "baseName": "returnBounce", - "type": "number" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "GetCampaignRecipients" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetExtendedCampaignStats" - } ]; - - static getAttributeTypeMap() { - return GetEmailCampaignsCampaignsInner.attributeTypeMap; - } -} - -export namespace GetEmailCampaignsCampaignsInner { - export enum TypeEnum { - Classic = 'classic', - Trigger = 'trigger' - } - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'in_process' - } -} diff --git a/model/getEmailEventReport.ts b/model/getEmailEventReport.ts deleted file mode 100644 index fb10a0e..0000000 --- a/model/getEmailEventReport.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetEmailEventReportEventsInner } from './getEmailEventReportEventsInner'; - -export class GetEmailEventReport { - 'events'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "events", - "baseName": "events", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetEmailEventReport.attributeTypeMap; - } -} - diff --git a/model/getEmailEventReportEventsInner.ts b/model/getEmailEventReportEventsInner.ts deleted file mode 100644 index 15a7daa..0000000 --- a/model/getEmailEventReportEventsInner.ts +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetEmailEventReportEventsInner { - /** - * Email address which generates the event - */ - 'email': string; - /** - * UTC date-time on which the event has been generated - */ - 'date': string; - /** - * Subject of the event - */ - 'subject'?: string; - /** - * Message ID which generated the event - */ - 'messageId': string; - /** - * Event which occurred - */ - 'event': GetEmailEventReportEventsInner.EventEnum; - /** - * Reason of bounce (only available if the event is hardbounce or softbounce) - */ - 'reason'?: string; - /** - * Tag of the email which generated the event - */ - 'tag'?: string; - /** - * IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) - */ - 'ip'?: string; - /** - * The link which is sent to the user (only available if the event is requests or opened or clicks) - */ - 'link'?: string; - /** - * Sender email from which the emails are sent - */ - 'from'?: string; - /** - * ID of the template (only available if the email is template based) - */ - 'templateId'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - }, - { - "name": "event", - "baseName": "event", - "type": "GetEmailEventReportEventsInner.EventEnum" - }, - { - "name": "reason", - "baseName": "reason", - "type": "string" - }, - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "link", - "baseName": "link", - "type": "string" - }, - { - "name": "from", - "baseName": "from", - "type": "string" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetEmailEventReportEventsInner.attributeTypeMap; - } -} - -export namespace GetEmailEventReportEventsInner { - export enum EventEnum { - Bounces = 'bounces', - HardBounces = 'hardBounces', - SoftBounces = 'softBounces', - Delivered = 'delivered', - Spam = 'spam', - Requests = 'requests', - Opened = 'opened', - Clicks = 'clicks', - Invalid = 'invalid', - Deferred = 'deferred', - Blocked = 'blocked', - Unsubscribed = 'unsubscribed', - Error = 'error', - LoadedByProxy = 'loadedByProxy' - } -} diff --git a/model/getExtendedCampaignOverview.ts b/model/getExtendedCampaignOverview.ts deleted file mode 100644 index 4bafda0..0000000 --- a/model/getExtendedCampaignOverview.ts +++ /dev/null @@ -1,343 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExtendedCampaignOverviewAllOfSender } from './getExtendedCampaignOverviewAllOfSender'; - -export class GetExtendedCampaignOverview { - /** - * ID of the campaign - */ - 'id': number; - /** - * Name of the campaign - */ - 'name': string; - /** - * Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` - */ - 'subject'?: string; - /** - * Preview text or preheader of the email campaign - */ - 'previewText'?: string; - /** - * Type of campaign - */ - 'type': GetExtendedCampaignOverview.TypeEnum; - /** - * Status of the campaign - */ - 'status': GetExtendedCampaignOverview.StatusEnum; - /** - * UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'scheduledAt'?: string; - /** - * Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. - */ - 'abTesting'?: boolean; - /** - * Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectA'?: string; - /** - * Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` - */ - 'subjectB'?: string; - /** - * The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` - */ - 'splitRule'?: number; - /** - * Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerCriteria'?: string; - /** - * The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` - */ - 'winnerDelay'?: number; - /** - * It is true if you have chosen to send your campaign at best time, otherwise it is false - */ - 'sendAtBestTime'?: boolean; - /** - * utm parameter associated with campaign - */ - 'utmCampaignValue'?: string; - /** - * source of utm parameter - */ - 'utmSource'?: string; - /** - * medium parameter - */ - 'utmMedium'?: string; - /** - * utm id - */ - 'utmID'?: number; - /** - * Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) - */ - 'testSent': boolean; - /** - * Header of the campaign - */ - 'header': string; - /** - * Footer of the campaign - */ - 'footer': string; - 'sender': GetExtendedCampaignOverviewAllOfSender; - /** - * Email defined as the \"Reply to\" of the campaign - */ - 'replyTo': string; - /** - * Customisation of the \"to\" field of the campaign - */ - 'toField'?: string; - /** - * HTML content of the campaign - */ - 'htmlContent': string; - /** - * Link to share the campaign on social medias - */ - 'shareLink'?: string; - /** - * Tag of the campaign - */ - 'tag'?: string; - /** - * Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - /** - * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. - */ - 'inlineImageActivation'?: boolean; - /** - * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign - */ - 'mirrorActive'?: boolean; - /** - * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times - */ - 'recurring'?: boolean; - /** - * Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if \'status\' of the campaign is \'sent\' - */ - 'sentDate'?: string; - /** - * Total number of non-delivered campaigns for a particular campaign id. - */ - 'returnBounce'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "previewText", - "baseName": "previewText", - "type": "string" - }, - { - "name": "type", - "baseName": "type", - "type": "GetExtendedCampaignOverview.TypeEnum" - }, - { - "name": "status", - "baseName": "status", - "type": "GetExtendedCampaignOverview.StatusEnum" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" - }, - { - "name": "subjectB", - "baseName": "subjectB", - "type": "string" - }, - { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "string" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", - "type": "number" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" - }, - { - "name": "utmCampaignValue", - "baseName": "utmCampaignValue", - "type": "string" - }, - { - "name": "utmSource", - "baseName": "utmSource", - "type": "string" - }, - { - "name": "utmMedium", - "baseName": "utmMedium", - "type": "string" - }, - { - "name": "utmID", - "baseName": "utmID", - "type": "number" - }, - { - "name": "testSent", - "baseName": "testSent", - "type": "boolean" - }, - { - "name": "header", - "baseName": "header", - "type": "string" - }, - { - "name": "footer", - "baseName": "footer", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "GetExtendedCampaignOverviewAllOfSender" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "shareLink", - "baseName": "shareLink", - "type": "string" - }, - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "inlineImageActivation", - "baseName": "inlineImageActivation", - "type": "boolean" - }, - { - "name": "mirrorActive", - "baseName": "mirrorActive", - "type": "boolean" - }, - { - "name": "recurring", - "baseName": "recurring", - "type": "boolean" - }, - { - "name": "sentDate", - "baseName": "sentDate", - "type": "string" - }, - { - "name": "returnBounce", - "baseName": "returnBounce", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetExtendedCampaignOverview.attributeTypeMap; - } -} - -export namespace GetExtendedCampaignOverview { - export enum TypeEnum { - Classic = 'classic', - Trigger = 'trigger' - } - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'in_process' - } -} diff --git a/model/getExtendedCampaignOverviewAllOfSender.ts b/model/getExtendedCampaignOverviewAllOfSender.ts deleted file mode 100644 index 9a2c6c2..0000000 --- a/model/getExtendedCampaignOverviewAllOfSender.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetExtendedCampaignOverviewAllOfSender { - /** - * Sender name of the campaign - */ - 'name'?: string; - /** - * Sender email of the campaign - */ - 'email'?: string; - /** - * Sender id of the campaign - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetExtendedCampaignOverviewAllOfSender.attributeTypeMap; - } -} - diff --git a/model/getExtendedCampaignStats.ts b/model/getExtendedCampaignStats.ts deleted file mode 100644 index 88e8e7a..0000000 --- a/model/getExtendedCampaignStats.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCampaignStats } from './getCampaignStats'; -import { GetDeviceBrowserStats } from './getDeviceBrowserStats'; -import { GetStatsByDevice } from './getStatsByDevice'; - -export class GetExtendedCampaignStats { - 'globalStats': GetCampaignStats; - /** - * List-wise statistics of the campaign. - */ - 'campaignStats': Array; - /** - * Number of clicks on mirror link - */ - 'mirrorClick': number; - /** - * Number of remaning emails to send - */ - 'remaining': number; - /** - * Statistics about the number of clicks for the links - */ - 'linksStats': object; - 'statsByDomain': { [key: string]: GetCampaignStats; }; - 'statsByDevice': GetStatsByDevice; - 'statsByBrowser': { [key: string]: GetDeviceBrowserStats; }; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "globalStats", - "baseName": "globalStats", - "type": "GetCampaignStats" - }, - { - "name": "campaignStats", - "baseName": "campaignStats", - "type": "Array" - }, - { - "name": "mirrorClick", - "baseName": "mirrorClick", - "type": "number" - }, - { - "name": "remaining", - "baseName": "remaining", - "type": "number" - }, - { - "name": "linksStats", - "baseName": "linksStats", - "type": "object" - }, - { - "name": "statsByDomain", - "baseName": "statsByDomain", - "type": "{ [key: string]: GetCampaignStats; }" - }, - { - "name": "statsByDevice", - "baseName": "statsByDevice", - "type": "GetStatsByDevice" - }, - { - "name": "statsByBrowser", - "baseName": "statsByBrowser", - "type": "{ [key: string]: GetDeviceBrowserStats; }" - } ]; - - static getAttributeTypeMap() { - return GetExtendedCampaignStats.attributeTypeMap; - } -} - diff --git a/model/getExtendedClient.ts b/model/getExtendedClient.ts deleted file mode 100644 index db95858..0000000 --- a/model/getExtendedClient.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExtendedClientAllOfAddress } from './getExtendedClientAllOfAddress'; - -export class GetExtendedClient { - /** - * Login Email - */ - 'email': string; - /** - * First Name - */ - 'firstName': string; - /** - * Last Name - */ - 'lastName': string; - /** - * Name of the company - */ - 'companyName': string; - 'address': GetExtendedClientAllOfAddress; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "address", - "baseName": "address", - "type": "GetExtendedClientAllOfAddress" - } ]; - - static getAttributeTypeMap() { - return GetExtendedClient.attributeTypeMap; - } -} - diff --git a/model/getExtendedClientAllOfAddress.ts b/model/getExtendedClientAllOfAddress.ts deleted file mode 100644 index e7c65ec..0000000 --- a/model/getExtendedClientAllOfAddress.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Address informations -*/ -export class GetExtendedClientAllOfAddress { - /** - * Street information - */ - 'street': string; - /** - * City information - */ - 'city': string; - /** - * Zip Code information - */ - 'zipCode': string; - /** - * Country information - */ - 'country': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "street", - "baseName": "street", - "type": "string" - }, - { - "name": "city", - "baseName": "city", - "type": "string" - }, - { - "name": "zipCode", - "baseName": "zipCode", - "type": "string" - }, - { - "name": "country", - "baseName": "country", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetExtendedClientAllOfAddress.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetails.ts b/model/getExtendedContactDetails.ts deleted file mode 100644 index 7b9f5a2..0000000 --- a/model/getExtendedContactDetails.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExtendedContactDetailsAllOfStatistics } from './getExtendedContactDetailsAllOfStatistics'; - -export class GetExtendedContactDetails { - /** - * Email address of the contact for which you requested the details - */ - 'email'?: string; - /** - * ID of the contact for which you requested the details - */ - 'id': number; - /** - * Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) - */ - 'emailBlacklisted': boolean; - /** - * Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) - */ - 'smsBlacklisted': boolean; - /** - * Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - 'listIds': Array; - 'listUnsubscribed'?: Array; - /** - * Set of attributes of the contact - */ - 'attributes': object; - 'statistics': GetExtendedContactDetailsAllOfStatistics; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" - }, - { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "listUnsubscribed", - "baseName": "listUnsubscribed", - "type": "Array" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetExtendedContactDetailsAllOfStatistics" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetails.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetailsAllOfStatistics.ts b/model/getExtendedContactDetailsAllOfStatistics.ts deleted file mode 100644 index bcd46b9..0000000 --- a/model/getExtendedContactDetailsAllOfStatistics.ts +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExtendedContactDetailsAllOfStatisticsClicked } from './getExtendedContactDetailsAllOfStatisticsClicked'; -import { GetExtendedContactDetailsAllOfStatisticsMessagesSent } from './getExtendedContactDetailsAllOfStatisticsMessagesSent'; -import { GetExtendedContactDetailsAllOfStatisticsOpened } from './getExtendedContactDetailsAllOfStatisticsOpened'; -import { GetExtendedContactDetailsAllOfStatisticsUnsubscriptions } from './getExtendedContactDetailsAllOfStatisticsUnsubscriptions'; - -/** -* Campaign statistics of the contact -*/ -export class GetExtendedContactDetailsAllOfStatistics { - /** - * Listing of the sent campaign for the contact - */ - 'messagesSent'?: Array; - /** - * Listing of the hardbounes generated by the contact - */ - 'hardBounces'?: Array; - /** - * Listing of the softbounes generated by the contact - */ - 'softBounces'?: Array; - /** - * Listing of the complaints generated by the contact - */ - 'complaints'?: Array; - 'unsubscriptions'?: GetExtendedContactDetailsAllOfStatisticsUnsubscriptions; - /** - * Listing of the openings generated by the contact - */ - 'opened'?: Array; - /** - * Listing of the clicks generated by the contact - */ - 'clicked'?: Array; - /** - * Listing of the transactional attributes for the contact - */ - 'transacAttributes'?: Array; - /** - * Listing of the delivered campaign for the contact - */ - 'delivered'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "messagesSent", - "baseName": "messagesSent", - "type": "Array" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "Array" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "Array" - }, - { - "name": "complaints", - "baseName": "complaints", - "type": "Array" - }, - { - "name": "unsubscriptions", - "baseName": "unsubscriptions", - "type": "GetExtendedContactDetailsAllOfStatisticsUnsubscriptions" - }, - { - "name": "opened", - "baseName": "opened", - "type": "Array" - }, - { - "name": "clicked", - "baseName": "clicked", - "type": "Array" - }, - { - "name": "transacAttributes", - "baseName": "transacAttributes", - "type": "Array" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetailsAllOfStatistics.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetailsAllOfStatisticsClicked.ts b/model/getExtendedContactDetailsAllOfStatisticsClicked.ts deleted file mode 100644 index 184094d..0000000 --- a/model/getExtendedContactDetailsAllOfStatisticsClicked.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExtendedContactDetailsAllOfStatisticsLinks } from './getExtendedContactDetailsAllOfStatisticsLinks'; - -export class GetExtendedContactDetailsAllOfStatisticsClicked { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - /** - * Listing of the clicked links for the campaign - */ - 'links': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "links", - "baseName": "links", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetailsAllOfStatisticsClicked.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetailsAllOfStatisticsLinks.ts b/model/getExtendedContactDetailsAllOfStatisticsLinks.ts deleted file mode 100644 index 2e91c39..0000000 --- a/model/getExtendedContactDetailsAllOfStatisticsLinks.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetExtendedContactDetailsAllOfStatisticsLinks { - /** - * Number of clicks on this link for the campaign - */ - 'count': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; - /** - * IP from which the user has clicked on the link - */ - 'ip': string; - /** - * URL of the clicked link - */ - 'url': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetailsAllOfStatisticsLinks.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetailsAllOfStatisticsMessagesSent.ts b/model/getExtendedContactDetailsAllOfStatisticsMessagesSent.ts deleted file mode 100644 index f5c564c..0000000 --- a/model/getExtendedContactDetailsAllOfStatisticsMessagesSent.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetExtendedContactDetailsAllOfStatisticsMessagesSent { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetailsAllOfStatisticsMessagesSent.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetailsAllOfStatisticsOpened.ts b/model/getExtendedContactDetailsAllOfStatisticsOpened.ts deleted file mode 100644 index 06d0dba..0000000 --- a/model/getExtendedContactDetailsAllOfStatisticsOpened.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetExtendedContactDetailsAllOfStatisticsOpened { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - /** - * Number of openings for the campaign - */ - 'count': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; - /** - * IP from which the user has opened the email - */ - 'ip': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetailsAllOfStatisticsOpened.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptions.ts b/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptions.ts deleted file mode 100644 index be0013c..0000000 --- a/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptions.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription } from './getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription'; -import { GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription } from './getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription'; - -/** -* Listing of the unsubscription for the contact -*/ -export class GetExtendedContactDetailsAllOfStatisticsUnsubscriptions { - /** - * Contact unsubscribe via unsubscription link in a campaign - */ - 'userUnsubscription': Array; - /** - * Contact has been unsubscribed from the administrator - */ - 'adminUnsubscription': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "userUnsubscription", - "baseName": "userUnsubscription", - "type": "Array" - }, - { - "name": "adminUnsubscription", - "baseName": "adminUnsubscription", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.ts b/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.ts deleted file mode 100644 index df87147..0000000 --- a/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription { - /** - * UTC date-time of the event - */ - 'eventTime': string; - /** - * IP from which the user has been unsubscribed - */ - 'ip'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.attributeTypeMap; - } -} - diff --git a/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.ts b/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.ts deleted file mode 100644 index d6c6dd5..0000000 --- a/model/getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription { - /** - * ID of the campaign which generated the event - */ - 'campaignId': number; - /** - * UTC date-time of the event - */ - 'eventTime': string; - /** - * IP from which the user has unsubscribed - */ - 'ip'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "eventTime", - "baseName": "eventTime", - "type": "string" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.attributeTypeMap; - } -} - diff --git a/model/getExtendedList.ts b/model/getExtendedList.ts deleted file mode 100644 index 8dcdbe1..0000000 --- a/model/getExtendedList.ts +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExtendedListAllOfCampaignStats } from './getExtendedListAllOfCampaignStats'; - -export class GetExtendedList { - /** - * ID of the list - */ - 'id': number; - /** - * Name of the list - */ - 'name': string; - /** - * Number of blacklisted contacts in the list - */ - 'totalBlacklisted': number; - /** - * Number of contacts in the list - */ - 'totalSubscribers': number; - /** - * Number of unique contacts in the list - */ - 'uniqueSubscribers': number; - /** - * ID of the folder - */ - 'folderId': number; - /** - * Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - 'campaignStats'?: Array; - /** - * Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) - */ - 'dynamicList'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "totalBlacklisted", - "baseName": "totalBlacklisted", - "type": "number" - }, - { - "name": "totalSubscribers", - "baseName": "totalSubscribers", - "type": "number" - }, - { - "name": "uniqueSubscribers", - "baseName": "uniqueSubscribers", - "type": "number" - }, - { - "name": "folderId", - "baseName": "folderId", - "type": "number" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "campaignStats", - "baseName": "campaignStats", - "type": "Array" - }, - { - "name": "dynamicList", - "baseName": "dynamicList", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetExtendedList.attributeTypeMap; - } -} - diff --git a/model/getExtendedListAllOfCampaignStats.ts b/model/getExtendedListAllOfCampaignStats.ts deleted file mode 100644 index 61807a6..0000000 --- a/model/getExtendedListAllOfCampaignStats.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCampaignStats } from './getCampaignStats'; - -export class GetExtendedListAllOfCampaignStats { - /** - * ID of the campaign - */ - 'campaignId': number; - 'stats': GetCampaignStats; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignId", - "baseName": "campaignId", - "type": "number" - }, - { - "name": "stats", - "baseName": "stats", - "type": "GetCampaignStats" - } ]; - - static getAttributeTypeMap() { - return GetExtendedListAllOfCampaignStats.attributeTypeMap; - } -} - diff --git a/model/getExternalFeedByUUID.ts b/model/getExternalFeedByUUID.ts deleted file mode 100644 index 6de456d..0000000 --- a/model/getExternalFeedByUUID.ts +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExternalFeedByUUIDHeadersInner } from './getExternalFeedByUUIDHeadersInner'; - -export class GetExternalFeedByUUID { - /** - * ID of the feed - */ - 'id': string; - /** - * Name of the feed - */ - 'name': string; - /** - * URL of the feed - */ - 'url': string; - /** - * Auth type of the feed: * `basic` * `token` * `noAuth` - */ - 'authType': GetExternalFeedByUUID.AuthTypeEnum; - /** - * Username for authType `basic` - */ - 'username'?: string; - /** - * Password for authType `basic` - */ - 'password'?: string; - /** - * Token for authType `token` - */ - 'token'?: string; - /** - * Custom headers for the feed - */ - 'headers': Array; - /** - * Maximum number of retries on the feed url - */ - 'maxRetries': number; - /** - * Toggle caching of feed url response - */ - 'cache': boolean; - /** - * Datetime on which the feed was created - */ - 'createdAt': Date; - /** - * Datetime on which the feed was modified - */ - 'modifiedAt': Date; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "authType", - "baseName": "authType", - "type": "GetExternalFeedByUUID.AuthTypeEnum" - }, - { - "name": "username", - "baseName": "username", - "type": "string" - }, - { - "name": "password", - "baseName": "password", - "type": "string" - }, - { - "name": "token", - "baseName": "token", - "type": "string" - }, - { - "name": "headers", - "baseName": "headers", - "type": "Array" - }, - { - "name": "maxRetries", - "baseName": "maxRetries", - "type": "number" - }, - { - "name": "cache", - "baseName": "cache", - "type": "boolean" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "Date" - } ]; - - static getAttributeTypeMap() { - return GetExternalFeedByUUID.attributeTypeMap; - } -} - -export namespace GetExternalFeedByUUID { - export enum AuthTypeEnum { - Basic = 'basic', - Token = 'token', - NoAuth = 'noAuth' - } -} diff --git a/model/getExternalFeedByUUIDHeadersInner.ts b/model/getExternalFeedByUUIDHeadersInner.ts deleted file mode 100644 index 22a81d1..0000000 --- a/model/getExternalFeedByUUIDHeadersInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetExternalFeedByUUIDHeadersInner { - /** - * Name of the header - */ - 'name'?: string; - /** - * Value of the header - */ - 'value'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "value", - "baseName": "value", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetExternalFeedByUUIDHeadersInner.attributeTypeMap; - } -} - diff --git a/model/getFolder.ts b/model/getFolder.ts deleted file mode 100644 index 6088518..0000000 --- a/model/getFolder.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetFolder { - /** - * ID of the folder - */ - 'id': number; - /** - * Name of the folder - */ - 'name': string; - /** - * Number of blacklisted contacts in the folder - */ - 'totalBlacklisted': number; - /** - * Number of contacts in the folder - */ - 'totalSubscribers': number; - /** - * Number of unique contacts in the folder - */ - 'uniqueSubscribers': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "totalBlacklisted", - "baseName": "totalBlacklisted", - "type": "number" - }, - { - "name": "totalSubscribers", - "baseName": "totalSubscribers", - "type": "number" - }, - { - "name": "uniqueSubscribers", - "baseName": "uniqueSubscribers", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetFolder.attributeTypeMap; - } -} - diff --git a/model/getFolderLists.ts b/model/getFolderLists.ts deleted file mode 100644 index fc33f66..0000000 --- a/model/getFolderLists.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetList } from './getList'; - -export class GetFolderLists { - 'lists'?: Array; - /** - * Number of lists in the folder - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "lists", - "baseName": "lists", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetFolderLists.attributeTypeMap; - } -} - diff --git a/model/getFolders.ts b/model/getFolders.ts deleted file mode 100644 index f229dfb..0000000 --- a/model/getFolders.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetFolder } from './getFolder'; - -export class GetFolders { - 'folders'?: Array; - /** - * Number of folders available in your account - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "folders", - "baseName": "folders", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetFolders.attributeTypeMap; - } -} - diff --git a/model/getInboundEmailEvents.ts b/model/getInboundEmailEvents.ts deleted file mode 100644 index 6415443..0000000 --- a/model/getInboundEmailEvents.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetInboundEmailEventsEventsInner } from './getInboundEmailEventsEventsInner'; - -export class GetInboundEmailEvents { - 'events'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "events", - "baseName": "events", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetInboundEmailEvents.attributeTypeMap; - } -} - diff --git a/model/getInboundEmailEventsByUuid.ts b/model/getInboundEmailEventsByUuid.ts deleted file mode 100644 index 369d0b3..0000000 --- a/model/getInboundEmailEventsByUuid.ts +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetInboundEmailEventsByUuidAttachmentsInner } from './getInboundEmailEventsByUuidAttachmentsInner'; -import { GetInboundEmailEventsByUuidLogsInner } from './getInboundEmailEventsByUuidLogsInner'; - -export class GetInboundEmailEventsByUuid { - /** - * Date when email was received on SMTP relay - */ - 'receivedAt'?: Date; - /** - * Date when email was delivered successfully to client’s webhook - */ - 'deliveredAt'?: Date; - /** - * Recipient’s email address - */ - 'recipient'?: string; - /** - * Sender’s email address - */ - 'sender'?: string; - /** - * Value of the Message-ID header. This will be present only after the processing is done. - */ - 'messageId'?: string; - /** - * Value of the Subject header. This will be present only after the processing is done. - */ - 'subject'?: string; - /** - * List of attachments of the email. This will be present only after the processing is done. - */ - 'attachments'?: Array; - /** - * List of events/logs that describe the lifecycle of the email on SIB platform - */ - 'logs'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "receivedAt", - "baseName": "receivedAt", - "type": "Date" - }, - { - "name": "deliveredAt", - "baseName": "deliveredAt", - "type": "Date" - }, - { - "name": "recipient", - "baseName": "recipient", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "attachments", - "baseName": "attachments", - "type": "Array" - }, - { - "name": "logs", - "baseName": "logs", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetInboundEmailEventsByUuid.attributeTypeMap; - } -} - diff --git a/model/getInboundEmailEventsByUuidAttachmentsInner.ts b/model/getInboundEmailEventsByUuidAttachmentsInner.ts deleted file mode 100644 index a68b04b..0000000 --- a/model/getInboundEmailEventsByUuidAttachmentsInner.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetInboundEmailEventsByUuidAttachmentsInner { - /** - * filename specified in the Content-Disposition header of the attachment - */ - 'name'?: string; - /** - * value of the Content-Type header of the attachment - */ - 'contentType'?: string; - /** - * value of the Content-ID header of the attachment. - */ - 'contentId'?: string; - /** - * size of the attachment in bytes - */ - 'contentLength'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "contentType", - "baseName": "contentType", - "type": "string" - }, - { - "name": "contentId", - "baseName": "contentId", - "type": "string" - }, - { - "name": "contentLength", - "baseName": "contentLength", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetInboundEmailEventsByUuidAttachmentsInner.attributeTypeMap; - } -} - diff --git a/model/getInboundEmailEventsByUuidLogsInner.ts b/model/getInboundEmailEventsByUuidLogsInner.ts deleted file mode 100644 index 0f34831..0000000 --- a/model/getInboundEmailEventsByUuidLogsInner.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetInboundEmailEventsByUuidLogsInner { - /** - * Date of the event - */ - 'date'?: Date; - /** - * Type of the event - */ - 'type'?: GetInboundEmailEventsByUuidLogsInner.TypeEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "date", - "baseName": "date", - "type": "Date" - }, - { - "name": "type", - "baseName": "type", - "type": "GetInboundEmailEventsByUuidLogsInner.TypeEnum" - } ]; - - static getAttributeTypeMap() { - return GetInboundEmailEventsByUuidLogsInner.attributeTypeMap; - } -} - -export namespace GetInboundEmailEventsByUuidLogsInner { - export enum TypeEnum { - Received = 'received', - Processed = 'processed', - WebhookFailed = 'webhookFailed', - WebhookDelivered = 'webhookDelivered' - } -} diff --git a/model/getInboundEmailEventsEventsInner.ts b/model/getInboundEmailEventsEventsInner.ts deleted file mode 100644 index 83b700a..0000000 --- a/model/getInboundEmailEventsEventsInner.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetInboundEmailEventsEventsInner { - /** - * UUID that can be used to fetch additional data - */ - 'uuid': string; - /** - * Date when email was received on SMTP relay - */ - 'date': Date; - /** - * Sender’s email address - */ - 'sender': string; - /** - * Recipient’s email address - */ - 'recipient': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "uuid", - "baseName": "uuid", - "type": "string" - }, - { - "name": "date", - "baseName": "date", - "type": "Date" - }, - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "recipient", - "baseName": "recipient", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetInboundEmailEventsEventsInner.attributeTypeMap; - } -} - diff --git a/model/getInvitedUsersList.ts b/model/getInvitedUsersList.ts deleted file mode 100644 index 4b0268e..0000000 --- a/model/getInvitedUsersList.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetInvitedUsersListUsersInner } from './getInvitedUsersListUsersInner'; - -export class GetInvitedUsersList { - /** - * Get invited users list - */ - 'users'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "users", - "baseName": "users", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetInvitedUsersList.attributeTypeMap; - } -} - diff --git a/model/getInvitedUsersListUsersInner.ts b/model/getInvitedUsersListUsersInner.ts deleted file mode 100644 index 0c964ac..0000000 --- a/model/getInvitedUsersListUsersInner.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetInvitedUsersListUsersInnerFeatureAccess } from './getInvitedUsersListUsersInnerFeatureAccess'; - -export class GetInvitedUsersListUsersInner { - /** - * Email address of the user. - */ - 'email': string; - /** - * Flag for indicating is user owner of the organization. - */ - 'isOwner': string; - /** - * Status of the invited user. - */ - 'status': string; - 'featureAccess': GetInvitedUsersListUsersInnerFeatureAccess; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "isOwner", - "baseName": "is_owner", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "string" - }, - { - "name": "featureAccess", - "baseName": "feature_access", - "type": "GetInvitedUsersListUsersInnerFeatureAccess" - } ]; - - static getAttributeTypeMap() { - return GetInvitedUsersListUsersInner.attributeTypeMap; - } -} - diff --git a/model/getInvitedUsersListUsersInnerFeatureAccess.ts b/model/getInvitedUsersListUsersInnerFeatureAccess.ts deleted file mode 100644 index 8d4e221..0000000 --- a/model/getInvitedUsersListUsersInnerFeatureAccess.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Feature accessiblity given to the user. -*/ -export class GetInvitedUsersListUsersInnerFeatureAccess { - /** - * Marketing features accessiblity. - */ - 'marketing'?: object; - /** - * Conversations features accessiblity. - */ - 'conversations'?: object; - /** - * CRM features accessiblity. - */ - 'crm'?: object; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "marketing", - "baseName": "marketing", - "type": "object" - }, - { - "name": "conversations", - "baseName": "conversations", - "type": "object" - }, - { - "name": "crm", - "baseName": "crm", - "type": "object" - } ]; - - static getAttributeTypeMap() { - return GetInvitedUsersListUsersInnerFeatureAccess.attributeTypeMap; - } -} - diff --git a/model/getIp.ts b/model/getIp.ts deleted file mode 100644 index 089102a..0000000 --- a/model/getIp.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetIp { - /** - * ID of the dedicated IP - */ - 'id': number; - /** - * Dedicated IP - */ - 'ip': string; - /** - * Status of the IP (true=active, false=inactive) - */ - 'active': boolean; - /** - * Domain associated to the IP - */ - 'domain': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "active", - "baseName": "active", - "type": "boolean" - }, - { - "name": "domain", - "baseName": "domain", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetIp.attributeTypeMap; - } -} - diff --git a/model/getIpFromSender.ts b/model/getIpFromSender.ts deleted file mode 100644 index 4df142b..0000000 --- a/model/getIpFromSender.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetIpFromSender { - /** - * ID of the dedicated IP - */ - 'id': number; - /** - * Dedicated IP - */ - 'ip': string; - /** - * Domain associated to the IP - */ - 'domain': string; - /** - * Weight of the IP - */ - 'weight': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "domain", - "baseName": "domain", - "type": "string" - }, - { - "name": "weight", - "baseName": "weight", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetIpFromSender.attributeTypeMap; - } -} - diff --git a/model/getIps.ts b/model/getIps.ts deleted file mode 100644 index dd0075f..0000000 --- a/model/getIps.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetIp } from './getIp'; - -export class GetIps { - /** - * Dedicated IP(s) available on your account - */ - 'ips': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ips", - "baseName": "ips", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetIps.attributeTypeMap; - } -} - diff --git a/model/getIpsFromSender.ts b/model/getIpsFromSender.ts deleted file mode 100644 index a700ab4..0000000 --- a/model/getIpsFromSender.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetIpFromSender } from './getIpFromSender'; - -export class GetIpsFromSender { - /** - * Dedicated IP(s) linked to a sender - */ - 'ips': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ips", - "baseName": "ips", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetIpsFromSender.attributeTypeMap; - } -} - diff --git a/model/getList.ts b/model/getList.ts deleted file mode 100644 index f5d4874..0000000 --- a/model/getList.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetList { - /** - * ID of the list - */ - 'id': number; - /** - * Name of the list - */ - 'name': string; - /** - * Number of blacklisted contacts in the list - */ - 'totalBlacklisted': number; - /** - * Number of contacts in the list - */ - 'totalSubscribers': number; - /** - * Number of unique contacts in the list - */ - 'uniqueSubscribers': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "totalBlacklisted", - "baseName": "totalBlacklisted", - "type": "number" - }, - { - "name": "totalSubscribers", - "baseName": "totalSubscribers", - "type": "number" - }, - { - "name": "uniqueSubscribers", - "baseName": "uniqueSubscribers", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetList.attributeTypeMap; - } -} - diff --git a/model/getLists.ts b/model/getLists.ts deleted file mode 100644 index 4a4eee0..0000000 --- a/model/getLists.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetListsListsInner } from './getListsListsInner'; - -export class GetLists { - /** - * Listing of all the lists available in your account - */ - 'lists'?: Array; - /** - * Number of lists in your account - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "lists", - "baseName": "lists", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetLists.attributeTypeMap; - } -} - diff --git a/model/getListsListsInner.ts b/model/getListsListsInner.ts deleted file mode 100644 index 1111140..0000000 --- a/model/getListsListsInner.ts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetListsListsInner { - /** - * ID of the list - */ - 'id': number; - /** - * Name of the list - */ - 'name': string; - /** - * Number of blacklisted contacts in the list - */ - 'totalBlacklisted': number; - /** - * Number of contacts in the list - */ - 'totalSubscribers': number; - /** - * Number of unique contacts in the list - */ - 'uniqueSubscribers': number; - /** - * ID of the folder - */ - 'folderId': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "totalBlacklisted", - "baseName": "totalBlacklisted", - "type": "number" - }, - { - "name": "totalSubscribers", - "baseName": "totalSubscribers", - "type": "number" - }, - { - "name": "uniqueSubscribers", - "baseName": "uniqueSubscribers", - "type": "number" - }, - { - "name": "folderId", - "baseName": "folderId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetListsListsInner.attributeTypeMap; - } -} - diff --git a/model/getOrders.ts b/model/getOrders.ts deleted file mode 100644 index 7f83452..0000000 --- a/model/getOrders.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetOrdersOrdersInner } from './getOrdersOrdersInner'; - -export class GetOrders { - 'orders'?: Array; - /** - * Number of orders - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "orders", - "baseName": "orders", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetOrders.attributeTypeMap; - } -} - diff --git a/model/getOrdersOrdersInner.ts b/model/getOrdersOrdersInner.ts deleted file mode 100644 index 660c812..0000000 --- a/model/getOrdersOrdersInner.ts +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { OrderBilling } from './orderBilling'; -import { OrderProductsInner } from './orderProductsInner'; - -export class GetOrdersOrdersInner { - /** - * Unique ID of the order. - */ - 'id': string; - /** - * Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created. - */ - 'createdAt': string; - /** - * Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated. - */ - 'updatedAt': string; - /** - * State of the order. - */ - 'status': string; - /** - * Total amount of the order, including all shipping expenses, tax and the price of items. - */ - 'amount': number; - 'products': Array; - /** - * Email of the contact, Mandatory if \"phone\" field is not passed in \"billing\" parameter. - */ - 'email'?: string; - 'billing'?: OrderBilling; - /** - * Coupons applied to the order. Stored case insensitive. - */ - 'coupons'?: Array; - /** - * Contact ID for the order - */ - 'contactId'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "updatedAt", - "baseName": "updatedAt", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "string" - }, - { - "name": "amount", - "baseName": "amount", - "type": "number" - }, - { - "name": "products", - "baseName": "products", - "type": "Array" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "billing", - "baseName": "billing", - "type": "OrderBilling" - }, - { - "name": "coupons", - "baseName": "coupons", - "type": "Array" - }, - { - "name": "contactId", - "baseName": "contact_id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetOrdersOrdersInner.attributeTypeMap; - } -} - diff --git a/model/getPaymentRequest.ts b/model/getPaymentRequest.ts deleted file mode 100644 index 9ab37a0..0000000 --- a/model/getPaymentRequest.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { Cart } from './cart'; -import { Configuration } from './configuration'; -import { Notification } from './notification'; - -export class GetPaymentRequest { - /** - * Reference of the payment request, it will appear on the payment page. - */ - 'reference': string; - /** - * Status of the payment request. - */ - 'status': GetPaymentRequest.StatusEnum; - 'configuration'?: Configuration; - /** - * Brevo ID of the contact requested to pay. - */ - 'contactId'?: number; - /** - * number of reminders sent. - */ - 'numberOfRemindersSent'?: number; - 'cart': Cart; - 'notification': Notification; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "reference", - "baseName": "reference", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "GetPaymentRequest.StatusEnum" - }, - { - "name": "configuration", - "baseName": "configuration", - "type": "Configuration" - }, - { - "name": "contactId", - "baseName": "contactId", - "type": "number" - }, - { - "name": "numberOfRemindersSent", - "baseName": "numberOfRemindersSent", - "type": "number" - }, - { - "name": "cart", - "baseName": "cart", - "type": "Cart" - }, - { - "name": "notification", - "baseName": "notification", - "type": "Notification" - } ]; - - static getAttributeTypeMap() { - return GetPaymentRequest.attributeTypeMap; - } -} - -export namespace GetPaymentRequest { - export enum StatusEnum { - Created = 'created', - Sent = 'sent', - ReminderSentPaid = 'reminderSent - paid' - } -} diff --git a/model/getProcess.ts b/model/getProcess.ts deleted file mode 100644 index c2577a1..0000000 --- a/model/getProcess.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetProcess { - /** - * Id of the process - */ - 'id': number; - /** - * Status of the process - */ - 'status': GetProcess.StatusEnum; - /** - * Process name - */ - 'name': string; - /** - * URL on which send export the of contacts once the process is completed - */ - 'exportUrl'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "status", - "baseName": "status", - "type": "GetProcess.StatusEnum" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "exportUrl", - "baseName": "export_url", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetProcess.attributeTypeMap; - } -} - -export namespace GetProcess { - export enum StatusEnum { - Queued = 'queued', - InProcess = 'in_process', - Completed = 'completed' - } -} diff --git a/model/getProcesses.ts b/model/getProcesses.ts deleted file mode 100644 index bfed1ac..0000000 --- a/model/getProcesses.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetProcess } from './getProcess'; - -export class GetProcesses { - /** - * List of processes available on your account - */ - 'processes'?: Array; - /** - * Number of processes available on your account - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "processes", - "baseName": "processes", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetProcesses.attributeTypeMap; - } -} - diff --git a/model/getProductDetails.ts b/model/getProductDetails.ts deleted file mode 100644 index c76c24a..0000000 --- a/model/getProductDetails.ts +++ /dev/null @@ -1,160 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetProductDetails { - /** - * Product ID for which you requested the details - */ - 'id': string; - /** - * Name of the product for which you requested the details - */ - 'name': string; - /** - * Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * Last modification UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - /** - * URL to the product - */ - 'url'?: string; - /** - * Absolute URL to the cover image of the product - */ - 'imageUrl'?: string; - /** - * Product identifier from the shop - */ - 'sku'?: string; - /** - * Price of the product - */ - 'price'?: number; - /** - * Category ID-s of the product - */ - 'categories'?: Array; - /** - * Parent product id of the product - */ - 'parentId'?: string; - /** - * S3 url of original image - */ - 's3Original'?: string; - /** - * S3 thumbnail url of original image in 120x120 dimension for analytics section - */ - 's3ThumbAnalytics': string; - /** - * Meta data of product such as description, vendor, producer, stock level, etc. - */ - 'metaInfo'?: object; - /** - * S3 thumbnail url of original image in 600x400 dimension for editor section - */ - 's3ThumbEditor': string; - /** - * product deleted from the shop\'s database - */ - 'isDeleted'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "imageUrl", - "baseName": "imageUrl", - "type": "string" - }, - { - "name": "sku", - "baseName": "sku", - "type": "string" - }, - { - "name": "price", - "baseName": "price", - "type": "number" - }, - { - "name": "categories", - "baseName": "categories", - "type": "Array" - }, - { - "name": "parentId", - "baseName": "parentId", - "type": "string" - }, - { - "name": "s3Original", - "baseName": "s3Original", - "type": "string" - }, - { - "name": "s3ThumbAnalytics", - "baseName": "s3ThumbAnalytics", - "type": "string" - }, - { - "name": "metaInfo", - "baseName": "metaInfo", - "type": "object" - }, - { - "name": "s3ThumbEditor", - "baseName": "s3ThumbEditor", - "type": "string" - }, - { - "name": "isDeleted", - "baseName": "isDeleted", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetProductDetails.attributeTypeMap; - } -} - diff --git a/model/getProducts.ts b/model/getProducts.ts deleted file mode 100644 index 893808f..0000000 --- a/model/getProducts.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetProductDetails } from './getProductDetails'; - -export class GetProducts { - 'products': Array; - /** - * Number of products - */ - 'count': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "products", - "baseName": "products", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetProducts.attributeTypeMap; - } -} - diff --git a/model/getReports.ts b/model/getReports.ts deleted file mode 100644 index 8d270b7..0000000 --- a/model/getReports.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetReportsReportsInner } from './getReportsReportsInner'; - -export class GetReports { - 'reports'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "reports", - "baseName": "reports", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetReports.attributeTypeMap; - } -} - diff --git a/model/getReportsReportsInner.ts b/model/getReportsReportsInner.ts deleted file mode 100644 index 0775195..0000000 --- a/model/getReportsReportsInner.ts +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetReportsReportsInner { - /** - * Date of the statistics - */ - 'date': string; - /** - * Number of requests for the date - */ - 'requests': number; - /** - * Number of delivered emails for the date - */ - 'delivered': number; - /** - * Number of hardbounces for the date - */ - 'hardBounces': number; - /** - * Number of softbounces for the date - */ - 'softBounces': number; - /** - * Number of clicks for the date - */ - 'clicks': number; - /** - * Number of unique clicks for the date - */ - 'uniqueClicks': number; - /** - * Number of openings for the date - */ - 'opens': number; - /** - * Number of unique openings for the date - */ - 'uniqueOpens': number; - /** - * Number of complaints (spam reports) for the date - */ - 'spamReports': number; - /** - * Number of blocked emails for the date - */ - 'blocked': number; - /** - * Number of invalid emails for the date - */ - 'invalid': number; - /** - * Number of unsubscribed emails for the date - */ - 'unsubscribed': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "requests", - "baseName": "requests", - "type": "number" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "number" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" - }, - { - "name": "clicks", - "baseName": "clicks", - "type": "number" - }, - { - "name": "uniqueClicks", - "baseName": "uniqueClicks", - "type": "number" - }, - { - "name": "opens", - "baseName": "opens", - "type": "number" - }, - { - "name": "uniqueOpens", - "baseName": "uniqueOpens", - "type": "number" - }, - { - "name": "spamReports", - "baseName": "spamReports", - "type": "number" - }, - { - "name": "blocked", - "baseName": "blocked", - "type": "number" - }, - { - "name": "invalid", - "baseName": "invalid", - "type": "number" - }, - { - "name": "unsubscribed", - "baseName": "unsubscribed", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetReportsReportsInner.attributeTypeMap; - } -} - diff --git a/model/getScheduledEmailByBatchId.ts b/model/getScheduledEmailByBatchId.ts deleted file mode 100644 index e33f355..0000000 --- a/model/getScheduledEmailByBatchId.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetScheduledEmailByBatchIdBatchesInner } from './getScheduledEmailByBatchIdBatchesInner'; - -export class GetScheduledEmailByBatchId { - /** - * Total number of batches - */ - 'count'?: number; - 'batches'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "batches", - "baseName": "batches", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetScheduledEmailByBatchId.attributeTypeMap; - } -} - diff --git a/model/getScheduledEmailByBatchIdBatchesInner.ts b/model/getScheduledEmailByBatchIdBatchesInner.ts deleted file mode 100644 index bfbb650..0000000 --- a/model/getScheduledEmailByBatchIdBatchesInner.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetScheduledEmailByBatchIdBatchesInner { - /** - * Datetime for which the batch was scheduled - */ - 'scheduledAt': Date; - /** - * Datetime on which the batch was scheduled - */ - 'createdAt': Date; - /** - * Current status of the scheduled batch - */ - 'status': GetScheduledEmailByBatchIdBatchesInner.StatusEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "Date" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" - }, - { - "name": "status", - "baseName": "status", - "type": "GetScheduledEmailByBatchIdBatchesInner.StatusEnum" - } ]; - - static getAttributeTypeMap() { - return GetScheduledEmailByBatchIdBatchesInner.attributeTypeMap; - } -} - -export namespace GetScheduledEmailByBatchIdBatchesInner { - export enum StatusEnum { - InProgress = 'inProgress', - Queued = 'queued', - Processed = 'processed', - Error = 'error' - } -} diff --git a/model/getScheduledEmailByMessageId.ts b/model/getScheduledEmailByMessageId.ts deleted file mode 100644 index 2fde3ac..0000000 --- a/model/getScheduledEmailByMessageId.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetScheduledEmailByMessageId { - /** - * Datetime for which the email was scheduled - */ - 'scheduledAt': Date; - /** - * Datetime on which the email was scheduled - */ - 'createdAt': Date; - /** - * Current status of the scheduled email - */ - 'status': GetScheduledEmailByMessageId.StatusEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "Date" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" - }, - { - "name": "status", - "baseName": "status", - "type": "GetScheduledEmailByMessageId.StatusEnum" - } ]; - - static getAttributeTypeMap() { - return GetScheduledEmailByMessageId.attributeTypeMap; - } -} - -export namespace GetScheduledEmailByMessageId { - export enum StatusEnum { - InProgress = 'inProgress', - Queued = 'queued', - Processed = 'processed', - Error = 'error' - } -} diff --git a/model/getSegments.ts b/model/getSegments.ts deleted file mode 100644 index e06494d..0000000 --- a/model/getSegments.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetSegmentsSegments } from './getSegmentsSegments'; - -export class GetSegments { - 'segments'?: GetSegmentsSegments; - /** - * Number of Segments available in your account - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "segments", - "baseName": "segments", - "type": "GetSegmentsSegments" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetSegments.attributeTypeMap; - } -} - diff --git a/model/getSegmentsSegments.ts b/model/getSegmentsSegments.ts deleted file mode 100644 index 3278115..0000000 --- a/model/getSegmentsSegments.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSegmentsSegments { - /** - * ID of the list - */ - 'id'?: number; - /** - * Name of the Segment - */ - 'segmentName'?: string; - /** - * Name of the Segment Category - */ - 'categoryName'?: string; - /** - * Updation UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'updatedAt'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "segmentName", - "baseName": "segmentName", - "type": "string" - }, - { - "name": "categoryName", - "baseName": "categoryName", - "type": "string" - }, - { - "name": "updatedAt", - "baseName": "updatedAt", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetSegmentsSegments.attributeTypeMap; - } -} - diff --git a/model/getSendersList.ts b/model/getSendersList.ts deleted file mode 100644 index 106362d..0000000 --- a/model/getSendersList.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetSendersListSendersInner } from './getSendersListSendersInner'; - -export class GetSendersList { - /** - * List of the senders available in your account - */ - 'senders'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "senders", - "baseName": "senders", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetSendersList.attributeTypeMap; - } -} - diff --git a/model/getSendersListSendersInner.ts b/model/getSendersListSendersInner.ts deleted file mode 100644 index 07011f6..0000000 --- a/model/getSendersListSendersInner.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetSendersListSendersInnerIpsInner } from './getSendersListSendersInnerIpsInner'; - -export class GetSendersListSendersInner { - /** - * Id of the sender - */ - 'id': number; - /** - * From Name associated to the sender - */ - 'name': string; - /** - * From Email associated to the sender - */ - 'email': string; - /** - * Status of sender (true=activated, false=deactivated) - */ - 'active': boolean; - /** - * List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs - */ - 'ips'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "active", - "baseName": "active", - "type": "boolean" - }, - { - "name": "ips", - "baseName": "ips", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetSendersListSendersInner.attributeTypeMap; - } -} - diff --git a/model/getSendersListSendersInnerIpsInner.ts b/model/getSendersListSendersInnerIpsInner.ts deleted file mode 100644 index 4ab58a3..0000000 --- a/model/getSendersListSendersInnerIpsInner.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSendersListSendersInnerIpsInner { - /** - * Dedicated IP available in your account - */ - 'ip': string; - /** - * Domain of the IP - */ - 'domain': string; - /** - * Weight of the IP for this sender - */ - 'weight': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ip", - "baseName": "ip", - "type": "string" - }, - { - "name": "domain", - "baseName": "domain", - "type": "string" - }, - { - "name": "weight", - "baseName": "weight", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetSendersListSendersInnerIpsInner.attributeTypeMap; - } -} - diff --git a/model/getSharedTemplateUrl.ts b/model/getSharedTemplateUrl.ts deleted file mode 100644 index a414a0f..0000000 --- a/model/getSharedTemplateUrl.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSharedTemplateUrl { - /** - * A unique URL for the email campaign or transactional template. This URL can be shared with other Brevo users. - */ - 'sharedUrl': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sharedUrl", - "baseName": "sharedUrl", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetSharedTemplateUrl.attributeTypeMap; - } -} - diff --git a/model/getSmsCampaign.ts b/model/getSmsCampaign.ts deleted file mode 100644 index 7b3f80f..0000000 --- a/model/getSmsCampaign.ts +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCampaignRecipients } from './getCampaignRecipients'; -import { GetSmsCampaignStats } from './getSmsCampaignStats'; - -export class GetSmsCampaign { - /** - * ID of the SMS Campaign - */ - 'id': number; - /** - * Name of the SMS Campaign - */ - 'name': string; - /** - * Status of the SMS Campaign - */ - 'status': GetSmsCampaign.StatusEnum; - /** - * Content of the SMS Campaign - */ - 'content': string; - /** - * UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format - */ - 'scheduledAt'?: string; - /** - * Sender of the SMS Campaign - */ - 'sender': string; - /** - * Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - 'recipients': GetCampaignRecipients; - 'statistics': GetSmsCampaignStats; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "GetSmsCampaign.StatusEnum" - }, - { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "GetCampaignRecipients" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetSmsCampaignStats" - } ]; - - static getAttributeTypeMap() { - return GetSmsCampaign.attributeTypeMap; - } -} - -export namespace GetSmsCampaign { - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'inProcess' - } -} diff --git a/model/getSmsCampaignOverview.ts b/model/getSmsCampaignOverview.ts deleted file mode 100644 index 81f721e..0000000 --- a/model/getSmsCampaignOverview.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSmsCampaignOverview { - /** - * ID of the SMS Campaign - */ - 'id': number; - /** - * Name of the SMS Campaign - */ - 'name': string; - /** - * Status of the SMS Campaign - */ - 'status': GetSmsCampaignOverview.StatusEnum; - /** - * Content of the SMS Campaign - */ - 'content': string; - /** - * UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format - */ - 'scheduledAt'?: string; - /** - * Sender of the SMS Campaign - */ - 'sender': string; - /** - * Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "GetSmsCampaignOverview.StatusEnum" - }, - { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetSmsCampaignOverview.attributeTypeMap; - } -} - -export namespace GetSmsCampaignOverview { - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'inProcess' - } -} diff --git a/model/getSmsCampaignStats.ts b/model/getSmsCampaignStats.ts deleted file mode 100644 index b814dca..0000000 --- a/model/getSmsCampaignStats.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSmsCampaignStats { - /** - * Number of delivered SMS - */ - 'delivered': number; - /** - * Number of sent SMS - */ - 'sent': number; - /** - * Number of processing SMS - */ - 'processing': number; - /** - * Number of softbounced SMS - */ - 'softBounces': number; - /** - * Number of hardbounced SMS - */ - 'hardBounces': number; - /** - * Number of unsubscription SMS - */ - 'unsubscriptions': number; - /** - * Number of replies to the SMS - */ - 'answered': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "delivered", - "baseName": "delivered", - "type": "number" - }, - { - "name": "sent", - "baseName": "sent", - "type": "number" - }, - { - "name": "processing", - "baseName": "processing", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "unsubscriptions", - "baseName": "unsubscriptions", - "type": "number" - }, - { - "name": "answered", - "baseName": "answered", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetSmsCampaignStats.attributeTypeMap; - } -} - diff --git a/model/getSmsCampaigns.ts b/model/getSmsCampaigns.ts deleted file mode 100644 index 36d09de..0000000 --- a/model/getSmsCampaigns.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetSmsCampaignsCampaignsInner } from './getSmsCampaignsCampaignsInner'; - -export class GetSmsCampaigns { - 'campaigns'?: Array; - /** - * Number of SMS campaigns retrieved - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaigns", - "baseName": "campaigns", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetSmsCampaigns.attributeTypeMap; - } -} - diff --git a/model/getSmsCampaignsCampaignsInner.ts b/model/getSmsCampaignsCampaignsInner.ts deleted file mode 100644 index c59d1f0..0000000 --- a/model/getSmsCampaignsCampaignsInner.ts +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetCampaignRecipients } from './getCampaignRecipients'; -import { GetSmsCampaignStats } from './getSmsCampaignStats'; - -export class GetSmsCampaignsCampaignsInner { - /** - * ID of the SMS Campaign - */ - 'id': number; - /** - * Name of the SMS Campaign - */ - 'name': string; - /** - * Status of the SMS Campaign - */ - 'status': GetSmsCampaignsCampaignsInner.StatusEnum; - /** - * Content of the SMS Campaign - */ - 'content': string; - /** - * UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format - */ - 'scheduledAt'?: string; - /** - * Sender of the SMS Campaign - */ - 'sender': string; - /** - * Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - 'recipients': GetCampaignRecipients; - 'statistics': GetSmsCampaignStats; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "GetSmsCampaignsCampaignsInner.StatusEnum" - }, - { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "GetCampaignRecipients" - }, - { - "name": "statistics", - "baseName": "statistics", - "type": "GetSmsCampaignStats" - } ]; - - static getAttributeTypeMap() { - return GetSmsCampaignsCampaignsInner.attributeTypeMap; - } -} - -export namespace GetSmsCampaignsCampaignsInner { - export enum StatusEnum { - Draft = 'draft', - Sent = 'sent', - Archive = 'archive', - Queued = 'queued', - Suspended = 'suspended', - InProcess = 'inProcess' - } -} diff --git a/model/getSmsEventReport.ts b/model/getSmsEventReport.ts deleted file mode 100644 index 6d0863a..0000000 --- a/model/getSmsEventReport.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetSmsEventReportEventsInner } from './getSmsEventReportEventsInner'; - -export class GetSmsEventReport { - 'events'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "events", - "baseName": "events", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetSmsEventReport.attributeTypeMap; - } -} - diff --git a/model/getSmsEventReportEventsInner.ts b/model/getSmsEventReportEventsInner.ts deleted file mode 100644 index 0f22d9a..0000000 --- a/model/getSmsEventReportEventsInner.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSmsEventReportEventsInner { - /** - * Phone number which has generated the event - */ - 'phoneNumber'?: string; - /** - * UTC date-time on which the event has been generated - */ - 'date'?: string; - /** - * Message ID which generated the event - */ - 'messageId'?: string; - /** - * Event which occurred - */ - 'event'?: GetSmsEventReportEventsInner.EventEnum; - /** - * Reason of bounce (only available if the event is hardbounce or softbounce) - */ - 'reason'?: string; - 'reply'?: string; - /** - * Tag of the SMS which generated the event - */ - 'tag'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "phoneNumber", - "baseName": "phoneNumber", - "type": "string" - }, - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - }, - { - "name": "event", - "baseName": "event", - "type": "GetSmsEventReportEventsInner.EventEnum" - }, - { - "name": "reason", - "baseName": "reason", - "type": "string" - }, - { - "name": "reply", - "baseName": "reply", - "type": "string" - }, - { - "name": "tag", - "baseName": "tag", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetSmsEventReportEventsInner.attributeTypeMap; - } -} - -export namespace GetSmsEventReportEventsInner { - export enum EventEnum { - Bounces = 'bounces', - HardBounces = 'hardBounces', - SoftBounces = 'softBounces', - Delivered = 'delivered', - Sent = 'sent', - Accepted = 'accepted', - Unsubscription = 'unsubscription', - Replies = 'replies', - Blocked = 'blocked', - Rejected = 'rejected', - Skipped = 'skipped' - } -} diff --git a/model/getSmtpTemplateOverview.ts b/model/getSmtpTemplateOverview.ts deleted file mode 100644 index 16a8c34..0000000 --- a/model/getSmtpTemplateOverview.ts +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetSmtpTemplateOverviewSender } from './getSmtpTemplateOverviewSender'; - -export class GetSmtpTemplateOverview { - /** - * ID of the template - */ - 'id': number; - /** - * Name of the template - */ - 'name': string; - /** - * Subject of the template - */ - 'subject': string; - /** - * Status of template (true=active, false=inactive) - */ - 'isActive': boolean; - /** - * Status of test sending for the template (true=test email has been sent, false=test email has not been sent) - */ - 'testSent': boolean; - 'sender': GetSmtpTemplateOverviewSender; - /** - * Email defined as the \"Reply to\" for the template - */ - 'replyTo': string; - /** - * Customisation of the \"to\" field for the template - */ - 'toField': string; - /** - * Tag of the template - */ - 'tag': string; - /** - * HTML content of the template - */ - 'htmlContent': string; - /** - * Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - /** - * It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. - */ - 'doiTemplate'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "isActive", - "baseName": "isActive", - "type": "boolean" - }, - { - "name": "testSent", - "baseName": "testSent", - "type": "boolean" - }, - { - "name": "sender", - "baseName": "sender", - "type": "GetSmtpTemplateOverviewSender" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "doiTemplate", - "baseName": "doiTemplate", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return GetSmtpTemplateOverview.attributeTypeMap; - } -} - diff --git a/model/getSmtpTemplateOverviewSender.ts b/model/getSmtpTemplateOverviewSender.ts deleted file mode 100644 index db48e10..0000000 --- a/model/getSmtpTemplateOverviewSender.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSmtpTemplateOverviewSender { - /** - * From email for the template - */ - 'name'?: string; - /** - * From email for the template - */ - 'email'?: string; - /** - * Sender id of the template - */ - 'id'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetSmtpTemplateOverviewSender.attributeTypeMap; - } -} - diff --git a/model/getSmtpTemplates.ts b/model/getSmtpTemplates.ts deleted file mode 100644 index 13f8d4d..0000000 --- a/model/getSmtpTemplates.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetSmtpTemplateOverview } from './getSmtpTemplateOverview'; - -export class GetSmtpTemplates { - /** - * Count of transactional email templates - */ - 'count'?: number; - 'templates'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "templates", - "baseName": "templates", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetSmtpTemplates.attributeTypeMap; - } -} - diff --git a/model/getSsoToken.ts b/model/getSsoToken.ts deleted file mode 100644 index 34da9bb..0000000 --- a/model/getSsoToken.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSsoToken { - /** - * Session token, it will remain valid for 15 days. - */ - 'token': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "token", - "baseName": "token", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetSsoToken.attributeTypeMap; - } -} - diff --git a/model/getStatsByDevice.ts b/model/getStatsByDevice.ts deleted file mode 100644 index e5c45dc..0000000 --- a/model/getStatsByDevice.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetDeviceBrowserStats } from './getDeviceBrowserStats'; - -export class GetStatsByDevice { - /** - * Statistics of the campaign on the basis of desktop devices - */ - 'desktop'?: { [key: string]: GetDeviceBrowserStats; }; - /** - * Statistics of the campaign on the basis of mobile devices - */ - 'mobile'?: { [key: string]: GetDeviceBrowserStats; }; - /** - * Statistics of the campaign on the basis of tablet devices - */ - 'tablet'?: { [key: string]: GetDeviceBrowserStats; }; - /** - * Statistics of the campaign on the basis of unknown devices - */ - 'unknown'?: { [key: string]: GetDeviceBrowserStats; }; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "desktop", - "baseName": "desktop", - "type": "{ [key: string]: GetDeviceBrowserStats; }" - }, - { - "name": "mobile", - "baseName": "mobile", - "type": "{ [key: string]: GetDeviceBrowserStats; }" - }, - { - "name": "tablet", - "baseName": "tablet", - "type": "{ [key: string]: GetDeviceBrowserStats; }" - }, - { - "name": "unknown", - "baseName": "unknown", - "type": "{ [key: string]: GetDeviceBrowserStats; }" - } ]; - - static getAttributeTypeMap() { - return GetStatsByDevice.attributeTypeMap; - } -} - diff --git a/model/getSubAccountGroups200ResponseInner.ts b/model/getSubAccountGroups200ResponseInner.ts deleted file mode 100644 index 5079390..0000000 --- a/model/getSubAccountGroups200ResponseInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetSubAccountGroups200ResponseInner { - /** - * Unique id of the group - */ - 'id'?: string; - /** - * The name of the group of sub-accounts - */ - 'groupName'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "groupName", - "baseName": "groupName", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetSubAccountGroups200ResponseInner.attributeTypeMap; - } -} - diff --git a/model/getTransacAggregatedSmsReport.ts b/model/getTransacAggregatedSmsReport.ts deleted file mode 100644 index 100ea00..0000000 --- a/model/getTransacAggregatedSmsReport.ts +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetTransacAggregatedSmsReport { - /** - * Time frame of the report - */ - 'range'?: string; - /** - * Number of requests for the timeframe - */ - 'requests'?: number; - /** - * Number of delivered SMS for the timeframe - */ - 'delivered'?: number; - /** - * Number of hardbounces for the timeframe - */ - 'hardBounces'?: number; - /** - * Number of softbounces for the timeframe - */ - 'softBounces'?: number; - /** - * Number of blocked contact for the timeframe - */ - 'blocked'?: number; - /** - * Number of unsubscription for the timeframe - */ - 'unsubscribed'?: number; - /** - * Number of answered SMS for the timeframe - */ - 'replied'?: number; - /** - * Number of accepted SMS for the timeframe - */ - 'accepted'?: number; - /** - * Number of rejected SMS for the timeframe - */ - 'rejected'?: number; - /** - * Number of skipped SMS for the timeframe - */ - 'skipped'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "range", - "baseName": "range", - "type": "string" - }, - { - "name": "requests", - "baseName": "requests", - "type": "number" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "number" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" - }, - { - "name": "blocked", - "baseName": "blocked", - "type": "number" - }, - { - "name": "unsubscribed", - "baseName": "unsubscribed", - "type": "number" - }, - { - "name": "replied", - "baseName": "replied", - "type": "number" - }, - { - "name": "accepted", - "baseName": "accepted", - "type": "number" - }, - { - "name": "rejected", - "baseName": "rejected", - "type": "number" - }, - { - "name": "skipped", - "baseName": "skipped", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetTransacAggregatedSmsReport.attributeTypeMap; - } -} - diff --git a/model/getTransacBlockedContacts.ts b/model/getTransacBlockedContacts.ts deleted file mode 100644 index c3e2bfa..0000000 --- a/model/getTransacBlockedContacts.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetTransacBlockedContactsContactsInner } from './getTransacBlockedContactsContactsInner'; - -export class GetTransacBlockedContacts { - /** - * Count of blocked or unsubscribed contact - */ - 'count'?: number; - 'contacts'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "contacts", - "baseName": "contacts", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetTransacBlockedContacts.attributeTypeMap; - } -} - diff --git a/model/getTransacBlockedContactsContactsInner.ts b/model/getTransacBlockedContactsContactsInner.ts deleted file mode 100644 index 27f7b60..0000000 --- a/model/getTransacBlockedContactsContactsInner.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetTransacBlockedContactsContactsInnerReason } from './getTransacBlockedContactsContactsInnerReason'; - -export class GetTransacBlockedContactsContactsInner { - /** - * Email address of the blocked or unsubscribed contact - */ - 'email': string; - /** - * Sender email address of the blocked or unsubscribed contact - */ - 'senderEmail': string; - 'reason': GetTransacBlockedContactsContactsInnerReason; - /** - * Date when the contact was blocked or unsubscribed on - */ - 'blockedAt': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "senderEmail", - "baseName": "senderEmail", - "type": "string" - }, - { - "name": "reason", - "baseName": "reason", - "type": "GetTransacBlockedContactsContactsInnerReason" - }, - { - "name": "blockedAt", - "baseName": "blockedAt", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetTransacBlockedContactsContactsInner.attributeTypeMap; - } -} - diff --git a/model/getTransacBlockedContactsContactsInnerReason.ts b/model/getTransacBlockedContactsContactsInnerReason.ts deleted file mode 100644 index b6a18d2..0000000 --- a/model/getTransacBlockedContactsContactsInnerReason.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Reason for blocking / unsubscribing -*/ -export class GetTransacBlockedContactsContactsInnerReason { - /** - * Reason code for blocking / unsubscribing (This code is safe for comparison) - */ - 'code'?: GetTransacBlockedContactsContactsInnerReason.CodeEnum; - /** - * Reason for blocking / unsubscribing (This string is not safe for comparison) - */ - 'message'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "code", - "baseName": "code", - "type": "GetTransacBlockedContactsContactsInnerReason.CodeEnum" - }, - { - "name": "message", - "baseName": "message", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetTransacBlockedContactsContactsInnerReason.attributeTypeMap; - } -} - -export namespace GetTransacBlockedContactsContactsInnerReason { - export enum CodeEnum { - UnsubscribedViaMa = 'unsubscribedViaMA', - UnsubscribedViaEmail = 'unsubscribedViaEmail', - AdminBlocked = 'adminBlocked', - UnsubscribedViaApi = 'unsubscribedViaApi', - HardBounce = 'hardBounce', - ContactFlaggedAsSpam = 'contactFlaggedAsSpam' - } -} diff --git a/model/getTransacEmailContent.ts b/model/getTransacEmailContent.ts deleted file mode 100644 index 8a2d566..0000000 --- a/model/getTransacEmailContent.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetTransacEmailContentEventsInner } from './getTransacEmailContentEventsInner'; - -export class GetTransacEmailContent { - /** - * Email address to which transactional email has been sent - */ - 'email': string; - /** - * Subject of the sent email - */ - 'subject': string; - /** - * Id of the template - */ - 'templateId'?: number; - /** - * Date on which transactional email was sent - */ - 'date': string; - /** - * Series of events which occurred on the transactional email - */ - 'events': Array; - /** - * Actual content of the transactional email that has been sent - */ - 'body': string; - /** - * Count of the attachments that were sent in the email - */ - 'attachmentCount': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "events", - "baseName": "events", - "type": "Array" - }, - { - "name": "body", - "baseName": "body", - "type": "string" - }, - { - "name": "attachmentCount", - "baseName": "attachmentCount", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetTransacEmailContent.attributeTypeMap; - } -} - diff --git a/model/getTransacEmailContentEventsInner.ts b/model/getTransacEmailContentEventsInner.ts deleted file mode 100644 index dc86357..0000000 --- a/model/getTransacEmailContentEventsInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetTransacEmailContentEventsInner { - /** - * Name of the event that occurred on the sent email - */ - 'name': string; - /** - * Time at which the event occurred - */ - 'time': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "time", - "baseName": "time", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetTransacEmailContentEventsInner.attributeTypeMap; - } -} - diff --git a/model/getTransacEmailsList.ts b/model/getTransacEmailsList.ts deleted file mode 100644 index b183490..0000000 --- a/model/getTransacEmailsList.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetTransacEmailsListTransactionalEmailsInner } from './getTransacEmailsListTransactionalEmailsInner'; - -export class GetTransacEmailsList { - /** - * Total number of transactional emails available on your account according to the passed filter - */ - 'count'?: number; - 'transactionalEmails'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "transactionalEmails", - "baseName": "transactionalEmails", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetTransacEmailsList.attributeTypeMap; - } -} - diff --git a/model/getTransacEmailsListTransactionalEmailsInner.ts b/model/getTransacEmailsListTransactionalEmailsInner.ts deleted file mode 100644 index 85b0eb3..0000000 --- a/model/getTransacEmailsListTransactionalEmailsInner.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetTransacEmailsListTransactionalEmailsInner { - /** - * Email address to which transactional email has been sent - */ - 'email': string; - /** - * Subject of the sent email - */ - 'subject': string; - /** - * Id of the template - */ - 'templateId'?: number; - /** - * Message Id of the sent email - */ - 'messageId': string; - /** - * Unique id of the email sent to a particular contact - */ - 'uuid': string; - /** - * Date on which transactional email was sent - */ - 'date': string; - /** - * Email address of the sender from which the email was sent - */ - 'from'?: string; - /** - * Tags used for your email - */ - 'tags'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - }, - { - "name": "uuid", - "baseName": "uuid", - "type": "string" - }, - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "from", - "baseName": "from", - "type": "string" - }, - { - "name": "tags", - "baseName": "tags", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetTransacEmailsListTransactionalEmailsInner.attributeTypeMap; - } -} - diff --git a/model/getTransacSmsReport.ts b/model/getTransacSmsReport.ts deleted file mode 100644 index 0ee35ef..0000000 --- a/model/getTransacSmsReport.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetTransacSmsReportReportsInner } from './getTransacSmsReportReportsInner'; - -export class GetTransacSmsReport { - 'reports'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "reports", - "baseName": "reports", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetTransacSmsReport.attributeTypeMap; - } -} - diff --git a/model/getTransacSmsReportReportsInner.ts b/model/getTransacSmsReportReportsInner.ts deleted file mode 100644 index 8908dc4..0000000 --- a/model/getTransacSmsReportReportsInner.ts +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetTransacSmsReportReportsInner { - /** - * Date for which statistics are retrieved - */ - 'date'?: string; - /** - * Number of requests for the date - */ - 'requests'?: number; - /** - * Number of delivered SMS for the date - */ - 'delivered'?: number; - /** - * Number of hardbounces for the date - */ - 'hardBounces'?: number; - /** - * Number of softbounces for the date - */ - 'softBounces'?: number; - /** - * Number of blocked contact for the date - */ - 'blocked'?: number; - /** - * Number of unsubscription for the date - */ - 'unsubscribed'?: number; - /** - * Number of answered SMS for the date - */ - 'replied'?: number; - /** - * Number of accepted SMS for the date - */ - 'accepted'?: number; - /** - * Number of rejected SMS for the date - */ - 'rejected'?: number; - /** - * Number of skipped SMS for the date - */ - 'skipped'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "requests", - "baseName": "requests", - "type": "number" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "number" - }, - { - "name": "hardBounces", - "baseName": "hardBounces", - "type": "number" - }, - { - "name": "softBounces", - "baseName": "softBounces", - "type": "number" - }, - { - "name": "blocked", - "baseName": "blocked", - "type": "number" - }, - { - "name": "unsubscribed", - "baseName": "unsubscribed", - "type": "number" - }, - { - "name": "replied", - "baseName": "replied", - "type": "number" - }, - { - "name": "accepted", - "baseName": "accepted", - "type": "number" - }, - { - "name": "rejected", - "baseName": "rejected", - "type": "number" - }, - { - "name": "skipped", - "baseName": "skipped", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetTransacSmsReportReportsInner.attributeTypeMap; - } -} - diff --git a/model/getUserPermission.ts b/model/getUserPermission.ts deleted file mode 100644 index 27a2c81..0000000 --- a/model/getUserPermission.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetUserPermissionPrivilegesInner } from './getUserPermissionPrivilegesInner'; - -/** -* Check user permission -*/ -export class GetUserPermission { - /** - * Email address of the user. - */ - 'email': string; - /** - * Status of the invited user. - */ - 'status': string; - /** - * Granular feature permissions given to the user. - */ - 'privileges': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "string" - }, - { - "name": "privileges", - "baseName": "privileges", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetUserPermission.attributeTypeMap; - } -} - diff --git a/model/getUserPermissionPrivilegesInner.ts b/model/getUserPermissionPrivilegesInner.ts deleted file mode 100644 index aa0267c..0000000 --- a/model/getUserPermissionPrivilegesInner.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetUserPermissionPrivilegesInner { - 'feature': string; - 'permissions': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "feature", - "baseName": "feature", - "type": "string" - }, - { - "name": "permissions", - "baseName": "permissions", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetUserPermissionPrivilegesInner.attributeTypeMap; - } -} - diff --git a/model/getWATemplates.ts b/model/getWATemplates.ts deleted file mode 100644 index 7ee949d..0000000 --- a/model/getWATemplates.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetWATemplatesTemplatesInner } from './getWATemplatesTemplatesInner'; - -export class GetWATemplates { - 'templates': Array; - /** - * Number of whatsApp templates retrived - */ - 'count': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "templates", - "baseName": "templates", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetWATemplates.attributeTypeMap; - } -} - diff --git a/model/getWATemplatesTemplatesInner.ts b/model/getWATemplatesTemplatesInner.ts deleted file mode 100644 index 5da9ffc..0000000 --- a/model/getWATemplatesTemplatesInner.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetWATemplatesTemplatesInner { - /** - * id of the template - */ - 'id': string; - /** - * Name of the WhatsApp template - */ - 'name': string; - /** - * Status of the WhatsApp template - */ - 'status': string; - /** - * Language in which template exists - */ - 'language': string; - /** - * category of the template - */ - 'category': string; - /** - * Error reason in the template creation - */ - 'errorReason'?: string; - /** - * Creation UTC date-time of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "string" - }, - { - "name": "language", - "baseName": "language", - "type": "string" - }, - { - "name": "category", - "baseName": "category", - "type": "string" - }, - { - "name": "errorReason", - "baseName": "errorReason", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetWATemplatesTemplatesInner.attributeTypeMap; - } -} - diff --git a/model/getWebhook.ts b/model/getWebhook.ts deleted file mode 100644 index cac06dc..0000000 --- a/model/getWebhook.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetWebhookAuth } from './getWebhookAuth'; -import { GetWebhookHeadersInner } from './getWebhookHeadersInner'; - -export class GetWebhook { - /** - * URL of the webhook - */ - 'url': string; - /** - * ID of the webhook - */ - 'id': number; - /** - * Description of the webhook - */ - 'description': string; - 'events': Array; - /** - * Type of webhook (marketing or transactional) - */ - 'type': GetWebhook.TypeEnum; - /** - * Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - /** - * To send batched webhooks - */ - 'batched'?: boolean; - 'auth'?: GetWebhookAuth; - /** - * Custom headers to be send with webhooks - */ - 'headers'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "description", - "baseName": "description", - "type": "string" - }, - { - "name": "events", - "baseName": "events", - "type": "Array" - }, - { - "name": "type", - "baseName": "type", - "type": "GetWebhook.TypeEnum" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - }, - { - "name": "batched", - "baseName": "batched", - "type": "boolean" - }, - { - "name": "auth", - "baseName": "auth", - "type": "GetWebhookAuth" - }, - { - "name": "headers", - "baseName": "headers", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetWebhook.attributeTypeMap; - } -} - -export namespace GetWebhook { - export enum TypeEnum { - Marketing = 'marketing', - Transactional = 'transactional' - } -} diff --git a/model/getWebhookAuth.ts b/model/getWebhookAuth.ts deleted file mode 100644 index 692664e..0000000 --- a/model/getWebhookAuth.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Add authentication on webhook url -*/ -export class GetWebhookAuth { - /** - * Type of authentication - */ - 'type'?: string; - /** - * Webhook authentication token - */ - 'token'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "type", - "baseName": "type", - "type": "string" - }, - { - "name": "token", - "baseName": "token", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetWebhookAuth.attributeTypeMap; - } -} - diff --git a/model/getWebhookHeadersInner.ts b/model/getWebhookHeadersInner.ts deleted file mode 100644 index 07d3f01..0000000 --- a/model/getWebhookHeadersInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetWebhookHeadersInner { - /** - * Header key name - */ - 'key'?: string; - /** - * Header value - */ - 'value'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "key", - "baseName": "key", - "type": "string" - }, - { - "name": "value", - "baseName": "value", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetWebhookHeadersInner.attributeTypeMap; - } -} - diff --git a/model/getWebhooks.ts b/model/getWebhooks.ts deleted file mode 100644 index 42541cb..0000000 --- a/model/getWebhooks.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetWebhook } from './getWebhook'; - -export class GetWebhooks { - 'webhooks': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "webhooks", - "baseName": "webhooks", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetWebhooks.attributeTypeMap; - } -} - diff --git a/model/getWhatsAppConfig.ts b/model/getWhatsAppConfig.ts deleted file mode 100644 index 0c7125b..0000000 --- a/model/getWhatsAppConfig.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetWhatsAppConfig { - /** - * Id of the WhatsApp business account - */ - 'whatsappBusinessAccountId'?: string; - /** - * Sending limit Information of the WhatsApp API account - */ - 'sendingLimit'?: string; - /** - * Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** - */ - 'phoneNumberQuality'?: GetWhatsAppConfig.PhoneNumberQualityEnum; - /** - * Status information related to WhatsApp Api account - */ - 'whatsappBusinessAccountStatus'?: string; - /** - * Verification status information of the Business account - */ - 'businessStatus'?: string; - /** - * Status of the name associated with WhatsApp Phone number - */ - 'phoneNumberNameStatus'?: GetWhatsAppConfig.PhoneNumberNameStatusEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "whatsappBusinessAccountId", - "baseName": "whatsappBusinessAccountId", - "type": "string" - }, - { - "name": "sendingLimit", - "baseName": "sendingLimit", - "type": "string" - }, - { - "name": "phoneNumberQuality", - "baseName": "phoneNumberQuality", - "type": "GetWhatsAppConfig.PhoneNumberQualityEnum" - }, - { - "name": "whatsappBusinessAccountStatus", - "baseName": "whatsappBusinessAccountStatus", - "type": "string" - }, - { - "name": "businessStatus", - "baseName": "businessStatus", - "type": "string" - }, - { - "name": "phoneNumberNameStatus", - "baseName": "phoneNumberNameStatus", - "type": "GetWhatsAppConfig.PhoneNumberNameStatusEnum" - } ]; - - static getAttributeTypeMap() { - return GetWhatsAppConfig.attributeTypeMap; - } -} - -export namespace GetWhatsAppConfig { - export enum PhoneNumberQualityEnum { - Green = 'GREEN', - Yellow = 'YELLOW', - Red = 'RED' - } - export enum PhoneNumberNameStatusEnum { - Approved = 'APPROVED', - Pending = 'PENDING', - Rejected = 'REJECTED' - } -} diff --git a/model/getWhatsappCampaignOverview.ts b/model/getWhatsappCampaignOverview.ts deleted file mode 100644 index 8ce7e84..0000000 --- a/model/getWhatsappCampaignOverview.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { WhatsappCampStats } from './whatsappCampStats'; -import { WhatsappCampTemplate } from './whatsappCampTemplate'; - -export class GetWhatsappCampaignOverview { - /** - * ID of the WhatsApp Campaign - */ - 'id': number; - /** - * Name of the WhatsApp Campaign - */ - 'campaignName': string; - /** - * Status of the WhatsApp Campaign - */ - 'campaignStatus': GetWhatsappCampaignOverview.CampaignStatusEnum; - /** - * UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format - */ - 'scheduledAt'?: string; - /** - * Sender of the WhatsApp Campaign - */ - 'senderNumber': string; - 'stats'?: WhatsappCampStats; - 'template': WhatsappCampTemplate; - /** - * Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "campaignName", - "baseName": "campaignName", - "type": "string" - }, - { - "name": "campaignStatus", - "baseName": "campaignStatus", - "type": "GetWhatsappCampaignOverview.CampaignStatusEnum" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "senderNumber", - "baseName": "senderNumber", - "type": "string" - }, - { - "name": "stats", - "baseName": "stats", - "type": "WhatsappCampStats" - }, - { - "name": "template", - "baseName": "template", - "type": "WhatsappCampTemplate" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetWhatsappCampaignOverview.attributeTypeMap; - } -} - -export namespace GetWhatsappCampaignOverview { - export enum CampaignStatusEnum { - Draft = 'draft', - Scheduled = 'scheduled', - Pending = 'pending', - Approved = 'approved', - Running = 'running', - Suspended = 'suspended', - Rejected = 'rejected', - Sent = 'sent' - } -} diff --git a/model/getWhatsappCampaigns.ts b/model/getWhatsappCampaigns.ts deleted file mode 100644 index b89b974..0000000 --- a/model/getWhatsappCampaigns.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetWhatsappCampaignsCampaignsInner } from './getWhatsappCampaignsCampaignsInner'; - -export class GetWhatsappCampaigns { - 'campaigns'?: Array; - /** - * Number of WhatsApp campaigns retrived - */ - 'count'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaigns", - "baseName": "campaigns", - "type": "Array" - }, - { - "name": "count", - "baseName": "count", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return GetWhatsappCampaigns.attributeTypeMap; - } -} - diff --git a/model/getWhatsappCampaignsCampaignsInner.ts b/model/getWhatsappCampaignsCampaignsInner.ts deleted file mode 100644 index 1ce1b10..0000000 --- a/model/getWhatsappCampaignsCampaignsInner.ts +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { WhatsappCampStats } from './whatsappCampStats'; - -export class GetWhatsappCampaignsCampaignsInner { - /** - * ID of the WhatsApp Campaign - */ - 'id': number; - /** - * Name of the WhatsApp Campaign - */ - 'campaignName': string; - /** - * Id of the WhatsApp template - */ - 'templateId': string; - /** - * Status of the WhatsApp Campaign - */ - 'campaignStatus': GetWhatsappCampaignsCampaignsInner.CampaignStatusEnum; - /** - * UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format - */ - 'scheduledAt': string; - /** - * Error reason in the campaign creation - */ - 'errorReason'?: string; - /** - * Count of invalidated contacts - */ - 'invalidatedContacts'?: number; - /** - * Read percentage of the the WhatsApp campaign created - */ - 'readPercentage'?: number; - 'stats'?: WhatsappCampStats; - /** - * Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'createdAt': string; - /** - * UTC date-time of last modification of the whatsapp template (YYYY-MM-DDTHH:mm:ss.SSSZ) - */ - 'modifiedAt': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "campaignName", - "baseName": "campaignName", - "type": "string" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "string" - }, - { - "name": "campaignStatus", - "baseName": "campaignStatus", - "type": "GetWhatsappCampaignsCampaignsInner.CampaignStatusEnum" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "errorReason", - "baseName": "errorReason", - "type": "string" - }, - { - "name": "invalidatedContacts", - "baseName": "invalidatedContacts", - "type": "number" - }, - { - "name": "readPercentage", - "baseName": "readPercentage", - "type": "number" - }, - { - "name": "stats", - "baseName": "stats", - "type": "WhatsappCampStats" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "modifiedAt", - "baseName": "modifiedAt", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetWhatsappCampaignsCampaignsInner.attributeTypeMap; - } -} - -export namespace GetWhatsappCampaignsCampaignsInner { - export enum CampaignStatusEnum { - Draft = 'draft', - Scheduled = 'scheduled', - Pending = 'pending', - Approved = 'approved', - Running = 'running', - Suspended = 'suspended', - Rejected = 'rejected', - Sent = 'sent' - } -} diff --git a/model/getWhatsappEventReport.ts b/model/getWhatsappEventReport.ts deleted file mode 100644 index b76c90f..0000000 --- a/model/getWhatsappEventReport.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetWhatsappEventReportEventsInner } from './getWhatsappEventReportEventsInner'; - -export class GetWhatsappEventReport { - 'events'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "events", - "baseName": "events", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return GetWhatsappEventReport.attributeTypeMap; - } -} - diff --git a/model/getWhatsappEventReportEventsInner.ts b/model/getWhatsappEventReportEventsInner.ts deleted file mode 100644 index cff42ef..0000000 --- a/model/getWhatsappEventReportEventsInner.ts +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class GetWhatsappEventReportEventsInner { - /** - * WhatsApp Number with country code. Example, 85264318721 - */ - 'contactNumber': string; - /** - * UTC date-time on which the event has been generated - */ - 'date': string; - /** - * Message ID which generated the event - */ - 'messageId': string; - /** - * Event which occurred - */ - 'event': GetWhatsappEventReportEventsInner.EventEnum; - /** - * Reason for the event (will be there in case of `error` and `soft-bounce` events) - */ - 'reason'?: string; - /** - * Text of the reply (will be there only in case of `reply` event with text) - */ - 'body'?: string; - /** - * Url of the media reply (will be there only in case of `reply` event with media) - */ - 'mediaUrl'?: string; - /** - * WhatsApp Number with country code. Example, 85264318721 - */ - 'senderNumber': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "contactNumber", - "baseName": "contactNumber", - "type": "string" - }, - { - "name": "date", - "baseName": "date", - "type": "string" - }, - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - }, - { - "name": "event", - "baseName": "event", - "type": "GetWhatsappEventReportEventsInner.EventEnum" - }, - { - "name": "reason", - "baseName": "reason", - "type": "string" - }, - { - "name": "body", - "baseName": "body", - "type": "string" - }, - { - "name": "mediaUrl", - "baseName": "mediaUrl", - "type": "string" - }, - { - "name": "senderNumber", - "baseName": "senderNumber", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return GetWhatsappEventReportEventsInner.attributeTypeMap; - } -} - -export namespace GetWhatsappEventReportEventsInner { - export enum EventEnum { - Sent = 'sent', - Delivered = 'delivered', - Read = 'read', - Error = 'error', - Unsubscribe = 'unsubscribe', - Reply = 'reply', - SoftBounce = 'soft-bounce' - } -} diff --git a/model/inviteAdminUser.ts b/model/inviteAdminUser.ts deleted file mode 100644 index ebe875b..0000000 --- a/model/inviteAdminUser.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { InviteAdminUserPrivilegesInner } from './inviteAdminUserPrivilegesInner'; - -export class InviteAdminUser { - /** - * Email address for the organization - */ - 'email': string; - /** - * All access to the features - */ - 'allFeaturesAccess': boolean; - /** - * Ids of Group - */ - 'groupIds'?: Array; - 'privileges': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "allFeaturesAccess", - "baseName": "all_features_access", - "type": "boolean" - }, - { - "name": "groupIds", - "baseName": "groupIds", - "type": "Array" - }, - { - "name": "privileges", - "baseName": "privileges", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return InviteAdminUser.attributeTypeMap; - } -} - diff --git a/model/inviteAdminUserPrivilegesInner.ts b/model/inviteAdminUserPrivilegesInner.ts deleted file mode 100644 index 802b506..0000000 --- a/model/inviteAdminUserPrivilegesInner.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Privileges given to the user -*/ -export class InviteAdminUserPrivilegesInner { - /** - * Feature name - */ - 'feature'?: InviteAdminUserPrivilegesInner.FeatureEnum; - /** - * Permissions for a given feature - */ - 'permissions'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "feature", - "baseName": "feature", - "type": "InviteAdminUserPrivilegesInner.FeatureEnum" - }, - { - "name": "permissions", - "baseName": "permissions", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return InviteAdminUserPrivilegesInner.attributeTypeMap; - } -} - -export namespace InviteAdminUserPrivilegesInner { - export enum FeatureEnum { - MyPlan = 'my_plan', - Api = 'api', - UserManagement = 'user_management', - AppManagement = 'app_management' - } - export enum PermissionsEnum { - All = 'all', - None = 'none' - } -} diff --git a/model/inviteuser.ts b/model/inviteuser.ts deleted file mode 100644 index 709d0cc..0000000 --- a/model/inviteuser.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { InviteuserPrivilegesInner } from './inviteuserPrivilegesInner'; - -export class Inviteuser { - /** - * Email address for the organization - */ - 'email': string; - /** - * All access to the features - */ - 'allFeaturesAccess': boolean; - 'privileges': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "allFeaturesAccess", - "baseName": "all_features_access", - "type": "boolean" - }, - { - "name": "privileges", - "baseName": "privileges", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return Inviteuser.attributeTypeMap; - } -} - diff --git a/model/inviteuserPrivilegesInner.ts b/model/inviteuserPrivilegesInner.ts deleted file mode 100644 index 8f47784..0000000 --- a/model/inviteuserPrivilegesInner.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Privileges given to the user -*/ -export class InviteuserPrivilegesInner { - /** - * Feature name - */ - 'feature'?: InviteuserPrivilegesInner.FeatureEnum; - /** - * Permissions for a given feature - */ - 'permissions'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "feature", - "baseName": "feature", - "type": "InviteuserPrivilegesInner.FeatureEnum" - }, - { - "name": "permissions", - "baseName": "permissions", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return InviteuserPrivilegesInner.attributeTypeMap; - } -} - -export namespace InviteuserPrivilegesInner { - export enum FeatureEnum { - EmailCampaigns = 'email_campaigns', - SmsCampaigns = 'sms_campaigns', - Contacts = 'contacts', - Templates = 'templates', - Workflows = 'workflows', - FacebookAds = 'facebook_ads', - LandingPages = 'landing_pages', - TransactionalEmails = 'transactional_emails', - SmtpApi = 'smtp_api', - UserManagement = 'user_management', - SalesPlatform = 'sales_platform', - Phone = 'phone', - Conversations = 'conversations', - SendersDomainsDedicatedIps = 'senders_domains_dedicated_ips', - PushNotifications = 'push_notifications' - } - export enum PermissionsEnum { - CreateEditDelete = 'create_edit_delete', - SendScheduleSuspend = 'send_schedule_suspend', - View = 'view', - Import = 'import', - Export = 'export', - ListAndAttributes = 'list_and_attributes', - Forms = 'forms', - ActivateDeactivate = 'activate_deactivate', - ActivateDeactivatePause = 'activate_deactivate_pause', - Settings = 'settings', - SchedulePause = 'schedule_pause', - All = 'all', - Logs = 'logs', - Access = 'access', - Assign = 'assign', - Configure = 'configure', - ManageOwnedDealsTasksCompanies = 'manage_owned_deals_tasks_companies', - ManageOthersDealsTasksCompanies = 'manage_others_deals_tasks_companies', - Reports = 'reports', - SendersManagement = 'senders_management', - DomainsManagement = 'domains_management', - DedicatedIpsManagement = 'dedicated_ips_management', - Send = 'send', - Smtp = 'smtp', - ApiKeys = 'api_keys', - AuthorizedIps = 'authorized_ips', - None = 'none' - } -} diff --git a/model/manageIp.ts b/model/manageIp.ts deleted file mode 100644 index 79f7e40..0000000 --- a/model/manageIp.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ManageIp { - /** - * Dedicated ID - */ - 'ip'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "ip", - "baseName": "ip", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ManageIp.attributeTypeMap; - } -} - diff --git a/model/masterDetailsResponse.ts b/model/masterDetailsResponse.ts deleted file mode 100644 index 63047fd..0000000 --- a/model/masterDetailsResponse.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { MasterDetailsResponseBillingInfo } from './masterDetailsResponseBillingInfo'; -import { MasterDetailsResponsePlanInfo } from './masterDetailsResponsePlanInfo'; - -export class MasterDetailsResponse { - /** - * Email id of master account - */ - 'email'?: string; - /** - * Company name of master account organization - */ - 'companyName'?: string; - /** - * Unique identifier of the master account organization - */ - 'id'?: number; - /** - * Currency code of the master account organization - */ - 'currencyCode'?: string; - /** - * Timezone of the master account organization - */ - 'timezone'?: string; - 'billingInfo'?: MasterDetailsResponseBillingInfo; - 'planInfo'?: MasterDetailsResponsePlanInfo; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "currencyCode", - "baseName": "currencyCode", - "type": "string" - }, - { - "name": "timezone", - "baseName": "timezone", - "type": "string" - }, - { - "name": "billingInfo", - "baseName": "billingInfo", - "type": "MasterDetailsResponseBillingInfo" - }, - { - "name": "planInfo", - "baseName": "planInfo", - "type": "MasterDetailsResponsePlanInfo" - } ]; - - static getAttributeTypeMap() { - return MasterDetailsResponse.attributeTypeMap; - } -} - diff --git a/model/masterDetailsResponseBillingInfo.ts b/model/masterDetailsResponseBillingInfo.ts deleted file mode 100644 index 5bcf989..0000000 --- a/model/masterDetailsResponseBillingInfo.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { MasterDetailsResponseBillingInfoAddress } from './masterDetailsResponseBillingInfoAddress'; -import { MasterDetailsResponseBillingInfoName } from './masterDetailsResponseBillingInfoName'; - -/** -* Billing details of the master account organization -*/ -export class MasterDetailsResponseBillingInfo { - /** - * Billing email id of master account - */ - 'email'?: string; - /** - * Company name of master account - */ - 'companyName'?: string; - 'name'?: MasterDetailsResponseBillingInfoName; - 'address'?: MasterDetailsResponseBillingInfoAddress; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "MasterDetailsResponseBillingInfoName" - }, - { - "name": "address", - "baseName": "address", - "type": "MasterDetailsResponseBillingInfoAddress" - } ]; - - static getAttributeTypeMap() { - return MasterDetailsResponseBillingInfo.attributeTypeMap; - } -} - diff --git a/model/masterDetailsResponseBillingInfoAddress.ts b/model/masterDetailsResponseBillingInfoAddress.ts deleted file mode 100644 index 164e737..0000000 --- a/model/masterDetailsResponseBillingInfoAddress.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Billing address of master account -*/ -export class MasterDetailsResponseBillingInfoAddress { - /** - * Street address - */ - 'streetAddress'?: string; - /** - * Locality - */ - 'locality'?: string; - /** - * Postal code - */ - 'postalCode'?: string; - /** - * State code - */ - 'stateCode'?: string; - /** - * Country code - */ - 'countryCode'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "streetAddress", - "baseName": "streetAddress", - "type": "string" - }, - { - "name": "locality", - "baseName": "locality", - "type": "string" - }, - { - "name": "postalCode", - "baseName": "postalCode", - "type": "string" - }, - { - "name": "stateCode", - "baseName": "stateCode", - "type": "string" - }, - { - "name": "countryCode", - "baseName": "countryCode", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return MasterDetailsResponseBillingInfoAddress.attributeTypeMap; - } -} - diff --git a/model/masterDetailsResponseBillingInfoName.ts b/model/masterDetailsResponseBillingInfoName.ts deleted file mode 100644 index 0aca6c5..0000000 --- a/model/masterDetailsResponseBillingInfoName.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Billing name of master account holder -*/ -export class MasterDetailsResponseBillingInfoName { - /** - * First name for billing - */ - 'givenName'?: string; - /** - * Last name for billing - */ - 'familyName'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "givenName", - "baseName": "givenName", - "type": "string" - }, - { - "name": "familyName", - "baseName": "familyName", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return MasterDetailsResponseBillingInfoName.attributeTypeMap; - } -} - diff --git a/model/masterDetailsResponsePlanInfo.ts b/model/masterDetailsResponsePlanInfo.ts deleted file mode 100644 index 6ad3b51..0000000 --- a/model/masterDetailsResponsePlanInfo.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { MasterDetailsResponsePlanInfoFeaturesInner } from './masterDetailsResponsePlanInfoFeaturesInner'; - -/** -* Plan details -*/ -export class MasterDetailsResponsePlanInfo { - /** - * Plan currency - */ - 'currencyCode'?: string; - /** - * Timestamp of next billing date - */ - 'nextBillingAt'?: number; - /** - * Plan amount - */ - 'price'?: number; - /** - * Plan period type - */ - 'planPeriod'?: MasterDetailsResponsePlanInfo.PlanPeriodEnum; - /** - * Number of sub-accounts - */ - 'subAccounts'?: number; - /** - * List of provided features in the plan - */ - 'features'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "currencyCode", - "baseName": "currencyCode", - "type": "string" - }, - { - "name": "nextBillingAt", - "baseName": "nextBillingAt", - "type": "number" - }, - { - "name": "price", - "baseName": "price", - "type": "number" - }, - { - "name": "planPeriod", - "baseName": "planPeriod", - "type": "MasterDetailsResponsePlanInfo.PlanPeriodEnum" - }, - { - "name": "subAccounts", - "baseName": "subAccounts", - "type": "number" - }, - { - "name": "features", - "baseName": "features", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return MasterDetailsResponsePlanInfo.attributeTypeMap; - } -} - -export namespace MasterDetailsResponsePlanInfo { - export enum PlanPeriodEnum { - Month = 'month', - Year = 'year' - } -} diff --git a/model/masterDetailsResponsePlanInfoFeaturesInner.ts b/model/masterDetailsResponsePlanInfoFeaturesInner.ts deleted file mode 100644 index 365e86a..0000000 --- a/model/masterDetailsResponsePlanInfoFeaturesInner.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class MasterDetailsResponsePlanInfoFeaturesInner { - /** - * Name of the feature - */ - 'name'?: string; - /** - * Unit value of the feature - */ - 'unitValue'?: string; - /** - * Quantity provided in the plan - */ - 'quantity'?: number; - /** - * Quantity with overages provided in the plan (only applicable on ENTv2) - */ - 'quantityWithOverages'?: number; - /** - * Quantity consumed by master - */ - 'used'?: number; - /** - * Quantity consumed by sub-organizations over the admin plan limit (only applicable on ENTv2) - */ - 'usedOverages'?: number; - /** - * Quantity remaining in the plan - */ - 'remaining'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "unitValue", - "baseName": "unitValue", - "type": "string" - }, - { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "quantityWithOverages", - "baseName": "quantityWithOverages", - "type": "number" - }, - { - "name": "used", - "baseName": "used", - "type": "number" - }, - { - "name": "usedOverages", - "baseName": "usedOverages", - "type": "number" - }, - { - "name": "remaining", - "baseName": "remaining", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return MasterDetailsResponsePlanInfoFeaturesInner.attributeTypeMap; - } -} - diff --git a/model/models.ts b/model/models.ts deleted file mode 100644 index 00d2660..0000000 --- a/model/models.ts +++ /dev/null @@ -1,1410 +0,0 @@ -import localVarRequest, { RequestOptions } from '../requestCompat'; - -export * from './abTestCampaignResult'; -export * from './abTestCampaignResultClickedLinks'; -export * from './abTestCampaignResultStatistics'; -export * from './abTestVersionClicksInner'; -export * from './abTestVersionStats'; -export * from './addChildDomain'; -export * from './addContactToList'; -export * from './addCredits'; -export * from './authenticateDomainModel'; -export * from './blockDomain'; -export * from './cart'; -export * from './companiesIdPatchRequest'; -export * from './companiesLinkUnlinkIdPatchRequest'; -export * from './companiesList'; -export * from './companiesPost200Response'; -export * from './companiesPostRequest'; -export * from './company'; -export * from './companyAttributesInner'; -export * from './componentItems'; -export * from './configuration'; -export * from './conversationsAgentOnlinePingPostRequest'; -export * from './conversationsMessage'; -export * from './conversationsMessageFile'; -export * from './conversationsMessageFileImageInfo'; -export * from './conversationsMessagesIdPutRequest'; -export * from './conversationsMessagesPostRequest'; -export * from './conversationsPushedMessagesIdPutRequest'; -export * from './conversationsPushedMessagesPostRequest'; -export * from './conversionSourceMetrics'; -export * from './conversionSourceProduct'; -export * from './corporateGroupDetailsResponse'; -export * from './corporateGroupDetailsResponseGroup'; -export * from './corporateGroupDetailsResponseSubAccountsInner'; -export * from './corporateGroupDetailsResponseUsersInner'; -export * from './corporateGroupPost201Response'; -export * from './corporateGroupPostRequest'; -export * from './corporateGroupUnlinkGroupIdSubAccountsPutRequest'; -export * from './corporateSubAccountIpAssociatePostRequest'; -export * from './corporateSubAccountIpDissociatePutRequest'; -export * from './corporateUserInvitationActionEmailPut200Response'; -export * from './createApiKeyRequest'; -export * from './createApiKeyResponse'; -export * from './createAttribute'; -export * from './createAttributeEnumerationInner'; -export * from './createCategoryModel'; -export * from './createChild'; -export * from './createContact'; -export * from './createCouponCollection201Response'; -export * from './createCouponCollectionRequest'; -export * from './createCouponsRequest'; -export * from './createDoiContact'; -export * from './createDomain'; -export * from './createDomainModel'; -export * from './createDomainModelDnsRecords'; -export * from './createDomainModelDnsRecordsDkimRecord'; -export * from './createEmailCampaign'; -export * from './createEmailCampaignRecipients'; -export * from './createEmailCampaignSender'; -export * from './createExternalFeed'; -export * from './createExternalFeed201Response'; -export * from './createList'; -export * from './createModel'; -export * from './createPaymentRequest'; -export * from './createPaymentResponse'; -export * from './createProductModel'; -export * from './createReseller'; -export * from './createSender'; -export * from './createSenderIpsInner'; -export * from './createSenderModel'; -export * from './createSmsCampaign'; -export * from './createSmsCampaignRecipients'; -export * from './createSmtpEmail'; -export * from './createSmtpTemplate'; -export * from './createSmtpTemplateSender'; -export * from './createSubAccount'; -export * from './createSubAccountResponse'; -export * from './createUpdateBatchCategory'; -export * from './createUpdateBatchCategoryModel'; -export * from './createUpdateBatchProducts'; -export * from './createUpdateBatchProductsModel'; -export * from './createUpdateCategories'; -export * from './createUpdateCategory'; -export * from './createUpdateContactModel'; -export * from './createUpdateFolder'; -export * from './createUpdateProduct'; -export * from './createUpdateProducts'; -export * from './createWebhook'; -export * from './createWhatsAppCampaign'; -export * from './createWhatsAppCampaignRecipients'; -export * from './createWhatsAppTemplate'; -export * from './createdBatchId'; -export * from './createdProcessId'; -export * from './crmDealsIdPatchRequest'; -export * from './crmDealsLinkUnlinkIdPatchRequest'; -export * from './crmDealsPost201Response'; -export * from './crmDealsPostRequest'; -export * from './crmTasksIdPatchRequest'; -export * from './crmTasksPost201Response'; -export * from './crmTasksPostRequest'; -export * from './deal'; -export * from './dealAttributesInner'; -export * from './dealsList'; -export * from './deleteHardbounces'; -export * from './ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response'; -export * from './ecommerceAttributionMetricsGet200Response'; -export * from './ecommerceAttributionMetricsGet200ResponseTotals'; -export * from './ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response'; -export * from './ecommerceConfigDisplayCurrencyGet200Response'; -export * from './emailExportRecipients'; -export * from './errorModel'; -export * from './event'; -export * from './eventIdentifiers'; -export * from './exportWebhooksHistory'; -export * from './fileData'; -export * from './fileDownloadableLink'; -export * from './getAccount'; -export * from './getAccountActivity'; -export * from './getAccountActivityLogsInner'; -export * from './getAccountAllOfMarketingAutomation'; -export * from './getAccountAllOfPlan'; -export * from './getAccountAllOfRelay'; -export * from './getAccountAllOfRelayData'; -export * from './getAggregatedReport'; -export * from './getAllExternalFeeds'; -export * from './getAllExternalFeedsFeedsInner'; -export * from './getAttributes'; -export * from './getAttributesAttributesInner'; -export * from './getAttributesAttributesInnerEnumerationInner'; -export * from './getBlockedDomains'; -export * from './getCampaignOverview'; -export * from './getCampaignRecipients'; -export * from './getCampaignStats'; -export * from './getCategories'; -export * from './getCategoryDetails'; -export * from './getChildAccountCreationStatus'; -export * from './getChildDomain'; -export * from './getChildInfo'; -export * from './getChildInfoAllOfApiKeys'; -export * from './getChildInfoAllOfApiKeysV2'; -export * from './getChildInfoAllOfApiKeysV3'; -export * from './getChildInfoAllOfCredits'; -export * from './getChildInfoAllOfStatistics'; -export * from './getChildrenList'; -export * from './getChildrenListChildrenInner'; -export * from './getClient'; -export * from './getContactCampaignStats'; -export * from './getContactCampaignStatsClickedInner'; -export * from './getContactCampaignStatsClickedInnerLinksInner'; -export * from './getContactCampaignStatsMessagesSentInner'; -export * from './getContactCampaignStatsOpenedInner'; -export * from './getContactCampaignStatsTransacAttributesInner'; -export * from './getContactCampaignStatsUnsubscriptions'; -export * from './getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner'; -export * from './getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner'; -export * from './getContactDetails'; -export * from './getContacts'; -export * from './getCorporateInvitedUsersList'; -export * from './getCorporateInvitedUsersListUsersInner'; -export * from './getCorporateInvitedUsersListUsersInnerFeatureAccess'; -export * from './getCorporateInvitedUsersListUsersInnerGroups'; -export * from './getCorporateUserPermission'; -export * from './getCorporateUserPermissionFeatureAccess'; -export * from './getCorporateUserPermissionGroupsInner'; -export * from './getCouponCollection'; -export * from './getDeviceBrowserStats'; -export * from './getDomainConfigurationModel'; -export * from './getDomainsList'; -export * from './getDomainsListDomainsInner'; -export * from './getEmailCampaign'; -export * from './getEmailCampaigns'; -export * from './getEmailCampaignsCampaignsInner'; -export * from './getEmailEventReport'; -export * from './getEmailEventReportEventsInner'; -export * from './getExtendedCampaignOverview'; -export * from './getExtendedCampaignOverviewAllOfSender'; -export * from './getExtendedCampaignStats'; -export * from './getExtendedClient'; -export * from './getExtendedClientAllOfAddress'; -export * from './getExtendedContactDetails'; -export * from './getExtendedContactDetailsAllOfStatistics'; -export * from './getExtendedContactDetailsAllOfStatisticsClicked'; -export * from './getExtendedContactDetailsAllOfStatisticsLinks'; -export * from './getExtendedContactDetailsAllOfStatisticsMessagesSent'; -export * from './getExtendedContactDetailsAllOfStatisticsOpened'; -export * from './getExtendedContactDetailsAllOfStatisticsUnsubscriptions'; -export * from './getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription'; -export * from './getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription'; -export * from './getExtendedList'; -export * from './getExtendedListAllOfCampaignStats'; -export * from './getExternalFeedByUUID'; -export * from './getExternalFeedByUUIDHeadersInner'; -export * from './getFolder'; -export * from './getFolderLists'; -export * from './getFolders'; -export * from './getInboundEmailEvents'; -export * from './getInboundEmailEventsByUuid'; -export * from './getInboundEmailEventsByUuidAttachmentsInner'; -export * from './getInboundEmailEventsByUuidLogsInner'; -export * from './getInboundEmailEventsEventsInner'; -export * from './getInvitedUsersList'; -export * from './getInvitedUsersListUsersInner'; -export * from './getInvitedUsersListUsersInnerFeatureAccess'; -export * from './getIp'; -export * from './getIpFromSender'; -export * from './getIps'; -export * from './getIpsFromSender'; -export * from './getList'; -export * from './getLists'; -export * from './getListsListsInner'; -export * from './getOrders'; -export * from './getOrdersOrdersInner'; -export * from './getPaymentRequest'; -export * from './getProcess'; -export * from './getProcesses'; -export * from './getProductDetails'; -export * from './getProducts'; -export * from './getReports'; -export * from './getReportsReportsInner'; -export * from './getScheduledEmailByBatchId'; -export * from './getScheduledEmailByBatchIdBatchesInner'; -export * from './getScheduledEmailByMessageId'; -export * from './getSegments'; -export * from './getSegmentsSegments'; -export * from './getSendersList'; -export * from './getSendersListSendersInner'; -export * from './getSendersListSendersInnerIpsInner'; -export * from './getSharedTemplateUrl'; -export * from './getSmsCampaign'; -export * from './getSmsCampaignOverview'; -export * from './getSmsCampaignStats'; -export * from './getSmsCampaigns'; -export * from './getSmsCampaignsCampaignsInner'; -export * from './getSmsEventReport'; -export * from './getSmsEventReportEventsInner'; -export * from './getSmtpTemplateOverview'; -export * from './getSmtpTemplateOverviewSender'; -export * from './getSmtpTemplates'; -export * from './getSsoToken'; -export * from './getStatsByDevice'; -export * from './getSubAccountGroups200ResponseInner'; -export * from './getTransacAggregatedSmsReport'; -export * from './getTransacBlockedContacts'; -export * from './getTransacBlockedContactsContactsInner'; -export * from './getTransacBlockedContactsContactsInnerReason'; -export * from './getTransacEmailContent'; -export * from './getTransacEmailContentEventsInner'; -export * from './getTransacEmailsList'; -export * from './getTransacEmailsListTransactionalEmailsInner'; -export * from './getTransacSmsReport'; -export * from './getTransacSmsReportReportsInner'; -export * from './getUserPermission'; -export * from './getUserPermissionPrivilegesInner'; -export * from './getWATemplates'; -export * from './getWATemplatesTemplatesInner'; -export * from './getWebhook'; -export * from './getWebhookAuth'; -export * from './getWebhookHeadersInner'; -export * from './getWebhooks'; -export * from './getWhatsAppConfig'; -export * from './getWhatsappCampaignOverview'; -export * from './getWhatsappCampaigns'; -export * from './getWhatsappCampaignsCampaignsInner'; -export * from './getWhatsappEventReport'; -export * from './getWhatsappEventReportEventsInner'; -export * from './inviteAdminUser'; -export * from './inviteAdminUserPrivilegesInner'; -export * from './inviteuser'; -export * from './inviteuserPrivilegesInner'; -export * from './manageIp'; -export * from './masterDetailsResponse'; -export * from './masterDetailsResponseBillingInfo'; -export * from './masterDetailsResponseBillingInfoAddress'; -export * from './masterDetailsResponseBillingInfoName'; -export * from './masterDetailsResponsePlanInfo'; -export * from './masterDetailsResponsePlanInfoFeaturesInner'; -export * from './note'; -export * from './noteData'; -export * from './noteId'; -export * from './notification'; -export * from './order'; -export * from './orderBatch'; -export * from './orderBilling'; -export * from './orderProductsInner'; -export * from './otp'; -export * from './pipeline'; -export * from './pipelineStage'; -export * from './postContactInfo'; -export * from './postContactInfoContacts'; -export * from './postSendFailed'; -export * from './postSendSmsTestFailed'; -export * from './putRevokeUserPermission'; -export * from './putresendcancelinvitation'; -export * from './remainingCreditModel'; -export * from './remainingCreditModelChild'; -export * from './remainingCreditModelReseller'; -export * from './removeContactFromList'; -export * from './removeCredits'; -export * from './requestContactExport'; -export * from './requestContactExportCustomContactFilter'; -export * from './requestContactImport'; -export * from './requestContactImportJsonBodyInner'; -export * from './requestContactImportNewList'; -export * from './requestSmsRecipientExport'; -export * from './scheduleSmtpEmail'; -export * from './sendReport'; -export * from './sendReportEmail'; -export * from './sendSms'; -export * from './sendSmtpEmail'; -export * from './sendSmtpEmailAttachmentInner'; -export * from './sendSmtpEmailBccInner'; -export * from './sendSmtpEmailCcInner'; -export * from './sendSmtpEmailMessageVersionsInner'; -export * from './sendSmtpEmailMessageVersionsInnerReplyTo'; -export * from './sendSmtpEmailMessageVersionsInnerToInner'; -export * from './sendSmtpEmailReplyTo'; -export * from './sendSmtpEmailSender'; -export * from './sendSmtpEmailToInner'; -export * from './sendTestEmail'; -export * from './sendTestSms'; -export * from './sendTransacSms'; -export * from './sendWhatsappMessage'; -export * from './sendWhatsappMessage201Response'; -export * from './ssoTokenRequest'; -export * from './ssoTokenRequestCorporate'; -export * from './subAccountAppsToggleRequest'; -export * from './subAccountDetailsResponse'; -export * from './subAccountDetailsResponseGroupsInner'; -export * from './subAccountDetailsResponsePlanInfo'; -export * from './subAccountDetailsResponsePlanInfoCredits'; -export * from './subAccountDetailsResponsePlanInfoCreditsEmails'; -export * from './subAccountDetailsResponsePlanInfoCreditsSms'; -export * from './subAccountDetailsResponsePlanInfoCreditsWpSubscribers'; -export * from './subAccountDetailsResponsePlanInfoFeatures'; -export * from './subAccountDetailsResponsePlanInfoFeaturesInbox'; -export * from './subAccountDetailsResponsePlanInfoFeaturesLandingPage'; -export * from './subAccountDetailsResponsePlanInfoFeaturesUsers'; -export * from './subAccountUpdatePlanRequest'; -export * from './subAccountUpdatePlanRequestCredits'; -export * from './subAccountUpdatePlanRequestFeatures'; -export * from './subAccountsResponse'; -export * from './subAccountsResponseSubAccountsInner'; -export * from './subAccountsResponseSubAccountsInnerGroupsInner'; -export * from './task'; -export * from './taskList'; -export * from './taskReminder'; -export * from './taskTypes'; -export * from './updateAttribute'; -export * from './updateAttributeEnumerationInner'; -export * from './updateBatchContacts'; -export * from './updateBatchContactsContactsInner'; -export * from './updateBatchContactsModel'; -export * from './updateCampaignStatus'; -export * from './updateChild'; -export * from './updateChildAccountStatus'; -export * from './updateChildDomain'; -export * from './updateContact'; -export * from './updateCouponCollection200Response'; -export * from './updateCouponCollectionRequest'; -export * from './updateEmailCampaign'; -export * from './updateEmailCampaignRecipients'; -export * from './updateEmailCampaignSender'; -export * from './updateExternalFeed'; -export * from './updateList'; -export * from './updateSender'; -export * from './updateSmsCampaign'; -export * from './updateSmtpTemplate'; -export * from './updateSmtpTemplateSender'; -export * from './updateWebhook'; -export * from './updateWhatsAppCampaign'; -export * from './uploadImageModel'; -export * from './uploadImageToGallery'; -export * from './variablesItems'; -export * from './whatsappCampStats'; -export * from './whatsappCampTemplate'; - -import * as fs from 'fs'; - -export interface RequestDetailedFile { - value: Buffer; - options?: { - filename?: string; - contentType?: string; - } -} - -export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile; - - -import { AbTestCampaignResult } from './abTestCampaignResult'; -import { AbTestCampaignResultClickedLinks } from './abTestCampaignResultClickedLinks'; -import { AbTestCampaignResultStatistics } from './abTestCampaignResultStatistics'; -import { AbTestVersionClicksInner } from './abTestVersionClicksInner'; -import { AbTestVersionStats } from './abTestVersionStats'; -import { AddChildDomain } from './addChildDomain'; -import { AddContactToList } from './addContactToList'; -import { AddCredits } from './addCredits'; -import { AuthenticateDomainModel } from './authenticateDomainModel'; -import { BlockDomain } from './blockDomain'; -import { Cart } from './cart'; -import { CompaniesIdPatchRequest } from './companiesIdPatchRequest'; -import { CompaniesLinkUnlinkIdPatchRequest } from './companiesLinkUnlinkIdPatchRequest'; -import { CompaniesList } from './companiesList'; -import { CompaniesPost200Response } from './companiesPost200Response'; -import { CompaniesPostRequest } from './companiesPostRequest'; -import { Company } from './company'; -import { CompanyAttributesInner } from './companyAttributesInner'; -import { ComponentItems } from './componentItems'; -import { Configuration } from './configuration'; -import { ConversationsAgentOnlinePingPostRequest } from './conversationsAgentOnlinePingPostRequest'; -import { ConversationsMessage } from './conversationsMessage'; -import { ConversationsMessageFile } from './conversationsMessageFile'; -import { ConversationsMessageFileImageInfo } from './conversationsMessageFileImageInfo'; -import { ConversationsMessagesIdPutRequest } from './conversationsMessagesIdPutRequest'; -import { ConversationsMessagesPostRequest } from './conversationsMessagesPostRequest'; -import { ConversationsPushedMessagesIdPutRequest } from './conversationsPushedMessagesIdPutRequest'; -import { ConversationsPushedMessagesPostRequest } from './conversationsPushedMessagesPostRequest'; -import { ConversionSourceMetrics } from './conversionSourceMetrics'; -import { ConversionSourceProduct } from './conversionSourceProduct'; -import { CorporateGroupDetailsResponse } from './corporateGroupDetailsResponse'; -import { CorporateGroupDetailsResponseGroup } from './corporateGroupDetailsResponseGroup'; -import { CorporateGroupDetailsResponseSubAccountsInner } from './corporateGroupDetailsResponseSubAccountsInner'; -import { CorporateGroupDetailsResponseUsersInner } from './corporateGroupDetailsResponseUsersInner'; -import { CorporateGroupPost201Response } from './corporateGroupPost201Response'; -import { CorporateGroupPostRequest } from './corporateGroupPostRequest'; -import { CorporateGroupUnlinkGroupIdSubAccountsPutRequest } from './corporateGroupUnlinkGroupIdSubAccountsPutRequest'; -import { CorporateSubAccountIpAssociatePostRequest } from './corporateSubAccountIpAssociatePostRequest'; -import { CorporateSubAccountIpDissociatePutRequest } from './corporateSubAccountIpDissociatePutRequest'; -import { CorporateUserInvitationActionEmailPut200Response } from './corporateUserInvitationActionEmailPut200Response'; -import { CreateApiKeyRequest } from './createApiKeyRequest'; -import { CreateApiKeyResponse } from './createApiKeyResponse'; -import { CreateAttribute } from './createAttribute'; -import { CreateAttributeEnumerationInner } from './createAttributeEnumerationInner'; -import { CreateCategoryModel } from './createCategoryModel'; -import { CreateChild } from './createChild'; -import { CreateContact } from './createContact'; -import { CreateCouponCollection201Response } from './createCouponCollection201Response'; -import { CreateCouponCollectionRequest } from './createCouponCollectionRequest'; -import { CreateCouponsRequest } from './createCouponsRequest'; -import { CreateDoiContact } from './createDoiContact'; -import { CreateDomain } from './createDomain'; -import { CreateDomainModel } from './createDomainModel'; -import { CreateDomainModelDnsRecords } from './createDomainModelDnsRecords'; -import { CreateDomainModelDnsRecordsDkimRecord } from './createDomainModelDnsRecordsDkimRecord'; -import { CreateEmailCampaign } from './createEmailCampaign'; -import { CreateEmailCampaignRecipients } from './createEmailCampaignRecipients'; -import { CreateEmailCampaignSender } from './createEmailCampaignSender'; -import { CreateExternalFeed } from './createExternalFeed'; -import { CreateExternalFeed201Response } from './createExternalFeed201Response'; -import { CreateList } from './createList'; -import { CreateModel } from './createModel'; -import { CreatePaymentRequest } from './createPaymentRequest'; -import { CreatePaymentResponse } from './createPaymentResponse'; -import { CreateProductModel } from './createProductModel'; -import { CreateReseller } from './createReseller'; -import { CreateSender } from './createSender'; -import { CreateSenderIpsInner } from './createSenderIpsInner'; -import { CreateSenderModel } from './createSenderModel'; -import { CreateSmsCampaign } from './createSmsCampaign'; -import { CreateSmsCampaignRecipients } from './createSmsCampaignRecipients'; -import { CreateSmtpEmail } from './createSmtpEmail'; -import { CreateSmtpTemplate } from './createSmtpTemplate'; -import { CreateSmtpTemplateSender } from './createSmtpTemplateSender'; -import { CreateSubAccount } from './createSubAccount'; -import { CreateSubAccountResponse } from './createSubAccountResponse'; -import { CreateUpdateBatchCategory } from './createUpdateBatchCategory'; -import { CreateUpdateBatchCategoryModel } from './createUpdateBatchCategoryModel'; -import { CreateUpdateBatchProducts } from './createUpdateBatchProducts'; -import { CreateUpdateBatchProductsModel } from './createUpdateBatchProductsModel'; -import { CreateUpdateCategories } from './createUpdateCategories'; -import { CreateUpdateCategory } from './createUpdateCategory'; -import { CreateUpdateContactModel } from './createUpdateContactModel'; -import { CreateUpdateFolder } from './createUpdateFolder'; -import { CreateUpdateProduct } from './createUpdateProduct'; -import { CreateUpdateProducts } from './createUpdateProducts'; -import { CreateWebhook } from './createWebhook'; -import { CreateWhatsAppCampaign } from './createWhatsAppCampaign'; -import { CreateWhatsAppCampaignRecipients } from './createWhatsAppCampaignRecipients'; -import { CreateWhatsAppTemplate } from './createWhatsAppTemplate'; -import { CreatedBatchId } from './createdBatchId'; -import { CreatedProcessId } from './createdProcessId'; -import { CrmDealsIdPatchRequest } from './crmDealsIdPatchRequest'; -import { CrmDealsLinkUnlinkIdPatchRequest } from './crmDealsLinkUnlinkIdPatchRequest'; -import { CrmDealsPost201Response } from './crmDealsPost201Response'; -import { CrmDealsPostRequest } from './crmDealsPostRequest'; -import { CrmTasksIdPatchRequest } from './crmTasksIdPatchRequest'; -import { CrmTasksPost201Response } from './crmTasksPost201Response'; -import { CrmTasksPostRequest } from './crmTasksPostRequest'; -import { Deal } from './deal'; -import { DealAttributesInner } from './dealAttributesInner'; -import { DealsList } from './dealsList'; -import { DeleteHardbounces } from './deleteHardbounces'; -import { EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response } from './ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response'; -import { EcommerceAttributionMetricsGet200Response } from './ecommerceAttributionMetricsGet200Response'; -import { EcommerceAttributionMetricsGet200ResponseTotals } from './ecommerceAttributionMetricsGet200ResponseTotals'; -import { EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response } from './ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response'; -import { EcommerceConfigDisplayCurrencyGet200Response } from './ecommerceConfigDisplayCurrencyGet200Response'; -import { EmailExportRecipients } from './emailExportRecipients'; -import { ErrorModel } from './errorModel'; -import { Event } from './event'; -import { EventIdentifiers } from './eventIdentifiers'; -import { ExportWebhooksHistory } from './exportWebhooksHistory'; -import { FileData } from './fileData'; -import { FileDownloadableLink } from './fileDownloadableLink'; -import { GetAccount } from './getAccount'; -import { GetAccountActivity } from './getAccountActivity'; -import { GetAccountActivityLogsInner } from './getAccountActivityLogsInner'; -import { GetAccountAllOfMarketingAutomation } from './getAccountAllOfMarketingAutomation'; -import { GetAccountAllOfPlan } from './getAccountAllOfPlan'; -import { GetAccountAllOfRelay } from './getAccountAllOfRelay'; -import { GetAccountAllOfRelayData } from './getAccountAllOfRelayData'; -import { GetAggregatedReport } from './getAggregatedReport'; -import { GetAllExternalFeeds } from './getAllExternalFeeds'; -import { GetAllExternalFeedsFeedsInner } from './getAllExternalFeedsFeedsInner'; -import { GetAttributes } from './getAttributes'; -import { GetAttributesAttributesInner } from './getAttributesAttributesInner'; -import { GetAttributesAttributesInnerEnumerationInner } from './getAttributesAttributesInnerEnumerationInner'; -import { GetBlockedDomains } from './getBlockedDomains'; -import { GetCampaignOverview } from './getCampaignOverview'; -import { GetCampaignRecipients } from './getCampaignRecipients'; -import { GetCampaignStats } from './getCampaignStats'; -import { GetCategories } from './getCategories'; -import { GetCategoryDetails } from './getCategoryDetails'; -import { GetChildAccountCreationStatus } from './getChildAccountCreationStatus'; -import { GetChildDomain } from './getChildDomain'; -import { GetChildInfo } from './getChildInfo'; -import { GetChildInfoAllOfApiKeys } from './getChildInfoAllOfApiKeys'; -import { GetChildInfoAllOfApiKeysV2 } from './getChildInfoAllOfApiKeysV2'; -import { GetChildInfoAllOfApiKeysV3 } from './getChildInfoAllOfApiKeysV3'; -import { GetChildInfoAllOfCredits } from './getChildInfoAllOfCredits'; -import { GetChildInfoAllOfStatistics } from './getChildInfoAllOfStatistics'; -import { GetChildrenList } from './getChildrenList'; -import { GetChildrenListChildrenInner } from './getChildrenListChildrenInner'; -import { GetClient } from './getClient'; -import { GetContactCampaignStats } from './getContactCampaignStats'; -import { GetContactCampaignStatsClickedInner } from './getContactCampaignStatsClickedInner'; -import { GetContactCampaignStatsClickedInnerLinksInner } from './getContactCampaignStatsClickedInnerLinksInner'; -import { GetContactCampaignStatsMessagesSentInner } from './getContactCampaignStatsMessagesSentInner'; -import { GetContactCampaignStatsOpenedInner } from './getContactCampaignStatsOpenedInner'; -import { GetContactCampaignStatsTransacAttributesInner } from './getContactCampaignStatsTransacAttributesInner'; -import { GetContactCampaignStatsUnsubscriptions } from './getContactCampaignStatsUnsubscriptions'; -import { GetContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner } from './getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner'; -import { GetContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner } from './getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner'; -import { GetContactDetails } from './getContactDetails'; -import { GetContacts } from './getContacts'; -import { GetCorporateInvitedUsersList } from './getCorporateInvitedUsersList'; -import { GetCorporateInvitedUsersListUsersInner } from './getCorporateInvitedUsersListUsersInner'; -import { GetCorporateInvitedUsersListUsersInnerFeatureAccess } from './getCorporateInvitedUsersListUsersInnerFeatureAccess'; -import { GetCorporateInvitedUsersListUsersInnerGroups } from './getCorporateInvitedUsersListUsersInnerGroups'; -import { GetCorporateUserPermission } from './getCorporateUserPermission'; -import { GetCorporateUserPermissionFeatureAccess } from './getCorporateUserPermissionFeatureAccess'; -import { GetCorporateUserPermissionGroupsInner } from './getCorporateUserPermissionGroupsInner'; -import { GetCouponCollection } from './getCouponCollection'; -import { GetDeviceBrowserStats } from './getDeviceBrowserStats'; -import { GetDomainConfigurationModel } from './getDomainConfigurationModel'; -import { GetDomainsList } from './getDomainsList'; -import { GetDomainsListDomainsInner } from './getDomainsListDomainsInner'; -import { GetEmailCampaign } from './getEmailCampaign'; -import { GetEmailCampaigns } from './getEmailCampaigns'; -import { GetEmailCampaignsCampaignsInner } from './getEmailCampaignsCampaignsInner'; -import { GetEmailEventReport } from './getEmailEventReport'; -import { GetEmailEventReportEventsInner } from './getEmailEventReportEventsInner'; -import { GetExtendedCampaignOverview } from './getExtendedCampaignOverview'; -import { GetExtendedCampaignOverviewAllOfSender } from './getExtendedCampaignOverviewAllOfSender'; -import { GetExtendedCampaignStats } from './getExtendedCampaignStats'; -import { GetExtendedClient } from './getExtendedClient'; -import { GetExtendedClientAllOfAddress } from './getExtendedClientAllOfAddress'; -import { GetExtendedContactDetails } from './getExtendedContactDetails'; -import { GetExtendedContactDetailsAllOfStatistics } from './getExtendedContactDetailsAllOfStatistics'; -import { GetExtendedContactDetailsAllOfStatisticsClicked } from './getExtendedContactDetailsAllOfStatisticsClicked'; -import { GetExtendedContactDetailsAllOfStatisticsLinks } from './getExtendedContactDetailsAllOfStatisticsLinks'; -import { GetExtendedContactDetailsAllOfStatisticsMessagesSent } from './getExtendedContactDetailsAllOfStatisticsMessagesSent'; -import { GetExtendedContactDetailsAllOfStatisticsOpened } from './getExtendedContactDetailsAllOfStatisticsOpened'; -import { GetExtendedContactDetailsAllOfStatisticsUnsubscriptions } from './getExtendedContactDetailsAllOfStatisticsUnsubscriptions'; -import { GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription } from './getExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription'; -import { GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription } from './getExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription'; -import { GetExtendedList } from './getExtendedList'; -import { GetExtendedListAllOfCampaignStats } from './getExtendedListAllOfCampaignStats'; -import { GetExternalFeedByUUID } from './getExternalFeedByUUID'; -import { GetExternalFeedByUUIDHeadersInner } from './getExternalFeedByUUIDHeadersInner'; -import { GetFolder } from './getFolder'; -import { GetFolderLists } from './getFolderLists'; -import { GetFolders } from './getFolders'; -import { GetInboundEmailEvents } from './getInboundEmailEvents'; -import { GetInboundEmailEventsByUuid } from './getInboundEmailEventsByUuid'; -import { GetInboundEmailEventsByUuidAttachmentsInner } from './getInboundEmailEventsByUuidAttachmentsInner'; -import { GetInboundEmailEventsByUuidLogsInner } from './getInboundEmailEventsByUuidLogsInner'; -import { GetInboundEmailEventsEventsInner } from './getInboundEmailEventsEventsInner'; -import { GetInvitedUsersList } from './getInvitedUsersList'; -import { GetInvitedUsersListUsersInner } from './getInvitedUsersListUsersInner'; -import { GetInvitedUsersListUsersInnerFeatureAccess } from './getInvitedUsersListUsersInnerFeatureAccess'; -import { GetIp } from './getIp'; -import { GetIpFromSender } from './getIpFromSender'; -import { GetIps } from './getIps'; -import { GetIpsFromSender } from './getIpsFromSender'; -import { GetList } from './getList'; -import { GetLists } from './getLists'; -import { GetListsListsInner } from './getListsListsInner'; -import { GetOrders } from './getOrders'; -import { GetOrdersOrdersInner } from './getOrdersOrdersInner'; -import { GetPaymentRequest } from './getPaymentRequest'; -import { GetProcess } from './getProcess'; -import { GetProcesses } from './getProcesses'; -import { GetProductDetails } from './getProductDetails'; -import { GetProducts } from './getProducts'; -import { GetReports } from './getReports'; -import { GetReportsReportsInner } from './getReportsReportsInner'; -import { GetScheduledEmailByBatchId } from './getScheduledEmailByBatchId'; -import { GetScheduledEmailByBatchIdBatchesInner } from './getScheduledEmailByBatchIdBatchesInner'; -import { GetScheduledEmailByMessageId } from './getScheduledEmailByMessageId'; -import { GetSegments } from './getSegments'; -import { GetSegmentsSegments } from './getSegmentsSegments'; -import { GetSendersList } from './getSendersList'; -import { GetSendersListSendersInner } from './getSendersListSendersInner'; -import { GetSendersListSendersInnerIpsInner } from './getSendersListSendersInnerIpsInner'; -import { GetSharedTemplateUrl } from './getSharedTemplateUrl'; -import { GetSmsCampaign } from './getSmsCampaign'; -import { GetSmsCampaignOverview } from './getSmsCampaignOverview'; -import { GetSmsCampaignStats } from './getSmsCampaignStats'; -import { GetSmsCampaigns } from './getSmsCampaigns'; -import { GetSmsCampaignsCampaignsInner } from './getSmsCampaignsCampaignsInner'; -import { GetSmsEventReport } from './getSmsEventReport'; -import { GetSmsEventReportEventsInner } from './getSmsEventReportEventsInner'; -import { GetSmtpTemplateOverview } from './getSmtpTemplateOverview'; -import { GetSmtpTemplateOverviewSender } from './getSmtpTemplateOverviewSender'; -import { GetSmtpTemplates } from './getSmtpTemplates'; -import { GetSsoToken } from './getSsoToken'; -import { GetStatsByDevice } from './getStatsByDevice'; -import { GetSubAccountGroups200ResponseInner } from './getSubAccountGroups200ResponseInner'; -import { GetTransacAggregatedSmsReport } from './getTransacAggregatedSmsReport'; -import { GetTransacBlockedContacts } from './getTransacBlockedContacts'; -import { GetTransacBlockedContactsContactsInner } from './getTransacBlockedContactsContactsInner'; -import { GetTransacBlockedContactsContactsInnerReason } from './getTransacBlockedContactsContactsInnerReason'; -import { GetTransacEmailContent } from './getTransacEmailContent'; -import { GetTransacEmailContentEventsInner } from './getTransacEmailContentEventsInner'; -import { GetTransacEmailsList } from './getTransacEmailsList'; -import { GetTransacEmailsListTransactionalEmailsInner } from './getTransacEmailsListTransactionalEmailsInner'; -import { GetTransacSmsReport } from './getTransacSmsReport'; -import { GetTransacSmsReportReportsInner } from './getTransacSmsReportReportsInner'; -import { GetUserPermission } from './getUserPermission'; -import { GetUserPermissionPrivilegesInner } from './getUserPermissionPrivilegesInner'; -import { GetWATemplates } from './getWATemplates'; -import { GetWATemplatesTemplatesInner } from './getWATemplatesTemplatesInner'; -import { GetWebhook } from './getWebhook'; -import { GetWebhookAuth } from './getWebhookAuth'; -import { GetWebhookHeadersInner } from './getWebhookHeadersInner'; -import { GetWebhooks } from './getWebhooks'; -import { GetWhatsAppConfig } from './getWhatsAppConfig'; -import { GetWhatsappCampaignOverview } from './getWhatsappCampaignOverview'; -import { GetWhatsappCampaigns } from './getWhatsappCampaigns'; -import { GetWhatsappCampaignsCampaignsInner } from './getWhatsappCampaignsCampaignsInner'; -import { GetWhatsappEventReport } from './getWhatsappEventReport'; -import { GetWhatsappEventReportEventsInner } from './getWhatsappEventReportEventsInner'; -import { InviteAdminUser } from './inviteAdminUser'; -import { InviteAdminUserPrivilegesInner } from './inviteAdminUserPrivilegesInner'; -import { Inviteuser } from './inviteuser'; -import { InviteuserPrivilegesInner } from './inviteuserPrivilegesInner'; -import { ManageIp } from './manageIp'; -import { MasterDetailsResponse } from './masterDetailsResponse'; -import { MasterDetailsResponseBillingInfo } from './masterDetailsResponseBillingInfo'; -import { MasterDetailsResponseBillingInfoAddress } from './masterDetailsResponseBillingInfoAddress'; -import { MasterDetailsResponseBillingInfoName } from './masterDetailsResponseBillingInfoName'; -import { MasterDetailsResponsePlanInfo } from './masterDetailsResponsePlanInfo'; -import { MasterDetailsResponsePlanInfoFeaturesInner } from './masterDetailsResponsePlanInfoFeaturesInner'; -import { Note } from './note'; -import { NoteData } from './noteData'; -import { NoteId } from './noteId'; -import { Notification } from './notification'; -import { Order } from './order'; -import { OrderBatch } from './orderBatch'; -import { OrderBilling } from './orderBilling'; -import { OrderProductsInner } from './orderProductsInner'; -import { Otp } from './otp'; -import { Pipeline } from './pipeline'; -import { PipelineStage } from './pipelineStage'; -import { PostContactInfo } from './postContactInfo'; -import { PostContactInfoContacts } from './postContactInfoContacts'; -import { PostSendFailed } from './postSendFailed'; -import { PostSendSmsTestFailed } from './postSendSmsTestFailed'; -import { PutRevokeUserPermission } from './putRevokeUserPermission'; -import { Putresendcancelinvitation } from './putresendcancelinvitation'; -import { RemainingCreditModel } from './remainingCreditModel'; -import { RemainingCreditModelChild } from './remainingCreditModelChild'; -import { RemainingCreditModelReseller } from './remainingCreditModelReseller'; -import { RemoveContactFromList } from './removeContactFromList'; -import { RemoveCredits } from './removeCredits'; -import { RequestContactExport } from './requestContactExport'; -import { RequestContactExportCustomContactFilter } from './requestContactExportCustomContactFilter'; -import { RequestContactImport } from './requestContactImport'; -import { RequestContactImportJsonBodyInner } from './requestContactImportJsonBodyInner'; -import { RequestContactImportNewList } from './requestContactImportNewList'; -import { RequestSmsRecipientExport } from './requestSmsRecipientExport'; -import { ScheduleSmtpEmail } from './scheduleSmtpEmail'; -import { SendReport } from './sendReport'; -import { SendReportEmail } from './sendReportEmail'; -import { SendSms } from './sendSms'; -import { SendSmtpEmail } from './sendSmtpEmail'; -import { SendSmtpEmailAttachmentInner } from './sendSmtpEmailAttachmentInner'; -import { SendSmtpEmailBccInner } from './sendSmtpEmailBccInner'; -import { SendSmtpEmailCcInner } from './sendSmtpEmailCcInner'; -import { SendSmtpEmailMessageVersionsInner } from './sendSmtpEmailMessageVersionsInner'; -import { SendSmtpEmailMessageVersionsInnerReplyTo } from './sendSmtpEmailMessageVersionsInnerReplyTo'; -import { SendSmtpEmailMessageVersionsInnerToInner } from './sendSmtpEmailMessageVersionsInnerToInner'; -import { SendSmtpEmailReplyTo } from './sendSmtpEmailReplyTo'; -import { SendSmtpEmailSender } from './sendSmtpEmailSender'; -import { SendSmtpEmailToInner } from './sendSmtpEmailToInner'; -import { SendTestEmail } from './sendTestEmail'; -import { SendTestSms } from './sendTestSms'; -import { SendTransacSms } from './sendTransacSms'; -import { SendWhatsappMessage } from './sendWhatsappMessage'; -import { SendWhatsappMessage201Response } from './sendWhatsappMessage201Response'; -import { SsoTokenRequest } from './ssoTokenRequest'; -import { SsoTokenRequestCorporate } from './ssoTokenRequestCorporate'; -import { SubAccountAppsToggleRequest } from './subAccountAppsToggleRequest'; -import { SubAccountDetailsResponse } from './subAccountDetailsResponse'; -import { SubAccountDetailsResponseGroupsInner } from './subAccountDetailsResponseGroupsInner'; -import { SubAccountDetailsResponsePlanInfo } from './subAccountDetailsResponsePlanInfo'; -import { SubAccountDetailsResponsePlanInfoCredits } from './subAccountDetailsResponsePlanInfoCredits'; -import { SubAccountDetailsResponsePlanInfoCreditsEmails } from './subAccountDetailsResponsePlanInfoCreditsEmails'; -import { SubAccountDetailsResponsePlanInfoCreditsSms } from './subAccountDetailsResponsePlanInfoCreditsSms'; -import { SubAccountDetailsResponsePlanInfoCreditsWpSubscribers } from './subAccountDetailsResponsePlanInfoCreditsWpSubscribers'; -import { SubAccountDetailsResponsePlanInfoFeatures } from './subAccountDetailsResponsePlanInfoFeatures'; -import { SubAccountDetailsResponsePlanInfoFeaturesInbox } from './subAccountDetailsResponsePlanInfoFeaturesInbox'; -import { SubAccountDetailsResponsePlanInfoFeaturesLandingPage } from './subAccountDetailsResponsePlanInfoFeaturesLandingPage'; -import { SubAccountDetailsResponsePlanInfoFeaturesUsers } from './subAccountDetailsResponsePlanInfoFeaturesUsers'; -import { SubAccountUpdatePlanRequest } from './subAccountUpdatePlanRequest'; -import { SubAccountUpdatePlanRequestCredits } from './subAccountUpdatePlanRequestCredits'; -import { SubAccountUpdatePlanRequestFeatures } from './subAccountUpdatePlanRequestFeatures'; -import { SubAccountsResponse } from './subAccountsResponse'; -import { SubAccountsResponseSubAccountsInner } from './subAccountsResponseSubAccountsInner'; -import { SubAccountsResponseSubAccountsInnerGroupsInner } from './subAccountsResponseSubAccountsInnerGroupsInner'; -import { Task } from './task'; -import { TaskList } from './taskList'; -import { TaskReminder } from './taskReminder'; -import { TaskTypes } from './taskTypes'; -import { UpdateAttribute } from './updateAttribute'; -import { UpdateAttributeEnumerationInner } from './updateAttributeEnumerationInner'; -import { UpdateBatchContacts } from './updateBatchContacts'; -import { UpdateBatchContactsContactsInner } from './updateBatchContactsContactsInner'; -import { UpdateBatchContactsModel } from './updateBatchContactsModel'; -import { UpdateCampaignStatus } from './updateCampaignStatus'; -import { UpdateChild } from './updateChild'; -import { UpdateChildAccountStatus } from './updateChildAccountStatus'; -import { UpdateChildDomain } from './updateChildDomain'; -import { UpdateContact } from './updateContact'; -import { UpdateCouponCollection200Response } from './updateCouponCollection200Response'; -import { UpdateCouponCollectionRequest } from './updateCouponCollectionRequest'; -import { UpdateEmailCampaign } from './updateEmailCampaign'; -import { UpdateEmailCampaignRecipients } from './updateEmailCampaignRecipients'; -import { UpdateEmailCampaignSender } from './updateEmailCampaignSender'; -import { UpdateExternalFeed } from './updateExternalFeed'; -import { UpdateList } from './updateList'; -import { UpdateSender } from './updateSender'; -import { UpdateSmsCampaign } from './updateSmsCampaign'; -import { UpdateSmtpTemplate } from './updateSmtpTemplate'; -import { UpdateSmtpTemplateSender } from './updateSmtpTemplateSender'; -import { UpdateWebhook } from './updateWebhook'; -import { UpdateWhatsAppCampaign } from './updateWhatsAppCampaign'; -import { UploadImageModel } from './uploadImageModel'; -import { UploadImageToGallery } from './uploadImageToGallery'; -import { VariablesItems } from './variablesItems'; -import { WhatsappCampStats } from './whatsappCampStats'; -import { WhatsappCampTemplate } from './whatsappCampTemplate'; - -/* tslint:disable:no-unused-variable */ -let primitives = [ - "string", - "boolean", - "double", - "integer", - "long", - "float", - "number", - "any" - ]; - -let enumsMap: {[index: string]: any} = { - "AbTestCampaignResult.WinningVersionEnum": AbTestCampaignResult.WinningVersionEnum, - "AbTestCampaignResult.WinningCriteriaEnum": AbTestCampaignResult.WinningCriteriaEnum, - "Cart.CurrencyEnum": Cart.CurrencyEnum, - "ConversationsMessage.TypeEnum": ConversationsMessage.TypeEnum, - "ConversionSourceMetrics.ConversionSourceEnum": ConversionSourceMetrics.ConversionSourceEnum, - "CreateAttribute.TypeEnum": CreateAttribute.TypeEnum, - "CreateChild.LanguageEnum": CreateChild.LanguageEnum, - "CreateEmailCampaign.WinnerCriteriaEnum": CreateEmailCampaign.WinnerCriteriaEnum, - "CreateExternalFeed.AuthTypeEnum": CreateExternalFeed.AuthTypeEnum, - "CreateSubAccount.LanguageEnum": CreateSubAccount.LanguageEnum, - "CreateWebhook.EventsEnum": CreateWebhook.EventsEnum, - "CreateWebhook.TypeEnum": CreateWebhook.TypeEnum, - "CreateWhatsAppTemplate.CategoryEnum": CreateWhatsAppTemplate.CategoryEnum, - "CreateWhatsAppTemplate.SourceEnum": CreateWhatsAppTemplate.SourceEnum, - "EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ConversionSourceEnum": EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response.ConversionSourceEnum, - "EmailExportRecipients.RecipientsTypeEnum": EmailExportRecipients.RecipientsTypeEnum, - "ErrorModel.CodeEnum": ErrorModel.CodeEnum, - "ExportWebhooksHistory.TypeEnum": ExportWebhooksHistory.TypeEnum, - "ExportWebhooksHistory.EventEnum": ExportWebhooksHistory.EventEnum, - "GetAccountAllOfPlan.TypeEnum": GetAccountAllOfPlan.TypeEnum, - "GetAccountAllOfPlan.CreditsTypeEnum": GetAccountAllOfPlan.CreditsTypeEnum, - "GetAllExternalFeedsFeedsInner.AuthTypeEnum": GetAllExternalFeedsFeedsInner.AuthTypeEnum, - "GetAttributesAttributesInner.CategoryEnum": GetAttributesAttributesInner.CategoryEnum, - "GetAttributesAttributesInner.TypeEnum": GetAttributesAttributesInner.TypeEnum, - "GetCampaignOverview.TypeEnum": GetCampaignOverview.TypeEnum, - "GetCampaignOverview.StatusEnum": GetCampaignOverview.StatusEnum, - "GetEmailCampaign.TypeEnum": GetEmailCampaign.TypeEnum, - "GetEmailCampaign.StatusEnum": GetEmailCampaign.StatusEnum, - "GetEmailCampaignsCampaignsInner.TypeEnum": GetEmailCampaignsCampaignsInner.TypeEnum, - "GetEmailCampaignsCampaignsInner.StatusEnum": GetEmailCampaignsCampaignsInner.StatusEnum, - "GetEmailEventReportEventsInner.EventEnum": GetEmailEventReportEventsInner.EventEnum, - "GetExtendedCampaignOverview.TypeEnum": GetExtendedCampaignOverview.TypeEnum, - "GetExtendedCampaignOverview.StatusEnum": GetExtendedCampaignOverview.StatusEnum, - "GetExternalFeedByUUID.AuthTypeEnum": GetExternalFeedByUUID.AuthTypeEnum, - "GetInboundEmailEventsByUuidLogsInner.TypeEnum": GetInboundEmailEventsByUuidLogsInner.TypeEnum, - "GetPaymentRequest.StatusEnum": GetPaymentRequest.StatusEnum, - "GetProcess.StatusEnum": GetProcess.StatusEnum, - "GetScheduledEmailByBatchIdBatchesInner.StatusEnum": GetScheduledEmailByBatchIdBatchesInner.StatusEnum, - "GetScheduledEmailByMessageId.StatusEnum": GetScheduledEmailByMessageId.StatusEnum, - "GetSmsCampaign.StatusEnum": GetSmsCampaign.StatusEnum, - "GetSmsCampaignOverview.StatusEnum": GetSmsCampaignOverview.StatusEnum, - "GetSmsCampaignsCampaignsInner.StatusEnum": GetSmsCampaignsCampaignsInner.StatusEnum, - "GetSmsEventReportEventsInner.EventEnum": GetSmsEventReportEventsInner.EventEnum, - "GetTransacBlockedContactsContactsInnerReason.CodeEnum": GetTransacBlockedContactsContactsInnerReason.CodeEnum, - "GetWebhook.TypeEnum": GetWebhook.TypeEnum, - "GetWhatsAppConfig.PhoneNumberQualityEnum": GetWhatsAppConfig.PhoneNumberQualityEnum, - "GetWhatsAppConfig.PhoneNumberNameStatusEnum": GetWhatsAppConfig.PhoneNumberNameStatusEnum, - "GetWhatsappCampaignOverview.CampaignStatusEnum": GetWhatsappCampaignOverview.CampaignStatusEnum, - "GetWhatsappCampaignsCampaignsInner.CampaignStatusEnum": GetWhatsappCampaignsCampaignsInner.CampaignStatusEnum, - "GetWhatsappEventReportEventsInner.EventEnum": GetWhatsappEventReportEventsInner.EventEnum, - "InviteAdminUserPrivilegesInner.FeatureEnum": InviteAdminUserPrivilegesInner.FeatureEnum, - "InviteAdminUserPrivilegesInner.PermissionsEnum": InviteAdminUserPrivilegesInner.PermissionsEnum, - "InviteuserPrivilegesInner.FeatureEnum": InviteuserPrivilegesInner.FeatureEnum, - "InviteuserPrivilegesInner.PermissionsEnum": InviteuserPrivilegesInner.PermissionsEnum, - "MasterDetailsResponsePlanInfo.PlanPeriodEnum": MasterDetailsResponsePlanInfo.PlanPeriodEnum, - "Notification.ChannelEnum": Notification.ChannelEnum, - "RequestContactExportCustomContactFilter.ActionForContactsEnum": RequestContactExportCustomContactFilter.ActionForContactsEnum, - "RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum": RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum, - "RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum": RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum, - "RequestSmsRecipientExport.RecipientsTypeEnum": RequestSmsRecipientExport.RecipientsTypeEnum, - "SendReport.LanguageEnum": SendReport.LanguageEnum, - "SendTransacSms.TypeEnum": SendTransacSms.TypeEnum, - "SsoTokenRequest.TargetEnum": SsoTokenRequest.TargetEnum, - "TaskReminder.UnitEnum": TaskReminder.UnitEnum, - "UpdateCampaignStatus.StatusEnum": UpdateCampaignStatus.StatusEnum, - "UpdateEmailCampaign.WinnerCriteriaEnum": UpdateEmailCampaign.WinnerCriteriaEnum, - "UpdateExternalFeed.AuthTypeEnum": UpdateExternalFeed.AuthTypeEnum, - "UpdateWebhook.EventsEnum": UpdateWebhook.EventsEnum, - "UpdateWhatsAppCampaign.CampaignStatusEnum": UpdateWhatsAppCampaign.CampaignStatusEnum, -} - -let typeMap: {[index: string]: any} = { - "AbTestCampaignResult": AbTestCampaignResult, - "AbTestCampaignResultClickedLinks": AbTestCampaignResultClickedLinks, - "AbTestCampaignResultStatistics": AbTestCampaignResultStatistics, - "AbTestVersionClicksInner": AbTestVersionClicksInner, - "AbTestVersionStats": AbTestVersionStats, - "AddChildDomain": AddChildDomain, - "AddContactToList": AddContactToList, - "AddCredits": AddCredits, - "AuthenticateDomainModel": AuthenticateDomainModel, - "BlockDomain": BlockDomain, - "Cart": Cart, - "CompaniesIdPatchRequest": CompaniesIdPatchRequest, - "CompaniesLinkUnlinkIdPatchRequest": CompaniesLinkUnlinkIdPatchRequest, - "CompaniesList": CompaniesList, - "CompaniesPost200Response": CompaniesPost200Response, - "CompaniesPostRequest": CompaniesPostRequest, - "Company": Company, - "CompanyAttributesInner": CompanyAttributesInner, - "ComponentItems": ComponentItems, - "Configuration": Configuration, - "ConversationsAgentOnlinePingPostRequest": ConversationsAgentOnlinePingPostRequest, - "ConversationsMessage": ConversationsMessage, - "ConversationsMessageFile": ConversationsMessageFile, - "ConversationsMessageFileImageInfo": ConversationsMessageFileImageInfo, - "ConversationsMessagesIdPutRequest": ConversationsMessagesIdPutRequest, - "ConversationsMessagesPostRequest": ConversationsMessagesPostRequest, - "ConversationsPushedMessagesIdPutRequest": ConversationsPushedMessagesIdPutRequest, - "ConversationsPushedMessagesPostRequest": ConversationsPushedMessagesPostRequest, - "ConversionSourceMetrics": ConversionSourceMetrics, - "ConversionSourceProduct": ConversionSourceProduct, - "CorporateGroupDetailsResponse": CorporateGroupDetailsResponse, - "CorporateGroupDetailsResponseGroup": CorporateGroupDetailsResponseGroup, - "CorporateGroupDetailsResponseSubAccountsInner": CorporateGroupDetailsResponseSubAccountsInner, - "CorporateGroupDetailsResponseUsersInner": CorporateGroupDetailsResponseUsersInner, - "CorporateGroupPost201Response": CorporateGroupPost201Response, - "CorporateGroupPostRequest": CorporateGroupPostRequest, - "CorporateGroupUnlinkGroupIdSubAccountsPutRequest": CorporateGroupUnlinkGroupIdSubAccountsPutRequest, - "CorporateSubAccountIpAssociatePostRequest": CorporateSubAccountIpAssociatePostRequest, - "CorporateSubAccountIpDissociatePutRequest": CorporateSubAccountIpDissociatePutRequest, - "CorporateUserInvitationActionEmailPut200Response": CorporateUserInvitationActionEmailPut200Response, - "CreateApiKeyRequest": CreateApiKeyRequest, - "CreateApiKeyResponse": CreateApiKeyResponse, - "CreateAttribute": CreateAttribute, - "CreateAttributeEnumerationInner": CreateAttributeEnumerationInner, - "CreateCategoryModel": CreateCategoryModel, - "CreateChild": CreateChild, - "CreateContact": CreateContact, - "CreateCouponCollection201Response": CreateCouponCollection201Response, - "CreateCouponCollectionRequest": CreateCouponCollectionRequest, - "CreateCouponsRequest": CreateCouponsRequest, - "CreateDoiContact": CreateDoiContact, - "CreateDomain": CreateDomain, - "CreateDomainModel": CreateDomainModel, - "CreateDomainModelDnsRecords": CreateDomainModelDnsRecords, - "CreateDomainModelDnsRecordsDkimRecord": CreateDomainModelDnsRecordsDkimRecord, - "CreateEmailCampaign": CreateEmailCampaign, - "CreateEmailCampaignRecipients": CreateEmailCampaignRecipients, - "CreateEmailCampaignSender": CreateEmailCampaignSender, - "CreateExternalFeed": CreateExternalFeed, - "CreateExternalFeed201Response": CreateExternalFeed201Response, - "CreateList": CreateList, - "CreateModel": CreateModel, - "CreatePaymentRequest": CreatePaymentRequest, - "CreatePaymentResponse": CreatePaymentResponse, - "CreateProductModel": CreateProductModel, - "CreateReseller": CreateReseller, - "CreateSender": CreateSender, - "CreateSenderIpsInner": CreateSenderIpsInner, - "CreateSenderModel": CreateSenderModel, - "CreateSmsCampaign": CreateSmsCampaign, - "CreateSmsCampaignRecipients": CreateSmsCampaignRecipients, - "CreateSmtpEmail": CreateSmtpEmail, - "CreateSmtpTemplate": CreateSmtpTemplate, - "CreateSmtpTemplateSender": CreateSmtpTemplateSender, - "CreateSubAccount": CreateSubAccount, - "CreateSubAccountResponse": CreateSubAccountResponse, - "CreateUpdateBatchCategory": CreateUpdateBatchCategory, - "CreateUpdateBatchCategoryModel": CreateUpdateBatchCategoryModel, - "CreateUpdateBatchProducts": CreateUpdateBatchProducts, - "CreateUpdateBatchProductsModel": CreateUpdateBatchProductsModel, - "CreateUpdateCategories": CreateUpdateCategories, - "CreateUpdateCategory": CreateUpdateCategory, - "CreateUpdateContactModel": CreateUpdateContactModel, - "CreateUpdateFolder": CreateUpdateFolder, - "CreateUpdateProduct": CreateUpdateProduct, - "CreateUpdateProducts": CreateUpdateProducts, - "CreateWebhook": CreateWebhook, - "CreateWhatsAppCampaign": CreateWhatsAppCampaign, - "CreateWhatsAppCampaignRecipients": CreateWhatsAppCampaignRecipients, - "CreateWhatsAppTemplate": CreateWhatsAppTemplate, - "CreatedBatchId": CreatedBatchId, - "CreatedProcessId": CreatedProcessId, - "CrmDealsIdPatchRequest": CrmDealsIdPatchRequest, - "CrmDealsLinkUnlinkIdPatchRequest": CrmDealsLinkUnlinkIdPatchRequest, - "CrmDealsPost201Response": CrmDealsPost201Response, - "CrmDealsPostRequest": CrmDealsPostRequest, - "CrmTasksIdPatchRequest": CrmTasksIdPatchRequest, - "CrmTasksPost201Response": CrmTasksPost201Response, - "CrmTasksPostRequest": CrmTasksPostRequest, - "Deal": Deal, - "DealAttributesInner": DealAttributesInner, - "DealsList": DealsList, - "DeleteHardbounces": DeleteHardbounces, - "EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response": EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response, - "EcommerceAttributionMetricsGet200Response": EcommerceAttributionMetricsGet200Response, - "EcommerceAttributionMetricsGet200ResponseTotals": EcommerceAttributionMetricsGet200ResponseTotals, - "EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response": EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response, - "EcommerceConfigDisplayCurrencyGet200Response": EcommerceConfigDisplayCurrencyGet200Response, - "EmailExportRecipients": EmailExportRecipients, - "ErrorModel": ErrorModel, - "Event": Event, - "EventIdentifiers": EventIdentifiers, - "ExportWebhooksHistory": ExportWebhooksHistory, - "FileData": FileData, - "FileDownloadableLink": FileDownloadableLink, - "GetAccount": GetAccount, - "GetAccountActivity": GetAccountActivity, - "GetAccountActivityLogsInner": GetAccountActivityLogsInner, - "GetAccountAllOfMarketingAutomation": GetAccountAllOfMarketingAutomation, - "GetAccountAllOfPlan": GetAccountAllOfPlan, - "GetAccountAllOfRelay": GetAccountAllOfRelay, - "GetAccountAllOfRelayData": GetAccountAllOfRelayData, - "GetAggregatedReport": GetAggregatedReport, - "GetAllExternalFeeds": GetAllExternalFeeds, - "GetAllExternalFeedsFeedsInner": GetAllExternalFeedsFeedsInner, - "GetAttributes": GetAttributes, - "GetAttributesAttributesInner": GetAttributesAttributesInner, - "GetAttributesAttributesInnerEnumerationInner": GetAttributesAttributesInnerEnumerationInner, - "GetBlockedDomains": GetBlockedDomains, - "GetCampaignOverview": GetCampaignOverview, - "GetCampaignRecipients": GetCampaignRecipients, - "GetCampaignStats": GetCampaignStats, - "GetCategories": GetCategories, - "GetCategoryDetails": GetCategoryDetails, - "GetChildAccountCreationStatus": GetChildAccountCreationStatus, - "GetChildDomain": GetChildDomain, - "GetChildInfo": GetChildInfo, - "GetChildInfoAllOfApiKeys": GetChildInfoAllOfApiKeys, - "GetChildInfoAllOfApiKeysV2": GetChildInfoAllOfApiKeysV2, - "GetChildInfoAllOfApiKeysV3": GetChildInfoAllOfApiKeysV3, - "GetChildInfoAllOfCredits": GetChildInfoAllOfCredits, - "GetChildInfoAllOfStatistics": GetChildInfoAllOfStatistics, - "GetChildrenList": GetChildrenList, - "GetChildrenListChildrenInner": GetChildrenListChildrenInner, - "GetClient": GetClient, - "GetContactCampaignStats": GetContactCampaignStats, - "GetContactCampaignStatsClickedInner": GetContactCampaignStatsClickedInner, - "GetContactCampaignStatsClickedInnerLinksInner": GetContactCampaignStatsClickedInnerLinksInner, - "GetContactCampaignStatsMessagesSentInner": GetContactCampaignStatsMessagesSentInner, - "GetContactCampaignStatsOpenedInner": GetContactCampaignStatsOpenedInner, - "GetContactCampaignStatsTransacAttributesInner": GetContactCampaignStatsTransacAttributesInner, - "GetContactCampaignStatsUnsubscriptions": GetContactCampaignStatsUnsubscriptions, - "GetContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner": GetContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner, - "GetContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner": GetContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner, - "GetContactDetails": GetContactDetails, - "GetContacts": GetContacts, - "GetCorporateInvitedUsersList": GetCorporateInvitedUsersList, - "GetCorporateInvitedUsersListUsersInner": GetCorporateInvitedUsersListUsersInner, - "GetCorporateInvitedUsersListUsersInnerFeatureAccess": GetCorporateInvitedUsersListUsersInnerFeatureAccess, - "GetCorporateInvitedUsersListUsersInnerGroups": GetCorporateInvitedUsersListUsersInnerGroups, - "GetCorporateUserPermission": GetCorporateUserPermission, - "GetCorporateUserPermissionFeatureAccess": GetCorporateUserPermissionFeatureAccess, - "GetCorporateUserPermissionGroupsInner": GetCorporateUserPermissionGroupsInner, - "GetCouponCollection": GetCouponCollection, - "GetDeviceBrowserStats": GetDeviceBrowserStats, - "GetDomainConfigurationModel": GetDomainConfigurationModel, - "GetDomainsList": GetDomainsList, - "GetDomainsListDomainsInner": GetDomainsListDomainsInner, - "GetEmailCampaign": GetEmailCampaign, - "GetEmailCampaigns": GetEmailCampaigns, - "GetEmailCampaignsCampaignsInner": GetEmailCampaignsCampaignsInner, - "GetEmailEventReport": GetEmailEventReport, - "GetEmailEventReportEventsInner": GetEmailEventReportEventsInner, - "GetExtendedCampaignOverview": GetExtendedCampaignOverview, - "GetExtendedCampaignOverviewAllOfSender": GetExtendedCampaignOverviewAllOfSender, - "GetExtendedCampaignStats": GetExtendedCampaignStats, - "GetExtendedClient": GetExtendedClient, - "GetExtendedClientAllOfAddress": GetExtendedClientAllOfAddress, - "GetExtendedContactDetails": GetExtendedContactDetails, - "GetExtendedContactDetailsAllOfStatistics": GetExtendedContactDetailsAllOfStatistics, - "GetExtendedContactDetailsAllOfStatisticsClicked": GetExtendedContactDetailsAllOfStatisticsClicked, - "GetExtendedContactDetailsAllOfStatisticsLinks": GetExtendedContactDetailsAllOfStatisticsLinks, - "GetExtendedContactDetailsAllOfStatisticsMessagesSent": GetExtendedContactDetailsAllOfStatisticsMessagesSent, - "GetExtendedContactDetailsAllOfStatisticsOpened": GetExtendedContactDetailsAllOfStatisticsOpened, - "GetExtendedContactDetailsAllOfStatisticsUnsubscriptions": GetExtendedContactDetailsAllOfStatisticsUnsubscriptions, - "GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription": GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription, - "GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription": GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription, - "GetExtendedList": GetExtendedList, - "GetExtendedListAllOfCampaignStats": GetExtendedListAllOfCampaignStats, - "GetExternalFeedByUUID": GetExternalFeedByUUID, - "GetExternalFeedByUUIDHeadersInner": GetExternalFeedByUUIDHeadersInner, - "GetFolder": GetFolder, - "GetFolderLists": GetFolderLists, - "GetFolders": GetFolders, - "GetInboundEmailEvents": GetInboundEmailEvents, - "GetInboundEmailEventsByUuid": GetInboundEmailEventsByUuid, - "GetInboundEmailEventsByUuidAttachmentsInner": GetInboundEmailEventsByUuidAttachmentsInner, - "GetInboundEmailEventsByUuidLogsInner": GetInboundEmailEventsByUuidLogsInner, - "GetInboundEmailEventsEventsInner": GetInboundEmailEventsEventsInner, - "GetInvitedUsersList": GetInvitedUsersList, - "GetInvitedUsersListUsersInner": GetInvitedUsersListUsersInner, - "GetInvitedUsersListUsersInnerFeatureAccess": GetInvitedUsersListUsersInnerFeatureAccess, - "GetIp": GetIp, - "GetIpFromSender": GetIpFromSender, - "GetIps": GetIps, - "GetIpsFromSender": GetIpsFromSender, - "GetList": GetList, - "GetLists": GetLists, - "GetListsListsInner": GetListsListsInner, - "GetOrders": GetOrders, - "GetOrdersOrdersInner": GetOrdersOrdersInner, - "GetPaymentRequest": GetPaymentRequest, - "GetProcess": GetProcess, - "GetProcesses": GetProcesses, - "GetProductDetails": GetProductDetails, - "GetProducts": GetProducts, - "GetReports": GetReports, - "GetReportsReportsInner": GetReportsReportsInner, - "GetScheduledEmailByBatchId": GetScheduledEmailByBatchId, - "GetScheduledEmailByBatchIdBatchesInner": GetScheduledEmailByBatchIdBatchesInner, - "GetScheduledEmailByMessageId": GetScheduledEmailByMessageId, - "GetSegments": GetSegments, - "GetSegmentsSegments": GetSegmentsSegments, - "GetSendersList": GetSendersList, - "GetSendersListSendersInner": GetSendersListSendersInner, - "GetSendersListSendersInnerIpsInner": GetSendersListSendersInnerIpsInner, - "GetSharedTemplateUrl": GetSharedTemplateUrl, - "GetSmsCampaign": GetSmsCampaign, - "GetSmsCampaignOverview": GetSmsCampaignOverview, - "GetSmsCampaignStats": GetSmsCampaignStats, - "GetSmsCampaigns": GetSmsCampaigns, - "GetSmsCampaignsCampaignsInner": GetSmsCampaignsCampaignsInner, - "GetSmsEventReport": GetSmsEventReport, - "GetSmsEventReportEventsInner": GetSmsEventReportEventsInner, - "GetSmtpTemplateOverview": GetSmtpTemplateOverview, - "GetSmtpTemplateOverviewSender": GetSmtpTemplateOverviewSender, - "GetSmtpTemplates": GetSmtpTemplates, - "GetSsoToken": GetSsoToken, - "GetStatsByDevice": GetStatsByDevice, - "GetSubAccountGroups200ResponseInner": GetSubAccountGroups200ResponseInner, - "GetTransacAggregatedSmsReport": GetTransacAggregatedSmsReport, - "GetTransacBlockedContacts": GetTransacBlockedContacts, - "GetTransacBlockedContactsContactsInner": GetTransacBlockedContactsContactsInner, - "GetTransacBlockedContactsContactsInnerReason": GetTransacBlockedContactsContactsInnerReason, - "GetTransacEmailContent": GetTransacEmailContent, - "GetTransacEmailContentEventsInner": GetTransacEmailContentEventsInner, - "GetTransacEmailsList": GetTransacEmailsList, - "GetTransacEmailsListTransactionalEmailsInner": GetTransacEmailsListTransactionalEmailsInner, - "GetTransacSmsReport": GetTransacSmsReport, - "GetTransacSmsReportReportsInner": GetTransacSmsReportReportsInner, - "GetUserPermission": GetUserPermission, - "GetUserPermissionPrivilegesInner": GetUserPermissionPrivilegesInner, - "GetWATemplates": GetWATemplates, - "GetWATemplatesTemplatesInner": GetWATemplatesTemplatesInner, - "GetWebhook": GetWebhook, - "GetWebhookAuth": GetWebhookAuth, - "GetWebhookHeadersInner": GetWebhookHeadersInner, - "GetWebhooks": GetWebhooks, - "GetWhatsAppConfig": GetWhatsAppConfig, - "GetWhatsappCampaignOverview": GetWhatsappCampaignOverview, - "GetWhatsappCampaigns": GetWhatsappCampaigns, - "GetWhatsappCampaignsCampaignsInner": GetWhatsappCampaignsCampaignsInner, - "GetWhatsappEventReport": GetWhatsappEventReport, - "GetWhatsappEventReportEventsInner": GetWhatsappEventReportEventsInner, - "InviteAdminUser": InviteAdminUser, - "InviteAdminUserPrivilegesInner": InviteAdminUserPrivilegesInner, - "Inviteuser": Inviteuser, - "InviteuserPrivilegesInner": InviteuserPrivilegesInner, - "ManageIp": ManageIp, - "MasterDetailsResponse": MasterDetailsResponse, - "MasterDetailsResponseBillingInfo": MasterDetailsResponseBillingInfo, - "MasterDetailsResponseBillingInfoAddress": MasterDetailsResponseBillingInfoAddress, - "MasterDetailsResponseBillingInfoName": MasterDetailsResponseBillingInfoName, - "MasterDetailsResponsePlanInfo": MasterDetailsResponsePlanInfo, - "MasterDetailsResponsePlanInfoFeaturesInner": MasterDetailsResponsePlanInfoFeaturesInner, - "Note": Note, - "NoteData": NoteData, - "NoteId": NoteId, - "Notification": Notification, - "Order": Order, - "OrderBatch": OrderBatch, - "OrderBilling": OrderBilling, - "OrderProductsInner": OrderProductsInner, - "Otp": Otp, - "Pipeline": Pipeline, - "PipelineStage": PipelineStage, - "PostContactInfo": PostContactInfo, - "PostContactInfoContacts": PostContactInfoContacts, - "PostSendFailed": PostSendFailed, - "PostSendSmsTestFailed": PostSendSmsTestFailed, - "PutRevokeUserPermission": PutRevokeUserPermission, - "Putresendcancelinvitation": Putresendcancelinvitation, - "RemainingCreditModel": RemainingCreditModel, - "RemainingCreditModelChild": RemainingCreditModelChild, - "RemainingCreditModelReseller": RemainingCreditModelReseller, - "RemoveContactFromList": RemoveContactFromList, - "RemoveCredits": RemoveCredits, - "RequestContactExport": RequestContactExport, - "RequestContactExportCustomContactFilter": RequestContactExportCustomContactFilter, - "RequestContactImport": RequestContactImport, - "RequestContactImportJsonBodyInner": RequestContactImportJsonBodyInner, - "RequestContactImportNewList": RequestContactImportNewList, - "RequestSmsRecipientExport": RequestSmsRecipientExport, - "ScheduleSmtpEmail": ScheduleSmtpEmail, - "SendReport": SendReport, - "SendReportEmail": SendReportEmail, - "SendSms": SendSms, - "SendSmtpEmail": SendSmtpEmail, - "SendSmtpEmailAttachmentInner": SendSmtpEmailAttachmentInner, - "SendSmtpEmailBccInner": SendSmtpEmailBccInner, - "SendSmtpEmailCcInner": SendSmtpEmailCcInner, - "SendSmtpEmailMessageVersionsInner": SendSmtpEmailMessageVersionsInner, - "SendSmtpEmailMessageVersionsInnerReplyTo": SendSmtpEmailMessageVersionsInnerReplyTo, - "SendSmtpEmailMessageVersionsInnerToInner": SendSmtpEmailMessageVersionsInnerToInner, - "SendSmtpEmailReplyTo": SendSmtpEmailReplyTo, - "SendSmtpEmailSender": SendSmtpEmailSender, - "SendSmtpEmailToInner": SendSmtpEmailToInner, - "SendTestEmail": SendTestEmail, - "SendTestSms": SendTestSms, - "SendTransacSms": SendTransacSms, - "SendWhatsappMessage": SendWhatsappMessage, - "SendWhatsappMessage201Response": SendWhatsappMessage201Response, - "SsoTokenRequest": SsoTokenRequest, - "SsoTokenRequestCorporate": SsoTokenRequestCorporate, - "SubAccountAppsToggleRequest": SubAccountAppsToggleRequest, - "SubAccountDetailsResponse": SubAccountDetailsResponse, - "SubAccountDetailsResponseGroupsInner": SubAccountDetailsResponseGroupsInner, - "SubAccountDetailsResponsePlanInfo": SubAccountDetailsResponsePlanInfo, - "SubAccountDetailsResponsePlanInfoCredits": SubAccountDetailsResponsePlanInfoCredits, - "SubAccountDetailsResponsePlanInfoCreditsEmails": SubAccountDetailsResponsePlanInfoCreditsEmails, - "SubAccountDetailsResponsePlanInfoCreditsSms": SubAccountDetailsResponsePlanInfoCreditsSms, - "SubAccountDetailsResponsePlanInfoCreditsWpSubscribers": SubAccountDetailsResponsePlanInfoCreditsWpSubscribers, - "SubAccountDetailsResponsePlanInfoFeatures": SubAccountDetailsResponsePlanInfoFeatures, - "SubAccountDetailsResponsePlanInfoFeaturesInbox": SubAccountDetailsResponsePlanInfoFeaturesInbox, - "SubAccountDetailsResponsePlanInfoFeaturesLandingPage": SubAccountDetailsResponsePlanInfoFeaturesLandingPage, - "SubAccountDetailsResponsePlanInfoFeaturesUsers": SubAccountDetailsResponsePlanInfoFeaturesUsers, - "SubAccountUpdatePlanRequest": SubAccountUpdatePlanRequest, - "SubAccountUpdatePlanRequestCredits": SubAccountUpdatePlanRequestCredits, - "SubAccountUpdatePlanRequestFeatures": SubAccountUpdatePlanRequestFeatures, - "SubAccountsResponse": SubAccountsResponse, - "SubAccountsResponseSubAccountsInner": SubAccountsResponseSubAccountsInner, - "SubAccountsResponseSubAccountsInnerGroupsInner": SubAccountsResponseSubAccountsInnerGroupsInner, - "Task": Task, - "TaskList": TaskList, - "TaskReminder": TaskReminder, - "TaskTypes": TaskTypes, - "UpdateAttribute": UpdateAttribute, - "UpdateAttributeEnumerationInner": UpdateAttributeEnumerationInner, - "UpdateBatchContacts": UpdateBatchContacts, - "UpdateBatchContactsContactsInner": UpdateBatchContactsContactsInner, - "UpdateBatchContactsModel": UpdateBatchContactsModel, - "UpdateCampaignStatus": UpdateCampaignStatus, - "UpdateChild": UpdateChild, - "UpdateChildAccountStatus": UpdateChildAccountStatus, - "UpdateChildDomain": UpdateChildDomain, - "UpdateContact": UpdateContact, - "UpdateCouponCollection200Response": UpdateCouponCollection200Response, - "UpdateCouponCollectionRequest": UpdateCouponCollectionRequest, - "UpdateEmailCampaign": UpdateEmailCampaign, - "UpdateEmailCampaignRecipients": UpdateEmailCampaignRecipients, - "UpdateEmailCampaignSender": UpdateEmailCampaignSender, - "UpdateExternalFeed": UpdateExternalFeed, - "UpdateList": UpdateList, - "UpdateSender": UpdateSender, - "UpdateSmsCampaign": UpdateSmsCampaign, - "UpdateSmtpTemplate": UpdateSmtpTemplate, - "UpdateSmtpTemplateSender": UpdateSmtpTemplateSender, - "UpdateWebhook": UpdateWebhook, - "UpdateWhatsAppCampaign": UpdateWhatsAppCampaign, - "UploadImageModel": UploadImageModel, - "UploadImageToGallery": UploadImageToGallery, - "VariablesItems": VariablesItems, - "WhatsappCampStats": WhatsappCampStats, - "WhatsappCampTemplate": WhatsappCampTemplate, -} - -export class ObjectSerializer { - public static findCorrectType(data: any, expectedType: string) { - if (data == undefined) { - return expectedType; - } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { - return expectedType; - } else if (expectedType === "Date") { - return expectedType; - } else { - if (enumsMap[expectedType]) { - return expectedType; - } - - if (!typeMap[expectedType]) { - return expectedType; // w/e we don't know the type - } - - // Check the discriminator - let discriminatorProperty = typeMap[expectedType].discriminator; - if (discriminatorProperty == null) { - return expectedType; // the type does not have a discriminator. use it. - } else { - if (data[discriminatorProperty]) { - var discriminatorType = data[discriminatorProperty]; - if(typeMap[discriminatorType]){ - return discriminatorType; // use the type given in the discriminator - } else { - return expectedType; // discriminator did not map to a type - } - } else { - return expectedType; // discriminator was not present (or an empty string) - } - } - } - } - - public static serialize(data: any, type: string) { - if (data == undefined) { - return data; - } else if (primitives.indexOf(type.toLowerCase()) !== -1) { - return data; - } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 - let subType: string = type.replace("Array<", ""); // Array => Type> - subType = subType.substring(0, subType.length - 1); // Type> => Type - let transformedData: any[] = []; - for (let index = 0; index < data.length; index++) { - let datum = data[index]; - transformedData.push(ObjectSerializer.serialize(datum, subType)); - } - return transformedData; - } else if (type === "Date") { - return data.toISOString(); - } else { - if (enumsMap[type]) { - return data; - } - if (!typeMap[type]) { // in case we dont know the type - return data; - } - - // Get the actual type of this object - type = this.findCorrectType(data, type); - - // get the map for the correct type. - let attributeTypes = typeMap[type].getAttributeTypeMap(); - let instance: {[index: string]: any} = {}; - for (let index = 0; index < attributeTypes.length; index++) { - let attributeType = attributeTypes[index]; - instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type); - } - return instance; - } - } - - public static deserialize(data: any, type: string) { - // polymorphism may change the actual type. - type = ObjectSerializer.findCorrectType(data, type); - if (data == undefined) { - return data; - } else if (primitives.indexOf(type.toLowerCase()) !== -1) { - return data; - } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 - let subType: string = type.replace("Array<", ""); // Array => Type> - subType = subType.substring(0, subType.length - 1); // Type> => Type - let transformedData: any[] = []; - for (let index = 0; index < data.length; index++) { - let datum = data[index]; - transformedData.push(ObjectSerializer.deserialize(datum, subType)); - } - return transformedData; - } else if (type === "Date") { - return new Date(data); - } else { - if (enumsMap[type]) {// is Enum - return data; - } - - if (!typeMap[type]) { // dont know the type - return data; - } - let instance = new typeMap[type](); - let attributeTypes = typeMap[type].getAttributeTypeMap(); - for (let index = 0; index < attributeTypes.length; index++) { - let attributeType = attributeTypes[index]; - instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type); - } - return instance; - } - } -} - -export interface Authentication { - /** - * Apply authentication settings to header and query params. - */ - applyToRequest(requestOptions: RequestOptions): Promise | void; -} - -export class HttpBasicAuth implements Authentication { - public username: string = ''; - public password: string = ''; - - applyToRequest(requestOptions: RequestOptions): void { - requestOptions.auth = { - username: this.username, password: this.password - } - } -} - -export class HttpBearerAuth implements Authentication { - public accessToken: string | (() => string) = ''; - - applyToRequest(requestOptions: RequestOptions): void { - if (requestOptions && requestOptions.headers) { - const accessToken = typeof this.accessToken === 'function' - ? this.accessToken() - : this.accessToken; - requestOptions.headers["Authorization"] = "Bearer " + accessToken; - } - } -} - -export class ApiKeyAuth implements Authentication { - public apiKey: string = ''; - - constructor(private location: string, private paramName: string) { - } - - applyToRequest(requestOptions: RequestOptions): void { - if (this.location == "query") { - (requestOptions.qs)[this.paramName] = this.apiKey; - } else if (this.location == "header" && requestOptions && requestOptions.headers) { - requestOptions.headers[this.paramName] = this.apiKey; - } else if (this.location == 'cookie' && requestOptions && requestOptions.headers) { - if (requestOptions.headers['Cookie']) { - requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey); - } - else { - requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey); - } - } - } -} - -export class OAuth implements Authentication { - public accessToken: string = ''; - - applyToRequest(requestOptions: RequestOptions): void { - if (requestOptions && requestOptions.headers) { - requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; - } - } -} - -export class VoidAuth implements Authentication { - public username: string = ''; - public password: string = ''; - - applyToRequest(_: RequestOptions): void { - // Do nothing - } -} - -export type Interceptor = (requestOptions: RequestOptions) => (Promise | void); diff --git a/model/note.ts b/model/note.ts deleted file mode 100644 index 2eeaaf3..0000000 --- a/model/note.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Note Details -*/ -export class Note { - /** - * Unique note Id - */ - 'id'?: string; - /** - * Text content of a note - */ - 'text': string; - /** - * Contact ids linked to a note - */ - 'contactIds'?: Array; - /** - * Deal ids linked to a note - */ - 'dealIds'?: Array; - /** - * Account details of user which created the note - */ - 'authorId'?: object; - /** - * Note created date/time - */ - 'createdAt'?: Date; - /** - * Note updated date/time - */ - 'updatedAt'?: Date; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "text", - "baseName": "text", - "type": "string" - }, - { - "name": "contactIds", - "baseName": "contactIds", - "type": "Array" - }, - { - "name": "dealIds", - "baseName": "dealIds", - "type": "Array" - }, - { - "name": "authorId", - "baseName": "authorId", - "type": "object" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "Date" - }, - { - "name": "updatedAt", - "baseName": "updatedAt", - "type": "Date" - } ]; - - static getAttributeTypeMap() { - return Note.attributeTypeMap; - } -} - diff --git a/model/noteData.ts b/model/noteData.ts deleted file mode 100644 index 4b0ccc4..0000000 --- a/model/noteData.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Note data to be saved -*/ -export class NoteData { - /** - * Text content of a note - */ - 'text': string; - /** - * Contact Ids linked to a note - */ - 'contactIds'?: Array; - /** - * Deal Ids linked to a note - */ - 'dealIds'?: Array; - /** - * Company Ids linked to a note - */ - 'companyIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "text", - "baseName": "text", - "type": "string" - }, - { - "name": "contactIds", - "baseName": "contactIds", - "type": "Array" - }, - { - "name": "dealIds", - "baseName": "dealIds", - "type": "Array" - }, - { - "name": "companyIds", - "baseName": "companyIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return NoteData.attributeTypeMap; - } -} - diff --git a/model/noteId.ts b/model/noteId.ts deleted file mode 100644 index 3fcec8e..0000000 --- a/model/noteId.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Updated Note ID -*/ -export class NoteId { - /** - * Unique note Id - */ - 'id'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return NoteId.attributeTypeMap; - } -} - diff --git a/model/notification.ts b/model/notification.ts deleted file mode 100644 index cd14c51..0000000 --- a/model/notification.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Optional. Use this object if you want to let Brevo send an email to the contact, with the payment request URL. If empty, no notifications (message and reminders) will be sent. -*/ -export class Notification { - /** - * Channel used to send the notifications. - */ - 'channel': Notification.ChannelEnum; - /** - * Use this field if you want to give more context to your contact about the payment request. - */ - 'text': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "channel", - "baseName": "channel", - "type": "Notification.ChannelEnum" - }, - { - "name": "text", - "baseName": "text", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return Notification.attributeTypeMap; - } -} - -export namespace Notification { - export enum ChannelEnum { - Email = 'email' - } -} diff --git a/model/order.ts b/model/order.ts deleted file mode 100644 index 9c0583e..0000000 --- a/model/order.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { OrderBilling } from './orderBilling'; -import { OrderProductsInner } from './orderProductsInner'; - -export class Order { - /** - * Unique ID of the order. - */ - 'id': string; - /** - * Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created. - */ - 'createdAt': string; - /** - * Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated. - */ - 'updatedAt': string; - /** - * State of the order. - */ - 'status': string; - /** - * Total amount of the order, including all shipping expenses, tax and the price of items. - */ - 'amount': number; - 'products': Array; - /** - * Email of the contact, Mandatory if \"phone\" field is not passed in \"billing\" parameter. - */ - 'email'?: string; - 'billing'?: OrderBilling; - /** - * Coupons applied to the order. Stored case insensitive. - */ - 'coupons'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "string" - }, - { - "name": "updatedAt", - "baseName": "updatedAt", - "type": "string" - }, - { - "name": "status", - "baseName": "status", - "type": "string" - }, - { - "name": "amount", - "baseName": "amount", - "type": "number" - }, - { - "name": "products", - "baseName": "products", - "type": "Array" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "billing", - "baseName": "billing", - "type": "OrderBilling" - }, - { - "name": "coupons", - "baseName": "coupons", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return Order.attributeTypeMap; - } -} - diff --git a/model/orderBatch.ts b/model/orderBatch.ts deleted file mode 100644 index 68a5e46..0000000 --- a/model/orderBatch.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { Order } from './order'; - -export class OrderBatch { - /** - * array of order objects - */ - 'orders': Array; - /** - * Notify Url provided by client to get the status of batch request - */ - 'notifyUrl'?: string; - /** - * Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual. - */ - 'historical'?: boolean = true; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "orders", - "baseName": "orders", - "type": "Array" - }, - { - "name": "notifyUrl", - "baseName": "notifyUrl", - "type": "string" - }, - { - "name": "historical", - "baseName": "historical", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return OrderBatch.attributeTypeMap; - } -} - diff --git a/model/orderBilling.ts b/model/orderBilling.ts deleted file mode 100644 index 59cac3b..0000000 --- a/model/orderBilling.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Billing details of an order. -*/ -export class OrderBilling { - /** - * Full billing address. - */ - 'address'?: string; - /** - * Exact city of the address. - */ - 'city'?: string; - /** - * Billing country 2-letter ISO code. - */ - 'countryCode'?: string; - /** - * Billing country name. - */ - 'country'?: string; - /** - * Phone number to contact for further details about the order, Mandatory if \"email\" field is not passed. - */ - 'phone'?: string; - /** - * Postcode for delivery and billing. - */ - 'postCode'?: string; - /** - * How the visitor will pay for the item(s), e.g. paypal, check, etc. - */ - 'paymentMethod'?: string; - /** - * Exact region (state/province) for delivery and billing. - */ - 'region'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "address", - "baseName": "address", - "type": "string" - }, - { - "name": "city", - "baseName": "city", - "type": "string" - }, - { - "name": "countryCode", - "baseName": "countryCode", - "type": "string" - }, - { - "name": "country", - "baseName": "country", - "type": "string" - }, - { - "name": "phone", - "baseName": "phone", - "type": "string" - }, - { - "name": "postCode", - "baseName": "postCode", - "type": "string" - }, - { - "name": "paymentMethod", - "baseName": "paymentMethod", - "type": "string" - }, - { - "name": "region", - "baseName": "region", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return OrderBilling.attributeTypeMap; - } -} - diff --git a/model/orderProductsInner.ts b/model/orderProductsInner.ts deleted file mode 100644 index abffe4b..0000000 --- a/model/orderProductsInner.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Details for the Products in an order. -*/ -export class OrderProductsInner { - /** - * ID of the product. - */ - 'productId': string; - /** - * How many pieces of the product the visitor has added to the cart. - */ - 'quantity': number; - /** - * Product ID of the red color shirts. - */ - 'variantId'?: string; - /** - * The price of a unit of product - */ - 'price': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "productId", - "baseName": "productId", - "type": "string" - }, - { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "variantId", - "baseName": "variantId", - "type": "string" - }, - { - "name": "price", - "baseName": "price", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return OrderProductsInner.attributeTypeMap; - } -} - diff --git a/model/otp.ts b/model/otp.ts deleted file mode 100644 index 192cd4f..0000000 --- a/model/otp.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class Otp { - /** - * 6 digit OTP received on email - */ - 'name'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return Otp.attributeTypeMap; - } -} - diff --git a/model/pipeline.ts b/model/pipeline.ts deleted file mode 100644 index 3ed6c08..0000000 --- a/model/pipeline.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { PipelineStage } from './pipelineStage'; - -/** -* List of stages -*/ -export class Pipeline { - /** - * Pipeline id - */ - 'pipeline'?: string; - /** - * Pipeline Name - */ - 'pipelineName'?: string; - /** - * List of stages - */ - 'stages'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "pipeline", - "baseName": "pipeline", - "type": "string" - }, - { - "name": "pipelineName", - "baseName": "pipeline_name", - "type": "string" - }, - { - "name": "stages", - "baseName": "stages", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return Pipeline.attributeTypeMap; - } -} - diff --git a/model/pipelineStage.ts b/model/pipelineStage.ts deleted file mode 100644 index fea8cc1..0000000 --- a/model/pipelineStage.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* List of stages -*/ -export class PipelineStage { - /** - * Stage id - */ - 'id'?: string; - /** - * Stage name - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return PipelineStage.attributeTypeMap; - } -} - diff --git a/model/postContactInfo.ts b/model/postContactInfo.ts deleted file mode 100644 index bce0d4f..0000000 --- a/model/postContactInfo.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { PostContactInfoContacts } from './postContactInfoContacts'; - -export class PostContactInfo { - 'contacts': PostContactInfoContacts; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "contacts", - "baseName": "contacts", - "type": "PostContactInfoContacts" - } ]; - - static getAttributeTypeMap() { - return PostContactInfo.attributeTypeMap; - } -} - diff --git a/model/postContactInfoContacts.ts b/model/postContactInfoContacts.ts deleted file mode 100644 index c0cc772..0000000 --- a/model/postContactInfoContacts.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class PostContactInfoContacts { - 'success'?: Array; - 'failure'?: Array; - /** - * Displays the count of total number of contacts removed from list when user opts for \"all\" option. - */ - 'total'?: number; - /** - * Id of the process created to remove contacts from list when user opts for \"all\" option. - */ - 'processId'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "success", - "baseName": "success", - "type": "Array" - }, - { - "name": "failure", - "baseName": "failure", - "type": "Array" - }, - { - "name": "total", - "baseName": "total", - "type": "number" - }, - { - "name": "processId", - "baseName": "processId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return PostContactInfoContacts.attributeTypeMap; - } -} - diff --git a/model/postSendFailed.ts b/model/postSendFailed.ts deleted file mode 100644 index 8895b16..0000000 --- a/model/postSendFailed.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class PostSendFailed { - /** - * Response code - */ - 'code': number; - /** - * Response message - */ - 'message': string; - 'unexistingEmails'?: Array; - 'withoutListEmails'?: Array; - 'blackListedEmails'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "code", - "baseName": "code", - "type": "number" - }, - { - "name": "message", - "baseName": "message", - "type": "string" - }, - { - "name": "unexistingEmails", - "baseName": "unexistingEmails", - "type": "Array" - }, - { - "name": "withoutListEmails", - "baseName": "withoutListEmails", - "type": "Array" - }, - { - "name": "blackListedEmails", - "baseName": "blackListedEmails", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return PostSendFailed.attributeTypeMap; - } -} - diff --git a/model/postSendSmsTestFailed.ts b/model/postSendSmsTestFailed.ts deleted file mode 100644 index cc1fefa..0000000 --- a/model/postSendSmsTestFailed.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class PostSendSmsTestFailed { - /** - * Response code - */ - 'code': number; - /** - * Response message - */ - 'message': string; - 'unexistingSms'?: Array; - 'withoutListSms'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "code", - "baseName": "code", - "type": "number" - }, - { - "name": "message", - "baseName": "message", - "type": "string" - }, - { - "name": "unexistingSms", - "baseName": "unexistingSms", - "type": "Array" - }, - { - "name": "withoutListSms", - "baseName": "withoutListSms", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return PostSendSmsTestFailed.attributeTypeMap; - } -} - diff --git a/model/putRevokeUserPermission.ts b/model/putRevokeUserPermission.ts deleted file mode 100644 index f2bd505..0000000 --- a/model/putRevokeUserPermission.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Revoke user permission -*/ -export class PutRevokeUserPermission { - /** - * Email address of the user. - */ - 'email': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return PutRevokeUserPermission.attributeTypeMap; - } -} - diff --git a/model/putresendcancelinvitation.ts b/model/putresendcancelinvitation.ts deleted file mode 100644 index 4496fe2..0000000 --- a/model/putresendcancelinvitation.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Revoke user permission -*/ -export class Putresendcancelinvitation { - /** - * Email address of the user. - */ - 'email': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return Putresendcancelinvitation.attributeTypeMap; - } -} - diff --git a/model/remainingCreditModel.ts b/model/remainingCreditModel.ts deleted file mode 100644 index e371db6..0000000 --- a/model/remainingCreditModel.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { RemainingCreditModelChild } from './remainingCreditModelChild'; -import { RemainingCreditModelReseller } from './remainingCreditModelReseller'; - -export class RemainingCreditModel { - 'child': RemainingCreditModelChild; - 'reseller': RemainingCreditModelReseller; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "child", - "baseName": "child", - "type": "RemainingCreditModelChild" - }, - { - "name": "reseller", - "baseName": "reseller", - "type": "RemainingCreditModelReseller" - } ]; - - static getAttributeTypeMap() { - return RemainingCreditModel.attributeTypeMap; - } -} - diff --git a/model/remainingCreditModelChild.ts b/model/remainingCreditModelChild.ts deleted file mode 100644 index 97f77f8..0000000 --- a/model/remainingCreditModelChild.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Credits remaining for child account -*/ -export class RemainingCreditModelChild { - /** - * SMS Credits remaining for child account - */ - 'sms': number; - /** - * Email Credits remaining for child account - */ - 'email': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sms", - "baseName": "sms", - "type": "number" - }, - { - "name": "email", - "baseName": "email", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return RemainingCreditModelChild.attributeTypeMap; - } -} - diff --git a/model/remainingCreditModelReseller.ts b/model/remainingCreditModelReseller.ts deleted file mode 100644 index 8dbe8e1..0000000 --- a/model/remainingCreditModelReseller.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class RemainingCreditModelReseller { - /** - * SMS Credits remaining for reseller account - */ - 'sms': number; - /** - * Email Credits remaining for reseller account - */ - 'email': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sms", - "baseName": "sms", - "type": "number" - }, - { - "name": "email", - "baseName": "email", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return RemainingCreditModelReseller.attributeTypeMap; - } -} - diff --git a/model/removeContactFromList.ts b/model/removeContactFromList.ts deleted file mode 100644 index 4d263ed..0000000 --- a/model/removeContactFromList.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class RemoveContactFromList { - /** - * Required if \'all\' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request. - */ - 'emails'?: Array; - /** - * Mandatory if Emails are not passed, ignored otherwise. Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api. - */ - 'ids'?: Array; - /** - * Required if none of \'emails\' or \'ids\' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress - */ - 'all'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "emails", - "baseName": "emails", - "type": "Array" - }, - { - "name": "ids", - "baseName": "ids", - "type": "Array" - }, - { - "name": "all", - "baseName": "all", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return RemoveContactFromList.attributeTypeMap; - } -} - diff --git a/model/removeCredits.ts b/model/removeCredits.ts deleted file mode 100644 index f34c10c..0000000 --- a/model/removeCredits.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class RemoveCredits { - /** - * Required if email credits are empty. SMS credits to be removed from the child account - */ - 'sms'?: number; - /** - * Required if sms credits are empty. Email credits to be removed from the child account - */ - 'email'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sms", - "baseName": "sms", - "type": "number" - }, - { - "name": "email", - "baseName": "email", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return RemoveCredits.attributeTypeMap; - } -} - diff --git a/model/requestContactExport.ts b/model/requestContactExport.ts deleted file mode 100644 index 8e8eec7..0000000 --- a/model/requestContactExport.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { RequestContactExportCustomContactFilter } from './requestContactExportCustomContactFilter'; - -export class RequestContactExport { - /** - * List of all the attributes that you want to export. These attributes must be present in your contact database. For example, [\'fname\', \'lname\', \'email\']. - */ - 'exportAttributes'?: Array; - 'customContactFilter': RequestContactExportCustomContactFilter; - /** - * Webhook that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 - */ - 'notifyUrl'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "exportAttributes", - "baseName": "exportAttributes", - "type": "Array" - }, - { - "name": "customContactFilter", - "baseName": "customContactFilter", - "type": "RequestContactExportCustomContactFilter" - }, - { - "name": "notifyUrl", - "baseName": "notifyUrl", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return RequestContactExport.attributeTypeMap; - } -} - diff --git a/model/requestContactExportCustomContactFilter.ts b/model/requestContactExportCustomContactFilter.ts deleted file mode 100644 index da2ff7d..0000000 --- a/model/requestContactExportCustomContactFilter.ts +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Set the filter for the contacts to be exported. -*/ -export class RequestContactExportCustomContactFilter { - /** - * Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only. - */ - 'actionForContacts'?: RequestContactExportCustomContactFilter.ActionForContactsEnum; - /** - * Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). - */ - 'actionForEmailCampaigns'?: RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum; - /** - * Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. - */ - 'actionForSmsCampaigns'?: RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum; - /** - * Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter. - */ - 'listId'?: number; - /** - * Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter. - */ - 'emailCampaignId'?: number; - /** - * Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. - */ - 'smsCampaignId'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "actionForContacts", - "baseName": "actionForContacts", - "type": "RequestContactExportCustomContactFilter.ActionForContactsEnum" - }, - { - "name": "actionForEmailCampaigns", - "baseName": "actionForEmailCampaigns", - "type": "RequestContactExportCustomContactFilter.ActionForEmailCampaignsEnum" - }, - { - "name": "actionForSmsCampaigns", - "baseName": "actionForSmsCampaigns", - "type": "RequestContactExportCustomContactFilter.ActionForSmsCampaignsEnum" - }, - { - "name": "listId", - "baseName": "listId", - "type": "number" - }, - { - "name": "emailCampaignId", - "baseName": "emailCampaignId", - "type": "number" - }, - { - "name": "smsCampaignId", - "baseName": "smsCampaignId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return RequestContactExportCustomContactFilter.attributeTypeMap; - } -} - -export namespace RequestContactExportCustomContactFilter { - export enum ActionForContactsEnum { - AllContacts = 'allContacts', - Subscribed = 'subscribed', - Unsubscribed = 'unsubscribed', - UnsubscribedPerList = 'unsubscribedPerList' - } - export enum ActionForEmailCampaignsEnum { - Openers = 'openers', - NonOpeners = 'nonOpeners', - Clickers = 'clickers', - NonClickers = 'nonClickers', - Unsubscribed = 'unsubscribed', - HardBounces = 'hardBounces', - SoftBounces = 'softBounces' - } - export enum ActionForSmsCampaignsEnum { - HardBounces = 'hardBounces', - SoftBounces = 'softBounces', - Unsubscribed = 'unsubscribed' - } -} diff --git a/model/requestContactImport.ts b/model/requestContactImport.ts deleted file mode 100644 index f2cf687..0000000 --- a/model/requestContactImport.ts +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { RequestContactImportJsonBodyInner } from './requestContactImportJsonBodyInner'; -import { RequestContactImportNewList } from './requestContactImportNewList'; - -export class RequestContactImport { - /** - * Mandatory if fileBody or jsonBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv, .json - */ - 'fileUrl'?: string; - /** - * Mandatory if fileUrl and jsonBody is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. - */ - 'fileBody'?: string; - /** - * **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files. - */ - 'jsonBody'?: Array; - /** - * Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7]. - */ - 'listIds'?: Array; - /** - * URL that will be called once the import process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 - */ - 'notifyUrl'?: string; - 'newList'?: RequestContactImportNewList; - /** - * To blacklist all the contacts for email - */ - 'emailBlacklist'?: boolean = false; - /** - * To disable email notification - */ - 'disableNotification'?: boolean = false; - /** - * To blacklist all the contacts for sms - */ - 'smsBlacklist'?: boolean = false; - /** - * To facilitate the choice to update the existing contacts - */ - 'updateExistingContacts'?: boolean = true; - /** - * To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in Brevo, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) - */ - 'emptyContactsAttributes'?: boolean = false; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "fileUrl", - "baseName": "fileUrl", - "type": "string" - }, - { - "name": "fileBody", - "baseName": "fileBody", - "type": "string" - }, - { - "name": "jsonBody", - "baseName": "jsonBody", - "type": "Array" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "notifyUrl", - "baseName": "notifyUrl", - "type": "string" - }, - { - "name": "newList", - "baseName": "newList", - "type": "RequestContactImportNewList" - }, - { - "name": "emailBlacklist", - "baseName": "emailBlacklist", - "type": "boolean" - }, - { - "name": "disableNotification", - "baseName": "disableNotification", - "type": "boolean" - }, - { - "name": "smsBlacklist", - "baseName": "smsBlacklist", - "type": "boolean" - }, - { - "name": "updateExistingContacts", - "baseName": "updateExistingContacts", - "type": "boolean" - }, - { - "name": "emptyContactsAttributes", - "baseName": "emptyContactsAttributes", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return RequestContactImport.attributeTypeMap; - } -} - diff --git a/model/requestContactImportJsonBodyInner.ts b/model/requestContactImportJsonBodyInner.ts deleted file mode 100644 index 5ba1da2..0000000 --- a/model/requestContactImportJsonBodyInner.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class RequestContactImportJsonBodyInner { - 'email'?: string; - /** - * List of attributes to be imported - */ - 'attributes'?: { [key: string]: any; }; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "{ [key: string]: any; }" - } ]; - - static getAttributeTypeMap() { - return RequestContactImportJsonBodyInner.attributeTypeMap; - } -} - diff --git a/model/requestContactImportNewList.ts b/model/requestContactImportNewList.ts deleted file mode 100644 index df00f67..0000000 --- a/model/requestContactImportNewList.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* To create a new list and import the contacts into it, pass the listName and an optional folderId. -*/ -export class RequestContactImportNewList { - /** - * List with listName will be created first and users will be imported in it (Mandatory if listIds is empty). - */ - 'listName'?: string; - /** - * Id of the folder where this new list shall be created (Mandatory if listName is not empty). - */ - 'folderId'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "listName", - "baseName": "listName", - "type": "string" - }, - { - "name": "folderId", - "baseName": "folderId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return RequestContactImportNewList.attributeTypeMap; - } -} - diff --git a/model/requestSmsRecipientExport.ts b/model/requestSmsRecipientExport.ts deleted file mode 100644 index 7a72e1e..0000000 --- a/model/requestSmsRecipientExport.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class RequestSmsRecipientExport { - /** - * URL that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 - */ - 'notifyURL'?: string; - /** - * Filter the recipients based on how they interacted with the campaign - */ - 'recipientsType': RequestSmsRecipientExport.RecipientsTypeEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "notifyURL", - "baseName": "notifyURL", - "type": "string" - }, - { - "name": "recipientsType", - "baseName": "recipientsType", - "type": "RequestSmsRecipientExport.RecipientsTypeEnum" - } ]; - - static getAttributeTypeMap() { - return RequestSmsRecipientExport.attributeTypeMap; - } -} - -export namespace RequestSmsRecipientExport { - export enum RecipientsTypeEnum { - All = 'all', - Delivered = 'delivered', - Answered = 'answered', - SoftBounces = 'softBounces', - HardBounces = 'hardBounces', - Unsubscribed = 'unsubscribed' - } -} diff --git a/model/scheduleSmtpEmail.ts b/model/scheduleSmtpEmail.ts deleted file mode 100644 index 7d2ad42..0000000 --- a/model/scheduleSmtpEmail.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class ScheduleSmtpEmail { - /** - * Message ID of the transactional email scheduled - */ - 'messageId'?: string; - 'messageIds'?: Array; - /** - * Batch ID of the batch transactional email scheduled - */ - 'batchId'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - }, - { - "name": "messageIds", - "baseName": "messageIds", - "type": "Array" - }, - { - "name": "batchId", - "baseName": "batchId", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return ScheduleSmtpEmail.attributeTypeMap; - } -} - diff --git a/model/sendReport.ts b/model/sendReport.ts deleted file mode 100644 index c754988..0000000 --- a/model/sendReport.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SendReportEmail } from './sendReportEmail'; - -export class SendReport { - /** - * Language of email content for campaign report sending. - */ - 'language'?: SendReport.LanguageEnum = SendReport.LanguageEnum.Fr; - 'email': SendReportEmail; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "language", - "baseName": "language", - "type": "SendReport.LanguageEnum" - }, - { - "name": "email", - "baseName": "email", - "type": "SendReportEmail" - } ]; - - static getAttributeTypeMap() { - return SendReport.attributeTypeMap; - } -} - -export namespace SendReport { - export enum LanguageEnum { - Fr = 'fr', - Es = 'es', - Pt = 'pt', - It = 'it', - De = 'de', - En = 'en' - } -} diff --git a/model/sendReportEmail.ts b/model/sendReportEmail.ts deleted file mode 100644 index 4471722..0000000 --- a/model/sendReportEmail.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Custom attributes for the report email. -*/ -export class SendReportEmail { - /** - * Email addresses of the recipients - */ - 'to': Array; - /** - * Custom text message to be presented in the report email. - */ - 'body': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "to", - "baseName": "to", - "type": "Array" - }, - { - "name": "body", - "baseName": "body", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendReportEmail.attributeTypeMap; - } -} - diff --git a/model/sendSms.ts b/model/sendSms.ts deleted file mode 100644 index 0f4cf97..0000000 --- a/model/sendSms.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendSms { - 'reference': string; - 'messageId': number; - /** - * Count of SMS\'s to send multiple text messages - */ - 'smsCount'?: number; - /** - * SMS credits used per text message - */ - 'usedCredits'?: number; - /** - * Remaining SMS credits of the user - */ - 'remainingCredits'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "reference", - "baseName": "reference", - "type": "string" - }, - { - "name": "messageId", - "baseName": "messageId", - "type": "number" - }, - { - "name": "smsCount", - "baseName": "smsCount", - "type": "number" - }, - { - "name": "usedCredits", - "baseName": "usedCredits", - "type": "number" - }, - { - "name": "remainingCredits", - "baseName": "remainingCredits", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SendSms.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmail.ts b/model/sendSmtpEmail.ts deleted file mode 100644 index c14168d..0000000 --- a/model/sendSmtpEmail.ts +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SendSmtpEmailAttachmentInner } from './sendSmtpEmailAttachmentInner'; -import { SendSmtpEmailBccInner } from './sendSmtpEmailBccInner'; -import { SendSmtpEmailCcInner } from './sendSmtpEmailCcInner'; -import { SendSmtpEmailMessageVersionsInner } from './sendSmtpEmailMessageVersionsInner'; -import { SendSmtpEmailReplyTo } from './sendSmtpEmailReplyTo'; -import { SendSmtpEmailSender } from './sendSmtpEmailSender'; -import { SendSmtpEmailToInner } from './sendSmtpEmailToInner'; - -export class SendSmtpEmail { - 'sender'?: SendSmtpEmailSender; - /** - * Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] - */ - 'to'?: Array; - /** - * List of email addresses and names (optional) of the recipients in bcc - */ - 'bcc'?: Array; - /** - * List of email addresses and names (optional) of the recipients in cc - */ - 'cc'?: Array; - /** - * HTML body of the message ( Mandatory if \'templateId\' is not passed, ignored if \'templateId\' is passed ) - */ - 'htmlContent'?: string; - /** - * Plain Text body of the message ( Ignored if \'templateId\' is passed ) - */ - 'textContent'?: string; - /** - * Subject of the message. Mandatory if \'templateId\' is not passed - */ - 'subject'?: string; - 'replyTo'?: SendSmtpEmailReplyTo; - /** - * Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm ( If \'templateId\' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then \'attachment\' is ignored ) - */ - 'attachment'?: Array; - /** - * Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. \'sender.ip\' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\", \"idempotencyKey\":\"abc-123\"}`. - */ - 'headers'?: object; - /** - * Id of the template. - */ - 'templateId'?: number; - /** - * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It\'s considered only if template is in New Template Language format. - */ - 'params'?: object; - /** - * You can customize and send out multiple versions of a mail. templateId can be customized only if global parameter contains templateId. htmlContent and textContent can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.brevo.com/docs/batch-send-transactional-emails - */ - 'messageVersions'?: Array; - /** - * Tag your emails to find them more easily - */ - 'tags'?: Array; - /** - * UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. **Please note this feature is currently a public beta**. - */ - 'scheduledAt'?: Date; - /** - * Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end. - */ - 'batchId'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sender", - "baseName": "sender", - "type": "SendSmtpEmailSender" - }, - { - "name": "to", - "baseName": "to", - "type": "Array" - }, - { - "name": "bcc", - "baseName": "bcc", - "type": "Array" - }, - { - "name": "cc", - "baseName": "cc", - "type": "Array" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "textContent", - "baseName": "textContent", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "SendSmtpEmailReplyTo" - }, - { - "name": "attachment", - "baseName": "attachment", - "type": "Array" - }, - { - "name": "headers", - "baseName": "headers", - "type": "object" - }, - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "params", - "baseName": "params", - "type": "object" - }, - { - "name": "messageVersions", - "baseName": "messageVersions", - "type": "Array" - }, - { - "name": "tags", - "baseName": "tags", - "type": "Array" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "Date" - }, - { - "name": "batchId", - "baseName": "batchId", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmail.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailAttachmentInner.ts b/model/sendSmtpEmailAttachmentInner.ts deleted file mode 100644 index 1634f30..0000000 --- a/model/sendSmtpEmailAttachmentInner.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendSmtpEmailAttachmentInner { - /** - * Absolute url of the attachment (no local file). - */ - 'url'?: string; - /** - * Base64 encoded chunk data of the attachment generated on the fly - */ - 'content'?: string; - /** - * Required if content is passed. Name of the attachment - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailAttachmentInner.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailBccInner.ts b/model/sendSmtpEmailBccInner.ts deleted file mode 100644 index c929e51..0000000 --- a/model/sendSmtpEmailBccInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendSmtpEmailBccInner { - /** - * Email address of the recipient in bcc - */ - 'email': string; - /** - * Name of the recipient in bcc. Maximum allowed characters are 70. - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailBccInner.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailCcInner.ts b/model/sendSmtpEmailCcInner.ts deleted file mode 100644 index be26f87..0000000 --- a/model/sendSmtpEmailCcInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendSmtpEmailCcInner { - /** - * Email address of the recipient in cc - */ - 'email': string; - /** - * Name of the recipient in cc. Maximum allowed characters are 70. - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailCcInner.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailMessageVersionsInner.ts b/model/sendSmtpEmailMessageVersionsInner.ts deleted file mode 100644 index 708c739..0000000 --- a/model/sendSmtpEmailMessageVersionsInner.ts +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SendSmtpEmailBccInner } from './sendSmtpEmailBccInner'; -import { SendSmtpEmailCcInner } from './sendSmtpEmailCcInner'; -import { SendSmtpEmailMessageVersionsInnerReplyTo } from './sendSmtpEmailMessageVersionsInnerReplyTo'; -import { SendSmtpEmailMessageVersionsInnerToInner } from './sendSmtpEmailMessageVersionsInnerToInner'; - -export class SendSmtpEmailMessageVersionsInner { - /** - * List of email addresses and names (_optional_) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] - */ - 'to': Array; - /** - * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It\'s considered only if template is in New Template Language format. - */ - 'params'?: { [key: string]: object; }; - /** - * List of email addresses and names (optional) of the recipients in bcc - */ - 'bcc'?: Array; - /** - * List of email addresses and names (optional) of the recipients in cc - */ - 'cc'?: Array; - 'replyTo'?: SendSmtpEmailMessageVersionsInnerReplyTo; - /** - * Custom subject specific to message version - */ - 'subject'?: string; - /** - * HTML body of the message. **Mandatory if \'templateId\' is not passed, ignored if \'templateId\' is passed** - */ - 'htmlContent'?: string; - /** - * Plain Text body of the message. **Ignored if \'templateId\' is passed** - */ - 'textContent'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "to", - "baseName": "to", - "type": "Array" - }, - { - "name": "params", - "baseName": "params", - "type": "{ [key: string]: object; }" - }, - { - "name": "bcc", - "baseName": "bcc", - "type": "Array" - }, - { - "name": "cc", - "baseName": "cc", - "type": "Array" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "SendSmtpEmailMessageVersionsInnerReplyTo" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "textContent", - "baseName": "textContent", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailMessageVersionsInner.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailMessageVersionsInnerReplyTo.ts b/model/sendSmtpEmailMessageVersionsInnerReplyTo.ts deleted file mode 100644 index d498d5e..0000000 --- a/model/sendSmtpEmailMessageVersionsInnerReplyTo.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {\"email\":\"ann6533@example.com\", \"name\":\"Ann\"} -*/ -export class SendSmtpEmailMessageVersionsInnerReplyTo { - /** - * Email address in reply to - */ - 'email': string; - /** - * Name in reply to. Maximum allowed characters are 70. - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailMessageVersionsInnerReplyTo.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailMessageVersionsInnerToInner.ts b/model/sendSmtpEmailMessageVersionsInnerToInner.ts deleted file mode 100644 index 0305a48..0000000 --- a/model/sendSmtpEmailMessageVersionsInnerToInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendSmtpEmailMessageVersionsInnerToInner { - /** - * Email address of the recipient - */ - 'email': string; - /** - * Name of the recipient. **Maximum allowed characters are 70**. - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailMessageVersionsInnerToInner.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailReplyTo.ts b/model/sendSmtpEmailReplyTo.ts deleted file mode 100644 index 1029c74..0000000 --- a/model/sendSmtpEmailReplyTo.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {\"email\":\"ann6533@example.com\", \"name\":\"Ann\"}. -*/ -export class SendSmtpEmailReplyTo { - /** - * Email address in reply to - */ - 'email': string; - /** - * Name in reply to. Maximum allowed characters are 70. - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailReplyTo.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailSender.ts b/model/sendSmtpEmailSender.ts deleted file mode 100644 index 5a7789c..0000000 --- a/model/sendSmtpEmailSender.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Mandatory if `templateId` is not passed. Pass `name` (optional) and `email` OR `id` of sender from which emails will be sent. `name` will be ignored if passed along with sender `id`. For example, {\"name\":\"Mary from MyShop\", \"email\":\"no-reply@myshop.com\"} or {\"id\":2} -*/ -export class SendSmtpEmailSender { - /** - * Name of the sender from which the emails will be sent. Maximum allowed characters are 70. Applicable only when email is passed. - */ - 'name'?: string; - /** - * Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. - */ - 'email'?: string; - /** - * Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailSender.attributeTypeMap; - } -} - diff --git a/model/sendSmtpEmailToInner.ts b/model/sendSmtpEmailToInner.ts deleted file mode 100644 index d859436..0000000 --- a/model/sendSmtpEmailToInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendSmtpEmailToInner { - /** - * Email address of the recipient - */ - 'email': string; - /** - * Name of the recipient. Maximum allowed characters are 70. - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendSmtpEmailToInner.attributeTypeMap; - } -} - diff --git a/model/sendTestEmail.ts b/model/sendTestEmail.ts deleted file mode 100644 index c96fd14..0000000 --- a/model/sendTestEmail.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendTestEmail { - /** - * List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day. - */ - 'emailTo'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "emailTo", - "baseName": "emailTo", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return SendTestEmail.attributeTypeMap; - } -} - diff --git a/model/sendTestSms.ts b/model/sendTestSms.ts deleted file mode 100644 index dc2fe5a..0000000 --- a/model/sendTestSms.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendTestSms { - /** - * Mobile number of the recipient with the country code. This number must belong to one of your contacts in Brevo account and must not be blacklisted - */ - 'phoneNumber'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "phoneNumber", - "baseName": "phoneNumber", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendTestSms.attributeTypeMap; - } -} - diff --git a/model/sendTransacSms.ts b/model/sendTransacSms.ts deleted file mode 100644 index b674f43..0000000 --- a/model/sendTransacSms.ts +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendTransacSms { - /** - * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** - */ - 'sender': string; - /** - * Mobile number to send SMS with the country code - */ - 'recipient': string; - /** - * Content of the message. If more than 160 characters long, will be sent as multiple text messages - */ - 'content': string; - /** - * Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. - */ - 'type'?: SendTransacSms.TypeEnum = SendTransacSms.TypeEnum.Transactional; - /** - * Tag of the message - */ - 'tag'?: string; - /** - * Webhook to call for each event triggered by the message (delivered etc.) - */ - 'webUrl'?: string; - /** - * Format of the message. It indicates whether the content should be treated as unicode or not. - */ - 'unicodeEnabled'?: boolean = false; - /** - * A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** - */ - 'organisationPrefix'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "recipient", - "baseName": "recipient", - "type": "string" - }, - { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "type", - "baseName": "type", - "type": "SendTransacSms.TypeEnum" - }, - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "webUrl", - "baseName": "webUrl", - "type": "string" - }, - { - "name": "unicodeEnabled", - "baseName": "unicodeEnabled", - "type": "boolean" - }, - { - "name": "organisationPrefix", - "baseName": "organisationPrefix", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendTransacSms.attributeTypeMap; - } -} - -export namespace SendTransacSms { - export enum TypeEnum { - Transactional = 'transactional', - Marketing = 'marketing' - } -} diff --git a/model/sendWhatsappMessage.ts b/model/sendWhatsappMessage.ts deleted file mode 100644 index 4987b2a..0000000 --- a/model/sendWhatsappMessage.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendWhatsappMessage { - /** - * ID of the template to send - */ - 'templateId'?: number; - /** - * Text to be sent as message body (will be overridden if templateId is passed in the same request) - */ - 'text'?: string; - /** - * WhatsApp Number with country code. Example, 85264318721 - */ - 'senderNumber': string; - /** - * Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. - */ - 'params'?: object; - /** - * List of phone numbers of the contacts - */ - 'contactNumbers': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "templateId", - "baseName": "templateId", - "type": "number" - }, - { - "name": "text", - "baseName": "text", - "type": "string" - }, - { - "name": "senderNumber", - "baseName": "senderNumber", - "type": "string" - }, - { - "name": "params", - "baseName": "params", - "type": "object" - }, - { - "name": "contactNumbers", - "baseName": "contactNumbers", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return SendWhatsappMessage.attributeTypeMap; - } -} - diff --git a/model/sendWhatsappMessage201Response.ts b/model/sendWhatsappMessage201Response.ts deleted file mode 100644 index 843cdcc..0000000 --- a/model/sendWhatsappMessage201Response.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SendWhatsappMessage201Response { - /** - * messageId of sent message - */ - 'messageId': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "messageId", - "baseName": "messageId", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SendWhatsappMessage201Response.attributeTypeMap; - } -} - diff --git a/model/ssoTokenRequest.ts b/model/ssoTokenRequest.ts deleted file mode 100644 index f09c201..0000000 --- a/model/ssoTokenRequest.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SsoTokenRequest { - /** - * Id of the sub-account organization - */ - 'id': number; - /** - * User email of sub-account organization - */ - 'email'?: string; - /** - * Set target after login success * automation - Redirect to Automation after login * email_campaign - Redirect to Email Campaign after login * contacts - Redirect to Contacts after login * landing_pages - Redirect to Landing Pages after login * email_transactional - Redirect to Email Transactional after login * senders - Redirect to Contacts after login * sms_campaign - Redirect to Sms Campaign after login * sms_transactional - Redirect to Sms Transactional after login - */ - 'target'?: SsoTokenRequest.TargetEnum; - /** - * Set the full target URL after login success. The user will land directly on this target URL after login - */ - 'url'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "target", - "baseName": "target", - "type": "SsoTokenRequest.TargetEnum" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SsoTokenRequest.attributeTypeMap; - } -} - -export namespace SsoTokenRequest { - export enum TargetEnum { - Automation = 'automation', - EmailCampaign = 'email_campaign', - Contacts = 'contacts', - LandingPages = 'landing_pages', - EmailTransactional = 'email_transactional', - Senders = 'senders', - SmsCampaign = 'sms_campaign', - SmsTransactional = 'sms_transactional' - } -} diff --git a/model/ssoTokenRequestCorporate.ts b/model/ssoTokenRequestCorporate.ts deleted file mode 100644 index 237617b..0000000 --- a/model/ssoTokenRequestCorporate.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SsoTokenRequestCorporate { - /** - * User email of sub-account organization - */ - 'email': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SsoTokenRequestCorporate.attributeTypeMap; - } -} - diff --git a/model/subAccountAppsToggleRequest.ts b/model/subAccountAppsToggleRequest.ts deleted file mode 100644 index 5d1c58c..0000000 --- a/model/subAccountAppsToggleRequest.ts +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* List of enable/disable applications on the sub-account -*/ -export class SubAccountAppsToggleRequest { - /** - * Set this field to enable or disable Inbox on the sub-account / Not applicable on ENTv2 - */ - 'inbox'?: boolean; - /** - * Set this field to enable or disable Whatsapp campaigns on the sub-account - */ - 'whatsapp'?: boolean; - /** - * Set this field to enable or disable Automation on the sub-account - */ - 'automation'?: boolean; - /** - * Set this field to enable or disable Email Campaigns on the sub-account - */ - 'emailCampaigns'?: boolean; - /** - * Set this field to enable or disable SMS Marketing on the sub-account - */ - 'smsCampaigns'?: boolean; - /** - * Set this field to enable or disable Landing pages on the sub-account - */ - 'landingPages'?: boolean; - /** - * Set this field to enable or disable Transactional Email on the sub-account - */ - 'transactionalEmails'?: boolean; - /** - * Set this field to enable or disable Transactional SMS on the sub-account - */ - 'transactionalSms'?: boolean; - /** - * Set this field to enable or disable Facebook ads on the sub-account - */ - 'facebookAds'?: boolean; - /** - * Set this field to enable or disable Web Push on the sub-account - */ - 'webPush'?: boolean; - /** - * Set this field to enable or disable Meetings on the sub-account - */ - 'meetings'?: boolean; - /** - * Set this field to enable or disable Conversations on the sub-account - */ - 'conversations'?: boolean; - /** - * Set this field to enable or disable Sales CRM on the sub-account - */ - 'crm'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "inbox", - "baseName": "inbox", - "type": "boolean" - }, - { - "name": "whatsapp", - "baseName": "whatsapp", - "type": "boolean" - }, - { - "name": "automation", - "baseName": "automation", - "type": "boolean" - }, - { - "name": "emailCampaigns", - "baseName": "email-campaigns", - "type": "boolean" - }, - { - "name": "smsCampaigns", - "baseName": "sms-campaigns", - "type": "boolean" - }, - { - "name": "landingPages", - "baseName": "landing-pages", - "type": "boolean" - }, - { - "name": "transactionalEmails", - "baseName": "transactional-emails", - "type": "boolean" - }, - { - "name": "transactionalSms", - "baseName": "transactional-sms", - "type": "boolean" - }, - { - "name": "facebookAds", - "baseName": "facebook-ads", - "type": "boolean" - }, - { - "name": "webPush", - "baseName": "web-push", - "type": "boolean" - }, - { - "name": "meetings", - "baseName": "meetings", - "type": "boolean" - }, - { - "name": "conversations", - "baseName": "conversations", - "type": "boolean" - }, - { - "name": "crm", - "baseName": "crm", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return SubAccountAppsToggleRequest.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponse.ts b/model/subAccountDetailsResponse.ts deleted file mode 100644 index b3ed22f..0000000 --- a/model/subAccountDetailsResponse.ts +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SubAccountDetailsResponseGroupsInner } from './subAccountDetailsResponseGroupsInner'; -import { SubAccountDetailsResponsePlanInfo } from './subAccountDetailsResponsePlanInfo'; - -export class SubAccountDetailsResponse { - /** - * Name of the sub-account user - */ - 'name'?: string; - /** - * Email id of the sub-account organization - */ - 'email'?: string; - /** - * Sub-account company name - */ - 'companyName'?: string; - /** - * List of group(s) associated with the sub-account - */ - 'groups'?: Array; - 'planInfo'?: SubAccountDetailsResponsePlanInfo; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "groups", - "baseName": "groups", - "type": "Array" - }, - { - "name": "planInfo", - "baseName": "planInfo", - "type": "SubAccountDetailsResponsePlanInfo" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponse.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponseGroupsInner.ts b/model/subAccountDetailsResponseGroupsInner.ts deleted file mode 100644 index 3be0e51..0000000 --- a/model/subAccountDetailsResponseGroupsInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SubAccountDetailsResponseGroupsInner { - /** - * Group id - */ - 'id'?: string; - /** - * Name of the group - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponseGroupsInner.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfo.ts b/model/subAccountDetailsResponsePlanInfo.ts deleted file mode 100644 index b938c4d..0000000 --- a/model/subAccountDetailsResponsePlanInfo.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SubAccountDetailsResponsePlanInfoCredits } from './subAccountDetailsResponsePlanInfoCredits'; -import { SubAccountDetailsResponsePlanInfoFeatures } from './subAccountDetailsResponsePlanInfoFeatures'; - -/** -* Sub-account plan details -*/ -export class SubAccountDetailsResponsePlanInfo { - 'credits'?: SubAccountDetailsResponsePlanInfoCredits; - 'features'?: SubAccountDetailsResponsePlanInfoFeatures; - /** - * type of the plan - */ - 'planType'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "credits", - "baseName": "credits", - "type": "SubAccountDetailsResponsePlanInfoCredits" - }, - { - "name": "features", - "baseName": "features", - "type": "SubAccountDetailsResponsePlanInfoFeatures" - }, - { - "name": "planType", - "baseName": "planType", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfo.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfoCredits.ts b/model/subAccountDetailsResponsePlanInfoCredits.ts deleted file mode 100644 index 7c0bba9..0000000 --- a/model/subAccountDetailsResponsePlanInfoCredits.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SubAccountDetailsResponsePlanInfoCreditsEmails } from './subAccountDetailsResponsePlanInfoCreditsEmails'; -import { SubAccountDetailsResponsePlanInfoCreditsSms } from './subAccountDetailsResponsePlanInfoCreditsSms'; -import { SubAccountDetailsResponsePlanInfoCreditsWpSubscribers } from './subAccountDetailsResponsePlanInfoCreditsWpSubscribers'; - -/** -* Credits quota and remaining credits on the sub-account -*/ -export class SubAccountDetailsResponsePlanInfoCredits { - 'emails'?: SubAccountDetailsResponsePlanInfoCreditsEmails; - 'sms'?: SubAccountDetailsResponsePlanInfoCreditsSms; - 'wpSubscribers'?: SubAccountDetailsResponsePlanInfoCreditsWpSubscribers; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "emails", - "baseName": "emails", - "type": "SubAccountDetailsResponsePlanInfoCreditsEmails" - }, - { - "name": "sms", - "baseName": "sms", - "type": "SubAccountDetailsResponsePlanInfoCreditsSms" - }, - { - "name": "wpSubscribers", - "baseName": "wpSubscribers", - "type": "SubAccountDetailsResponsePlanInfoCreditsWpSubscribers" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoCredits.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfoCreditsEmails.ts b/model/subAccountDetailsResponsePlanInfoCreditsEmails.ts deleted file mode 100644 index 303f0be..0000000 --- a/model/subAccountDetailsResponsePlanInfoCreditsEmails.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Email credits remaining on the sub-account -*/ -export class SubAccountDetailsResponsePlanInfoCreditsEmails { - /** - * Quantity of email messaging limits provided - */ - 'quantity'?: number; - /** - * Available email messaging limits for use - */ - 'remaining'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "remaining", - "baseName": "remaining", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoCreditsEmails.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfoCreditsSms.ts b/model/subAccountDetailsResponsePlanInfoCreditsSms.ts deleted file mode 100644 index 114eed3..0000000 --- a/model/subAccountDetailsResponsePlanInfoCreditsSms.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* SMS credits remaining on the sub-account -*/ -export class SubAccountDetailsResponsePlanInfoCreditsSms { - /** - * Quantity of SMS messaging limits provided - */ - 'quantity'?: number; - /** - * Available SMS messaging limits for use - */ - 'remaining'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "remaining", - "baseName": "remaining", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoCreditsSms.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfoCreditsWpSubscribers.ts b/model/subAccountDetailsResponsePlanInfoCreditsWpSubscribers.ts deleted file mode 100644 index a4f13c5..0000000 --- a/model/subAccountDetailsResponsePlanInfoCreditsWpSubscribers.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Push credits remaining on the sub-account -*/ -export class SubAccountDetailsResponsePlanInfoCreditsWpSubscribers { - /** - * Quantity of Push sending limits provided - */ - 'quantity'?: number; - /** - * Available Push sending limits for use - */ - 'remaining'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "remaining", - "baseName": "remaining", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoCreditsWpSubscribers.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfoFeatures.ts b/model/subAccountDetailsResponsePlanInfoFeatures.ts deleted file mode 100644 index 8881e1a..0000000 --- a/model/subAccountDetailsResponsePlanInfoFeatures.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SubAccountDetailsResponsePlanInfoFeaturesInbox } from './subAccountDetailsResponsePlanInfoFeaturesInbox'; -import { SubAccountDetailsResponsePlanInfoFeaturesLandingPage } from './subAccountDetailsResponsePlanInfoFeaturesLandingPage'; -import { SubAccountDetailsResponsePlanInfoFeaturesUsers } from './subAccountDetailsResponsePlanInfoFeaturesUsers'; - -/** -* Features available on the sub-account -*/ -export class SubAccountDetailsResponsePlanInfoFeatures { - 'inbox'?: SubAccountDetailsResponsePlanInfoFeaturesInbox; - 'landingPage'?: SubAccountDetailsResponsePlanInfoFeaturesLandingPage; - 'users'?: SubAccountDetailsResponsePlanInfoFeaturesUsers; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "inbox", - "baseName": "inbox", - "type": "SubAccountDetailsResponsePlanInfoFeaturesInbox" - }, - { - "name": "landingPage", - "baseName": "landingPage", - "type": "SubAccountDetailsResponsePlanInfoFeaturesLandingPage" - }, - { - "name": "users", - "baseName": "users", - "type": "SubAccountDetailsResponsePlanInfoFeaturesUsers" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoFeatures.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfoFeaturesInbox.ts b/model/subAccountDetailsResponsePlanInfoFeaturesInbox.ts deleted file mode 100644 index d218cdf..0000000 --- a/model/subAccountDetailsResponsePlanInfoFeaturesInbox.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Inbox details / Not available on ENTv2 -*/ -export class SubAccountDetailsResponsePlanInfoFeaturesInbox { - /** - * Quantity of inbox provided - */ - 'quantity'?: number; - /** - * Available inboxes for use - */ - 'remaining'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "remaining", - "baseName": "remaining", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoFeaturesInbox.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfoFeaturesLandingPage.ts b/model/subAccountDetailsResponsePlanInfoFeaturesLandingPage.ts deleted file mode 100644 index 6c85275..0000000 --- a/model/subAccountDetailsResponsePlanInfoFeaturesLandingPage.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Landing page details / Not available on ENTv2 -*/ -export class SubAccountDetailsResponsePlanInfoFeaturesLandingPage { - /** - * Quantity of landing pages provided - */ - 'quantity'?: number; - /** - * Available landing pages for use - */ - 'remaining'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "remaining", - "baseName": "remaining", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoFeaturesLandingPage.attributeTypeMap; - } -} - diff --git a/model/subAccountDetailsResponsePlanInfoFeaturesUsers.ts b/model/subAccountDetailsResponsePlanInfoFeaturesUsers.ts deleted file mode 100644 index e14f60a..0000000 --- a/model/subAccountDetailsResponsePlanInfoFeaturesUsers.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Multi-account details -*/ -export class SubAccountDetailsResponsePlanInfoFeaturesUsers { - /** - * Quantity of multi-account\'s provided - */ - 'quantity'?: number; - /** - * Available multi-accounts for use - */ - 'remaining'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "quantity", - "baseName": "quantity", - "type": "number" - }, - { - "name": "remaining", - "baseName": "remaining", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountDetailsResponsePlanInfoFeaturesUsers.attributeTypeMap; - } -} - diff --git a/model/subAccountUpdatePlanRequest.ts b/model/subAccountUpdatePlanRequest.ts deleted file mode 100644 index 57082dc..0000000 --- a/model/subAccountUpdatePlanRequest.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SubAccountUpdatePlanRequestCredits } from './subAccountUpdatePlanRequestCredits'; -import { SubAccountUpdatePlanRequestFeatures } from './subAccountUpdatePlanRequestFeatures'; - -/** -* Details of the plan to be changed -*/ -export class SubAccountUpdatePlanRequest { - 'credits'?: SubAccountUpdatePlanRequestCredits; - 'features'?: SubAccountUpdatePlanRequestFeatures; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "credits", - "baseName": "credits", - "type": "SubAccountUpdatePlanRequestCredits" - }, - { - "name": "features", - "baseName": "features", - "type": "SubAccountUpdatePlanRequestFeatures" - } ]; - - static getAttributeTypeMap() { - return SubAccountUpdatePlanRequest.attributeTypeMap; - } -} - diff --git a/model/subAccountUpdatePlanRequestCredits.ts b/model/subAccountUpdatePlanRequestCredits.ts deleted file mode 100644 index fda3ca7..0000000 --- a/model/subAccountUpdatePlanRequestCredits.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Credit details to update -*/ -export class SubAccountUpdatePlanRequestCredits { - /** - * Number of email credits - */ - 'email'?: number; - /** - * Number of SMS credits | available in ENT-v2 only - */ - 'sms'?: number; - /** - * Number of Push credits, possible value is 0 and -1 | available in ENT-v2 only - */ - 'wpSubscribers'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "number" - }, - { - "name": "sms", - "baseName": "sms", - "type": "number" - }, - { - "name": "wpSubscribers", - "baseName": "wpSubscribers", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountUpdatePlanRequestCredits.attributeTypeMap; - } -} - diff --git a/model/subAccountUpdatePlanRequestFeatures.ts b/model/subAccountUpdatePlanRequestFeatures.ts deleted file mode 100644 index 8f95372..0000000 --- a/model/subAccountUpdatePlanRequestFeatures.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Features details to update -*/ -export class SubAccountUpdatePlanRequestFeatures { - /** - * Number of multi-users - */ - 'users'?: number; - /** - * Number of landing pages / Not required on ENTv2 - */ - 'landingPage'?: number; - /** - * Number of inboxes / Not required on ENTv2 - */ - 'inbox'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "users", - "baseName": "users", - "type": "number" - }, - { - "name": "landingPage", - "baseName": "landingPage", - "type": "number" - }, - { - "name": "inbox", - "baseName": "inbox", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return SubAccountUpdatePlanRequestFeatures.attributeTypeMap; - } -} - diff --git a/model/subAccountsResponse.ts b/model/subAccountsResponse.ts deleted file mode 100644 index b3ca663..0000000 --- a/model/subAccountsResponse.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SubAccountsResponseSubAccountsInner } from './subAccountsResponseSubAccountsInner'; - -export class SubAccountsResponse { - /** - * Total number of subaccounts - */ - 'count'?: number; - 'subAccounts'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "count", - "baseName": "count", - "type": "number" - }, - { - "name": "subAccounts", - "baseName": "subAccounts", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return SubAccountsResponse.attributeTypeMap; - } -} - diff --git a/model/subAccountsResponseSubAccountsInner.ts b/model/subAccountsResponseSubAccountsInner.ts deleted file mode 100644 index ac21ad5..0000000 --- a/model/subAccountsResponseSubAccountsInner.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { SubAccountsResponseSubAccountsInnerGroupsInner } from './subAccountsResponseSubAccountsInnerGroupsInner'; - -export class SubAccountsResponseSubAccountsInner { - /** - * id of the sub-account - */ - 'id': number; - /** - * Name of the sub-account company - */ - 'companyName': string; - /** - * Whether the sub-account is active or not - */ - 'active': boolean; - /** - * Timestamp when the sub-account was created - */ - 'createdAt': number; - /** - * Group details - */ - 'groups': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "active", - "baseName": "active", - "type": "boolean" - }, - { - "name": "createdAt", - "baseName": "createdAt", - "type": "number" - }, - { - "name": "groups", - "baseName": "groups", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return SubAccountsResponseSubAccountsInner.attributeTypeMap; - } -} - diff --git a/model/subAccountsResponseSubAccountsInnerGroupsInner.ts b/model/subAccountsResponseSubAccountsInnerGroupsInner.ts deleted file mode 100644 index 7206c43..0000000 --- a/model/subAccountsResponseSubAccountsInnerGroupsInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class SubAccountsResponseSubAccountsInnerGroupsInner { - /** - * Group identifier - */ - 'id'?: string; - /** - * Name of the group - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return SubAccountsResponseSubAccountsInnerGroupsInner.attributeTypeMap; - } -} - diff --git a/model/task.ts b/model/task.ts deleted file mode 100644 index 80e337d..0000000 --- a/model/task.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Task Details -*/ -export class Task { - /** - * Unique task id - */ - 'id'?: string; - /** - * Id for type of task e.g Call / Email / Meeting etc. - */ - 'taskTypeId': string; - /** - * Name of task - */ - 'name': string; - /** - * Contact ids for contacts linked to this task - */ - 'contactsIds'?: Array; - /** - * Deal ids for deals a task is linked to - */ - 'dealsIds'?: Array; - /** - * Companies ids for companies a task is linked to - */ - 'companiesIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "taskTypeId", - "baseName": "taskTypeId", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "contactsIds", - "baseName": "contactsIds", - "type": "Array" - }, - { - "name": "dealsIds", - "baseName": "dealsIds", - "type": "Array" - }, - { - "name": "companiesIds", - "baseName": "companiesIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return Task.attributeTypeMap; - } -} - diff --git a/model/taskList.ts b/model/taskList.ts deleted file mode 100644 index 325b6f0..0000000 --- a/model/taskList.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { Task } from './task'; - -/** -* List of tasks -*/ -export class TaskList { - /** - * List of tasks - */ - 'items'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "items", - "baseName": "items", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return TaskList.attributeTypeMap; - } -} - diff --git a/model/taskReminder.ts b/model/taskReminder.ts deleted file mode 100644 index f61fdb0..0000000 --- a/model/taskReminder.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Task reminder date/time for a task -*/ -export class TaskReminder { - /** - * Value of time unit before reminder is to be sent - */ - 'value': number; - /** - * Unit of time before reminder is to be sent - */ - 'unit': TaskReminder.UnitEnum; - /** - * Type of task reminder e.g email, push - */ - 'types': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "value", - "baseName": "value", - "type": "number" - }, - { - "name": "unit", - "baseName": "unit", - "type": "TaskReminder.UnitEnum" - }, - { - "name": "types", - "baseName": "types", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return TaskReminder.attributeTypeMap; - } -} - -export namespace TaskReminder { - export enum UnitEnum { - Minutes = 'minutes', - Hours = 'hours', - Weeks = 'weeks', - Days = 'days' - } -} diff --git a/model/taskTypes.ts b/model/taskTypes.ts deleted file mode 100644 index 33ac476..0000000 --- a/model/taskTypes.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Task types details -*/ -export class TaskTypes { - /** - * Id of task type - */ - 'id'?: string; - /** - * Title of task type - */ - 'title'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "title", - "baseName": "title", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return TaskTypes.attributeTypeMap; - } -} - diff --git a/model/updateAttribute.ts b/model/updateAttribute.ts deleted file mode 100644 index 4e134ff..0000000 --- a/model/updateAttribute.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { UpdateAttributeEnumerationInner } from './updateAttributeEnumerationInner'; - -export class UpdateAttribute { - /** - * Value of the attribute to update. Use only if the attribute\'s category is \'calculated\' or \'global\' - */ - 'value'?: string; - /** - * List of the values and labels that the attribute can take. Use only if the attribute\'s category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}] - */ - 'enumeration'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "value", - "baseName": "value", - "type": "string" - }, - { - "name": "enumeration", - "baseName": "enumeration", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return UpdateAttribute.attributeTypeMap; - } -} - diff --git a/model/updateAttributeEnumerationInner.ts b/model/updateAttributeEnumerationInner.ts deleted file mode 100644 index 5a01795..0000000 --- a/model/updateAttributeEnumerationInner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateAttributeEnumerationInner { - /** - * Id of the value - */ - 'value': number; - /** - * Label of the value - */ - 'label': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "value", - "baseName": "value", - "type": "number" - }, - { - "name": "label", - "baseName": "label", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return UpdateAttributeEnumerationInner.attributeTypeMap; - } -} - diff --git a/model/updateBatchContacts.ts b/model/updateBatchContacts.ts deleted file mode 100644 index 54de7c3..0000000 --- a/model/updateBatchContacts.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { UpdateBatchContactsContactsInner } from './updateBatchContactsContactsInner'; - -export class UpdateBatchContacts { - /** - * List of contacts to be updated - */ - 'contacts'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "contacts", - "baseName": "contacts", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return UpdateBatchContacts.attributeTypeMap; - } -} - diff --git a/model/updateBatchContactsContactsInner.ts b/model/updateBatchContactsContactsInner.ts deleted file mode 100644 index 8f1502b..0000000 --- a/model/updateBatchContactsContactsInner.ts +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateBatchContactsContactsInner { - /** - * Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) - */ - 'email'?: string; - /** - * id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) - */ - 'id'?: number; - /** - * SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) - */ - 'sms'?: string; - /** - * Pass your own Id to update ext_id of a contact. - */ - 'extId'?: string; - /** - * Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}** - */ - 'attributes'?: { [key: string]: object; }; - /** - * Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) - */ - 'emailBlacklisted'?: boolean; - /** - * Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) - */ - 'smsBlacklisted'?: boolean; - /** - * Ids of the lists to add the contact to - */ - 'listIds'?: Array; - /** - * Ids of the lists to remove the contact from - */ - 'unlinkListIds'?: Array; - /** - * transactional email forbidden sender for contact. Use only for email Contact - */ - 'smtpBlacklistSender'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - }, - { - "name": "sms", - "baseName": "sms", - "type": "string" - }, - { - "name": "extId", - "baseName": "ext_id", - "type": "string" - }, - { - "name": "attributes", - "baseName": "attributes", - "type": "{ [key: string]: object; }" - }, - { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" - }, - { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "unlinkListIds", - "baseName": "unlinkListIds", - "type": "Array" - }, - { - "name": "smtpBlacklistSender", - "baseName": "smtpBlacklistSender", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return UpdateBatchContactsContactsInner.attributeTypeMap; - } -} - diff --git a/model/updateBatchContactsModel.ts b/model/updateBatchContactsModel.ts deleted file mode 100644 index b519460..0000000 --- a/model/updateBatchContactsModel.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateBatchContactsModel { - 'successIds'?: Array; - 'failureIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "successIds", - "baseName": "successIds", - "type": "Array" - }, - { - "name": "failureIds", - "baseName": "failureIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return UpdateBatchContactsModel.attributeTypeMap; - } -} - diff --git a/model/updateCampaignStatus.ts b/model/updateCampaignStatus.ts deleted file mode 100644 index 4d3e4df..0000000 --- a/model/updateCampaignStatus.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Status of the campaign -*/ -export class UpdateCampaignStatus { - /** - * Note:- replicateTemplate status will be available only for template type campaigns. - */ - 'status'?: UpdateCampaignStatus.StatusEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "status", - "baseName": "status", - "type": "UpdateCampaignStatus.StatusEnum" - } ]; - - static getAttributeTypeMap() { - return UpdateCampaignStatus.attributeTypeMap; - } -} - -export namespace UpdateCampaignStatus { - export enum StatusEnum { - Suspended = 'suspended', - Archive = 'archive', - Darchive = 'darchive', - Sent = 'sent', - Queued = 'queued', - Replicate = 'replicate', - ReplicateTemplate = 'replicateTemplate', - Draft = 'draft' - } -} diff --git a/model/updateChild.ts b/model/updateChild.ts deleted file mode 100644 index 5106901..0000000 --- a/model/updateChild.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateChild { - /** - * New Email address to update the child account - */ - 'email'?: string; - /** - * New First name to use to update the child account - */ - 'firstName'?: string; - /** - * New Last name to use to update the child account - */ - 'lastName'?: string; - /** - * New Company name to use to update the child account - */ - 'companyName'?: string; - /** - * New password for the child account to login - */ - 'password'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "firstName", - "baseName": "firstName", - "type": "string" - }, - { - "name": "lastName", - "baseName": "lastName", - "type": "string" - }, - { - "name": "companyName", - "baseName": "companyName", - "type": "string" - }, - { - "name": "password", - "baseName": "password", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return UpdateChild.attributeTypeMap; - } -} - diff --git a/model/updateChildAccountStatus.ts b/model/updateChildAccountStatus.ts deleted file mode 100644 index 5bfcefc..0000000 --- a/model/updateChildAccountStatus.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateChildAccountStatus { - /** - * Status of Transactional Email Platform activation for your account (true=enabled, false=disabled) - */ - 'transactionalEmail'?: boolean; - /** - * Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) - */ - 'transactionalSms'?: boolean; - /** - * Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) - */ - 'marketingAutomation'?: boolean; - /** - * Status of SMS Campaign Platform activation for your account (true=enabled, false=disabled) - */ - 'smsCampaign'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "transactionalEmail", - "baseName": "transactionalEmail", - "type": "boolean" - }, - { - "name": "transactionalSms", - "baseName": "transactionalSms", - "type": "boolean" - }, - { - "name": "marketingAutomation", - "baseName": "marketingAutomation", - "type": "boolean" - }, - { - "name": "smsCampaign", - "baseName": "smsCampaign", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return UpdateChildAccountStatus.attributeTypeMap; - } -} - diff --git a/model/updateChildDomain.ts b/model/updateChildDomain.ts deleted file mode 100644 index 5cfd79d..0000000 --- a/model/updateChildDomain.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateChildDomain { - /** - * Value for the sender domain that will replace the existing domain - */ - 'domain'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "domain", - "baseName": "domain", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return UpdateChildDomain.attributeTypeMap; - } -} - diff --git a/model/updateContact.ts b/model/updateContact.ts deleted file mode 100644 index f96112c..0000000 --- a/model/updateContact.ts +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateContact { - /** - * Pass the set of attributes to be updated. These attributes must be present in your account. Values that don\'t match the attribute type (e.g. text or string in a date attribute) will be ignored.To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. The attribute\'s parameter should be passed in capital letter while updating a contact. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} - */ - 'attributes'?: object; - /** - * Pass your own Id to update ext_id of a contact. - */ - 'extId'?: string; - /** - * Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) - */ - 'emailBlacklisted'?: boolean; - /** - * Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) - */ - 'smsBlacklisted'?: boolean; - /** - * Ids of the lists to add the contact to - */ - 'listIds'?: Array; - /** - * Ids of the lists to remove the contact from - */ - 'unlinkListIds'?: Array; - /** - * transactional email forbidden sender for contact. Use only for email Contact - */ - 'smtpBlacklistSender'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "attributes", - "baseName": "attributes", - "type": "object" - }, - { - "name": "extId", - "baseName": "ext_id", - "type": "string" - }, - { - "name": "emailBlacklisted", - "baseName": "emailBlacklisted", - "type": "boolean" - }, - { - "name": "smsBlacklisted", - "baseName": "smsBlacklisted", - "type": "boolean" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "unlinkListIds", - "baseName": "unlinkListIds", - "type": "Array" - }, - { - "name": "smtpBlacklistSender", - "baseName": "smtpBlacklistSender", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return UpdateContact.attributeTypeMap; - } -} - diff --git a/model/updateCouponCollection200Response.ts b/model/updateCouponCollection200Response.ts deleted file mode 100644 index 6c3c871..0000000 --- a/model/updateCouponCollection200Response.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateCouponCollection200Response { - /** - * The id of the collection - */ - 'id': string; - /** - * The name of the collection - */ - 'name': string; - /** - * The default coupon of the collection - */ - 'defaultCoupon'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "defaultCoupon", - "baseName": "defaultCoupon", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return UpdateCouponCollection200Response.attributeTypeMap; - } -} - diff --git a/model/updateCouponCollectionRequest.ts b/model/updateCouponCollectionRequest.ts deleted file mode 100644 index dc5292d..0000000 --- a/model/updateCouponCollectionRequest.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateCouponCollectionRequest { - /** - * A default coupon to be used in case there are no coupons left - */ - 'defaultCoupon'?: string; - /** - * Specify an expiration date for the coupon collection in RFC3339 format. Use null to remove the expiration date. - */ - 'expirationDate'?: Date; - /** - * Send a notification alert (email) when the remaining days until the expiration date are equal or fall bellow this number. Use null to disable alerts. - */ - 'remainingDaysAlert'?: number; - /** - * Send a notification alert (email) when the remaining coupons count is equal or fall bellow this number. Use null to disable alerts. - */ - 'remainingCouponsAlert'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "defaultCoupon", - "baseName": "defaultCoupon", - "type": "string" - }, - { - "name": "expirationDate", - "baseName": "expirationDate", - "type": "Date" - }, - { - "name": "remainingDaysAlert", - "baseName": "remainingDaysAlert", - "type": "number" - }, - { - "name": "remainingCouponsAlert", - "baseName": "remainingCouponsAlert", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return UpdateCouponCollectionRequest.attributeTypeMap; - } -} - diff --git a/model/updateEmailCampaign.ts b/model/updateEmailCampaign.ts deleted file mode 100644 index 8fa81b9..0000000 --- a/model/updateEmailCampaign.ts +++ /dev/null @@ -1,306 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { UpdateEmailCampaignRecipients } from './updateEmailCampaignRecipients'; -import { UpdateEmailCampaignSender } from './updateEmailCampaignSender'; - -export class UpdateEmailCampaign { - /** - * Tag of the campaign - */ - 'tag'?: string; - 'sender'?: UpdateEmailCampaignSender; - /** - * Name of the campaign - */ - 'name'?: string; - /** - * Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. REQUIRED if htmlUrl is empty - */ - 'htmlContent'?: string; - /** - * Url which contents the body of the email message. REQUIRED if htmlContent is empty - */ - 'htmlUrl'?: string; - /** - * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). - */ - 'scheduledAt'?: string; - /** - * Subject of the campaign - */ - 'subject'?: string; - /** - * Preview text or preheader of the email campaign - */ - 'previewText'?: string; - /** - * Email on which campaign recipients will be able to reply to - */ - 'replyTo'?: string; - /** - * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter \'params\' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization - */ - 'toField'?: string; - 'recipients'?: UpdateEmailCampaignRecipients; - /** - * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps - */ - 'attachmentUrl'?: string; - /** - * Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts. - */ - 'inlineImageActivation'?: boolean = false; - /** - * Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign - */ - 'mirrorActive'?: boolean; - /** - * FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times - */ - 'recurring'?: boolean = false; - /** - * Footer of the email campaign - */ - 'footer'?: string; - /** - * Header of the email campaign - */ - 'header'?: string; - /** - * Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed - */ - 'utmCampaign'?: string; - /** - * Pass the set of attributes to customize the type \'classic\' campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. The \'params\' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of \'subject\', \'htmlContent/htmlUrl\', \'sender.name\' & \'toField\' - */ - 'params'?: object; - /** - * Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled. - */ - 'sendAtBestTime'?: boolean; - /** - * Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. \'subjectA\', \'subjectB\', \'splitRule\', \'winnerCriteria\' & \'winnerDelay\' will be considered if abTesting is set to true. \'subject\' if passed is ignored. Can be set to true only if \'sendAtBestTime\' is \'false\'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B - */ - 'abTesting'?: boolean = false; - /** - * Subject A of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value - */ - 'subjectA'?: string; - /** - * Subject B of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value - */ - 'subjectB'?: string; - /** - * Add the size of your test groups. Considered if abTesting = true. We\'ll send version A and B to a random sample of recipients, and then the winning version to everyone else - */ - 'splitRule'?: number; - /** - * Choose the metrics that will determinate the winning version. Considered if \'splitRule\' >= 1 and < 50. If splitRule = 50, \'winnerCriteria\' is ignored if passed or alreday exist in record - */ - 'winnerCriteria'?: UpdateEmailCampaign.WinnerCriteriaEnum; - /** - * Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if \'splitRule\' >= 1 and < 50. If splitRule = 50, \'winnerDelay\' is ignored if passed or alreday exist in record - */ - 'winnerDelay'?: number; - /** - * Available for dedicated ip clients. Set this to true if you wish to warm up your ip. - */ - 'ipWarmupEnable'?: boolean = false; - /** - * Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. - */ - 'initialQuota'?: number; - /** - * Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. - */ - 'increaseRate'?: number; - /** - * Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. - */ - 'unsubscriptionPageId'?: string; - /** - * Mandatory if templateId is used containing the {{ update_profile }} tag. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. - */ - 'updateFormId'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "UpdateEmailCampaignSender" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "htmlUrl", - "baseName": "htmlUrl", - "type": "string" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "previewText", - "baseName": "previewText", - "type": "string" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "UpdateEmailCampaignRecipients" - }, - { - "name": "attachmentUrl", - "baseName": "attachmentUrl", - "type": "string" - }, - { - "name": "inlineImageActivation", - "baseName": "inlineImageActivation", - "type": "boolean" - }, - { - "name": "mirrorActive", - "baseName": "mirrorActive", - "type": "boolean" - }, - { - "name": "recurring", - "baseName": "recurring", - "type": "boolean" - }, - { - "name": "footer", - "baseName": "footer", - "type": "string" - }, - { - "name": "header", - "baseName": "header", - "type": "string" - }, - { - "name": "utmCampaign", - "baseName": "utmCampaign", - "type": "string" - }, - { - "name": "params", - "baseName": "params", - "type": "object" - }, - { - "name": "sendAtBestTime", - "baseName": "sendAtBestTime", - "type": "boolean" - }, - { - "name": "abTesting", - "baseName": "abTesting", - "type": "boolean" - }, - { - "name": "subjectA", - "baseName": "subjectA", - "type": "string" - }, - { - "name": "subjectB", - "baseName": "subjectB", - "type": "string" - }, - { - "name": "splitRule", - "baseName": "splitRule", - "type": "number" - }, - { - "name": "winnerCriteria", - "baseName": "winnerCriteria", - "type": "UpdateEmailCampaign.WinnerCriteriaEnum" - }, - { - "name": "winnerDelay", - "baseName": "winnerDelay", - "type": "number" - }, - { - "name": "ipWarmupEnable", - "baseName": "ipWarmupEnable", - "type": "boolean" - }, - { - "name": "initialQuota", - "baseName": "initialQuota", - "type": "number" - }, - { - "name": "increaseRate", - "baseName": "increaseRate", - "type": "number" - }, - { - "name": "unsubscriptionPageId", - "baseName": "unsubscriptionPageId", - "type": "string" - }, - { - "name": "updateFormId", - "baseName": "updateFormId", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return UpdateEmailCampaign.attributeTypeMap; - } -} - -export namespace UpdateEmailCampaign { - export enum WinnerCriteriaEnum { - Open = 'open', - Click = 'click' - } -} diff --git a/model/updateEmailCampaignRecipients.ts b/model/updateEmailCampaignRecipients.ts deleted file mode 100644 index 1377f08..0000000 --- a/model/updateEmailCampaignRecipients.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Segment ids and List ids to include/exclude from campaign -*/ -export class UpdateEmailCampaignRecipients { - /** - * List ids which have to be excluded from a campaign - */ - 'exclusionListIds'?: Array; - /** - * Lists Ids to send the campaign to. Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty - */ - 'listIds'?: Array; - /** - * Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it. Segment ids to send the campaign to. - */ - 'segmentIds'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "exclusionListIds", - "baseName": "exclusionListIds", - "type": "Array" - }, - { - "name": "listIds", - "baseName": "listIds", - "type": "Array" - }, - { - "name": "segmentIds", - "baseName": "segmentIds", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return UpdateEmailCampaignRecipients.attributeTypeMap; - } -} - diff --git a/model/updateEmailCampaignSender.ts b/model/updateEmailCampaignSender.ts deleted file mode 100644 index b3a9d92..0000000 --- a/model/updateEmailCampaignSender.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Sender details including id or email and name (optional). Only one of either Sender\'s email or Sender\'s ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` -*/ -export class UpdateEmailCampaignSender { - /** - * Sender Name from which the campaign emails are sent - */ - 'name'?: string; - /** - * Sender email from which the campaign emails are sent - */ - 'email'?: string; - /** - * Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return UpdateEmailCampaignSender.attributeTypeMap; - } -} - diff --git a/model/updateExternalFeed.ts b/model/updateExternalFeed.ts deleted file mode 100644 index b8900fb..0000000 --- a/model/updateExternalFeed.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetExternalFeedByUUIDHeadersInner } from './getExternalFeedByUUIDHeadersInner'; - -export class UpdateExternalFeed { - /** - * Name of the feed - */ - 'name'?: string; - /** - * URL of the feed - */ - 'url'?: string; - /** - * Auth type of the feed: * `basic` * `token` * `noAuth` - */ - 'authType'?: UpdateExternalFeed.AuthTypeEnum; - /** - * Username for authType `basic` - */ - 'username'?: string; - /** - * Password for authType `basic` - */ - 'password'?: string; - /** - * Token for authType `token` - */ - 'token'?: string; - /** - * Custom headers for the feed - */ - 'headers'?: Array; - /** - * Maximum number of retries on the feed url - */ - 'maxRetries'?: number; - /** - * Toggle caching of feed url response - */ - 'cache'?: boolean = false; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "authType", - "baseName": "authType", - "type": "UpdateExternalFeed.AuthTypeEnum" - }, - { - "name": "username", - "baseName": "username", - "type": "string" - }, - { - "name": "password", - "baseName": "password", - "type": "string" - }, - { - "name": "token", - "baseName": "token", - "type": "string" - }, - { - "name": "headers", - "baseName": "headers", - "type": "Array" - }, - { - "name": "maxRetries", - "baseName": "maxRetries", - "type": "number" - }, - { - "name": "cache", - "baseName": "cache", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return UpdateExternalFeed.attributeTypeMap; - } -} - -export namespace UpdateExternalFeed { - export enum AuthTypeEnum { - Basic = 'basic', - Token = 'token', - NoAuth = 'noAuth' - } -} diff --git a/model/updateList.ts b/model/updateList.ts deleted file mode 100644 index 439419a..0000000 --- a/model/updateList.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UpdateList { - /** - * Name of the list. Either of the two parameters (name, folderId) can be updated at a time. - */ - 'name'?: string; - /** - * Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. - */ - 'folderId'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "folderId", - "baseName": "folderId", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return UpdateList.attributeTypeMap; - } -} - diff --git a/model/updateSender.ts b/model/updateSender.ts deleted file mode 100644 index 7855db3..0000000 --- a/model/updateSender.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateSenderIpsInner } from './createSenderIpsInner'; - -export class UpdateSender { - /** - * From Name to update the sender - */ - 'name'?: string; - /** - * From Email to update the sender - */ - 'email'?: string; - /** - * Only in case of dedicated IP, IPs to associate to the sender. If passed, will replace all the existing IPs. - */ - 'ips'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "ips", - "baseName": "ips", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return UpdateSender.attributeTypeMap; - } -} - diff --git a/model/updateSmsCampaign.ts b/model/updateSmsCampaign.ts deleted file mode 100644 index 6700660..0000000 --- a/model/updateSmsCampaign.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateSmsCampaignRecipients } from './createSmsCampaignRecipients'; - -export class UpdateSmsCampaign { - /** - * Name of the campaign - */ - 'name'?: string; - /** - * Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** - */ - 'sender'?: string; - /** - * Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS - */ - 'content'?: string; - 'recipients'?: CreateSmsCampaignRecipients; - /** - * UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - */ - 'scheduledAt'?: string; - /** - * Format of the message. It indicates whether the content should be treated as unicode or not. - */ - 'unicodeEnabled'?: boolean = false; - /** - * A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** - */ - 'organisationPrefix'?: string; - /** - * Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** - */ - 'unsubscribeInstruction'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "string" - }, - { - "name": "content", - "baseName": "content", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "CreateSmsCampaignRecipients" - }, - { - "name": "scheduledAt", - "baseName": "scheduledAt", - "type": "string" - }, - { - "name": "unicodeEnabled", - "baseName": "unicodeEnabled", - "type": "boolean" - }, - { - "name": "organisationPrefix", - "baseName": "organisationPrefix", - "type": "string" - }, - { - "name": "unsubscribeInstruction", - "baseName": "unsubscribeInstruction", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return UpdateSmsCampaign.attributeTypeMap; - } -} - diff --git a/model/updateSmtpTemplate.ts b/model/updateSmtpTemplate.ts deleted file mode 100644 index ea4b112..0000000 --- a/model/updateSmtpTemplate.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { UpdateSmtpTemplateSender } from './updateSmtpTemplateSender'; - -export class UpdateSmtpTemplate { - /** - * Tag of the template - */ - 'tag'?: string; - 'sender'?: UpdateSmtpTemplateSender; - /** - * Name of the template - */ - 'templateName'?: string; - /** - * Required if htmlUrl is empty. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) - */ - 'htmlContent'?: string; - /** - * Required if htmlContent is empty. URL to the body of the email (HTML) - */ - 'htmlUrl'?: string; - /** - * Subject of the email - */ - 'subject'?: string; - /** - * Email on which campaign recipients will be able to reply to - */ - 'replyTo'?: string; - /** - * To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter \'params\' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization - */ - 'toField'?: string; - /** - * Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps - */ - 'attachmentUrl'?: string; - /** - * Status of the template. isActive = false means template is inactive, isActive = true means template is active - */ - 'isActive'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "tag", - "baseName": "tag", - "type": "string" - }, - { - "name": "sender", - "baseName": "sender", - "type": "UpdateSmtpTemplateSender" - }, - { - "name": "templateName", - "baseName": "templateName", - "type": "string" - }, - { - "name": "htmlContent", - "baseName": "htmlContent", - "type": "string" - }, - { - "name": "htmlUrl", - "baseName": "htmlUrl", - "type": "string" - }, - { - "name": "subject", - "baseName": "subject", - "type": "string" - }, - { - "name": "replyTo", - "baseName": "replyTo", - "type": "string" - }, - { - "name": "toField", - "baseName": "toField", - "type": "string" - }, - { - "name": "attachmentUrl", - "baseName": "attachmentUrl", - "type": "string" - }, - { - "name": "isActive", - "baseName": "isActive", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return UpdateSmtpTemplate.attributeTypeMap; - } -} - diff --git a/model/updateSmtpTemplateSender.ts b/model/updateSmtpTemplateSender.ts deleted file mode 100644 index b9d5a6d..0000000 --- a/model/updateSmtpTemplateSender.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -/** -* Sender details including id or email and name (optional). Only one of either Sender\'s email or Sender\'s ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` -*/ -export class UpdateSmtpTemplateSender { - /** - * Name of the sender - */ - 'name'?: string; - /** - * Email of the sender - */ - 'email'?: string; - /** - * Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). - */ - 'id'?: number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "email", - "baseName": "email", - "type": "string" - }, - { - "name": "id", - "baseName": "id", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return UpdateSmtpTemplateSender.attributeTypeMap; - } -} - diff --git a/model/updateWebhook.ts b/model/updateWebhook.ts deleted file mode 100644 index 7a1450d..0000000 --- a/model/updateWebhook.ts +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { GetWebhookAuth } from './getWebhookAuth'; -import { GetWebhookHeadersInner } from './getWebhookHeadersInner'; - -export class UpdateWebhook { - /** - * URL of the webhook - */ - 'url'?: string; - /** - * Description of the webhook - */ - 'description'?: string; - /** - * - Events triggering the webhook. Possible values for **Transactional** type webhook: #### `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` - Possible values for **Marketing** type webhook: #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` - Possible values for **Inbound** type webhook: #### `inboundEmailProcessed` - */ - 'events'?: Array; - /** - * Inbound domain of webhook, used in case of event type `inbound` - */ - 'domain'?: string; - /** - * To send batched webhooks - */ - 'batched'?: boolean; - 'auth'?: GetWebhookAuth; - /** - * Custom headers to be send with webhooks - */ - 'headers'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "url", - "baseName": "url", - "type": "string" - }, - { - "name": "description", - "baseName": "description", - "type": "string" - }, - { - "name": "events", - "baseName": "events", - "type": "Array" - }, - { - "name": "domain", - "baseName": "domain", - "type": "string" - }, - { - "name": "batched", - "baseName": "batched", - "type": "boolean" - }, - { - "name": "auth", - "baseName": "auth", - "type": "GetWebhookAuth" - }, - { - "name": "headers", - "baseName": "headers", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return UpdateWebhook.attributeTypeMap; - } -} - -export namespace UpdateWebhook { - export enum EventsEnum { - Sent = 'sent', - HardBounce = 'hardBounce', - SoftBounce = 'softBounce', - Blocked = 'blocked', - Spam = 'spam', - Delivered = 'delivered', - Request = 'request', - Click = 'click', - Invalid = 'invalid', - Deferred = 'deferred', - Opened = 'opened', - UniqueOpened = 'uniqueOpened', - Unsubscribed = 'unsubscribed', - ListAddition = 'listAddition', - ContactUpdated = 'contactUpdated', - ContactDeleted = 'contactDeleted', - InboundEmailProcessed = 'inboundEmailProcessed' - } -} diff --git a/model/updateWhatsAppCampaign.ts b/model/updateWhatsAppCampaign.ts deleted file mode 100644 index 0f2158a..0000000 --- a/model/updateWhatsAppCampaign.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { CreateWhatsAppCampaignRecipients } from './createWhatsAppCampaignRecipients'; - -export class UpdateWhatsAppCampaign { - /** - * Name of the campaign - */ - 'campaignName'?: string; - /** - * Status of the campaign - */ - 'campaignStatus'?: UpdateWhatsAppCampaign.CampaignStatusEnum = UpdateWhatsAppCampaign.CampaignStatusEnum.Scheduled; - /** - * Reschedule the sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of campaign. **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** Use this field to update the scheduledAt of any existing draft or scheduled WhatsApp campaign. - */ - 'rescheduleFor'?: string; - 'recipients'?: CreateWhatsAppCampaignRecipients; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "campaignName", - "baseName": "campaignName", - "type": "string" - }, - { - "name": "campaignStatus", - "baseName": "campaignStatus", - "type": "UpdateWhatsAppCampaign.CampaignStatusEnum" - }, - { - "name": "rescheduleFor", - "baseName": "rescheduleFor", - "type": "string" - }, - { - "name": "recipients", - "baseName": "recipients", - "type": "CreateWhatsAppCampaignRecipients" - } ]; - - static getAttributeTypeMap() { - return UpdateWhatsAppCampaign.attributeTypeMap; - } -} - -export namespace UpdateWhatsAppCampaign { - export enum CampaignStatusEnum { - Scheduled = 'scheduled', - Suspended = 'suspended' - } -} diff --git a/model/uploadImageModel.ts b/model/uploadImageModel.ts deleted file mode 100644 index 99e6338..0000000 --- a/model/uploadImageModel.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UploadImageModel { - /** - * URL of the image uploaded - */ - 'url': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "url", - "baseName": "url", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return UploadImageModel.attributeTypeMap; - } -} - diff --git a/model/uploadImageToGallery.ts b/model/uploadImageToGallery.ts deleted file mode 100644 index 837efc6..0000000 --- a/model/uploadImageToGallery.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class UploadImageToGallery { - /** - * The absolute url of the image (no local file). Maximum allowed size for image is 2MB. Allowed extensions for images are - jpeg, jpg, png, bmp, gif. - */ - 'imageUrl': string; - /** - * Name of the image. - */ - 'name'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "imageUrl", - "baseName": "imageUrl", - "type": "string" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return UploadImageToGallery.attributeTypeMap; - } -} - diff --git a/model/variablesItems.ts b/model/variablesItems.ts deleted file mode 100644 index eecd648..0000000 --- a/model/variablesItems.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class VariablesItems { - 'name'?: string; - '_default'?: string; - 'datatype'?: string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "_default", - "baseName": "default", - "type": "string" - }, - { - "name": "datatype", - "baseName": "datatype", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return VariablesItems.attributeTypeMap; - } -} - diff --git a/model/whatsappCampStats.ts b/model/whatsappCampStats.ts deleted file mode 100644 index 7595801..0000000 --- a/model/whatsappCampStats.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class WhatsappCampStats { - 'sent': number; - 'delivered': number; - 'read': number; - 'unsubscribe': number; - 'notSent': number; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sent", - "baseName": "sent", - "type": "number" - }, - { - "name": "delivered", - "baseName": "delivered", - "type": "number" - }, - { - "name": "read", - "baseName": "read", - "type": "number" - }, - { - "name": "unsubscribe", - "baseName": "unsubscribe", - "type": "number" - }, - { - "name": "notSent", - "baseName": "not_sent", - "type": "number" - } ]; - - static getAttributeTypeMap() { - return WhatsappCampStats.attributeTypeMap; - } -} - diff --git a/model/whatsappCampTemplate.ts b/model/whatsappCampTemplate.ts deleted file mode 100644 index 75ef534..0000000 --- a/model/whatsappCampTemplate.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Brevo API - * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity | - * - * The version of the OpenAPI document: 3.0.0 - * Contact: contact@brevo.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; -import { ComponentItems } from './componentItems'; -import { VariablesItems } from './variablesItems'; - -export class WhatsappCampTemplate { - /** - * name of the template - */ - 'name'?: string; - /** - * description of the template - */ - 'category'?: string; - /** - * language of the template - */ - 'language'?: string; - 'containsButton'?: boolean; - 'displayHeader'?: boolean; - /** - * type of header - */ - 'headerType'?: string; - /** - * array of component item objects - */ - 'components'?: Array; - /** - * array of variables item object - */ - 'headerVariables'?: Array; - /** - * array of variables item variables - */ - 'bodyVariables'?: Array; - 'buttonType'?: string; - 'hideFooter'?: boolean; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "category", - "baseName": "category", - "type": "string" - }, - { - "name": "language", - "baseName": "language", - "type": "string" - }, - { - "name": "containsButton", - "baseName": "contains_button", - "type": "boolean" - }, - { - "name": "displayHeader", - "baseName": "display_header", - "type": "boolean" - }, - { - "name": "headerType", - "baseName": "header_type", - "type": "string" - }, - { - "name": "components", - "baseName": "components", - "type": "Array" - }, - { - "name": "headerVariables", - "baseName": "header_variables", - "type": "Array" - }, - { - "name": "bodyVariables", - "baseName": "body_variables", - "type": "Array" - }, - { - "name": "buttonType", - "baseName": "button_type", - "type": "string" - }, - { - "name": "hideFooter", - "baseName": "hide_footer", - "type": "boolean" - } ]; - - static getAttributeTypeMap() { - return WhatsappCampTemplate.attributeTypeMap; - } -} - diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 5ddee65..0000000 --- a/package-lock.json +++ /dev/null @@ -1,2277 +0,0 @@ -{ - "name": "@getbrevo/brevo", - "version": "3.0.1", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "@getbrevo/brevo", - "version": "3.0.1", - "license": "MIT", - "dependencies": { - "axios": "^1.6.8", - "bluebird": "^3.5.0", - "rewire": "^7.0.0" - }, - "devDependencies": { - "@types/bluebird": "^3.5.33", - "@types/node": "^12.20.55", - "typescript": "^4.0" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", - "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", - "deprecated": "Use @eslint/config-array instead", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead" - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@types/bluebird": { - "version": "3.5.42", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.42.tgz", - "integrity": "sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==", - "dev": true - }, - "node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "dev": true - }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" - }, - "node_modules/acorn": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", - "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/axios": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz", - "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.4", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/axios/node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" - }, - "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "engines": { - "node": ">=8" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "license": "MIT" - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rewire": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-7.0.0.tgz", - "integrity": "sha512-DyyNyzwMtGYgu0Zl/ya0PR/oaunM+VuCuBxCuhYJHHaV0V+YvYa3bBGxb5OZ71vndgmp1pYY8F4YOwQo1siRGw==", - "dependencies": { - "eslint": "^8.47.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, - "dependencies": { - "@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "requires": { - "eslint-visitor-keys": "^3.3.0" - } - }, - "@eslint-community/regexpp": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", - "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==" - }, - "@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - } - }, - "@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==" - }, - "@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", - "requires": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - } - }, - "@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==" - }, - "@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==" - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@types/bluebird": { - "version": "3.5.42", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.42.tgz", - "integrity": "sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==", - "dev": true - }, - "@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "dev": true - }, - "@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" - }, - "acorn": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", - "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==" - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "requires": {} - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "axios": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz", - "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==", - "requires": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.4", - "proxy-from-env": "^1.1.0" - }, - "dependencies": { - "form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" - } - } - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "requires": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", - "requires": { - "ms": "2.1.2" - } - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "requires": { - "esutils": "^2.0.2" - } - }, - "dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "requires": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - } - }, - "es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" - }, - "es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" - }, - "es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "requires": { - "es-errors": "^1.3.0" - } - }, - "es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "requires": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" - }, - "eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - } - }, - "eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==" - }, - "espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "requires": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - } - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "requires": { - "estraverse": "^5.1.0" - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "requires": { - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - }, - "fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "requires": { - "flat-cache": "^3.0.4" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", - "requires": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" - }, - "follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" - }, - "get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "requires": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - } - }, - "get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "requires": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - } - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "requires": { - "is-glob": "^4.0.3" - } - }, - "globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "requires": { - "type-fest": "^0.20.2" - } - }, - "gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" - }, - "graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" - }, - "has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "requires": { - "has-symbols": "^1.0.3" - } - }, - "hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "requires": { - "function-bind": "^1.1.2" - } - }, - "ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==" - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "requires": { - "argparse": "^2.0.1" - } - }, - "json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" - }, - "keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "requires": { - "json-buffer": "3.0.1" - } - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, - "math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { - "mime-db": "1.52.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "requires": { - "p-limit": "^3.0.2" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "requires": { - "callsites": "^3.0.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" - }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, - "punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, - "rewire": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-7.0.0.tgz", - "integrity": "sha512-DyyNyzwMtGYgu0Zl/ya0PR/oaunM+VuCuBxCuhYJHHaV0V+YvYa3bBGxb5OZ71vndgmp1pYY8F4YOwQo1siRGw==", - "requires": { - "eslint": "^8.47.0" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" - }, - "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" - } - } -} diff --git a/package.json b/package.json index 46133a1..f6eda55 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,75 @@ { - "name": "@getbrevo/brevo", - "version": "3.0.1", - "description": "NodeJS client for @getbrevo/brevo", + "name": "", + "version": "0.0.52", + "private": false, "repository": { "type": "git", - "url": "https://github.com/getbrevo/brevo-node.git" + "url": "git+https://github.com/getbrevo/brevo-node.git" }, - "main": "dist/api.js", - "types": "dist/api.d.ts", - "scripts": { - "clean": "rm -Rf node_modules/ *.js", - "build": "tsc" + "type": "commonjs", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.mjs", + "types": "./dist/cjs/index.d.ts", + "exports": { + ".": { + "types": "./dist/cjs/index.d.ts", + "import": { + "types": "./dist/esm/index.d.mts", + "default": "./dist/esm/index.mjs" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.js" + }, + "default": "./dist/cjs/index.js" + }, + "./package.json": "./package.json" }, - "author": "Brevo", - "license": "MIT", - "dependencies": { - "axios": "^1.6.8", - "bluebird": "^3.5.0", - "rewire": "^7.0.0" + "files": [ + "dist", + "reference.md", + "README.md", + "LICENSE" + ], + "scripts": { + "format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "build": "pnpm build:cjs && pnpm build:esm", + "build:cjs": "tsc --project ./tsconfig.cjs.json", + "build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm", + "test": "vitest", + "test:unit": "vitest --project unit", + "test:wire": "vitest --project wire" }, + "dependencies": {}, "devDependencies": { - "@types/bluebird": "^3.5.33", - "@types/node": "^12.20.55", - "typescript": "^4.0" + "webpack": "^5.97.1", + "ts-loader": "^9.5.1", + "vitest": "^3.2.4", + "msw": "2.11.2", + "@types/node": "^18.19.70", + "typescript": "~5.7.2", + "@biomejs/biome": "2.3.11" + }, + "browser": { + "fs": false, + "os": false, + "path": false, + "stream": false + }, + "packageManager": "pnpm@10.20.0", + "engines": { + "node": ">=18.0.0" + }, + "sideEffects": false, + "description": "Brevo SDK for Node.js with TypeScript support.", + "author": { + "name": "Brevo", + "url": "https://brevo.com", + "email": "support@brevo.com" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..71751e3 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,2164 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@biomejs/biome': + specifier: 2.3.11 + version: 2.3.11 + '@types/node': + specifier: ^18.19.70 + version: 18.19.130 + msw: + specifier: 2.11.2 + version: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) + ts-loader: + specifier: ^9.5.1 + version: 9.5.4(typescript@5.7.3)(webpack@5.104.1) + typescript: + specifier: ~5.7.2 + version: 5.7.3 + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0) + webpack: + specifier: ^5.97.1 + version: 5.104.1 + +packages: + + '@biomejs/biome@2.3.11': + resolution: {integrity: sha512-/zt+6qazBWguPG6+eWmiELqO+9jRsMZ/DBU3lfuU2ngtIQYzymocHhKiZRyrbra4aCOoyTg/BmY+6WH5mv9xmQ==} + engines: {node: '>=14.21.3'} + hasBin: true + + '@biomejs/cli-darwin-arm64@2.3.11': + resolution: {integrity: sha512-/uXXkBcPKVQY7rc9Ys2CrlirBJYbpESEDme7RKiBD6MmqR2w3j0+ZZXRIL2xiaNPsIMMNhP1YnA+jRRxoOAFrA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + + '@biomejs/cli-darwin-x64@2.3.11': + resolution: {integrity: sha512-fh7nnvbweDPm2xEmFjfmq7zSUiox88plgdHF9OIW4i99WnXrAC3o2P3ag9judoUMv8FCSUnlwJCM1B64nO5Fbg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + + '@biomejs/cli-linux-arm64-musl@2.3.11': + resolution: {integrity: sha512-XPSQ+XIPZMLaZ6zveQdwNjbX+QdROEd1zPgMwD47zvHV+tCGB88VH+aynyGxAHdzL+Tm/+DtKST5SECs4iwCLg==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-arm64@2.3.11': + resolution: {integrity: sha512-l4xkGa9E7Uc0/05qU2lMYfN1H+fzzkHgaJoy98wO+b/7Gl78srbCRRgwYSW+BTLixTBrM6Ede5NSBwt7rd/i6g==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-x64-musl@2.3.11': + resolution: {integrity: sha512-vU7a8wLs5C9yJ4CB8a44r12aXYb8yYgBn+WeyzbMjaCMklzCv1oXr8x+VEyWodgJt9bDmhiaW/I0RHbn7rsNmw==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-linux-x64@2.3.11': + resolution: {integrity: sha512-/1s9V/H3cSe0r0Mv/Z8JryF5x9ywRxywomqZVLHAoa/uN0eY7F8gEngWKNS5vbbN/BsfpCG5yeBT5ENh50Frxg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-win32-arm64@2.3.11': + resolution: {integrity: sha512-PZQ6ElCOnkYapSsysiTy0+fYX+agXPlWugh6+eQ6uPKI3vKAqNp6TnMhoM3oY2NltSB89hz59o8xIfOdyhi9Iw==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + + '@biomejs/cli-win32-x64@2.3.11': + resolution: {integrity: sha512-43VrG813EW+b5+YbDbz31uUsheX+qFKCpXeY9kfdAx+ww3naKxeVkTD9zLIWxUPfJquANMHrmW3wbe/037G0Qg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + + '@bundled-es-modules/cookie@2.0.1': + resolution: {integrity: sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw==} + + '@bundled-es-modules/statuses@1.0.1': + resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} + + '@esbuild/aix-ppc64@0.27.2': + resolution: {integrity: sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.27.2': + resolution: {integrity: sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.27.2': + resolution: {integrity: sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.27.2': + resolution: {integrity: sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.27.2': + resolution: {integrity: sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.27.2': + resolution: {integrity: sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.27.2': + resolution: {integrity: sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.27.2': + resolution: {integrity: sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.27.2': + resolution: {integrity: sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.27.2': + resolution: {integrity: sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.27.2': + resolution: {integrity: sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.27.2': + resolution: {integrity: sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.27.2': + resolution: {integrity: sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.27.2': + resolution: {integrity: sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.27.2': + resolution: {integrity: sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.27.2': + resolution: {integrity: sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.27.2': + resolution: {integrity: sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.27.2': + resolution: {integrity: sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.27.2': + resolution: {integrity: sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.27.2': + resolution: {integrity: sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.27.2': + resolution: {integrity: sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/openharmony-arm64@0.27.2': + resolution: {integrity: sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + + '@esbuild/sunos-x64@0.27.2': + resolution: {integrity: sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.27.2': + resolution: {integrity: sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.27.2': + resolution: {integrity: sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.27.2': + resolution: {integrity: sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@inquirer/ansi@1.0.2': + resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==} + engines: {node: '>=18'} + + '@inquirer/confirm@5.1.21': + resolution: {integrity: sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/core@10.3.2': + resolution: {integrity: sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/figures@1.0.15': + resolution: {integrity: sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==} + engines: {node: '>=18'} + + '@inquirer/type@3.0.10': + resolution: {integrity: sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/source-map@0.3.11': + resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@mswjs/interceptors@0.39.8': + resolution: {integrity: sha512-2+BzZbjRO7Ct61k8fMNHEtoKjeWI9pIlHFTqBwZ5icHpqszIgEZbjb1MW5Z0+bITTCTl3gk4PDBxs9tA/csXvA==} + engines: {node: '>=18'} + + '@open-draft/deferred-promise@2.2.0': + resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} + + '@open-draft/logger@0.3.0': + resolution: {integrity: sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==} + + '@open-draft/until@2.1.0': + resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} + + '@rollup/rollup-android-arm-eabi@4.57.1': + resolution: {integrity: sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.57.1': + resolution: {integrity: sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.57.1': + resolution: {integrity: sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.57.1': + resolution: {integrity: sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.57.1': + resolution: {integrity: sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.57.1': + resolution: {integrity: sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.57.1': + resolution: {integrity: sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.57.1': + resolution: {integrity: sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.57.1': + resolution: {integrity: sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.57.1': + resolution: {integrity: sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loong64-gnu@4.57.1': + resolution: {integrity: sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-loong64-musl@4.57.1': + resolution: {integrity: sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.57.1': + resolution: {integrity: sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-ppc64-musl@4.57.1': + resolution: {integrity: sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.57.1': + resolution: {integrity: sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-riscv64-musl@4.57.1': + resolution: {integrity: sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.57.1': + resolution: {integrity: sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.57.1': + resolution: {integrity: sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.57.1': + resolution: {integrity: sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-openbsd-x64@4.57.1': + resolution: {integrity: sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.57.1': + resolution: {integrity: sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.57.1': + resolution: {integrity: sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.57.1': + resolution: {integrity: sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-gnu@4.57.1': + resolution: {integrity: sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.57.1': + resolution: {integrity: sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==} + cpu: [x64] + os: [win32] + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/cookie@0.6.0': + resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/eslint-scope@3.7.7': + resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} + + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/node@18.19.130': + resolution: {integrity: sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==} + + '@types/statuses@2.0.6': + resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==} + + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + + '@webassemblyjs/ast@1.14.1': + resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} + + '@webassemblyjs/floating-point-hex-parser@1.13.2': + resolution: {integrity: sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==} + + '@webassemblyjs/helper-api-error@1.13.2': + resolution: {integrity: sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==} + + '@webassemblyjs/helper-buffer@1.14.1': + resolution: {integrity: sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==} + + '@webassemblyjs/helper-numbers@1.13.2': + resolution: {integrity: sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==} + + '@webassemblyjs/helper-wasm-bytecode@1.13.2': + resolution: {integrity: sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==} + + '@webassemblyjs/helper-wasm-section@1.14.1': + resolution: {integrity: sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==} + + '@webassemblyjs/ieee754@1.13.2': + resolution: {integrity: sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==} + + '@webassemblyjs/leb128@1.13.2': + resolution: {integrity: sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==} + + '@webassemblyjs/utf8@1.13.2': + resolution: {integrity: sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==} + + '@webassemblyjs/wasm-edit@1.14.1': + resolution: {integrity: sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==} + + '@webassemblyjs/wasm-gen@1.14.1': + resolution: {integrity: sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==} + + '@webassemblyjs/wasm-opt@1.14.1': + resolution: {integrity: sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==} + + '@webassemblyjs/wasm-parser@1.14.1': + resolution: {integrity: sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==} + + '@webassemblyjs/wast-printer@1.14.1': + resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} + + '@xtuc/ieee754@1.2.0': + resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} + + '@xtuc/long@4.2.2': + resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} + + acorn-import-phases@1.0.4: + resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==} + engines: {node: '>=10.13.0'} + peerDependencies: + acorn: ^8.14.0 + + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + engines: {node: '>=0.4.0'} + hasBin: true + + ajv-formats@2.1.1: + resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv-keywords@5.1.0: + resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} + peerDependencies: + ajv: ^8.8.2 + + ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + baseline-browser-mapping@2.9.19: + resolution: {integrity: sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==} + hasBin: true + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + browserslist@4.28.1: + resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + + caniuse-lite@1.0.30001766: + resolution: {integrity: sha512-4C0lfJ0/YPjJQHagaE9x2Elb69CIqEPZeG0anQt9SIvIoOH4a4uaRl73IavyO+0qZh6MDLH//DrXThEYKHkmYA==} + + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + check-error@2.1.3: + resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} + engines: {node: '>= 16'} + + chrome-trace-event@1.0.4: + resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} + engines: {node: '>=6.0'} + + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + commander@2.20.3: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + + cookie@0.7.2: + resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} + engines: {node: '>= 0.6'} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + + electron-to-chromium@1.5.283: + resolution: {integrity: sha512-3vifjt1HgrGW/h76UEeny+adYApveS9dH2h3p57JYzBSXJIKUJAvtmIytDKjcSCt9xHfrNCFJ7gts6vkhuq++w==} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + enhanced-resolve@5.18.4: + resolution: {integrity: sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==} + engines: {node: '>=10.13.0'} + + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + + es-module-lexer@2.0.0: + resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} + + esbuild@0.27.2: + resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==} + engines: {node: '>=18'} + hasBin: true + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + eslint-scope@5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} + + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + estraverse@4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + + expect-type@1.3.0: + resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} + engines: {node: '>=12.0.0'} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-uri@3.1.0: + resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + glob-to-regexp@0.4.1: + resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + graphql@16.12.0: + resolution: {integrity: sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + headers-polyfill@4.0.3: + resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-node-process@1.2.0: + resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + jest-worker@27.5.1: + resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} + engines: {node: '>= 10.13.0'} + + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + loader-runner@4.3.1: + resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} + engines: {node: '>=6.11.5'} + + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + msw@2.11.2: + resolution: {integrity: sha512-MI54hLCsrMwiflkcqlgYYNJJddY5/+S0SnONvhv1owOplvqohKSQyGejpNdUGyCwgs4IH7PqaNbPw/sKOEze9Q==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + typescript: '>= 4.8.x' + peerDependenciesMeta: + typescript: + optional: true + + mute-stream@2.0.0: + resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} + engines: {node: ^18.17.0 || >=20.5.0} + + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + + node-releases@2.0.27: + resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} + + outvariant@1.4.3: + resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} + + path-to-regexp@6.3.0: + resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + picomatch@4.0.3: + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} + engines: {node: '>=12'} + + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + engines: {node: ^10 || ^12 || >=14} + + randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + rettime@0.7.0: + resolution: {integrity: sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==} + + rollup@4.57.1: + resolution: {integrity: sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + schema-utils@4.3.3: + resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} + engines: {node: '>= 10.13.0'} + + semver@7.7.3: + resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} + engines: {node: '>=10'} + hasBin: true + + serialize-javascript@6.0.2: + resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + source-map@0.7.6: + resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} + engines: {node: '>= 12'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + + std-env@3.10.0: + resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + + strict-event-emitter@0.5.1: + resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-literal@3.1.0: + resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + + tapable@2.3.0: + resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} + engines: {node: '>=6'} + + terser-webpack-plugin@5.3.16: + resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} + engines: {node: '>= 10.13.0'} + peerDependencies: + '@swc/core': '*' + esbuild: '*' + uglify-js: '*' + webpack: ^5.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + esbuild: + optional: true + uglify-js: + optional: true + + terser@5.46.0: + resolution: {integrity: sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==} + engines: {node: '>=10'} + hasBin: true + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + engines: {node: '>=12.0.0'} + + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} + engines: {node: '>=14.0.0'} + + tinyspy@4.0.4: + resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} + engines: {node: '>=14.0.0'} + + tldts-core@7.0.19: + resolution: {integrity: sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A==} + + tldts@7.0.19: + resolution: {integrity: sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA==} + hasBin: true + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tough-cookie@6.0.0: + resolution: {integrity: sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==} + engines: {node: '>=16'} + + ts-loader@9.5.4: + resolution: {integrity: sha512-nCz0rEwunlTZiy6rXFByQU1kVVpCIgUpc/psFiKVrUwrizdnIbRFu8w7bxhUF0X613DYwT4XzrZHpVyMe758hQ==} + engines: {node: '>=12.0.0'} + peerDependencies: + typescript: '*' + webpack: ^5.0.0 + + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} + engines: {node: '>=16'} + + typescript@5.7.3: + resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + + vite@7.3.1: + resolution: {integrity: sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + watchpack@2.5.1: + resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} + engines: {node: '>=10.13.0'} + + webpack-sources@3.3.3: + resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} + engines: {node: '>=10.13.0'} + + webpack@5.104.1: + resolution: {integrity: sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA==} + engines: {node: '>=10.13.0'} + hasBin: true + peerDependencies: + webpack-cli: '*' + peerDependenciesMeta: + webpack-cli: + optional: true + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + + wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yoctocolors-cjs@2.1.3: + resolution: {integrity: sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==} + engines: {node: '>=18'} + +snapshots: + + '@biomejs/biome@2.3.11': + optionalDependencies: + '@biomejs/cli-darwin-arm64': 2.3.11 + '@biomejs/cli-darwin-x64': 2.3.11 + '@biomejs/cli-linux-arm64': 2.3.11 + '@biomejs/cli-linux-arm64-musl': 2.3.11 + '@biomejs/cli-linux-x64': 2.3.11 + '@biomejs/cli-linux-x64-musl': 2.3.11 + '@biomejs/cli-win32-arm64': 2.3.11 + '@biomejs/cli-win32-x64': 2.3.11 + + '@biomejs/cli-darwin-arm64@2.3.11': + optional: true + + '@biomejs/cli-darwin-x64@2.3.11': + optional: true + + '@biomejs/cli-linux-arm64-musl@2.3.11': + optional: true + + '@biomejs/cli-linux-arm64@2.3.11': + optional: true + + '@biomejs/cli-linux-x64-musl@2.3.11': + optional: true + + '@biomejs/cli-linux-x64@2.3.11': + optional: true + + '@biomejs/cli-win32-arm64@2.3.11': + optional: true + + '@biomejs/cli-win32-x64@2.3.11': + optional: true + + '@bundled-es-modules/cookie@2.0.1': + dependencies: + cookie: 0.7.2 + + '@bundled-es-modules/statuses@1.0.1': + dependencies: + statuses: 2.0.2 + + '@esbuild/aix-ppc64@0.27.2': + optional: true + + '@esbuild/android-arm64@0.27.2': + optional: true + + '@esbuild/android-arm@0.27.2': + optional: true + + '@esbuild/android-x64@0.27.2': + optional: true + + '@esbuild/darwin-arm64@0.27.2': + optional: true + + '@esbuild/darwin-x64@0.27.2': + optional: true + + '@esbuild/freebsd-arm64@0.27.2': + optional: true + + '@esbuild/freebsd-x64@0.27.2': + optional: true + + '@esbuild/linux-arm64@0.27.2': + optional: true + + '@esbuild/linux-arm@0.27.2': + optional: true + + '@esbuild/linux-ia32@0.27.2': + optional: true + + '@esbuild/linux-loong64@0.27.2': + optional: true + + '@esbuild/linux-mips64el@0.27.2': + optional: true + + '@esbuild/linux-ppc64@0.27.2': + optional: true + + '@esbuild/linux-riscv64@0.27.2': + optional: true + + '@esbuild/linux-s390x@0.27.2': + optional: true + + '@esbuild/linux-x64@0.27.2': + optional: true + + '@esbuild/netbsd-arm64@0.27.2': + optional: true + + '@esbuild/netbsd-x64@0.27.2': + optional: true + + '@esbuild/openbsd-arm64@0.27.2': + optional: true + + '@esbuild/openbsd-x64@0.27.2': + optional: true + + '@esbuild/openharmony-arm64@0.27.2': + optional: true + + '@esbuild/sunos-x64@0.27.2': + optional: true + + '@esbuild/win32-arm64@0.27.2': + optional: true + + '@esbuild/win32-ia32@0.27.2': + optional: true + + '@esbuild/win32-x64@0.27.2': + optional: true + + '@inquirer/ansi@1.0.2': {} + + '@inquirer/confirm@5.1.21(@types/node@18.19.130)': + dependencies: + '@inquirer/core': 10.3.2(@types/node@18.19.130) + '@inquirer/type': 3.0.10(@types/node@18.19.130) + optionalDependencies: + '@types/node': 18.19.130 + + '@inquirer/core@10.3.2(@types/node@18.19.130)': + dependencies: + '@inquirer/ansi': 1.0.2 + '@inquirer/figures': 1.0.15 + '@inquirer/type': 3.0.10(@types/node@18.19.130) + cli-width: 4.1.0 + mute-stream: 2.0.0 + signal-exit: 4.1.0 + wrap-ansi: 6.2.0 + yoctocolors-cjs: 2.1.3 + optionalDependencies: + '@types/node': 18.19.130 + + '@inquirer/figures@1.0.15': {} + + '@inquirer/type@3.0.10(@types/node@18.19.130)': + optionalDependencies: + '@types/node': 18.19.130 + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/source-map@0.3.11': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@mswjs/interceptors@0.39.8': + dependencies: + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/logger': 0.3.0 + '@open-draft/until': 2.1.0 + is-node-process: 1.2.0 + outvariant: 1.4.3 + strict-event-emitter: 0.5.1 + + '@open-draft/deferred-promise@2.2.0': {} + + '@open-draft/logger@0.3.0': + dependencies: + is-node-process: 1.2.0 + outvariant: 1.4.3 + + '@open-draft/until@2.1.0': {} + + '@rollup/rollup-android-arm-eabi@4.57.1': + optional: true + + '@rollup/rollup-android-arm64@4.57.1': + optional: true + + '@rollup/rollup-darwin-arm64@4.57.1': + optional: true + + '@rollup/rollup-darwin-x64@4.57.1': + optional: true + + '@rollup/rollup-freebsd-arm64@4.57.1': + optional: true + + '@rollup/rollup-freebsd-x64@4.57.1': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.57.1': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.57.1': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.57.1': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.57.1': + optional: true + + '@rollup/rollup-linux-loong64-gnu@4.57.1': + optional: true + + '@rollup/rollup-linux-loong64-musl@4.57.1': + optional: true + + '@rollup/rollup-linux-ppc64-gnu@4.57.1': + optional: true + + '@rollup/rollup-linux-ppc64-musl@4.57.1': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.57.1': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.57.1': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.57.1': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.57.1': + optional: true + + '@rollup/rollup-linux-x64-musl@4.57.1': + optional: true + + '@rollup/rollup-openbsd-x64@4.57.1': + optional: true + + '@rollup/rollup-openharmony-arm64@4.57.1': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.57.1': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.57.1': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.57.1': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.57.1': + optional: true + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/cookie@0.6.0': {} + + '@types/deep-eql@4.0.2': {} + + '@types/eslint-scope@3.7.7': + dependencies: + '@types/eslint': 9.6.1 + '@types/estree': 1.0.8 + + '@types/eslint@9.6.1': + dependencies: + '@types/estree': 1.0.8 + '@types/json-schema': 7.0.15 + + '@types/estree@1.0.8': {} + + '@types/json-schema@7.0.15': {} + + '@types/node@18.19.130': + dependencies: + undici-types: 5.26.5 + + '@types/statuses@2.0.6': {} + + '@vitest/expect@3.2.4': + dependencies: + '@types/chai': 5.2.3 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + tinyrainbow: 2.0.0 + + '@vitest/mocker@3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.0))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + msw: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) + + '@vitest/pretty-format@3.2.4': + dependencies: + tinyrainbow: 2.0.0 + + '@vitest/runner@3.2.4': + dependencies: + '@vitest/utils': 3.2.4 + pathe: 2.0.3 + strip-literal: 3.1.0 + + '@vitest/snapshot@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@3.2.4': + dependencies: + tinyspy: 4.0.4 + + '@vitest/utils@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + loupe: 3.2.1 + tinyrainbow: 2.0.0 + + '@webassemblyjs/ast@1.14.1': + dependencies: + '@webassemblyjs/helper-numbers': 1.13.2 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + + '@webassemblyjs/floating-point-hex-parser@1.13.2': {} + + '@webassemblyjs/helper-api-error@1.13.2': {} + + '@webassemblyjs/helper-buffer@1.14.1': {} + + '@webassemblyjs/helper-numbers@1.13.2': + dependencies: + '@webassemblyjs/floating-point-hex-parser': 1.13.2 + '@webassemblyjs/helper-api-error': 1.13.2 + '@xtuc/long': 4.2.2 + + '@webassemblyjs/helper-wasm-bytecode@1.13.2': {} + + '@webassemblyjs/helper-wasm-section@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/wasm-gen': 1.14.1 + + '@webassemblyjs/ieee754@1.13.2': + dependencies: + '@xtuc/ieee754': 1.2.0 + + '@webassemblyjs/leb128@1.13.2': + dependencies: + '@xtuc/long': 4.2.2 + + '@webassemblyjs/utf8@1.13.2': {} + + '@webassemblyjs/wasm-edit@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/helper-wasm-section': 1.14.1 + '@webassemblyjs/wasm-gen': 1.14.1 + '@webassemblyjs/wasm-opt': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + '@webassemblyjs/wast-printer': 1.14.1 + + '@webassemblyjs/wasm-gen@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/ieee754': 1.13.2 + '@webassemblyjs/leb128': 1.13.2 + '@webassemblyjs/utf8': 1.13.2 + + '@webassemblyjs/wasm-opt@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-buffer': 1.14.1 + '@webassemblyjs/wasm-gen': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + + '@webassemblyjs/wasm-parser@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/helper-api-error': 1.13.2 + '@webassemblyjs/helper-wasm-bytecode': 1.13.2 + '@webassemblyjs/ieee754': 1.13.2 + '@webassemblyjs/leb128': 1.13.2 + '@webassemblyjs/utf8': 1.13.2 + + '@webassemblyjs/wast-printer@1.14.1': + dependencies: + '@webassemblyjs/ast': 1.14.1 + '@xtuc/long': 4.2.2 + + '@xtuc/ieee754@1.2.0': {} + + '@xtuc/long@4.2.2': {} + + acorn-import-phases@1.0.4(acorn@8.15.0): + dependencies: + acorn: 8.15.0 + + acorn@8.15.0: {} + + ajv-formats@2.1.1(ajv@8.17.1): + optionalDependencies: + ajv: 8.17.1 + + ajv-keywords@5.1.0(ajv@8.17.1): + dependencies: + ajv: 8.17.1 + fast-deep-equal: 3.1.3 + + ajv@8.17.1: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.0 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + assertion-error@2.0.1: {} + + baseline-browser-mapping@2.9.19: {} + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + browserslist@4.28.1: + dependencies: + baseline-browser-mapping: 2.9.19 + caniuse-lite: 1.0.30001766 + electron-to-chromium: 1.5.283 + node-releases: 2.0.27 + update-browserslist-db: 1.2.3(browserslist@4.28.1) + + buffer-from@1.1.2: {} + + cac@6.7.14: {} + + caniuse-lite@1.0.30001766: {} + + chai@5.3.3: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.3 + deep-eql: 5.0.2 + loupe: 3.2.1 + pathval: 2.0.1 + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + check-error@2.1.3: {} + + chrome-trace-event@1.0.4: {} + + cli-width@4.1.0: {} + + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + + commander@2.20.3: {} + + cookie@0.7.2: {} + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + deep-eql@5.0.2: {} + + electron-to-chromium@1.5.283: {} + + emoji-regex@8.0.0: {} + + enhanced-resolve@5.18.4: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.3.0 + + es-module-lexer@1.7.0: {} + + es-module-lexer@2.0.0: {} + + esbuild@0.27.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.27.2 + '@esbuild/android-arm': 0.27.2 + '@esbuild/android-arm64': 0.27.2 + '@esbuild/android-x64': 0.27.2 + '@esbuild/darwin-arm64': 0.27.2 + '@esbuild/darwin-x64': 0.27.2 + '@esbuild/freebsd-arm64': 0.27.2 + '@esbuild/freebsd-x64': 0.27.2 + '@esbuild/linux-arm': 0.27.2 + '@esbuild/linux-arm64': 0.27.2 + '@esbuild/linux-ia32': 0.27.2 + '@esbuild/linux-loong64': 0.27.2 + '@esbuild/linux-mips64el': 0.27.2 + '@esbuild/linux-ppc64': 0.27.2 + '@esbuild/linux-riscv64': 0.27.2 + '@esbuild/linux-s390x': 0.27.2 + '@esbuild/linux-x64': 0.27.2 + '@esbuild/netbsd-arm64': 0.27.2 + '@esbuild/netbsd-x64': 0.27.2 + '@esbuild/openbsd-arm64': 0.27.2 + '@esbuild/openbsd-x64': 0.27.2 + '@esbuild/openharmony-arm64': 0.27.2 + '@esbuild/sunos-x64': 0.27.2 + '@esbuild/win32-arm64': 0.27.2 + '@esbuild/win32-ia32': 0.27.2 + '@esbuild/win32-x64': 0.27.2 + + escalade@3.2.0: {} + + eslint-scope@5.1.1: + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + + esrecurse@4.3.0: + dependencies: + estraverse: 5.3.0 + + estraverse@4.3.0: {} + + estraverse@5.3.0: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.8 + + events@3.3.0: {} + + expect-type@1.3.0: {} + + fast-deep-equal@3.1.3: {} + + fast-uri@3.1.0: {} + + fdir@6.5.0(picomatch@4.0.3): + optionalDependencies: + picomatch: 4.0.3 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + fsevents@2.3.3: + optional: true + + get-caller-file@2.0.5: {} + + glob-to-regexp@0.4.1: {} + + graceful-fs@4.2.11: {} + + graphql@16.12.0: {} + + has-flag@4.0.0: {} + + headers-polyfill@4.0.3: {} + + is-fullwidth-code-point@3.0.0: {} + + is-node-process@1.2.0: {} + + is-number@7.0.0: {} + + jest-worker@27.5.1: + dependencies: + '@types/node': 18.19.130 + merge-stream: 2.0.0 + supports-color: 8.1.1 + + js-tokens@9.0.1: {} + + json-parse-even-better-errors@2.3.1: {} + + json-schema-traverse@1.0.0: {} + + loader-runner@4.3.1: {} + + loupe@3.2.1: {} + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + merge-stream@2.0.0: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + + mime-db@1.52.0: {} + + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + + ms@2.1.3: {} + + msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3): + dependencies: + '@bundled-es-modules/cookie': 2.0.1 + '@bundled-es-modules/statuses': 1.0.1 + '@inquirer/confirm': 5.1.21(@types/node@18.19.130) + '@mswjs/interceptors': 0.39.8 + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/until': 2.1.0 + '@types/cookie': 0.6.0 + '@types/statuses': 2.0.6 + graphql: 16.12.0 + headers-polyfill: 4.0.3 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + picocolors: 1.1.1 + rettime: 0.7.0 + strict-event-emitter: 0.5.1 + tough-cookie: 6.0.0 + type-fest: 4.41.0 + yargs: 17.7.2 + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - '@types/node' + + mute-stream@2.0.0: {} + + nanoid@3.3.11: {} + + neo-async@2.6.2: {} + + node-releases@2.0.27: {} + + outvariant@1.4.3: {} + + path-to-regexp@6.3.0: {} + + pathe@2.0.3: {} + + pathval@2.0.1: {} + + picocolors@1.1.1: {} + + picomatch@2.3.1: {} + + picomatch@4.0.3: {} + + postcss@8.5.6: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + randombytes@2.1.0: + dependencies: + safe-buffer: 5.2.1 + + require-directory@2.1.1: {} + + require-from-string@2.0.2: {} + + rettime@0.7.0: {} + + rollup@4.57.1: + dependencies: + '@types/estree': 1.0.8 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.57.1 + '@rollup/rollup-android-arm64': 4.57.1 + '@rollup/rollup-darwin-arm64': 4.57.1 + '@rollup/rollup-darwin-x64': 4.57.1 + '@rollup/rollup-freebsd-arm64': 4.57.1 + '@rollup/rollup-freebsd-x64': 4.57.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.57.1 + '@rollup/rollup-linux-arm-musleabihf': 4.57.1 + '@rollup/rollup-linux-arm64-gnu': 4.57.1 + '@rollup/rollup-linux-arm64-musl': 4.57.1 + '@rollup/rollup-linux-loong64-gnu': 4.57.1 + '@rollup/rollup-linux-loong64-musl': 4.57.1 + '@rollup/rollup-linux-ppc64-gnu': 4.57.1 + '@rollup/rollup-linux-ppc64-musl': 4.57.1 + '@rollup/rollup-linux-riscv64-gnu': 4.57.1 + '@rollup/rollup-linux-riscv64-musl': 4.57.1 + '@rollup/rollup-linux-s390x-gnu': 4.57.1 + '@rollup/rollup-linux-x64-gnu': 4.57.1 + '@rollup/rollup-linux-x64-musl': 4.57.1 + '@rollup/rollup-openbsd-x64': 4.57.1 + '@rollup/rollup-openharmony-arm64': 4.57.1 + '@rollup/rollup-win32-arm64-msvc': 4.57.1 + '@rollup/rollup-win32-ia32-msvc': 4.57.1 + '@rollup/rollup-win32-x64-gnu': 4.57.1 + '@rollup/rollup-win32-x64-msvc': 4.57.1 + fsevents: 2.3.3 + + safe-buffer@5.2.1: {} + + schema-utils@4.3.3: + dependencies: + '@types/json-schema': 7.0.15 + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) + ajv-keywords: 5.1.0(ajv@8.17.1) + + semver@7.7.3: {} + + serialize-javascript@6.0.2: + dependencies: + randombytes: 2.1.0 + + siginfo@2.0.0: {} + + signal-exit@4.1.0: {} + + source-map-js@1.2.1: {} + + source-map-support@0.5.21: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + + source-map@0.6.1: {} + + source-map@0.7.6: {} + + stackback@0.0.2: {} + + statuses@2.0.2: {} + + std-env@3.10.0: {} + + strict-event-emitter@0.5.1: {} + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-literal@3.1.0: + dependencies: + js-tokens: 9.0.1 + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + supports-color@8.1.1: + dependencies: + has-flag: 4.0.0 + + tapable@2.3.0: {} + + terser-webpack-plugin@5.3.16(webpack@5.104.1): + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + jest-worker: 27.5.1 + schema-utils: 4.3.3 + serialize-javascript: 6.0.2 + terser: 5.46.0 + webpack: 5.104.1 + + terser@5.46.0: + dependencies: + '@jridgewell/source-map': 0.3.11 + acorn: 8.15.0 + commander: 2.20.3 + source-map-support: 0.5.21 + + tinybench@2.9.0: {} + + tinyexec@0.3.2: {} + + tinyglobby@0.2.15: + dependencies: + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + + tinypool@1.1.1: {} + + tinyrainbow@2.0.0: {} + + tinyspy@4.0.4: {} + + tldts-core@7.0.19: {} + + tldts@7.0.19: + dependencies: + tldts-core: 7.0.19 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tough-cookie@6.0.0: + dependencies: + tldts: 7.0.19 + + ts-loader@9.5.4(typescript@5.7.3)(webpack@5.104.1): + dependencies: + chalk: 4.1.2 + enhanced-resolve: 5.18.4 + micromatch: 4.0.8 + semver: 7.7.3 + source-map: 0.7.6 + typescript: 5.7.3 + webpack: 5.104.1 + + type-fest@4.41.0: {} + + typescript@5.7.3: {} + + undici-types@5.26.5: {} + + update-browserslist-db@1.2.3(browserslist@4.28.1): + dependencies: + browserslist: 4.28.1 + escalade: 3.2.0 + picocolors: 1.1.1 + + vite-node@3.2.4(@types/node@18.19.130)(terser@5.46.0): + dependencies: + cac: 6.7.14 + debug: 4.4.3 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite@7.3.1(@types/node@18.19.130)(terser@5.46.0): + dependencies: + esbuild: 0.27.2 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.57.1 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 18.19.130 + fsevents: 2.3.3 + terser: 5.46.0 + + vitest@3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0): + dependencies: + '@types/chai': 5.2.3 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.0)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + debug: 4.4.3 + expect-type: 1.3.0 + magic-string: 0.30.21 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.10.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.15 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) + vite-node: 3.2.4(@types/node@18.19.130)(terser@5.46.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 18.19.130 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + watchpack@2.5.1: + dependencies: + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + + webpack-sources@3.3.3: {} + + webpack@5.104.1: + dependencies: + '@types/eslint-scope': 3.7.7 + '@types/estree': 1.0.8 + '@types/json-schema': 7.0.15 + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/wasm-edit': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + acorn: 8.15.0 + acorn-import-phases: 1.0.4(acorn@8.15.0) + browserslist: 4.28.1 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.18.4 + es-module-lexer: 2.0.0 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.1 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 4.3.3 + tapable: 2.3.0 + terser-webpack-plugin: 5.3.16(webpack@5.104.1) + watchpack: 2.5.1 + webpack-sources: 3.3.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + + wrap-ansi@6.2.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + y18n@5.0.8: {} + + yargs-parser@21.1.1: {} + + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + yoctocolors-cjs@2.1.3: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..6e4c395 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1 @@ +packages: ['.'] \ No newline at end of file diff --git a/reference.md b/reference.md new file mode 100644 index 0000000..76d621f --- /dev/null +++ b/reference.md @@ -0,0 +1,17230 @@ +# Reference +## Account +
client.account.getAccount() -> Brevo.GetAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves details of your Brevo account. + +**Use this to:** +- Get account information (email, name, company, address) +- Check plan details (type, credits, expiration) +- Get relay information (for transactional emails) +- Check Marketing Automation status +- View date/time preferences and account settings +- Access organization and user identifiers + +**Key information returned:** +- Complete account details (organization ID, user ID, company information) +- Address and contact information +- Plan configurations and credit allocations across different verticals +- Marketing Automation settings and tracker key +- SMTP relay configuration for transactional emails +- Date/time preferences and account settings +- Enterprise features availability status + +**Important considerations:** +- Provides comprehensive account overview for billing and configuration management +- Essential for understanding current plan limitations and feature availability +- Marketing Automation key required for advanced automation features +- Plan verticals show detailed breakdown across Marketing, Chat, and CRM categories +- Relay configuration crucial for transactional email setup and deliverability +- Date/time preferences affect campaign scheduling and reporting displays +- Enterprise status determines access to advanced features and sub-account management +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.account.getAccount(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `AccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.account.getAccountActivity({ ...params }) -> Brevo.GetAccountActivityResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves user activity logs from your organization for security monitoring and audit compliance. + +Use this to: +- Monitor user login activities and access patterns +- Track account modifications and configuration changes +- Generate security audit reports and compliance documentation +- Investigate suspicious activities and unauthorized access +- Monitor team member actions and account usage + +Key information returned: +- Complete user activity details and timestamps +- User identification (email, IP address, browser) +- Action types and activity descriptions +- Security-relevant events and access logs +- Historical activity data for audit trails + +Note: Requires Enterprise plan for access to organization activity logs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.account.getAccountActivity(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetAccountActivityRequest` + +
+
+ +
+
+ +**requestOptions:** `AccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## MasterAccount +
client.masterAccount.createANewGroupOfSubAccounts({ ...params }) -> Brevo.PostCorporateGroupResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows to create a group of sub-accounts +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.createANewGroupOfSubAccounts({ + groupName: "My group" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCorporateGroupRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.deleteSubAccountFromGroup({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows you to remove a sub-organization from a group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.deleteSubAccountFromGroup({ + groupId: "groupId", + subAccountIds: [423432, 234323, 87678] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutCorporateGroupUnlinkGroupIdSubAccountsRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.getAGroupDetails({ ...params }) -> Brevo.GetCorporateGroupIdResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows you to retrieve a specific group’s information such as +the list of sub-organizations and the user associated with the group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.getAGroupDetails({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCorporateGroupIdRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.updateAGroupOfSubAccounts({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows to update a group of sub-accounts +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.updateAGroupOfSubAccounts({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutCorporateGroupIdRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.deleteAGroup({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows you to delete a group of sub-organizations. When a +group is deleted, the sub-organizations are no longer part of this group. +The users associated with the group are no longer associated with the group +once deleted. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.deleteAGroup({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCorporateGroupIdRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.getSubAccountGroups() -> Brevo.GetSubAccountGroupsResponseItem[] +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows you to list all groups created on your Admin account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.getSubAccountGroups(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.getCorporateInvitedUsersList({ ...params }) -> Brevo.GetCorporateInvitedUsersListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows you to list all Admin users of your Admin account. You +can filter users by type (active or pending) and paginate results using +offset and limit. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.getCorporateInvitedUsersList(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCorporateInvitedUsersListRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.listOfAllIPs() -> Brevo.GetCorporateIpResponseItem[] +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows you to retrieve the list of active IPs on your Admin +account +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.listOfAllIPs(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.getTheDetailsOfRequestedMasterAccount() -> Brevo.GetCorporateMasterAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will provide the details of the master account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.getTheDetailsOfRequestedMasterAccount(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.generateSsoTokenToAccessAdminAccount({ ...params }) -> Brevo.GetSsoToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint generates an SSO token to authenticate and access the admin +account using the endpoint +https://account-app.brevo.com/account/login/corporate/sso/[token], where +[token] will be replaced by the actual token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.generateSsoTokenToAccessAdminAccount({ + email: "vipin+ent-user@brevo.com" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCorporateSsoTokenRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.getTheListOfAllTheSubAccountsOfTheMasterAccount({ ...params }) -> Brevo.GetCorporateSubAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will provide the list all the sub-accounts of the master +account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.getTheListOfAllTheSubAccountsOfTheMasterAccount({ + offset: 1, + limit: 1 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCorporateSubAccountRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.createANewSubAccountUnderAMasterAccount({ ...params }) -> Brevo.PostCorporateSubAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will create a new sub-account under a master account +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.createANewSubAccountUnderAMasterAccount({ + companyName: "Test Sub-account", + email: "test-sub@example.com", + groupIds: ["5f8f8c3b5f56a02d4433b3a7", "5f8f8c3b5f56a02d4433b3a8"], + language: "fr", + timezone: "Europe/Paris" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCorporateSubAccountRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.associateAnIpToSubAccounts({ ...params }) -> Record<string, unknown> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows to associate an IP to sub-accounts +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.associateAnIpToSubAccounts({ + ids: [234322, 325553, 893432], + ip: "103.11.32.88" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCorporateSubAccountIpAssociateRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.dissociateAnIpToSubAccounts({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows to dissociate an IP from sub-accounts +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.dissociateAnIpToSubAccounts({ + ids: [234322, 325553, 893432], + ip: "103.11.32.88" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutCorporateSubAccountIpDissociateRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.createAnApiKeyForASubAccount({ ...params }) -> Brevo.PostCorporateSubAccountKeyResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will generate an API v3 key for a sub-account +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.createAnApiKeyForASubAccount({ + id: 3232323, + name: "My Api Key" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCorporateSubAccountKeyRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.generateSsoTokenToAccessSubAccount({ ...params }) -> Brevo.GetSsoToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint generates an sso token to authenticate and access a +sub-account of the master using the account endpoint +https://account-app.brevo.com/account/login/sub-account/sso/[token], where +[token] will be replaced by the actual token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.generateSsoTokenToAccessSubAccount({ + id: 3232323 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCorporateSubAccountSsoTokenRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.getSubAccountDetails({ ...params }) -> Brevo.GetCorporateSubAccountIdResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will provide the details for the specified sub-account company +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.getSubAccountDetails({ + id: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCorporateSubAccountIdRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.deleteASubAccount({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.deleteASubAccount({ + id: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCorporateSubAccountIdRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.enableDisableSubAccountApplicationS({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +API endpoint for the Corporate owner to enable/disable applications on the +sub-account +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.enableDisableSubAccountApplicationS({ + id: 1000000, + "landing-pages": true, + meetings: true, + "sms-campaigns": false, + "web-push": false, + whatsapp: true +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutCorporateSubAccountIdApplicationsToggleRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.updateSubAccountPlan({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will update the sub-account plan. On the Corporate solution +new version v2, you can set an unlimited number of credits in your +sub-organization. Please pass the value “-1" to set the consumable in +unlimited mode. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.updateSubAccountPlan({ + id: 1000000, + credits: { + email: 5000, + externalFeeds: 1, + sms: 2000, + whatsapp: 100, + wpSubscribers: -1 + }, + features: { + inbox: 10, + landingPage: 20, + salesUsers: 6, + users: 15 + } +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutCorporateSubAccountIdPlanRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.updateSubAccountsPlan({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will update multiple sub-accounts plan. On the Corporate +solution new version v2, you can set an unlimited number of credits in your +sub-organization. Please pass the value “-1" to set the consumable in +unlimited mode. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.updateSubAccountsPlan({ + credits: { + email: 5000, + externalFeeds: 1, + sms: 2000, + whatsapp: 100, + wpSubscribers: -1 + }, + features: { + landingPage: 20, + salesUsers: 6, + users: 15 + }, + subAccountIds: [4534345, 987893, 876785] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutCorporateSubAccountsPlanRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.inviteAdminUser({ ...params }) -> Brevo.InviteAdminUserResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +`This endpoint allows you to invite a member to manage the Admin account +Features and their respective permissions are as below: - `my_plan`: + - "all" +- `api`: + - "none" +- `user_management`: + - "all" +- `app_management` | Not available in ENTv2: + - "all" +- `sub_organization_groups` + - "create" + - "edit_delete" +- `create_sub_organizations` + - "all" +- `manage_sub_organizations` + - "all" +- `analytics` + - "download_data" + - "create_alerts" + - "my_looks" + - "explore_create" +- `security` + - "all" +**Note**: - If `all_features_access: false` then only privileges are +required otherwise if `true` then it's assumed that all permissions will be +there for the invited admin user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.inviteAdminUser({ + all_features_access: true, + email: "inviteuser@example.com", + privileges: [{}] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.InviteAdminUserRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.resendCancelAdminUserInvitation({ ...params }) -> Brevo.PutCorporateUserInvitationActionEmailResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will allow the user to: +- Resend an admin user invitation +- Cancel an admin user invitation +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.resendCancelAdminUserInvitation({ + action: "resend", + email: "email" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutCorporateUserInvitationActionEmailRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.revokeAnAdminUser({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint allows to revoke/remove an invited member of your Admin +account +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.revokeAnAdminUser({ + email: "email" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCorporateUserRevokeEmailRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.getCorporateUserPermission({ ...params }) -> Brevo.GetCorporateUserPermissionResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will provide the list of admin user permissions +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.getCorporateUserPermission({ + email: "email" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCorporateUserPermissionRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.masterAccount.changeAdminUserPermissions({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will allow you to change the permissions of Admin users of +your Admin account +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.masterAccount.changeAdminUserPermissions({ + email: "email", + all_features_access: false, + privileges: [{ + feature: "user_management", + permissions: ["all"] + }, { + feature: "api", + permissions: ["all"] + }, { + feature: "my_plan", + permissions: ["none"] + }, { + feature: "apps_management", + permissions: ["all"] + }, { + feature: "create_sub_organizations", + permissions: ["all"] + }, { + feature: "sub_organization_groups", + permissions: ["create", "edit_delete"] + }, { + feature: "manage_sub_organizations", + permissions: ["all"] + }, { + feature: "security", + permissions: ["none"] + }, { + feature: "analytics", + permissions: ["create_alerts", "download_data", "my_looks", "explore_create"] + }] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutCorporateUserEmailPermissionsRequest` + +
+
+ +
+
+ +**requestOptions:** `MasterAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## User +
client.user.getInvitedUsersList() -> Brevo.GetInvitedUsersListResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.getInvitedUsersList(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `UserClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.user.putRevokeUserPermission({ ...params }) -> Brevo.PutRevokeUserPermissionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.putRevokeUserPermission({ + email: "email" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutRevokeUserPermissionRequest` + +
+
+ +
+
+ +**requestOptions:** `UserClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.user.inviteuser({ ...params }) -> Brevo.InviteuserResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +`Feature` - A Feature represents a specific functionality like Email +campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, +determine which feature you want to manage access to. You must specify the +feature accurately to avoid errors. `Permission` - A Permission defines the +level of access or control a user has over a specific feature. While +inviting user, decide on the permission level required for the selected +feature. Make sure the chosen permission is related to the selected feature. +Features and their respective permissions are as below: - `email_campaigns`: + - "create_edit_delete" + - "send_schedule_suspend" +- `sms_campaigns`: + - "create_edit_delete" + - "send_schedule_suspend" +- `contacts`: + - "view" + - "create_edit_delete" + - "import" + - "export" + - "list_and_attributes" + - "forms" +- `templates`: + - "create_edit_delete" + - "activate_deactivate" +- `workflows`: + - "create_edit_delete" + - "activate_deactivate_pause" + - "settings" +- `landing_pages`: + - "all" +- `transactional_emails`: + - "settings" + - "logs" +- `smtp_api`: + - "smtp" + - "api_keys" + - "authorized_ips" +- `user_management`: + - "all" +- `sales_platform`: + - "create_edit_deals" + - "delete_deals" + - "manage_others_deals_tasks" + - "reports" + - "settings" +- `phone`: + - "all" +- `conversations`: + - "access" + - "assign" + - "configure" +- `senders_domains_dedicated_ips`: + - "senders_management" + - "domains_management" + - "dedicated_ips_management" +- `push_notifications`: + - "view" + - "create_edit_delete" + - "send" + - "settings" +- `companies`: + - "manage_owned_companies" + - "manage_other_companies" + - "settings" +**Note**: - If `all_features_access: false` then only privileges are +required otherwise if `true` then it's assumed that all permissions will be +there for the invited user. - The availability of feature and its permission +depends on your current plan. Please select the features and permissions +accordingly. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.inviteuser({ + all_features_access: true, + email: "inviteuser@example.com", + privileges: [{}] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.Inviteuser` + +
+
+ +
+
+ +**requestOptions:** `UserClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.user.putresendcancelinvitation({ ...params }) -> Brevo.PutresendcancelinvitationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.putresendcancelinvitation({ + action: "resend", + email: "email" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutresendcancelinvitationRequest` + +
+
+ +
+
+ +**requestOptions:** `UserClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.user.editUserPermission({ ...params }) -> Brevo.EditUserPermissionResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +`Feature` - A Feature represents a specific functionality like Email +campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, +determine which feature you want to manage access to. You must specify the +feature accurately to avoid errors. `Permission` - A Permission defines the +level of access or control a user has over a specific feature. While +inviting user, decide on the permission level required for the selected +feature. Make sure the chosen permission is related to the selected feature. +Features and their respective permissions are as below: - `email_campaigns`: + - "create_edit_delete" + - "send_schedule_suspend" +- `sms_campaigns`: + - "create_edit_delete" + - "send_schedule_suspend" +- `contacts`: + - "view" + - "create_edit_delete" + - "import" + - "export" + - "list_and_attributes" + - "forms" +- `templates`: + - "create_edit_delete" + - "activate_deactivate" +- `workflows`: + - "create_edit_delete" + - "activate_deactivate_pause" + - "settings" +- `landing_pages`: + - "all" +- `transactional_emails`: + - "settings" + - "logs" +- `smtp_api`: + - "smtp" + - "api_keys" + - "authorized_ips" +- `user_management`: + - "all" +- `sales_platform`: + - "create_edit_deals" + - "delete_deals" + - "manage_others_deals_tasks" + - "reports" + - "settings" +- `phone`: + - "all" +- `conversations`: + - "access" + - "assign" + - "configure" +- `senders_domains_dedicated_ips`: + - "senders_management" + - "domains_management" + - "dedicated_ips_management" +- `push_notifications`: + - "view" + - "create_edit_delete" + - "send" + - "settings" +- `companies`: + - "manage_owned_companies" + - "manage_other_companies" + - "settings" +**Note**: - The privileges array remains the same as in the send invitation; +the user simply needs to provide the permissions that need to be updated. - +The availability of feature and its permission depends on your current plan. +Please select the features and permissions accordingly. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.editUserPermission({ + all_features_access: true, + email: "inviteuser@example.com", + privileges: [{}] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.Inviteuser` + +
+
+ +
+
+ +**requestOptions:** `UserClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.user.getUserPermission({ ...params }) -> Brevo.GetUserPermissionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.user.getUserPermission({ + email: "email" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetUserPermissionRequest` + +
+
+ +
+
+ +**requestOptions:** `UserClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Process +
client.process.getProcesses({ ...params }) -> Brevo.GetProcessesResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a list of background processes from your Brevo account with filtering and pagination. + +**Use this to:** +- Monitor background process activity and status +- Track long-running operations and tasks +- Find process IDs for detailed status checking +- Review process history and performance +- Identify failed or stuck processes for troubleshooting + +**Key information returned:** +- Process details (ID, name, type, status) +- Process creation and completion timestamps +- Process progress and completion status +- Error information for failed processes +- Process result data and download links + +**Important considerations:** +- Background processes handle long-running operations like imports and exports +- Process status indicates current state (queued, processing, completed, failed, cancelled) +- Export processes provide download URLs when completed +- Failed processes include error messages for troubleshooting +- Use pagination for accounts with many historical processes +- Sort options available for creation order (ascending or descending) +- Different process types handle specific operations (imports, exports, calculations) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.process.getProcesses(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetProcessesRequest` + +
+
+ +
+
+ +**requestOptions:** `ProcessClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.process.getProcess({ ...params }) -> Brevo.GetProcessResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves detailed information about a specific background process. + +**Use this to:** +- Get detailed status of a specific process +- Monitor process progress and completion +- Download results from completed export processes +- Check error details for failed processes +- Track process execution times + +**Key information returned:** +- Complete process details and status +- Import/export statistics and results +- Error information for troubleshooting +- Download URLs for export processes +- Process timing and performance data + +**Important considerations:** +- Process ID must exist in your account +- Completed processes provide detailed statistics and results +- Export processes include download URLs when successful +- Failed processes contain error messages for debugging +- Timing information helps with performance analysis +- Different process types return different result structures +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.process.getProcess({ + processId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetProcessRequest` + +
+
+ +
+
+ +**requestOptions:** `ProcessClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Senders +
client.senders.getSenders({ ...params }) -> Brevo.GetSendersResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a list of all email senders from your Brevo account with optional filtering. + +**Use this to:** +- Get all available senders for email campaign setup +- Find sender details including ID, name, and email address +- Filter senders by IP address for dedicated IP users +- Filter senders by domain for domain-specific configurations +- Monitor sender configuration and status + +**Key information returned:** +- Sender details (ID, name, email address) +- Sender status and verification information +- Associated IP addresses and domains (for dedicated IP accounts) +- Sender configuration settings + +**Important considerations:** +- Standard accounts show empty IP arrays, dedicated IP accounts show IP assignments +- Filtering by IP only available for accounts with dedicated IPs +- Domain filtering helps organize senders by business units or brands +- Sender status indicates if sender is active and ready for campaign use +- Email verification required before sender can be used in campaigns +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.senders.getSenders(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSendersRequest` + +
+
+ +
+
+ +**requestOptions:** `SendersClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.senders.createSender({ ...params }) -> Brevo.CreateSenderResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new email sender in your Brevo account. + +**Use this to:** +- Add new senders for email campaigns +- Configure sender identity (name and email) +- Associate dedicated IPs with the sender (for dedicated IP accounts) +- Set up domain-based sender configurations + +**Key information returned:** +- Created sender ID +- DKIM and SPF configuration status +- Success confirmation + +**Important considerations:** +- Verification email sent to specified sender address +- DKIM and SPF configuration affects deliverability +- Dedicated IP accounts require IP association during creation +- IP weights must sum to 100 when specified +- Sender must be verified before use in campaigns +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.senders.createSender({ + email: "support@example.com", + name: "Support Team" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateSenderRequest` + +
+
+ +
+
+ +**requestOptions:** `SendersClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.senders.getIps() -> Brevo.GetIpsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves all dedicated IPs associated with your Brevo account. + +Use this to: +- List all your dedicated IPs +- Check the status of your dedicated IPs (active/inactive) +- Find IP addresses and associated domains for configuration purposes +- Monitor your IP reputation and deliverability +- Verify available IPs for sender configuration + +Key information returned: +- IP ID and address +- Associated domain +- Active status +- IP configuration details +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.senders.getIps(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `SendersClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.senders.updateSender({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an existing email sender's configuration. + +Use this to: +- Modify sender display name or email address +- Update dedicated IP associations +- Change sender configuration settings +- Correct sender information + +Key information returned: +- Success confirmation +- Updated sender details +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.senders.updateSender({ + senderId: 1000000, + name: "New Support Team" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateSenderRequest` + +
+
+ +
+
+ +**requestOptions:** `SendersClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.senders.deleteSender({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes an email sender from your Brevo account. + +Use this to: +- Remove senders that are no longer needed +- Clean up sender configurations +- Remove duplicate or test senders + +Key information returned: +- Success confirmation message +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.senders.deleteSender({ + senderId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteSenderRequest` + +
+
+ +
+
+ +**requestOptions:** `SendersClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.senders.getIpsFromSender({ ...params }) -> Brevo.GetIpsFromSenderResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves the dedicated IPs associated with a specific sender. + +Use this to: +- Check IP configuration for a sender +- Verify dedicated IP associations +- Get IP details for troubleshooting +- Monitor sender IP configuration + +Key information returned: +- List of associated dedicated IPs +- IP addresses and domain configurations +- IP status and settings +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.senders.getIpsFromSender({ + senderId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetIpsFromSenderRequest` + +
+
+ +
+
+ +**requestOptions:** `SendersClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.senders.validateSenderByOtp({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Validates a sender using the OTP (One-Time Password) received via email. + +Use this to: +- Complete sender verification process +- Activate a newly created sender +- Verify ownership of the sender email address +- Enable the sender for use in email campaigns + +Key information returned: +- Success confirmation of sender verification +- Sender activation status +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.senders.validateSenderByOtp({ + senderId: 1000000, + otp: 123456 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.ValidateSenderByOtpRequest` + +
+
+ +
+
+ +**requestOptions:** `SendersClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Domains +
client.domains.getDomains() -> Brevo.GetDomainsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves all domains associated with the account. + +Use this to: +- List all domains +- Verify domain existence +- Check domain authentication and verification status +- Monitor domain configuration and provider information +- Review domain creation history and ownership + +Key information returned: +- Domain details (ID, name, authentication status) +- Verification and authentication states +- Associated IP addresses and DNS providers +- Creator information and creation timestamps +- Pagination information for large domain lists +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.domains.getDomains(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `DomainsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.domains.createDomain({ ...params }) -> Brevo.CreateDomainResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new domain in Brevo. + +Use this to: +- Add new domains for sending emails +- Set up domain authentication for better deliverability +- Configure DNS records for email authentication +- Establish domain-based sender identities + +Key information returned: +- Created domain ID and configuration +- Required DNS records for authentication +- Domain provider detection results +- Setup instructions and next steps +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.domains.createDomain({ + name: "mycompany.com" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateDomainRequest` + +
+
+ +
+
+ +**requestOptions:** `DomainsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.domains.getDomainConfiguration({ ...params }) -> Brevo.GetDomainConfigurationResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves configuration of a specific domain, to know if the domain is valid or not. + +Use this to: +- Check domain configuration +- Validate a domain configuration +- Monitor DNS record status +- Troubleshoot authentication issues + +Key information returned: +- Domain verification and authentication status +- DNS records configuration and validation status +- Detailed authentication requirements +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.domains.getDomainConfiguration({ + domainName: "domainName" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetDomainConfigurationRequest` + +
+
+ +
+
+ +**requestOptions:** `DomainsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.domains.deleteDomain({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a domain from Brevo. + +Use this to: +- Remove existing domains +- Clean up unused domain configurations +- Remove test domains + +Key information returned: +- Success confirmation message +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.domains.deleteDomain({ + domainName: "domainName" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteDomainRequest` + +
+
+ +
+
+ +**requestOptions:** `DomainsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.domains.authenticateDomain({ ...params }) -> Brevo.AuthenticateDomainResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Authenticates a specific domain. + +Use this to: +- Authenticate a domain +- Verify DNS record configuration +- Complete domain setup for sending +- Enable domain for email authentication + +Key information returned: +- Authentication success confirmation +- Domain readiness status for email sending +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.domains.authenticateDomain({ + domainName: "domainName" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.AuthenticateDomainRequest` + +
+
+ +
+
+ +**requestOptions:** `DomainsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Webhooks +
client.webhooks.getWebhooks({ ...params }) -> Brevo.GetWebhooksResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves all webhooks from your Brevo account with filtering and sorting options. + +Use this to: +- Monitor webhook configurations and event handling +- List webhooks by type (transactional, marketing, inbound) +- Review webhook endpoints and authentication +- Track webhook creation and modification history +- Audit webhook event subscriptions + +Key information returned: +- Complete webhook details and configuration +- Event types and channel subscriptions +- Authentication and security settings +- Webhook URLs and custom headers +- Creation and modification timestamps +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.webhooks.getWebhooks(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetWebhooksRequest` + +
+
+ +
+
+ +**requestOptions:** `WebhooksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.webhooks.createWebhook({ ...params }) -> Brevo.CreateWebhookResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new webhook to receive real-time notifications for specified events. + +Use this to: +- Set up event notifications for transactional or marketing emails +- Configure webhook endpoints for campaign tracking +- Enable real-time monitoring of email delivery status +- Subscribe to contact list changes and updates +- Implement custom event handling and automation + +Key information returned: +- Created webhook ID and configuration +- Success confirmation and setup details +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.webhooks.createWebhook({ + events: ["sent"], + url: "http://requestb.in/173lyyx1" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateWebhookRequest` + +
+
+ +
+
+ +**requestOptions:** `WebhooksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.webhooks.exportWebhooksHistory({ ...params }) -> Brevo.ExportWebhooksHistoryResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +To have it activated please send us a request and we will activate it for your account. + + +Exports webhook event history to CSV format for analysis and reporting. + +Use this to: +- Generate comprehensive webhook event reports +- Analyze webhook delivery patterns and success rates +- Export event data for external analysis tools +- Create historical reports for compliance and auditing +- Track webhook performance and reliability metrics + +Key information returned: +- Process ID for tracking export completion +- CSV file will be delivered to specified webhook URL +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.webhooks.exportWebhooksHistory({ + event: "invalid_parameter", + notifyURL: "https://brevo.com", + type: "transactional" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.ExportWebhooksHistoryRequest` + +
+
+ +
+
+ +**requestOptions:** `WebhooksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.webhooks.getWebhook({ ...params }) -> Brevo.GetWebhook +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves detailed information about a specific webhook configuration. + +Use this to: +- Get complete webhook configuration and settings +- Check webhook event subscriptions and triggers +- Review authentication and security settings +- Verify webhook URL and custom headers +- Access webhook creation and modification history + +Key information returned: +- Complete webhook details and configuration +- Event types and channel subscriptions +- Authentication credentials and methods +- Custom headers and request settings +- Webhook status and activity information +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.webhooks.getWebhook({ + webhookId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetWebhookRequest` + +
+
+ +
+
+ +**requestOptions:** `WebhooksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.webhooks.updateWebhook({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an existing webhook configuration and event subscriptions. + +Use this to: +- Modify webhook event subscriptions and triggers +- Update webhook URL and endpoint configuration +- Change authentication settings and credentials +- Adjust custom headers and request parameters +- Enable or disable specific webhook events + +Key information returned: +- Success confirmation of webhook updates +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.webhooks.updateWebhook({ + webhookId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateWebhookRequest` + +
+
+ +
+
+ +**requestOptions:** `WebhooksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.webhooks.deleteWebhook({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Permanently deletes a webhook and stops all event notifications. + +Use this to: +- Remove unused or obsolete webhook configurations +- Clean up webhook endpoints and subscriptions +- Stop event notifications to specific URLs +- Maintain organized webhook management + +Key information returned: +- Success confirmation of webhook deletion +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.webhooks.deleteWebhook({ + webhookId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteWebhookRequest` + +
+
+ +
+
+ +**requestOptions:** `WebhooksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## ExternalFeeds +
client.externalFeeds.getAllExternalFeeds({ ...params }) -> Brevo.GetAllExternalFeedsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves all external feeds from your Brevo account with filtering and pagination. + +**Use this to:** +- Get an overview of all external data feeds +- Find feeds by name using search functionality +- Filter feeds by creation date range +- Browse feeds by authentication type +- Monitor feed library organization and usage + +**Key information returned:** +- Feed details (UUID, name, URL, authentication type) +- Feed configuration and settings +- Creation and modification timestamps +- Feed status and error information +- Authentication and header configurations + +**Important considerations:** +- External feeds enable dynamic content in email campaigns +- Feeds must be accessible from Brevo servers +- Authentication credentials are securely stored +- Feed performance affects campaign delivery +- Use pagination for accounts with many feeds +- Date range filtering limited to 30 days maximum +- Search functionality works on feed name matching +- Internal feeds are system-managed and cannot be modified +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.externalFeeds.getAllExternalFeeds({ + search: "product", + startDate: "2024-01-01", + endDate: "2024-01-31" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetAllExternalFeedsRequest` + +
+
+ +
+
+ +**requestOptions:** `ExternalFeedsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.externalFeeds.createExternalFeed({ ...params }) -> Brevo.CreateExternalFeedResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new external feed for dynamic content in email campaigns. + +**Use this to:** +- Set up external data sources for dynamic content +- Configure authentication for protected feeds +- Enable real-time content updates in campaigns +- Establish connections to product catalogs, blogs, or APIs + +**Key information returned:** +- Created feed UUID for reference in campaigns +- Success confirmation + +**Important considerations:** +- Feed URL must be accessible from Brevo infrastructure +- Authentication credentials are securely encrypted +- Test feed accessibility before campaign use +- Consider feed response time for campaign performance +- Monitor feed reliability and uptime +- Use caching for frequently accessed feeds +- Maximum 5 retry attempts allowed for failed requests +- Custom headers support for API integration requirements +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.externalFeeds.createExternalFeed({ + name: "Public API Feed", + url: "https://jsonplaceholder.typicode.com/posts", + authType: "noAuth", + maxRetries: 3, + cache: true +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateExternalFeedRequest` + +
+
+ +
+
+ +**requestOptions:** `ExternalFeedsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.externalFeeds.getExternalFeedByUuid({ ...params }) -> Brevo.GetExternalFeedByUuidResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves details of a specific external feed by its UUID. + +**Use this to:** +- Get complete configuration of an external feed +- Check feed authentication settings +- Review feed personalization options +- Verify feed URL and parameters +- Monitor feed modification history + +**Key information returned:** +- Complete feed configuration and settings +- Authentication credentials and headers +- Personalization and fallback settings +- Creation and modification timestamps +- Cache and retry configurations + +**Important considerations:** +- UUID must exist in your account +- Provides complete feed information for troubleshooting +- Essential before making modifications +- Shows current feed health status +- Useful for debugging feed issues +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.externalFeeds.getExternalFeedByUuid({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetExternalFeedByUuidRequest` + +
+
+ +
+
+ +**requestOptions:** `ExternalFeedsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.externalFeeds.updateExternalFeed({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates configuration of an existing external feed. + +**Use this to:** +- Update feed URLs when data sources change +- Modify authentication credentials +- Change cache and retry settings +- Update custom headers +- Rename feeds for better organization + +**Key information returned:** +- Success confirmation message + +**Important considerations:** +- Only provided fields will be updated +- Feed UUID must exist in your account +- Authentication changes require verification +- URL changes should be tested before campaign use +- Monitor campaigns using this feed after updates +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.externalFeeds.updateExternalFeed({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + name: "Updated Product Catalog", + url: "https://api.newstore.com/products/v2" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateExternalFeedRequest` + +
+
+ +
+
+ +**requestOptions:** `ExternalFeedsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.externalFeeds.deleteExternalFeed({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes an external feed from your Brevo account. + +**Use this to:** +- Remove external feeds that are no longer needed +- Clean up unused data sources +- Remove test or outdated feeds +- Maintain organized feed library + +**Key information returned:** +- Success confirmation message + +**Important considerations:** +- This action is PERMANENT and cannot be undone +- Feed configuration and history will be lost +- Check if feed is used in active campaigns before deletion +- Remove feed references from email templates +- Consider deactivating instead of deleting if unsure +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.externalFeeds.deleteExternalFeed({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteExternalFeedRequest` + +
+
+ +
+
+ +**requestOptions:** `ExternalFeedsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## CustomObjects +
client.customObjects.upsertrecords({ ...params }) -> Brevo.UpsertrecordsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +Custom objects are only available to Enterprise plans. + +This feature is in beta. These are subject to change. + + +This API allows bulk upsert of object records in a single request. Each object record may include + - Attributes + - Identifiers + - Associations +**Response:** + The API processes the request asynchronously and returns a processId that you can use to track the background process status. +**API and Schema Limitation:** + - Size: + - Max 1000 objects records per request + - Max request body size: 1 MB + - Max 500 attributes defined per object record upsert request + - This is coherent with schema limitation: an object cannot have more than 500 attributes. + - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) + - Max 10 associations defined per object record upsert request + - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. +**Errors:** + - Make sure both object records exist before associating them, else the API will return an error. + - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.customObjects.upsertrecords({ + object_type: "vehicle", + records: [{}] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpsertrecordsRequest` + +
+
+ +
+
+ +**requestOptions:** `CustomObjectsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.customObjects.getrecords({ ...params }) -> Brevo.GetrecordsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +Custom objects are only available to Enterprise plans. + +This feature is in beta. These are subject to change. + + +This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.customObjects.getrecords({ + object_type: "vehicle", + limit: 1000000, + page_num: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetrecordsRequest` + +
+
+ +
+
+ +**requestOptions:** `CustomObjectsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.customObjects.batchDeleteObjectRecords({ ...params }) -> Brevo.BatchDeleteObjectRecordsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Use this endpoint to delete multiple object records of the same object-type in one request. +The request is accepted and processed asynchronously. You can track the status of the deletion process using the returned **processId**. +**API and Schema Limitations:** - Each request can contain up to **1000** object record identifiers - If more records must be deleted → send multiple batch requests +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.customObjects.batchDeleteObjectRecords({ + object_type: "vehicle", + identifiers: { + ext_ids: ["ext-001", "ext-002"] + } +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.BatchDeleteObjectRecordsRequest` + +
+
+ +
+
+ +**requestOptions:** `CustomObjectsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Contacts +
client.contacts.getContacts({ ...params }) -> Brevo.GetContacts +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +Accepted Number Formats + +91xxxxxxxxxx ++91xxxxxxxxxx +0091xxxxxxxxxx + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getContacts(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetContactsRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.createContact({ ...params }) -> Brevo.CreateContactResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates new contacts on Brevo. Contacts can be created by passing either -

1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
+
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.createContact(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateContactRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getAttributes() -> Brevo.GetAttributesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getAttributes(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.createAttribute({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.createAttribute({ + attributeCategory: "normal", + attributeName: "attributeName" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateAttributeRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.updateAttribute({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.updateAttribute({ + attributeCategory: "category", + attributeName: "attributeName" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateAttributeRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.deleteAttribute({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.deleteAttribute({ + attributeCategory: "normal", + attributeName: "attributeName" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteAttributeRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.deleteMultiAttributeOptions({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.deleteMultiAttributeOptions({ + attributeType: "multiple-choice", + multipleChoiceAttribute: "multipleChoiceAttribute", + multipleChoiceAttributeOption: "multipleChoiceAttributeOption" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteMultiAttributeOptionsRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.updateBatchContacts({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.updateBatchContacts(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateBatchContactsRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.createDoiContact({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.createDoiContact({ + email: "elly@example.com", + includeListIds: [36], + redirectionUrl: "http://requestb.in/173lyyx1", + templateId: 2 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateDoiContactRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.requestContactExport({ ...params }) -> Brevo.RequestContactExportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.requestContactExport({ + customContactFilter: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.RequestContactExportRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getFolders({ ...params }) -> Brevo.GetFoldersResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +Ongoing changes for this endpoint + +We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + +These are non breaking changes. + +The default value for the attributes will be 0. + +The uniqueSubscribers field is deprecated + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getFolders(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetFoldersRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.createFolder({ ...params }) -> Brevo.CreateFolderResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.createFolder({}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateUpdateFolder` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getFolder({ ...params }) -> Brevo.GetFolder +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +Ongoing changes for this endpoint. + +We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + +These are non breaking changes. The default value for the attributes will be 0. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getFolder({ + folderId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetFolderRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.updateFolder({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.updateFolder({ + folderId: 1000000, + body: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateFolderRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.deleteFolder({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.deleteFolder({ + folderId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteFolderRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getFolderLists({ ...params }) -> Brevo.GetFolderListsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +Ongoing changes for this endpoint. + +We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + +These are non breaking changes. The default value for the attributes will be 0. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getFolderLists({ + folderId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetFolderListsRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.importContacts({ ...params }) -> Brevo.ImportContactsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +It returns the background process ID which on completion calls the notify URL that you have set in the input. **Note**: - Any contact attribute that doesn't exist in your account will be ignored at import end. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.importContacts(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.ImportContactsRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getLists({ ...params }) -> Brevo.GetListsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +Ongoing changes for this endpoint. + +We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + +These are non breaking changes. The default value for the attributes will be 0. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getLists(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetListsRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.createList({ ...params }) -> Brevo.CreateListResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.createList({ + folderId: 2, + name: "Magento Customer - ES" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateListRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getList({ ...params }) -> Brevo.GetListResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getList({ + listId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetListRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.updateList({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.updateList({ + listId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateListRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.deleteList({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.deleteList({ + listId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteListRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getContactsFromList({ ...params }) -> Brevo.GetContacts +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getContactsFromList({ + listId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetContactsFromListRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.addContactToList({ ...params }) -> Brevo.PostContactInfo +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.addContactToList({ + listId: 1000000, + body: { + emails: ["jeff32@example.com", "jim56@example.com"] + } +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.AddContactToListRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.removeContactFromList({ ...params }) -> Brevo.PostContactInfo +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + all: true + } +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.RemoveContactFromListRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getSegments({ ...params }) -> Brevo.GetSegmentsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getSegments(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSegmentsRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getContactInfo({ ...params }) -> Brevo.GetContactInfoResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +Accepted Number Formats + +91xxxxxxxxxx ++91xxxxxxxxxx +0091xxxxxxxxxx + + +There are 2 ways to get a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getContactInfo({ + identifier: "identifier" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetContactInfoRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.updateContact({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +There are 2 ways to update a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.updateContact({ + identifier: "identifier" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateContactRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.deleteContact({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +There are 2 ways to delete a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.deleteContact({ + identifier: "identifier" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteContactRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.contacts.getContactStats({ ...params }) -> Brevo.GetContactStatsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getContactStats({ + identifier: "identifier" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetContactStatsRequest` + +
+
+ +
+
+ +**requestOptions:** `ContactsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Conversations +
client.conversations.setsAgentsStatusToOnlineFor23Minutes({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +We recommend pinging this endpoint every minute for as long as the agent has to be considered online. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.setsAgentsStatusToOnlineFor23Minutes({ + agentId: "d9nKoegKSjmCtyK78" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostConversationsAgentOnlinePingRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.sendAMessageAsAnAgent({ ...params }) -> Brevo.ConversationsMessage +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.sendAMessageAsAnAgent({ + agentId: "d9nKoegKSjmCtyK78", + text: "Hello! How can I help you?", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostConversationsMessagesRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.getAMessage({ ...params }) -> Brevo.ConversationsMessage +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.getAMessage({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetConversationsMessagesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.updateAMessageSentByAnAgent({ ...params }) -> Brevo.ConversationsMessage +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Only agents’ messages can be edited. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.updateAMessageSentByAnAgent({ + id: "id", + text: "Good morning! How can I help you?" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutConversationsMessagesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.deleteAMessageSentByAnAgent({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Only agents’ messages can be deleted. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.deleteAMessageSentByAnAgent({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteConversationsMessagesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.sendAnAutomatedMessageToAVisitor({ ...params }) -> Brevo.ConversationsMessage +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Example of automated messages: order status, announce new features in your web app, etc. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.sendAnAutomatedMessageToAVisitor({ + groupId: "PjRBMhWGen6aRHjif", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostConversationsPushedMessagesRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.getAnAutomatedMessage({ ...params }) -> Brevo.ConversationsMessage +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.getAnAutomatedMessage({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetConversationsPushedMessagesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.updateAnAutomatedMessage({ ...params }) -> Brevo.ConversationsMessage +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.updateAnAutomatedMessage({ + id: "id", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutConversationsPushedMessagesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.deleteAnAutomatedMessage({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.deleteAnAutomatedMessage({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteConversationsPushedMessagesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.conversations.setVisitorGroupAssignment({ ...params }) -> Brevo.PutConversationsVisitorGroupResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assigns a visitor to a specific agent group or removes them from their current group. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.conversations.setVisitorGroupAssignment({ + groupId: "PjRBMhWGen6aRHjif" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PutConversationsVisitorGroupRequest` + +
+
+ +
+
+ +**requestOptions:** `ConversationsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Ecommerce +
client.ecommerce.getCategories({ ...params }) -> Brevo.GetCategoriesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getCategories(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCategoriesRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.createUpdateCategory({ ...params }) -> Brevo.CreateUpdateCategoryResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.createUpdateCategory({ + id: "CAT123" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateUpdateCategoryRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.createUpdateBatchCategory({ ...params }) -> Brevo.CreateUpdateBatchCategoryResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.createUpdateBatchCategory({ + categories: [{ + id: "CAT123" + }] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateUpdateBatchCategoryRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.getCategoryInfo({ ...params }) -> Brevo.GetCategoryDetails +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getCategoryInfo({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCategoryInfoRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.activateTheECommerceApp() -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Getting access to Brevo eCommerce. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.activateTheECommerceApp(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows({ ...params }) -> Brevo.GetEcommerceAttributionMetricsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows({ + periodFrom: "2022-01-02T00:00:00Z", + periodTo: "2022-01-03T00:00:00Z" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetEcommerceAttributionMetricsRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow({ ...params }) -> Brevo.GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow({ + conversionSource: "email_campaign", + conversionSourceId: "sale" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.getAttributedProductSalesForASingleBrevoCampaignOrWorkflow({ ...params }) -> Brevo.GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getAttributedProductSalesForASingleBrevoCampaignOrWorkflow({ + conversionSource: "email_campaign", + conversionSourceId: "sale" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount() -> Brevo.GetEcommerceConfigDisplayCurrencyResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.setConfigDisplayCurrency({ ...params }) -> Brevo.SetConfigDisplayCurrencyResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.setConfigDisplayCurrency({ + code: "EUR" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SetConfigDisplayCurrencyRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.getOrders({ ...params }) -> unknown +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all the orders +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getOrders(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetOrdersRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.createOrder({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Manages the transactional status of the order +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.createOrder({ + amount: 308.42, + createdAt: "2021-07-29T20:59:23.383Z", + id: "14", + products: [{ + price: 99.99, + productId: "P1", + quantity: 10 + }], + status: "completed", + updatedAt: "2021-07-30T10:59:23.383Z" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.Order` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.createBatchOrder({ ...params }) -> Brevo.CreateBatchOrderResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create multiple orders at one time instead of one order at a time +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.createBatchOrder({ + orders: [{ + amount: 308.42, + createdAt: "2021-07-29T20:59:23.383Z", + id: "14", + products: [{ + price: 99.99, + productId: "P1", + quantity: 10 + }], + status: "completed", + updatedAt: "2021-07-30T10:59:23.383Z" + }] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateBatchOrderRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.getProducts({ ...params }) -> Brevo.GetProductsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getProducts(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetProductsRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.createUpdateProduct({ ...params }) -> Brevo.CreateUpdateProductResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.createUpdateProduct({ + id: "P11", + name: "Iphone 11" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateUpdateProductRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.createUpdateBatchProducts({ ...params }) -> Brevo.CreateUpdateBatchProductsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.createUpdateBatchProducts({ + products: [{ + id: "P11", + name: "Iphone 11" + }] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateUpdateBatchProductsRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.getProductInfo({ ...params }) -> Brevo.GetProductDetails +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.getProductInfo({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetProductInfoRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.ecommerce.createProductAlert({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.createProductAlert({ + id: "id", + type: "back_in_stock" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateProductAlertRequest` + +
+
+ +
+
+ +**requestOptions:** `EcommerceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Coupons +
client.coupons.getCouponCollections({ ...params }) -> Brevo.GetCouponCollection +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.coupons.getCouponCollections(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCouponCollectionsRequest` + +
+
+ +
+
+ +**requestOptions:** `CouponsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.coupons.createCouponCollection({ ...params }) -> Brevo.CreateCouponCollectionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.coupons.createCouponCollection({ + defaultCoupon: "Winter", + name: "10%OFF" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateCouponCollectionRequest` + +
+
+ +
+
+ +**requestOptions:** `CouponsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.coupons.getCouponCollection({ ...params }) -> Brevo.GetCouponCollection +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.coupons.getCouponCollection({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCouponCollectionRequest` + +
+
+ +
+
+ +**requestOptions:** `CouponsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.coupons.updateCouponCollection({ ...params }) -> Brevo.UpdateCouponCollectionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.coupons.updateCouponCollection({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateCouponCollectionRequest` + +
+
+ +
+
+ +**requestOptions:** `CouponsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.coupons.createCoupons({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.coupons.createCoupons({ + collectionId: "23befbae-1505-47a8-bd27-e30ef739f32c", + coupons: ["Uf12AF"] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateCouponsRequest` + +
+
+ +
+
+ +**requestOptions:** `CouponsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Payments +
client.payments.createPaymentRequest({ ...params }) -> Brevo.CreatePaymentRequestResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.payments.createPaymentRequest({ + cart: { + currency: "EUR", + specificAmount: 1200 + }, + contactId: 43, + reference: "Invoice #INV0001" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreatePaymentRequestRequest` + +
+
+ +
+
+ +**requestOptions:** `PaymentsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.payments.getPaymentRequest({ ...params }) -> Brevo.GetPaymentRequestResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.payments.getPaymentRequest({ + id: "050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetPaymentRequestRequest` + +
+
+ +
+
+ +**requestOptions:** `PaymentsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.payments.deletePaymentRequest({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.payments.deletePaymentRequest({ + id: "9ae7d68a-565c-4695-9381-d8fb3e3a14cc" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeletePaymentRequestRequest` + +
+
+ +
+
+ +**requestOptions:** `PaymentsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Event +
client.event.createEvent({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create an event to track a contact's interaction. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.event.createEvent({ + event_name: "video_played", + identifiers: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateEventRequest` + +
+
+ +
+
+ +**requestOptions:** `EventClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## InboundParsing +
client.inboundParsing.getInboundEmailEvents({ ...params }) -> Brevo.GetInboundEmailEventsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will show the list of all the events for the received emails. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.inboundParsing.getInboundEmailEvents(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetInboundEmailEventsRequest` + +
+
+ +
+
+ +**requestOptions:** `InboundParsingClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.inboundParsing.getInboundEmailEventsByUuid({ ...params }) -> Brevo.GetInboundEmailEventsByUuidResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will show the list of all events history for one particular received email. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.inboundParsing.getInboundEmailEventsByUuid({ + uuid: "uuid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetInboundEmailEventsByUuidRequest` + +
+
+ +
+
+ +**requestOptions:** `InboundParsingClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.inboundParsing.getInboundEmailAttachment({ ...params }) -> core.BinaryResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will retrieve inbound attachment with download token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.inboundParsing.getInboundEmailAttachment({ + downloadToken: "downloadToken" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetInboundEmailAttachmentRequest` + +
+
+ +
+
+ +**requestOptions:** `InboundParsingClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Balance +
client.balance.getActiveBalancesApi({ ...params }) -> Brevo.BalanceLimit +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns Active Balances +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.getActiveBalancesApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.getBalanceDefinitionList({ ...params }) -> Brevo.GetBalanceDefinitionListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns balance definition page +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.getBalanceDefinitionList({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetBalanceDefinitionListRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.createBalanceDefinition({ ...params }) -> Brevo.BalanceDefinition +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates balance definition and returns information +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.createBalanceDefinition({ + pid: "pid", + name: "name", + unit: "POINTS" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.getBalanceDefinition({ ...params }) -> Brevo.BalanceDefinition +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns balance definition +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.getBalanceDefinition({ + pid: "pid", + bdid: "bdid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetBalanceDefinitionRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.updateBalanceDefinition({ ...params }) -> Brevo.BalanceDefinition +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates Balance definition +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.updateBalanceDefinition({ + pid: "pid", + bdid: "bdid", + name: "name", + unit: "POINTS" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateBalanceDefinitionRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.deleteBalanceDefinition({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete Balance definition +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.deleteBalanceDefinition({ + pid: "pid", + bdid: "bdid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteBalanceDefinitionRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.createBalanceLimit({ ...params }) -> Brevo.BalanceLimit +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates balance limit and sends the created UUID along with the data +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.createBalanceLimit({ + pid: "pid", + bdid: "bdid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateBalanceLimitRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.getBalanceLimit({ ...params }) -> Brevo.BalanceLimit +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Fetches balance limits and send the created UUID along with the data +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.getBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetBalanceLimitRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.updateBalanceLimit({ ...params }) -> Brevo.BalanceLimit +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates balance limit +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.updateBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateBalanceLimitRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.deleteBalanceLimit({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete balance limit +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.deleteBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteBalanceLimitRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.getContactBalances({ ...params }) -> Brevo.GetContactBalancesResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns balance list +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.getContactBalances({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetContactBalancesRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.createBalanceOrder({ ...params }) -> Brevo.CreateBalanceOrderResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns created order +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.createBalanceOrder({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateBalanceOrderRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.getSubscriptionBalances({ ...params }) -> Brevo.GetSubscriptionBalancesResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns subscription balances +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.getSubscriptionBalances({ + pid: "pid", + cid: "cid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSubscriptionBalancesRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.createSubscriptionBalances({ ...params }) -> Brevo.PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a balance for a contact +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.createSubscriptionBalances({ + pid: "pid", + cid: "cid", + balanceDefinitionId: "balanceDefinitionId" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.getTransactionHistoryApi({ ...params }) -> Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns transaction history +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.getTransactionHistoryApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.beginTransaction({ ...params }) -> Brevo.Transaction +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates new transaction and returns information +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.beginTransaction({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.BeginTransactionRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.cancelTransaction({ ...params }) -> Brevo.Transaction +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Cancels transaction +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.cancelTransaction({ + pid: "pid", + tid: "tid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CancelTransactionRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.balance.completeTransaction({ ...params }) -> Brevo.Transaction +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Completes transaction +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.balance.completeTransaction({ + pid: "pid", + tid: "tid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CompleteTransactionRequest` + +
+
+ +
+
+ +**requestOptions:** `BalanceClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Program +
client.program.getLpList({ ...params }) -> Brevo.GetLpListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns list of loyalty programs +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.getLpList(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetLpListRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.createNewLp({ ...params }) -> Brevo.LoyaltyProgram +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates loyalty program +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.createNewLp({ + name: "name" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateNewLpRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.getLoyaltyProgramInfo({ ...params }) -> Brevo.LoyaltyProgram +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns loyalty program +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.getLoyaltyProgramInfo({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetLoyaltyProgramInfoRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.updateLoyaltyProgram({ ...params }) -> Brevo.LoyaltyProgram +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates loyalty program +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.updateLoyaltyProgram({ + pid: "pid", + name: "name" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateLoyaltyProgramRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.deleteLoyaltyProgram({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes Loyalty Program +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.deleteLoyaltyProgram({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteLoyaltyProgramRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.partiallyUpdateLoyaltyProgram({ ...params }) -> Brevo.LoyaltyProgram +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Partially updates loyalty program +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.partiallyUpdateLoyaltyProgram({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PartiallyUpdateLoyaltyProgramRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.getParameterSubscriptionInfo({ ...params }) -> Brevo.GetParameterSubscriptionInfoResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get Information of balances, tiers, rewards and subscription members for a subscription +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.getParameterSubscriptionInfo({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetParameterSubscriptionInfoRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.publishLoyaltyProgram({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Publishes loyalty program +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.publishLoyaltyProgram({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PublishLoyaltyProgramRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.subscribeMemberToASubscription({ ...params }) -> Brevo.SubscribeMemberToASubscriptionResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Add member to a subscription +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.subscribeMemberToASubscription({ + pid: "pid", + memberContactIds: [1] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SubscribeMemberToASubscriptionRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.deleteContactMembers({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes member from a subscription +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.deleteContactMembers({ + pid: "pid", + memberContactIds: "memberContactIds" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteContactMembersRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.program.subscribeToLoyaltyProgram({ ...params }) -> Brevo.SubscribeToLoyaltyProgramResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Subscribes to a loyalty program +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.subscribeToLoyaltyProgram({ + pid: "pid", + contactId: 1 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SubscribeToLoyaltyProgramRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Reward +
client.reward.getCodeCount({ ...params }) -> Brevo.GetCodeCountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get code count +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.getCodeCount({ + pid: "pid", + cpid: "cpid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCodeCountRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.getRewardPageApi({ ...params }) -> Brevo.GetLoyaltyOfferProgramsPidOffersResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a reward page +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.getRewardPageApi({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetLoyaltyOfferProgramsPidOffersRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.createReward({ ...params }) -> Brevo.CreateRewardResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new reward in the loyalty program. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.createReward({ + pid: "pid", + name: "name" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateRewardRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.createVoucher({ ...params }) -> Brevo.CreateVoucherResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a voucher and attribute it to a specific membership. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.createVoucher({ + pid: "pid", + rewardId: "rewardId" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateVoucherRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.redeemVoucher({ ...params }) -> Brevo.Redeem +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a request to redeem a voucher. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.redeemVoucher({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.RedeemVoucherRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.completeRedeemTransaction({ ...params }) -> Brevo.Redeem +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Completes voucher redeem request. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CompleteRedeemTransactionRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.revokeVouchers({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Revoke attributed vouchers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.revokeVouchers({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.RevokeVouchersRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.validateReward({ ...params }) -> Brevo.ValidateRewardResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Validates a reward. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.validateReward({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.ValidateRewardRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.getRewardInformation({ ...params }) -> Brevo.GetLoyaltyOfferProgramsPidRewardsRidResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns reward information. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.getRewardInformation({ + pid: "pid", + rid: "rid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetLoyaltyOfferProgramsPidRewardsRidRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.reward.getVoucherForAContact({ ...params }) -> Brevo.GetLoyaltyOfferProgramsPidVouchersResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get voucher for a contact +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.reward.getVoucherForAContact({ + pid: "pid", + contactId: 1 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetLoyaltyOfferProgramsPidVouchersRequest` + +
+
+ +
+
+ +**requestOptions:** `RewardClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Tier +
client.tier.addSubscriptionToTier({ ...params }) -> Brevo.AddSubscriptionToTierResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Manually assigns a tier to a specific membership. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.AddSubscriptionToTierRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.getListOfTierGroups({ ...params }) -> Brevo.GetListOfTierGroupsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the list of tier groups defined within the loyalty program. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.getListOfTierGroups({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetListOfTierGroupsRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.createTierGroup({ ...params }) -> Brevo.TierGroup +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new tier group in a loyalty program. *(The changes will take effect with the next publication of the loyalty program)* +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.createTierGroup({ + pid: "pid", + name: "name" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateTierGroupRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.getTierGroup({ ...params }) -> Brevo.TierGroup +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns tier group information. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.getTierGroup({ + pid: "pid", + gid: "gid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetTierGroupRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.updateTierGroup({ ...params }) -> Brevo.TierGroup +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a tier group from a loyalty program. *(The changes will take effect with the next publication of the loyalty program)* +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.updateTierGroup({ + pid: "pid", + gid: "gid", + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder"], + upgradeStrategy: "real_time" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateTierGroupRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.deleteTierGroup({ ...params }) -> string +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a tier group from a loyalty program. *(The changes will take effect with the next publication of the loyalty program)* +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.deleteTierGroup({ + pid: "pid", + gid: "gid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteTierGroupRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.createTierForTierGroup({ ...params }) -> Brevo.Tier +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new tier in a loyalty program tier group. *(The changes will take effect with the next publication of the loyalty program)* +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.createTierForTierGroup({ + pid: "pid", + gid: "gid", + accessConditions: [{}], + name: "name" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateTierForTierGroupRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.getLoyaltyProgramTier({ ...params }) -> Brevo.GetLoyaltyProgramTierResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the list of tiers defined within the loyalty program. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.getLoyaltyProgramTier({ + pid: "pid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetLoyaltyProgramTierRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.updateTier({ ...params }) -> Brevo.Tier +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Modifies an existing tier for the specified tier group *(The changes will take effect with the next publication of the loyalty program)* +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.updateTier({ + pid: "pid", + tid: "tid", + accessConditions: [{}], + name: "name", + tierRewards: [{}] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateTierRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tier.deleteTier({ ...params }) -> string +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes a tier from a loyalty program tier group. *(The changes will take effect with the next publication of the loyalty program)* +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tier.deleteTier({ + pid: "pid", + tid: "tid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteTierRequest` + +
+
+ +
+
+ +**requestOptions:** `TierClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## EmailCampaigns +
client.emailCampaigns.getEmailCampaigns({ ...params }) -> Brevo.GetEmailCampaignsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +The response payload for this endpoint has changed + +You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.getEmailCampaigns(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetEmailCampaignsRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.createEmailCampaign({ ...params }) -> Brevo.CreateEmailCampaignResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.createEmailCampaign({ + name: "Newsletter - May 2017", + sender: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateEmailCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.uploadImageToGallery({ ...params }) -> Brevo.UploadImageToGalleryResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.uploadImageToGallery({ + imageUrl: "https://somedomain.com/image1.jpg" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UploadImageToGalleryRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.getEmailCampaign({ ...params }) -> Brevo.GetEmailCampaignResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.getEmailCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetEmailCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.updateEmailCampaign({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.updateEmailCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateEmailCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.deleteEmailCampaign({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.deleteEmailCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteEmailCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.getAbTestCampaignResult({ ...params }) -> Brevo.GetAbTestCampaignResultResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Obtain winning version of an A/B test email campaign +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.getAbTestCampaignResult({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetAbTestCampaignResultRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.emailExportRecipients({ ...params }) -> Brevo.EmailExportRecipientsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.emailExportRecipients({ + campaignId: 1000000, + recipientsType: "all" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.EmailExportRecipientsRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.sendEmailCampaignNow({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.sendEmailCampaignNow({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendEmailCampaignNowRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.sendReport({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A PDF will be sent to the specified email addresses +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.sendReport({ + campaignId: 1000000, + body: { + email: { + body: "Please find attached the report of our last email campaign.", + to: ["jim.suehan@example.com"] + } + } +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendReportRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.sendTestEmail({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.sendTestEmail({ + campaignId: 1000000, + body: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendTestEmailRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.getSharedTemplateUrl({ ...params }) -> Brevo.GetSharedTemplateUrlResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a unique URL to share & import an email template from one Brevo account to another. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.getSharedTemplateUrl({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSharedTemplateUrlRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.emailCampaigns.updateCampaignStatus({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.updateCampaignStatus({ + campaignId: 1000000, + body: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateCampaignStatusRequest` + +
+
+ +
+
+ +**requestOptions:** `EmailCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## SmsCampaigns +
client.smsCampaigns.getSmsCampaigns({ ...params }) -> Brevo.GetSmsCampaignsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.getSmsCampaigns(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSmsCampaignsRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.createSmsCampaign({ ...params }) -> Brevo.CreateSmsCampaignResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.createSmsCampaign({ + content: "Get a discount by visiting our NY store and saying : Happy Spring!", + name: "Spring Promo Code", + sender: "MyShop" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateSmsCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.getSmsCampaign({ ...params }) -> Brevo.GetSmsCampaignResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.getSmsCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSmsCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.updateSmsCampaign({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.updateSmsCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateSmsCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.deleteSmsCampaign({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.deleteSmsCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteSmsCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.requestSmsRecipientExport({ ...params }) -> Brevo.RequestSmsRecipientExportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +It returns the background process ID which on completion calls the notify URL that you have set in the input. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.requestSmsRecipientExport({ + campaignId: 1000000, + recipientsType: "all" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.RequestSmsRecipientExportRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.sendSmsCampaignNow({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.sendSmsCampaignNow({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendSmsCampaignNowRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.sendSmsReport({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.sendSmsReport({ + campaignId: 1000000, + body: { + email: { + body: "Please find attached the report of our last email campaign.", + to: ["jim.suehan@example.com"] + } + } +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendSmsReportRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.sendTestSms({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.sendTestSms({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendTestSmsRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.smsCampaigns.updateSmsCampaignStatus({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsCampaigns.updateSmsCampaignStatus({ + campaignId: 1000000, + body: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateSmsCampaignStatusRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## WhatsAppCampaigns +
client.whatsAppCampaigns.getWhatsAppCampaigns({ ...params }) -> Brevo.GetWhatsAppCampaignsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.getWhatsAppCampaigns(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetWhatsAppCampaignsRequest` + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.whatsAppCampaigns.createWhatsAppCampaign({ ...params }) -> Brevo.CreateWhatsAppCampaignResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + + + +This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. + +[Get all the Lists](https://developers.brevo.com/reference/getlists-1) + +[Get all the Segments](https://developers.brevo.com/reference/getsegments) + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.createWhatsAppCampaign({ + name: "Test Campaign", + recipients: {}, + scheduledAt: "2017-06-01T12:30:00+02:00", + templateId: 19 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateWhatsAppCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.whatsAppCampaigns.getWhatsAppConfig() -> Brevo.GetWhatsAppConfigResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.getWhatsAppConfig(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.whatsAppCampaigns.createWhatsAppTemplate({ ...params }) -> Brevo.CreateWhatsAppTemplateResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.createWhatsAppTemplate({ + bodyText: "making it look like readable English", + category: "MARKETING", + language: "en", + name: "Test template" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateWhatsAppTemplateRequest` + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.whatsAppCampaigns.getWhatsAppTemplates({ ...params }) -> Brevo.GetWhatsAppTemplatesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.getWhatsAppTemplates(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetWhatsAppTemplatesRequest` + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.whatsAppCampaigns.sendWhatsAppTemplateApproval({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.sendWhatsAppTemplateApproval({ + templateId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendWhatsAppTemplateApprovalRequest` + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.whatsAppCampaigns.getWhatsAppCampaign({ ...params }) -> Brevo.GetWhatsAppCampaignResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.getWhatsAppCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetWhatsAppCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.whatsAppCampaigns.updateWhatsAppCampaign({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + + + +This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. + +[Get all the Lists](https://developers.brevo.com/reference/getlists-1) + +[Get all the Segments](https://developers.brevo.com/reference/getsegments) + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.updateWhatsAppCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateWhatsAppCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.whatsAppCampaigns.deleteWhatsAppCampaign({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.whatsAppCampaigns.deleteWhatsAppCampaign({ + campaignId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteWhatsAppCampaignRequest` + +
+
+ +
+
+ +**requestOptions:** `WhatsAppCampaignsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Companies +
client.companies.getAllCompanies({ ...params }) -> Brevo.GetCompaniesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.getAllCompanies(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCompaniesRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.createACompany({ ...params }) -> Brevo.PostCompaniesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.createACompany({ + name: "company" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCompaniesRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.importCompaniesCreationAndUpdation({ ...params }) -> Brevo.PostCompaniesImportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Import companies from a CSV file with mapping options. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.importCompaniesCreationAndUpdation({}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCompaniesImportRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.linkAndUnlinkCompanyWithContactAndDeal({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.linkAndUnlinkCompanyWithContactAndDeal({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PatchCompaniesLinkUnlinkIdRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.getACompany({ ...params }) -> Brevo.Company +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.getACompany({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCompaniesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.deleteACompany({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.deleteACompany({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCompaniesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.updateACompany({ ...params }) -> Brevo.Company +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.updateACompany({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PatchCompaniesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.createACompanyDealAttribute({ ...params }) -> Brevo.PostCrmAttributesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.createACompanyDealAttribute({ + attributeType: "text", + label: "Attribute Label", + objectType: "companies" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCrmAttributesRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.getCompanyAttributes() -> Brevo.GetCrmAttributesCompaniesResponseItem[] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.getCompanyAttributes(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Deals +
client.deals.getDealAttributes() -> Brevo.GetCrmAttributesDealsResponseItem[] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.getDealAttributes(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.getAllDeals({ ...params }) -> Brevo.GetCrmDealsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.getAllDeals(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmDealsRequest` + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.createADeal({ ...params }) -> Brevo.PostCrmDealsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.createADeal({ + name: "Deal: Connect with company" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCrmDealsRequest` + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.importDealsCreationAndUpdation({ ...params }) -> Brevo.PostCrmDealsImportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Import deals from a CSV file with mapping options. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.importDealsCreationAndUpdation({}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCrmDealsImportRequest` + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.linkAndUnlinkADealWithContactsAndCompanies({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.linkAndUnlinkADealWithContactsAndCompanies({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PatchCrmDealsLinkUnlinkIdRequest` + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.getADeal({ ...params }) -> Brevo.Deal +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.getADeal({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmDealsIdRequest` + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.deleteADeal({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.deleteADeal({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCrmDealsIdRequest` + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.updateADeal({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.updateADeal({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PatchCrmDealsIdRequest` + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.getPipelineStages() -> Brevo.Pipeline +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.getPipelineStages(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.getAllPipelines() -> Brevo.Pipelines +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.getAllPipelines(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.deals.getAPipeline({ ...params }) -> Brevo.Pipelines +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.deals.getAPipeline({ + pipelineID: "pipelineID" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmPipelineDetailsPipelineIdRequest` + +
+
+ +
+
+ +**requestOptions:** `DealsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Files +
client.files.getAllFiles({ ...params }) -> Brevo.FileData[] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.files.getAllFiles(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmFilesRequest` + +
+
+ +
+
+ +**requestOptions:** `FilesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.files.uploadAFile({ ...params }) -> Brevo.FileData +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.files.uploadAFile({ + file: fs.createReadStream("/path/to/your/file") +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCrmFilesRequest` + +
+
+ +
+
+ +**requestOptions:** `FilesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.files.downloadAFile({ ...params }) -> Brevo.GetCrmFilesIdResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.files.downloadAFile({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmFilesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `FilesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.files.deleteAFile({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.files.deleteAFile({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCrmFilesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `FilesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.files.getFileDetails({ ...params }) -> Brevo.FileData +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.files.getFileDetails({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmFilesIdDataRequest` + +
+
+ +
+
+ +**requestOptions:** `FilesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Notes +
client.notes.getAllNotes({ ...params }) -> Brevo.Note[] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.notes.getAllNotes(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmNotesRequest` + +
+
+ +
+
+ +**requestOptions:** `NotesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.notes.createANote({ ...params }) -> Brevo.PostCrmNotesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.notes.createANote({ + text: "In communication with client_dev for resolution of queries." +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.NoteData` + +
+
+ +
+
+ +**requestOptions:** `NotesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.notes.getANote({ ...params }) -> Brevo.Note +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.notes.getANote({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmNotesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `NotesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.notes.deleteANote({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.notes.deleteANote({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCrmNotesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `NotesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.notes.updateANote({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.notes.updateANote({ + id: "id", + body: { + text: "In communication with client_dev for resolution of queries." + } +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PatchCrmNotesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `NotesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## Tasks +
client.tasks.getAllTasks({ ...params }) -> Brevo.GetCrmTasksResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tasks.getAllTasks({ + sortBy: "name" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmTasksRequest` + +
+
+ +
+
+ +**requestOptions:** `TasksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tasks.createATask({ ...params }) -> Brevo.PostCrmTasksResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tasks.createATask({ + date: "2021-11-01T17:44:54Z", + name: "Task: Connect with client_dev", + taskTypeId: "61a5cd07ca1347c82306ad09" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PostCrmTasksRequest` + +
+
+ +
+
+ +**requestOptions:** `TasksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tasks.getATask({ ...params }) -> Brevo.Task +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tasks.getATask({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetCrmTasksIdRequest` + +
+
+ +
+
+ +**requestOptions:** `TasksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tasks.deleteATask({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tasks.deleteATask({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCrmTasksIdRequest` + +
+
+ +
+
+ +**requestOptions:** `TasksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tasks.updateATask({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tasks.updateATask({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PatchCrmTasksIdRequest` + +
+
+ +
+
+ +**requestOptions:** `TasksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.tasks.getAllTaskTypes() -> Brevo.GetCrmTasktypesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.tasks.getAllTaskTypes(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `TasksClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## TransactionalWhatsApp +
client.transactionalWhatsApp.sendWhatsappMessage({ ...params }) -> Brevo.SendWhatsappMessageResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalWhatsApp.sendWhatsappMessage({ + contactNumbers: ["contactNumbers"], + senderNumber: "senderNumber", + templateId: 123 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendWhatsappMessageRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalWhatsAppClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalWhatsApp.getWhatsappEventReport({ ...params }) -> Brevo.GetWhatsappEventReportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will show the unaggregated statistics for WhatsApp activity (30 days by default if `startDate` and `endDate` or `days` is not passed. The date range can not exceed 90 days) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalWhatsApp.getWhatsappEventReport(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetWhatsappEventReportRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalWhatsAppClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## TransactionalEmails +
client.transactionalEmails.getTransacBlockedContacts({ ...params }) -> Brevo.GetTransacBlockedContactsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getTransacBlockedContacts(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetTransacBlockedContactsRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.unblockOrResubscribeATransactionalContact({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.unblockOrResubscribeATransactionalContact({ + email: "email" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteSmtpBlockedContactsEmailRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getBlockedDomains() -> Brevo.GetBlockedDomainsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the list of blocked domains +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getBlockedDomains(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.blockNewDomain({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Blocks a new domain in order to avoid messages being sent to the same +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.blockNewDomain({ + domain: "example.com" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.BlockNewDomainRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.deleteBlockedDomain({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Unblocks an existing domain from the list of blocked domains +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.deleteBlockedDomain({ + domain: "domain" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteBlockedDomainRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.deleteHardbounces({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.deleteHardbounces(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteHardbouncesRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.sendTransacEmail({ ...params }) -> Brevo.SendTransacEmailResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.sendTransacEmail({ + htmlContent: "

Hello,

This is my first transactional email sent from Brevo.

", + sender: { + email: "hello@brevo.com", + name: "Alex from Brevo" + }, + subject: "Hello from Brevo!", + to: [{ + email: "johndoe@example.com", + name: "John Doe" + }] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendTransacEmailRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.deleteScheduledEmailById({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete scheduled batch of emails by batchId or single scheduled email by messageId +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.deleteScheduledEmailById({ + identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteScheduledEmailByIdRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getScheduledEmailById({ ...params }) -> Brevo.GetScheduledEmailByIdResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Fetch scheduled batch of emails by batchId or single scheduled email by messageId (Can retrieve data upto 30 days old) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getScheduledEmailById({ + identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", + startDate: "2022-02-02", + endDate: "2022-03-02" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetScheduledEmailByIdRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getTransacEmailsList({ ...params }) -> Brevo.GetTransacEmailsListResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getTransacEmailsList(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetTransacEmailsListRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getTransacEmailContent({ ...params }) -> Brevo.GetTransacEmailContentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +You can get the uuid using either of the following methods: + +Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response. + +The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getTransacEmailContent({ + uuid: "uuid" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetTransacEmailContentRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.deleteAnSmtpTransactionalLog({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.deleteAnSmtpTransactionalLog({ + identifier: "identifier" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteSmtpLogIdentifierRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getAggregatedSmtpReport({ ...params }) -> Brevo.GetAggregatedSmtpReportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getAggregatedSmtpReport(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetAggregatedSmtpReportRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getEmailEventReport({ ...params }) -> Brevo.GetEmailEventReportResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getEmailEventReport(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetEmailEventReportRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getSmtpReport({ ...params }) -> Brevo.GetSmtpReportResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getSmtpReport(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSmtpReportRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.postPreviewSmtpEmailTemplates({ ...params }) -> Brevo.PostPreviewSmtpEmailTemplatesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.postPreviewSmtpEmailTemplates({ + "key": "value" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `unknown` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getSmtpTemplates({ ...params }) -> Brevo.GetSmtpTemplatesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getSmtpTemplates(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSmtpTemplatesRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.createSmtpTemplate({ ...params }) -> Brevo.CreateSmtpTemplateResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.createSmtpTemplate({ + sender: {}, + subject: "Thanks for your purchase !", + templateName: "Order Confirmation - EN" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateSmtpTemplateRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.getSmtpTemplate({ ...params }) -> Brevo.GetSmtpTemplateOverview +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.getSmtpTemplate({ + templateId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSmtpTemplateRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.updateSmtpTemplate({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.updateSmtpTemplate({ + templateId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.UpdateSmtpTemplateRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.deleteSmtpTemplate({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.deleteSmtpTemplate({ + templateId: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteSmtpTemplateRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalEmails.sendTestTemplate({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalEmails.sendTestTemplate({ + templateId: 1000000, + body: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendTestTemplateRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalEmailsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## TransactionalSms +
client.transactionalSms.sendAsyncTransactionalSms({ ...params }) -> Brevo.SendAsyncTransactionalSmsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. + +Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. + + + +Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalSms.sendAsyncTransactionalSms({ + recipient: "33689965433", + sender: "MyShop" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendTransacSms` + +
+
+ +
+
+ +**requestOptions:** `TransactionalSmsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalSms.sendTransacSms({ ...params }) -> Brevo.SendTransacSmsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalSms.sendTransacSms({ + recipient: "33689965433", + sender: "MyShop" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.SendTransacSms` + +
+
+ +
+
+ +**requestOptions:** `TransactionalSmsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalSms.getTransacAggregatedSmsReport({ ...params }) -> Brevo.GetTransacAggregatedSmsReportResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalSms.getTransacAggregatedSmsReport(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetTransacAggregatedSmsReportRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalSmsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalSms.getSmsEvents({ ...params }) -> Brevo.GetSmsEventsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalSms.getSmsEvents(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSmsEventsRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalSmsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.transactionalSms.getTransacSmsReport({ ...params }) -> Brevo.GetTransacSmsReportResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transactionalSms.getTransacSmsReport(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetTransacSmsReportRequest` + +
+
+ +
+
+ +**requestOptions:** `TransactionalSmsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## SmsTemplates +
client.smsTemplates.getSmsTemplates({ ...params }) -> Brevo.GetSmsTemplatesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.smsTemplates.getSmsTemplates(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetSmsTemplatesRequest` + +
+
+ +
+
+ +**requestOptions:** `SmsTemplatesClient.RequestOptions` + +
+
+
+
+ + +
+
+
diff --git a/requestCompat.ts b/requestCompat.ts deleted file mode 100644 index 306c9aa..0000000 --- a/requestCompat.ts +++ /dev/null @@ -1,138 +0,0 @@ -import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'; -import { IncomingMessage as HttpIncomingMessage } from 'http'; - -// Type for request options (partial, for compatibility) -export interface RequestOptions { - method?: string; - url?: string; - uri?: string; // For backward compatibility - params?: any; - headers?: any; - data?: any; - form?: any; - formData?: any; - useQuerystring?: boolean; - json?: boolean; - body?: any; - auth?: { - username: string; - password: string; - }; - qs?: any; - encoding?: any; -} - -// Create a proper IncomingMessage that extends the Node.js interface -export class IncomingMessage extends HttpIncomingMessage { - statusCode?: number; - statusMessage?: string; - - constructor(res: AxiosResponse) { - // Create a mock socket for the IncomingMessage - const mockSocket = { - remoteAddress: '', - remoteFamily: '', - remotePort: 0, - localAddress: '', - localPort: 0, - bytesRead: 0, - bytesWritten: 0, - connecting: false, - destroyed: false, - readable: true, - writable: false, - allowHalfOpen: false, - timeout: 0, - setKeepAlive: () => {}, - setNoDelay: () => {}, - setTimeout: () => {}, - unref: () => {}, - ref: () => {}, - cork: () => {}, - uncork: () => {}, - destroy: () => {}, - pause: () => {}, - resume: () => {}, - write: () => false, - end: () => {}, - on: () => {}, - once: () => {}, - emit: () => false, - addListener: () => {}, - removeListener: () => {}, - removeAllListeners: () => {}, - setMaxListeners: () => {}, - getMaxListeners: () => 0, - listeners: () => [], - rawListeners: () => [], - listenerCount: () => 0, - prependListener: () => {}, - prependOnceListener: () => {}, - eventNames: () => [], - } as any; - - super(mockSocket); - - this.statusCode = res.status; - this.statusMessage = res.statusText; - this.headers = res.headers as any; - - // Set up the response body - const responseData = res.data; - if (typeof responseData === 'string') { - this.push(responseData); - } else if (responseData) { - this.push(JSON.stringify(responseData)); - } - this.push(null); // End the stream - } -} - -// Main compatibility function -function request(options: RequestOptions, callback: (error: any, response: IncomingMessage, body: any) => void) { - // Convert to axios config - const axiosConfig: AxiosRequestConfig = { - method: options.method?.toLowerCase() as any, - url: options.url || options.uri, - params: options.params || options.qs, - headers: options.headers, - data: options.data || options.body, - auth: options.auth, - }; - - // Handle form/formData - if (options.form) { - axiosConfig.headers = axiosConfig.headers || {}; - axiosConfig.headers['Content-Type'] = 'application/x-www-form-urlencoded'; - axiosConfig.data = new URLSearchParams(options.form).toString(); - } else if (options.formData) { - axiosConfig.headers = axiosConfig.headers || {}; - axiosConfig.headers['Content-Type'] = 'multipart/form-data'; - axiosConfig.data = options.formData; - } - - // Handle json option - if (options.json) { - axiosConfig.headers = axiosConfig.headers || {}; - axiosConfig.headers['Content-Type'] = 'application/json'; - if (typeof axiosConfig.data === 'object' && axiosConfig.data !== null) { - axiosConfig.data = JSON.stringify(axiosConfig.data); - } - } - - axios(axiosConfig) - .then((response: AxiosResponse) => { - const incomingMessage = new IncomingMessage(response); - callback(null, incomingMessage, response.data); - }) - .catch((error: AxiosError) => { - if (error.response) { - const incomingMessage = new IncomingMessage(error.response); - callback(error, incomingMessage, error.response.data); - } else { - callback(error, null as any, null); - } - }); -} - -export default request; \ No newline at end of file diff --git a/scripts/rename-to-esm-files.js b/scripts/rename-to-esm-files.js new file mode 100644 index 0000000..dc1df1c --- /dev/null +++ b/scripts/rename-to-esm-files.js @@ -0,0 +1,123 @@ +#!/usr/bin/env node + +const fs = require("fs").promises; +const path = require("path"); + +const extensionMap = { + ".js": ".mjs", + ".d.ts": ".d.mts", +}; +const oldExtensions = Object.keys(extensionMap); + +async function findFiles(rootPath) { + const files = []; + + async function scan(directory) { + const entries = await fs.readdir(directory, { withFileTypes: true }); + + for (const entry of entries) { + const fullPath = path.join(directory, entry.name); + + if (entry.isDirectory()) { + if (entry.name !== "node_modules" && !entry.name.startsWith(".")) { + await scan(fullPath); + } + } else if (entry.isFile()) { + if (oldExtensions.some((ext) => entry.name.endsWith(ext))) { + files.push(fullPath); + } + } + } + } + + await scan(rootPath); + return files; +} + +async function updateFiles(files) { + const updatedFiles = []; + for (const file of files) { + const updated = await updateFileContents(file); + updatedFiles.push(updated); + } + + console.log(`Updated imports in ${updatedFiles.length} files.`); +} + +async function updateFileContents(file) { + const content = await fs.readFile(file, "utf8"); + + let newContent = content; + // Update each extension type defined in the map + for (const [oldExt, newExt] of Object.entries(extensionMap)) { + // Handle static imports/exports + const staticRegex = new RegExp(`(import|export)(.+from\\s+['"])(\\.\\.?\\/[^'"]+)(\\${oldExt})(['"])`, "g"); + newContent = newContent.replace(staticRegex, `$1$2$3${newExt}$5`); + + // Handle dynamic imports (yield import, await import, regular import()) + const dynamicRegex = new RegExp( + `(yield\\s+import|await\\s+import|import)\\s*\\(\\s*['"](\\.\\.\?\\/[^'"]+)(\\${oldExt})['"]\\s*\\)`, + "g", + ); + newContent = newContent.replace(dynamicRegex, `$1("$2${newExt}")`); + } + + if (content !== newContent) { + await fs.writeFile(file, newContent, "utf8"); + return true; + } + return false; +} + +async function renameFiles(files) { + let counter = 0; + for (const file of files) { + const ext = oldExtensions.find((ext) => file.endsWith(ext)); + const newExt = extensionMap[ext]; + + if (newExt) { + const newPath = file.slice(0, -ext.length) + newExt; + await fs.rename(file, newPath); + counter++; + } + } + + console.log(`Renamed ${counter} files.`); +} + +async function main() { + try { + const targetDir = process.argv[2]; + if (!targetDir) { + console.error("Please provide a target directory"); + process.exit(1); + } + + const targetPath = path.resolve(targetDir); + const targetStats = await fs.stat(targetPath); + + if (!targetStats.isDirectory()) { + console.error("The provided path is not a directory"); + process.exit(1); + } + + console.log(`Scanning directory: ${targetDir}`); + + const files = await findFiles(targetDir); + + if (files.length === 0) { + console.log("No matching files found."); + process.exit(0); + } + + console.log(`Found ${files.length} files.`); + await updateFiles(files); + await renameFiles(files); + console.log("\nDone!"); + } catch (error) { + console.error("An error occurred:", error.message); + process.exit(1); + } +} + +main(); diff --git a/src/BaseClient.ts b/src/BaseClient.ts new file mode 100644 index 0000000..7f18c42 --- /dev/null +++ b/src/BaseClient.ts @@ -0,0 +1,85 @@ +// This file was auto-generated by Fern from our API Definition. + +import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.js"; +import { mergeHeaders } from "./core/headers.js"; +import * as core from "./core/index.js"; +import type * as environments from "./environments.js"; + +export type BaseClientOptions = { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + /** Additional headers to include in requests. */ + headers?: Record | null | undefined>; + /** The default maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The default number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */ + fetch?: typeof fetch; + /** Configure logging for the client. */ + logging?: core.logging.LogConfig | core.logging.Logger; +} & HeaderAuthProvider.AuthOptions; + +export interface BaseRequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional query string parameters to include in the request. */ + queryParams?: Record; + /** Additional headers to include in the request. */ + headers?: Record | null | undefined>; +} + +export type NormalizedClientOptions = T & { + logging: core.logging.Logger; + authProvider?: core.AuthProvider; +}; + +export type NormalizedClientOptionsWithAuth = + NormalizedClientOptions & { + authProvider: core.AuthProvider; + }; + +export function normalizeClientOptions( + options: T, +): NormalizedClientOptions { + const headers = mergeHeaders( + { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "", + "X-Fern-SDK-Version": "0.0.52", + "User-Agent": "/0.0.52", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + options?.headers, + ); + + return { + ...options, + logging: core.logging.createLogger(options?.logging), + headers, + } as NormalizedClientOptions; +} + +export function normalizeClientOptionsWithAuth( + options: T, +): NormalizedClientOptionsWithAuth { + const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth; + const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized); + normalized.authProvider ??= new HeaderAuthProvider(normalizedWithNoOpAuthProvider); + return normalized; +} + +function withNoOpAuthProvider( + options: NormalizedClientOptions, +): NormalizedClientOptionsWithAuth { + return { + ...options, + authProvider: new core.NoOpAuthProvider(), + }; +} diff --git a/src/Client.ts b/src/Client.ts new file mode 100644 index 0000000..40bf938 --- /dev/null +++ b/src/Client.ts @@ -0,0 +1,210 @@ +// This file was auto-generated by Fern from our API Definition. + +import { AccountClient } from "./api/resources/account/client/Client.js"; +import { BalanceClient } from "./api/resources/balance/client/Client.js"; +import { CompaniesClient } from "./api/resources/companies/client/Client.js"; +import { ContactsClient } from "./api/resources/contacts/client/Client.js"; +import { ConversationsClient } from "./api/resources/conversations/client/Client.js"; +import { CouponsClient } from "./api/resources/coupons/client/Client.js"; +import { CustomObjectsClient } from "./api/resources/customObjects/client/Client.js"; +import { DealsClient } from "./api/resources/deals/client/Client.js"; +import { DomainsClient } from "./api/resources/domains/client/Client.js"; +import { EcommerceClient } from "./api/resources/ecommerce/client/Client.js"; +import { EmailCampaignsClient } from "./api/resources/emailCampaigns/client/Client.js"; +import { EventClient } from "./api/resources/event/client/Client.js"; +import { ExternalFeedsClient } from "./api/resources/externalFeeds/client/Client.js"; +import { FilesClient } from "./api/resources/files/client/Client.js"; +import { InboundParsingClient } from "./api/resources/inboundParsing/client/Client.js"; +import { MasterAccountClient } from "./api/resources/masterAccount/client/Client.js"; +import { NotesClient } from "./api/resources/notes/client/Client.js"; +import { PaymentsClient } from "./api/resources/payments/client/Client.js"; +import { ProcessClient } from "./api/resources/process/client/Client.js"; +import { ProgramClient } from "./api/resources/program/client/Client.js"; +import { RewardClient } from "./api/resources/reward/client/Client.js"; +import { SendersClient } from "./api/resources/senders/client/Client.js"; +import { SmsCampaignsClient } from "./api/resources/smsCampaigns/client/Client.js"; +import { SmsTemplatesClient } from "./api/resources/smsTemplates/client/Client.js"; +import { TasksClient } from "./api/resources/tasks/client/Client.js"; +import { TierClient } from "./api/resources/tier/client/Client.js"; +import { TransactionalEmailsClient } from "./api/resources/transactionalEmails/client/Client.js"; +import { TransactionalSmsClient } from "./api/resources/transactionalSms/client/Client.js"; +import { TransactionalWhatsAppClient } from "./api/resources/transactionalWhatsApp/client/Client.js"; +import { UserClient } from "./api/resources/user/client/Client.js"; +import { WebhooksClient } from "./api/resources/webhooks/client/Client.js"; +import { WhatsAppCampaignsClient } from "./api/resources/whatsAppCampaigns/client/Client.js"; +import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient.js"; + +export declare namespace BrevoClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class BrevoClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + protected _account: AccountClient | undefined; + protected _masterAccount: MasterAccountClient | undefined; + protected _user: UserClient | undefined; + protected _process: ProcessClient | undefined; + protected _senders: SendersClient | undefined; + protected _domains: DomainsClient | undefined; + protected _webhooks: WebhooksClient | undefined; + protected _externalFeeds: ExternalFeedsClient | undefined; + protected _customObjects: CustomObjectsClient | undefined; + protected _contacts: ContactsClient | undefined; + protected _conversations: ConversationsClient | undefined; + protected _ecommerce: EcommerceClient | undefined; + protected _coupons: CouponsClient | undefined; + protected _payments: PaymentsClient | undefined; + protected _event: EventClient | undefined; + protected _inboundParsing: InboundParsingClient | undefined; + protected _balance: BalanceClient | undefined; + protected _program: ProgramClient | undefined; + protected _reward: RewardClient | undefined; + protected _tier: TierClient | undefined; + protected _emailCampaigns: EmailCampaignsClient | undefined; + protected _smsCampaigns: SmsCampaignsClient | undefined; + protected _whatsAppCampaigns: WhatsAppCampaignsClient | undefined; + protected _companies: CompaniesClient | undefined; + protected _deals: DealsClient | undefined; + protected _files: FilesClient | undefined; + protected _notes: NotesClient | undefined; + protected _tasks: TasksClient | undefined; + protected _transactionalWhatsApp: TransactionalWhatsAppClient | undefined; + protected _transactionalEmails: TransactionalEmailsClient | undefined; + protected _transactionalSms: TransactionalSmsClient | undefined; + protected _smsTemplates: SmsTemplatesClient | undefined; + + constructor(options: BrevoClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + public get account(): AccountClient { + return (this._account ??= new AccountClient(this._options)); + } + + public get masterAccount(): MasterAccountClient { + return (this._masterAccount ??= new MasterAccountClient(this._options)); + } + + public get user(): UserClient { + return (this._user ??= new UserClient(this._options)); + } + + public get process(): ProcessClient { + return (this._process ??= new ProcessClient(this._options)); + } + + public get senders(): SendersClient { + return (this._senders ??= new SendersClient(this._options)); + } + + public get domains(): DomainsClient { + return (this._domains ??= new DomainsClient(this._options)); + } + + public get webhooks(): WebhooksClient { + return (this._webhooks ??= new WebhooksClient(this._options)); + } + + public get externalFeeds(): ExternalFeedsClient { + return (this._externalFeeds ??= new ExternalFeedsClient(this._options)); + } + + public get customObjects(): CustomObjectsClient { + return (this._customObjects ??= new CustomObjectsClient(this._options)); + } + + public get contacts(): ContactsClient { + return (this._contacts ??= new ContactsClient(this._options)); + } + + public get conversations(): ConversationsClient { + return (this._conversations ??= new ConversationsClient(this._options)); + } + + public get ecommerce(): EcommerceClient { + return (this._ecommerce ??= new EcommerceClient(this._options)); + } + + public get coupons(): CouponsClient { + return (this._coupons ??= new CouponsClient(this._options)); + } + + public get payments(): PaymentsClient { + return (this._payments ??= new PaymentsClient(this._options)); + } + + public get event(): EventClient { + return (this._event ??= new EventClient(this._options)); + } + + public get inboundParsing(): InboundParsingClient { + return (this._inboundParsing ??= new InboundParsingClient(this._options)); + } + + public get balance(): BalanceClient { + return (this._balance ??= new BalanceClient(this._options)); + } + + public get program(): ProgramClient { + return (this._program ??= new ProgramClient(this._options)); + } + + public get reward(): RewardClient { + return (this._reward ??= new RewardClient(this._options)); + } + + public get tier(): TierClient { + return (this._tier ??= new TierClient(this._options)); + } + + public get emailCampaigns(): EmailCampaignsClient { + return (this._emailCampaigns ??= new EmailCampaignsClient(this._options)); + } + + public get smsCampaigns(): SmsCampaignsClient { + return (this._smsCampaigns ??= new SmsCampaignsClient(this._options)); + } + + public get whatsAppCampaigns(): WhatsAppCampaignsClient { + return (this._whatsAppCampaigns ??= new WhatsAppCampaignsClient(this._options)); + } + + public get companies(): CompaniesClient { + return (this._companies ??= new CompaniesClient(this._options)); + } + + public get deals(): DealsClient { + return (this._deals ??= new DealsClient(this._options)); + } + + public get files(): FilesClient { + return (this._files ??= new FilesClient(this._options)); + } + + public get notes(): NotesClient { + return (this._notes ??= new NotesClient(this._options)); + } + + public get tasks(): TasksClient { + return (this._tasks ??= new TasksClient(this._options)); + } + + public get transactionalWhatsApp(): TransactionalWhatsAppClient { + return (this._transactionalWhatsApp ??= new TransactionalWhatsAppClient(this._options)); + } + + public get transactionalEmails(): TransactionalEmailsClient { + return (this._transactionalEmails ??= new TransactionalEmailsClient(this._options)); + } + + public get transactionalSms(): TransactionalSmsClient { + return (this._transactionalSms ??= new TransactionalSmsClient(this._options)); + } + + public get smsTemplates(): SmsTemplatesClient { + return (this._smsTemplates ??= new SmsTemplatesClient(this._options)); + } +} diff --git a/src/api/errors/BadRequestError.ts b/src/api/errors/BadRequestError.ts new file mode 100644 index 0000000..ac1541d --- /dev/null +++ b/src/api/errors/BadRequestError.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; + +export class BadRequestError extends errors.BrevoError { + constructor(body?: unknown, rawResponse?: core.RawResponse) { + super({ + message: "BadRequestError", + statusCode: 400, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/ConflictError.ts b/src/api/errors/ConflictError.ts new file mode 100644 index 0000000..3b42f2b --- /dev/null +++ b/src/api/errors/ConflictError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class ConflictError extends errors.BrevoError { + constructor(body: Brevo.ErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "ConflictError", + statusCode: 409, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/ExpectationFailedError.ts b/src/api/errors/ExpectationFailedError.ts new file mode 100644 index 0000000..8460f90 --- /dev/null +++ b/src/api/errors/ExpectationFailedError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class ExpectationFailedError extends errors.BrevoError { + constructor(body: Brevo.ErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "ExpectationFailedError", + statusCode: 417, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/FailedDependencyError.ts b/src/api/errors/FailedDependencyError.ts new file mode 100644 index 0000000..f0153d8 --- /dev/null +++ b/src/api/errors/FailedDependencyError.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; + +export class FailedDependencyError extends errors.BrevoError { + constructor(body?: unknown, rawResponse?: core.RawResponse) { + super({ + message: "FailedDependencyError", + statusCode: 424, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/ForbiddenError.ts b/src/api/errors/ForbiddenError.ts new file mode 100644 index 0000000..3033c68 --- /dev/null +++ b/src/api/errors/ForbiddenError.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; + +export class ForbiddenError extends errors.BrevoError { + constructor(body?: unknown, rawResponse?: core.RawResponse) { + super({ + message: "ForbiddenError", + statusCode: 403, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/InternalServerError.ts b/src/api/errors/InternalServerError.ts new file mode 100644 index 0000000..5249423 --- /dev/null +++ b/src/api/errors/InternalServerError.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; + +export class InternalServerError extends errors.BrevoError { + constructor(body?: unknown, rawResponse?: core.RawResponse) { + super({ + message: "InternalServerError", + statusCode: 500, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/MethodNotAllowedError.ts b/src/api/errors/MethodNotAllowedError.ts new file mode 100644 index 0000000..b7cc81e --- /dev/null +++ b/src/api/errors/MethodNotAllowedError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class MethodNotAllowedError extends errors.BrevoError { + constructor(body: Brevo.ErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "MethodNotAllowedError", + statusCode: 405, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts new file mode 100644 index 0000000..b9a3919 --- /dev/null +++ b/src/api/errors/NotFoundError.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; + +export class NotFoundError extends errors.BrevoError { + constructor(body?: unknown, rawResponse?: core.RawResponse) { + super({ + message: "NotFoundError", + statusCode: 404, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/PaymentRequiredError.ts b/src/api/errors/PaymentRequiredError.ts new file mode 100644 index 0000000..8950119 --- /dev/null +++ b/src/api/errors/PaymentRequiredError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class PaymentRequiredError extends errors.BrevoError { + constructor(body: Brevo.ErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "PaymentRequiredError", + statusCode: 402, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/PreconditionFailedError.ts b/src/api/errors/PreconditionFailedError.ts new file mode 100644 index 0000000..89799b4 --- /dev/null +++ b/src/api/errors/PreconditionFailedError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class PreconditionFailedError extends errors.BrevoError { + constructor(body: Brevo.ErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "PreconditionFailedError", + statusCode: 412, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/TooEarlyError.ts b/src/api/errors/TooEarlyError.ts new file mode 100644 index 0000000..6463853 --- /dev/null +++ b/src/api/errors/TooEarlyError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class TooEarlyError extends errors.BrevoError { + constructor(body: Brevo.ContactErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "TooEarlyError", + statusCode: 425, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/TooManyRequestsError.ts b/src/api/errors/TooManyRequestsError.ts new file mode 100644 index 0000000..a95e781 --- /dev/null +++ b/src/api/errors/TooManyRequestsError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class TooManyRequestsError extends errors.BrevoError { + constructor(body: Brevo.ErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "TooManyRequestsError", + statusCode: 429, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/UnauthorizedError.ts b/src/api/errors/UnauthorizedError.ts new file mode 100644 index 0000000..b7f109d --- /dev/null +++ b/src/api/errors/UnauthorizedError.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; + +export class UnauthorizedError extends errors.BrevoError { + constructor(body?: unknown, rawResponse?: core.RawResponse) { + super({ + message: "UnauthorizedError", + statusCode: 401, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/UnprocessableEntityError.ts b/src/api/errors/UnprocessableEntityError.ts new file mode 100644 index 0000000..8c0db26 --- /dev/null +++ b/src/api/errors/UnprocessableEntityError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class UnprocessableEntityError extends errors.BrevoError { + constructor(body: Brevo.ErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "UnprocessableEntityError", + statusCode: 422, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/UnsupportedMediaTypeError.ts b/src/api/errors/UnsupportedMediaTypeError.ts new file mode 100644 index 0000000..7cf49e1 --- /dev/null +++ b/src/api/errors/UnsupportedMediaTypeError.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../core/index.js"; +import * as errors from "../../errors/index.js"; +import type * as Brevo from "../index.js"; + +export class UnsupportedMediaTypeError extends errors.BrevoError { + constructor(body: Brevo.ErrorModel, rawResponse?: core.RawResponse) { + super({ + message: "UnsupportedMediaTypeError", + statusCode: 415, + body: body, + rawResponse: rawResponse, + }); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts new file mode 100644 index 0000000..e21ea5f --- /dev/null +++ b/src/api/errors/index.ts @@ -0,0 +1,15 @@ +export * from "./BadRequestError.js"; +export * from "./ConflictError.js"; +export * from "./ExpectationFailedError.js"; +export * from "./FailedDependencyError.js"; +export * from "./ForbiddenError.js"; +export * from "./InternalServerError.js"; +export * from "./MethodNotAllowedError.js"; +export * from "./NotFoundError.js"; +export * from "./PaymentRequiredError.js"; +export * from "./PreconditionFailedError.js"; +export * from "./TooEarlyError.js"; +export * from "./TooManyRequestsError.js"; +export * from "./UnauthorizedError.js"; +export * from "./UnprocessableEntityError.js"; +export * from "./UnsupportedMediaTypeError.js"; diff --git a/src/api/index.ts b/src/api/index.ts new file mode 100644 index 0000000..6ed44b0 --- /dev/null +++ b/src/api/index.ts @@ -0,0 +1,3 @@ +export * from "./errors/index.js"; +export * from "./resources/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/account/client/Client.ts b/src/api/resources/account/client/Client.ts new file mode 100644 index 0000000..883de54 --- /dev/null +++ b/src/api/resources/account/client/Client.ts @@ -0,0 +1,192 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace AccountClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class AccountClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: AccountClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Retrieves details of your Brevo account. + * + * **Use this to:** + * - Get account information (email, name, company, address) + * - Check plan details (type, credits, expiration) + * - Get relay information (for transactional emails) + * - Check Marketing Automation status + * - View date/time preferences and account settings + * - Access organization and user identifiers + * + * **Key information returned:** + * - Complete account details (organization ID, user ID, company information) + * - Address and contact information + * - Plan configurations and credit allocations across different verticals + * - Marketing Automation settings and tracker key + * - SMTP relay configuration for transactional emails + * - Date/time preferences and account settings + * - Enterprise features availability status + * + * **Important considerations:** + * - Provides comprehensive account overview for billing and configuration management + * - Essential for understanding current plan limitations and feature availability + * - Marketing Automation key required for advanced automation features + * - Plan verticals show detailed breakdown across Marketing, Chat, and CRM categories + * - Relay configuration crucial for transactional email setup and deliverability + * - Date/time preferences affect campaign scheduling and reporting displays + * - Enterprise status determines access to advanced features and sub-account management + * + * @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.account.getAccount() + */ + public getAccount( + requestOptions?: AccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAccount(requestOptions)); + } + + private async __getAccount( + requestOptions?: AccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "account", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetAccountResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/account"); + } + + /** + * Retrieves user activity logs from your organization for security monitoring and audit compliance. + * + * Use this to: + * - Monitor user login activities and access patterns + * - Track account modifications and configuration changes + * - Generate security audit reports and compliance documentation + * - Investigate suspicious activities and unauthorized access + * - Monitor team member actions and account usage + * + * Key information returned: + * - Complete user activity details and timestamps + * - User identification (email, IP address, browser) + * - Action types and activity descriptions + * - Security-relevant events and access logs + * - Historical activity data for audit trails + * + * Note: Requires Enterprise plan for access to organization activity logs. + * + * @param {Brevo.GetAccountActivityRequest} request + * @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.account.getAccountActivity() + */ + public getAccountActivity( + request: Brevo.GetAccountActivityRequest = {}, + requestOptions?: AccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAccountActivity(request, requestOptions)); + } + + private async __getAccountActivity( + request: Brevo.GetAccountActivityRequest = {}, + requestOptions?: AccountClient.RequestOptions, + ): Promise> { + const { startDate, endDate, email, limit, offset } = request; + const _queryParams: Record = { + startDate, + endDate, + email, + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "organization/activities", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetAccountActivityResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/organization/activities"); + } +} diff --git a/src/api/resources/account/client/index.ts b/src/api/resources/account/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/account/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/account/client/requests/GetAccountActivityRequest.ts b/src/api/resources/account/client/requests/GetAccountActivityRequest.ts new file mode 100644 index 0000000..0de0517 --- /dev/null +++ b/src/api/resources/account/client/requests/GetAccountActivityRequest.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetAccountActivityRequest { + /** + * Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) + * format to filter the activity in your account. Maximum time period that + * can be selected is one month. Additionally, you can retrieve activity + * logs from the past 12 months from the date of your search. + */ + startDate?: string; + /** + * Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) + * format to filter the activity in your account. Maximum time period that + * can be selected is one month. + */ + endDate?: string; + /** Enter the user's email address to filter their activity in the account. */ + email?: string; + /** Number of documents per page */ + limit?: number; + /** Index of the first document in the page. */ + offset?: number; +} diff --git a/src/api/resources/account/client/requests/index.ts b/src/api/resources/account/client/requests/index.ts new file mode 100644 index 0000000..134aec1 --- /dev/null +++ b/src/api/resources/account/client/requests/index.ts @@ -0,0 +1 @@ +export type { GetAccountActivityRequest } from "./GetAccountActivityRequest.js"; diff --git a/src/api/resources/account/index.ts b/src/api/resources/account/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/account/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/account/types/GetAccountActivityResponse.ts b/src/api/resources/account/types/GetAccountActivityResponse.ts new file mode 100644 index 0000000..96fb4ed --- /dev/null +++ b/src/api/resources/account/types/GetAccountActivityResponse.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetAccountActivityResponse { + /** Get user activity logs */ + logs?: GetAccountActivityResponse.Logs.Item[]; +} + +export namespace GetAccountActivityResponse { + export type Logs = Logs.Item[]; + + export namespace Logs { + export interface Item { + /** Type of activity in the account. */ + action: string; + /** Time of the activity. */ + date: string; + /** Browser details of the user who performed the activity. */ + user_agent: string; + /** + * Email address of the user who performed activity in the + * account. + */ + user_email: string; + /** + * IP address of the user who performed activity in the + * account. + */ + user_ip: string; + } + } +} diff --git a/src/api/resources/account/types/GetAccountResponse.ts b/src/api/resources/account/types/GetAccountResponse.ts new file mode 100644 index 0000000..8da5eb6 --- /dev/null +++ b/src/api/resources/account/types/GetAccountResponse.ts @@ -0,0 +1,182 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetAccountResponse { + /** Unique identifier for the organization */ + organization_id: string; + /** Unique identifier for the user */ + user_id: number; + /** Indicates if the account has enterprise features */ + enterprise: boolean; + /** Name of the company */ + companyName: string; + /** Login Email */ + email: string; + /** First Name */ + firstName: string; + /** Last Name */ + lastName: string; + /** Address informations */ + address: GetAccountResponse.Address; + /** User's date and time preferences */ + dateTimePreferences: GetAccountResponse.DateTimePreferences; + marketingAutomation?: GetAccountResponse.MarketingAutomation; + /** Information about your plans and credits */ + plan: GetAccountResponse.Plan.Item[]; + /** Detailed information about different plan categories */ + planVerticals?: GetAccountResponse.PlanVerticals.Item[]; + /** Information about your transactional email account */ + relay: GetAccountResponse.Relay; +} + +export namespace GetAccountResponse { + /** + * Address informations + */ + export interface Address { + /** City information */ + city: string; + /** Country information */ + country: string; + /** Street information */ + street: string; + /** Zip Code information */ + zipCode: string; + } + + /** + * User's date and time preferences + */ + export interface DateTimePreferences { + /** User's timezone setting */ + timezone: string; + /** Preferred time format (12 or 24 hour) */ + timeFormat: string; + /** Preferred date format */ + dateFormat: string; + } + + export interface MarketingAutomation { + /** + * Status of Marketing Automation Plateform activation + * for your account (true=enabled, false=disabled) + */ + enabled: boolean; + /** Marketing Automation Tracker ID */ + key?: string; + } + + export type Plan = Plan.Item[]; + + export namespace Plan { + export interface Item { + /** Remaining credits of the user */ + credits: number; + /** + * This is the type of the credit, "Send Limit" is one + * of the possible types of credit of a user. "Send + * Limit" implies the total number of emails you can + * send to the subscribers in your account. + */ + creditsType: "sendLimit"; + /** + * Date of the period from which the plan will end + * (Unix timestamp format) + */ + endDate?: string; + /** + * Date of the period from which the plan will start + * (Unix timestamp format) + */ + startDate?: string; + /** Displays the plan type of the user */ + type: Item.Type; + } + + export namespace Item { + /** Displays the plan type of the user */ + export const Type = { + PayAsYouGo: "payAsYouGo", + Free: "free", + Subscription: "subscription", + Sms: "sms", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; + } + } + + export type PlanVerticals = PlanVerticals.Item[]; + + export namespace PlanVerticals { + export interface Item { + /** Category of the plan */ + planCategory: Item.PlanCategory; + /** Type of plan within the category */ + planType: string; + /** Name of the plan */ + name: string; + /** Current status of the plan */ + status: Item.Status; + /** Plan start date (Unix timestamp) */ + startDate: string; + /** Plan end date (Unix timestamp) */ + endDate: string; + /** User seat information for the plan */ + users: Item.Users; + /** Credits allocated for this plan category (optional, may not be present for all plan categories) */ + credits?: string; + } + + export namespace Item { + /** Category of the plan */ + export const PlanCategory = { + Marketing: "Marketing", + Chat: "Chat", + Crm: "CRM", + } as const; + export type PlanCategory = (typeof PlanCategory)[keyof typeof PlanCategory]; + /** Current status of the plan */ + export const Status = { + Active: "active", + Inactive: "inactive", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; + + /** + * User seat information for the plan + */ + export interface Users { + /** Number of purchased user seats */ + purchasedSeats: string; + /** Number of used user seats */ + usedSeats: string; + } + } + } + + /** + * Information about your transactional email account + */ + export interface Relay { + /** Data regarding the transactional email account */ + data: Relay.Data; + /** + * Status of your transactional email Account + * (true=Enabled, false=Disabled) + */ + enabled: boolean; + } + + export namespace Relay { + /** + * Data regarding the transactional email account + */ + export interface Data { + /** Port used for SMTP Relay */ + port: number; + /** URL of the SMTP Relay */ + relay: string; + /** Email to use as login on transactional platform */ + userName: string; + } + } +} diff --git a/src/api/resources/account/types/index.ts b/src/api/resources/account/types/index.ts new file mode 100644 index 0000000..e24bfc1 --- /dev/null +++ b/src/api/resources/account/types/index.ts @@ -0,0 +1,2 @@ +export * from "./GetAccountActivityResponse.js"; +export * from "./GetAccountResponse.js"; diff --git a/src/api/resources/balance/client/Client.ts b/src/api/resources/balance/client/Client.ts new file mode 100644 index 0000000..2b3775f --- /dev/null +++ b/src/api/resources/balance/client/Client.ts @@ -0,0 +1,1707 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace BalanceClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class BalanceClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: BalanceClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Returns Active Balances + * + * @param {Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.getActiveBalancesApi({ + * pid: "pid", + * contact_id: 1, + * balance_definition_id: "balance_definition_id" + * }) + */ + public getActiveBalancesApi( + request: Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getActiveBalancesApi(request, requestOptions)); + } + + private async __getActiveBalancesApi( + request: Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { + pid, + limit, + offset, + sort_field: sortField, + sort, + contact_id: contactId, + balance_definition_id: balanceDefinitionId, + } = request; + const _queryParams: Record = { + limit, + offset, + sort_field: sortField, + sort, + contact_id: contactId, + balance_definition_id: balanceDefinitionId, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/active-balance`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.BalanceLimit, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/balance/programs/{pid}/active-balance", + ); + } + + /** + * Returns balance definition page + * + * @param {Brevo.GetBalanceDefinitionListRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.getBalanceDefinitionList({ + * pid: "pid" + * }) + */ + public getBalanceDefinitionList( + request: Brevo.GetBalanceDefinitionListRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getBalanceDefinitionList(request, requestOptions)); + } + + private async __getBalanceDefinitionList( + request: Brevo.GetBalanceDefinitionListRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, limit, offset, sortField, sort, version } = request; + const _queryParams: Record = { + limit, + offset, + sortField: sortField != null ? sortField : undefined, + sort: sort != null ? sort : undefined, + version: version != null ? version : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetBalanceDefinitionListResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/balance/programs/{pid}/balance-definitions", + ); + } + + /** + * Creates balance definition and returns information + * + * @param {Brevo.PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.createBalanceDefinition({ + * pid: "pid", + * name: "name", + * unit: "POINTS" + * }) + */ + public createBalanceDefinition( + request: Brevo.PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createBalanceDefinition(request, requestOptions)); + } + + private async __createBalanceDefinition( + request: Brevo.PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.BalanceDefinition, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/balance/programs/{pid}/balance-definitions", + ); + } + + /** + * Returns balance definition + * + * @param {Brevo.GetBalanceDefinitionRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.getBalanceDefinition({ + * pid: "pid", + * bdid: "bdid" + * }) + */ + public getBalanceDefinition( + request: Brevo.GetBalanceDefinitionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getBalanceDefinition(request, requestOptions)); + } + + private async __getBalanceDefinition( + request: Brevo.GetBalanceDefinitionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, bdid, version } = request; + const _queryParams: Record = { + version: version != null ? version : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions/${core.url.encodePathParam(bdid)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.BalanceDefinition, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/balance/programs/{pid}/balance-definitions/{bdid}", + ); + } + + /** + * Updates Balance definition + * + * @param {Brevo.UpdateBalanceDefinitionRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.FailedDependencyError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.updateBalanceDefinition({ + * pid: "pid", + * bdid: "bdid", + * name: "name", + * unit: "POINTS" + * }) + */ + public updateBalanceDefinition( + request: Brevo.UpdateBalanceDefinitionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateBalanceDefinition(request, requestOptions)); + } + + private async __updateBalanceDefinition( + request: Brevo.UpdateBalanceDefinitionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, bdid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions/${core.url.encodePathParam(bdid)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.BalanceDefinition, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 424: + throw new Brevo.FailedDependencyError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/loyalty/balance/programs/{pid}/balance-definitions/{bdid}", + ); + } + + /** + * Delete Balance definition + * + * @param {Brevo.DeleteBalanceDefinitionRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.deleteBalanceDefinition({ + * pid: "pid", + * bdid: "bdid" + * }) + */ + public deleteBalanceDefinition( + request: Brevo.DeleteBalanceDefinitionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteBalanceDefinition(request, requestOptions)); + } + + private async __deleteBalanceDefinition( + request: Brevo.DeleteBalanceDefinitionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, bdid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions/${core.url.encodePathParam(bdid)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/balance/programs/{pid}/balance-definitions/{bdid}", + ); + } + + /** + * Creates balance limit and sends the created UUID along with the data + * + * @param {Brevo.CreateBalanceLimitRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.FailedDependencyError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.createBalanceLimit({ + * pid: "pid", + * bdid: "bdid", + * constraintType: "transaction", + * durationUnit: "day", + * durationValue: 1, + * transactionType: "credit", + * value: 1 + * }) + */ + public createBalanceLimit( + request: Brevo.CreateBalanceLimitRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createBalanceLimit(request, requestOptions)); + } + + private async __createBalanceLimit( + request: Brevo.CreateBalanceLimitRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, bdid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions/${core.url.encodePathParam(bdid)}/limits`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.BalanceLimit, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 424: + throw new Brevo.FailedDependencyError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits", + ); + } + + /** + * Fetches balance limits and send the created UUID along with the data + * + * @param {Brevo.GetBalanceLimitRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.getBalanceLimit({ + * pid: "pid", + * bdid: "bdid", + * blid: "blid" + * }) + */ + public getBalanceLimit( + request: Brevo.GetBalanceLimitRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getBalanceLimit(request, requestOptions)); + } + + private async __getBalanceLimit( + request: Brevo.GetBalanceLimitRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, bdid, blid, version } = request; + const _queryParams: Record = { + version: version != null ? version : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions/${core.url.encodePathParam(bdid)}/limits/${core.url.encodePathParam(blid)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.BalanceLimit, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}", + ); + } + + /** + * Updates balance limit + * + * @param {Brevo.UpdateBalanceLimitRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.updateBalanceLimit({ + * pid: "pid", + * bdid: "bdid", + * blid: "blid", + * constraintType: "transaction", + * durationUnit: "day", + * durationValue: 1, + * transactionType: "credit", + * value: 1 + * }) + */ + public updateBalanceLimit( + request: Brevo.UpdateBalanceLimitRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateBalanceLimit(request, requestOptions)); + } + + private async __updateBalanceLimit( + request: Brevo.UpdateBalanceLimitRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, bdid, blid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions/${core.url.encodePathParam(bdid)}/limits/${core.url.encodePathParam(blid)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.BalanceLimit, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}", + ); + } + + /** + * Delete balance limit + * + * @param {Brevo.DeleteBalanceLimitRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.deleteBalanceLimit({ + * pid: "pid", + * bdid: "bdid", + * blid: "blid" + * }) + */ + public deleteBalanceLimit( + request: Brevo.DeleteBalanceLimitRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteBalanceLimit(request, requestOptions)); + } + + private async __deleteBalanceLimit( + request: Brevo.DeleteBalanceLimitRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, bdid, blid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/balance-definitions/${core.url.encodePathParam(bdid)}/limits/${core.url.encodePathParam(blid)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}", + ); + } + + /** + * Returns balance list + * + * @param {Brevo.GetContactBalancesRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.getContactBalances({ + * pid: "pid" + * }) + */ + public getContactBalances( + request: Brevo.GetContactBalancesRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getContactBalances(request, requestOptions)); + } + + private async __getContactBalances( + request: Brevo.GetContactBalancesRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/contact-balances`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetContactBalancesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/balance/programs/{pid}/contact-balances", + ); + } + + /** + * Returns created order + * + * @param {Brevo.CreateBalanceOrderRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.createBalanceOrder({ + * pid: "pid", + * amount: 1.1, + * balanceDefinitionId: "balanceDefinitionId", + * contactId: 1, + * dueAt: "dueAt", + * source: "source" + * }) + */ + public createBalanceOrder( + request: Brevo.CreateBalanceOrderRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createBalanceOrder(request, requestOptions)); + } + + private async __createBalanceOrder( + request: Brevo.CreateBalanceOrderRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/create-order`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateBalanceOrderResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/balance/programs/{pid}/create-order", + ); + } + + /** + * Returns subscription balances + * + * @param {Brevo.GetSubscriptionBalancesRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.getSubscriptionBalances({ + * pid: "pid", + * cid: "cid" + * }) + */ + public getSubscriptionBalances( + request: Brevo.GetSubscriptionBalancesRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSubscriptionBalances(request, requestOptions)); + } + + private async __getSubscriptionBalances( + request: Brevo.GetSubscriptionBalancesRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, cid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/subscriptions/${core.url.encodePathParam(cid)}/balances`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetSubscriptionBalancesResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/balance/programs/{pid}/subscriptions/{cid}/balances", + ); + } + + /** + * Creates a balance for a contact + * + * @param {Brevo.PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.createSubscriptionBalances({ + * pid: "pid", + * cid: "cid", + * balanceDefinitionId: "balanceDefinitionId" + * }) + */ + public createSubscriptionBalances( + request: Brevo.PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createSubscriptionBalances(request, requestOptions)); + } + + private async __createSubscriptionBalances( + request: Brevo.PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, cid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/subscriptions/${core.url.encodePathParam(cid)}/balances`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/balance/programs/{pid}/subscriptions/{cid}/balances", + ); + } + + /** + * Returns transaction history + * + * @param {Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.getTransactionHistoryApi({ + * pid: "pid", + * contact_id: 1, + * balance_definition_id: "balance_definition_id" + * }) + */ + public getTransactionHistoryApi( + request: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransactionHistoryApi(request, requestOptions)); + } + + private async __getTransactionHistoryApi( + request: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { + pid, + limit, + offset, + sort_field: sortField, + sort, + contact_id: contactId, + balance_definition_id: balanceDefinitionId, + filters, + } = request; + const _queryParams: Record = { + limit, + offset, + sort_field: sortField != null ? sortField : undefined, + sort: sort != null ? sort : undefined, + contact_id: contactId, + balance_definition_id: balanceDefinitionId, + filters, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/transaction-history`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/balance/programs/{pid}/transaction-history", + ); + } + + /** + * Creates new transaction and returns information + * + * @param {Brevo.BeginTransactionRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.beginTransaction({ + * pid: "pid", + * amount: 1.1, + * balanceDefinitionId: "balanceDefinitionId" + * }) + */ + public beginTransaction( + request: Brevo.BeginTransactionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__beginTransaction(request, requestOptions)); + } + + private async __beginTransaction( + request: Brevo.BeginTransactionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/transactions`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Transaction, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/balance/programs/{pid}/transactions", + ); + } + + /** + * Cancels transaction + * + * @param {Brevo.CancelTransactionRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.cancelTransaction({ + * pid: "pid", + * tid: "tid" + * }) + */ + public cancelTransaction( + request: Brevo.CancelTransactionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__cancelTransaction(request, requestOptions)); + } + + private async __cancelTransaction( + request: Brevo.CancelTransactionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, tid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/transactions/${core.url.encodePathParam(tid)}/cancel`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Transaction, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/balance/programs/{pid}/transactions/{tid}/cancel", + ); + } + + /** + * Completes transaction + * + * @param {Brevo.CompleteTransactionRequest} request + * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.balance.completeTransaction({ + * pid: "pid", + * tid: "tid" + * }) + */ + public completeTransaction( + request: Brevo.CompleteTransactionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__completeTransaction(request, requestOptions)); + } + + private async __completeTransaction( + request: Brevo.CompleteTransactionRequest, + requestOptions?: BalanceClient.RequestOptions, + ): Promise> { + const { pid, tid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/balance/programs/${core.url.encodePathParam(pid)}/transactions/${core.url.encodePathParam(tid)}/complete`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Transaction, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/balance/programs/{pid}/transactions/{tid}/complete", + ); + } +} diff --git a/src/api/resources/balance/client/index.ts b/src/api/resources/balance/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/balance/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/balance/client/requests/BeginTransactionRequest.ts b/src/api/resources/balance/client/requests/BeginTransactionRequest.ts new file mode 100644 index 0000000..7ecd06e --- /dev/null +++ b/src/api/resources/balance/client/requests/BeginTransactionRequest.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * amount: 1.1, + * balanceDefinitionId: "balanceDefinitionId" + * } + */ +export interface BeginTransactionRequest { + /** Loyalty Program Id */ + pid: string; + /** Unique identifier for the loyalty subscription (required unless `contactId` is provided). */ + LoyaltySubscriptionId?: string; + /** Transaction amount (must be provided). */ + amount: number; + /** Whether the transaction should be automatically completed. */ + autoComplete?: boolean; + /** Unique identifier (UUID) of the associated balance definition. */ + balanceDefinitionId: string; + /** Optional expiry time for the balance in minutes (must be greater than 0 if provided). */ + balanceExpiryInMinutes?: number; + /** Unique identifier of the contact involved in the transaction (required unless `LoyaltySubscriptionId` is provided). */ + contactId?: number; + /** Optional timestamp specifying when the transaction occurred. */ + eventTime?: string; + /** Optional metadata associated with the transaction. */ + meta?: Record; + /** Optional time-to-live for the transaction (must be greater than 0 if provided). */ + ttl?: number; +} diff --git a/src/api/resources/balance/client/requests/CancelTransactionRequest.ts b/src/api/resources/balance/client/requests/CancelTransactionRequest.ts new file mode 100644 index 0000000..66bac14 --- /dev/null +++ b/src/api/resources/balance/client/requests/CancelTransactionRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * tid: "tid" + * } + */ +export interface CancelTransactionRequest { + /** Loyalty Program Id */ + pid: string; + /** Transaction Id */ + tid: string; +} diff --git a/src/api/resources/balance/client/requests/CompleteTransactionRequest.ts b/src/api/resources/balance/client/requests/CompleteTransactionRequest.ts new file mode 100644 index 0000000..bc25413 --- /dev/null +++ b/src/api/resources/balance/client/requests/CompleteTransactionRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * tid: "tid" + * } + */ +export interface CompleteTransactionRequest { + /** Loyalty Program Id */ + pid: string; + /** Transaction Id */ + tid: string; +} diff --git a/src/api/resources/balance/client/requests/CreateBalanceLimitRequest.ts b/src/api/resources/balance/client/requests/CreateBalanceLimitRequest.ts new file mode 100644 index 0000000..c3cf8f2 --- /dev/null +++ b/src/api/resources/balance/client/requests/CreateBalanceLimitRequest.ts @@ -0,0 +1,55 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * bdid: "bdid", + * constraintType: "transaction", + * durationUnit: "day", + * durationValue: 1, + * transactionType: "credit", + * value: 1 + * } + */ +export interface CreateBalanceLimitRequest { + /** Loyalty Program Id */ + pid: string; + /** Balance Definition Id */ + bdid: string; + /** Defines whether the limit applies to transaction count or amount. */ + constraintType: CreateBalanceLimitRequest.ConstraintType; + /** Unit of time for which the limit is applicable. */ + durationUnit: CreateBalanceLimitRequest.DurationUnit; + /** Number of time units for the balance limit. */ + durationValue: number; + /** Determines if the limit resets on a rolling schedule. */ + slidingSchedule?: boolean; + /** Specifies whether the limit applies to credit or debit transactions. */ + transactionType: CreateBalanceLimitRequest.TransactionType; + /** Maximum allowed value for the specified constraint type. */ + value: number; +} + +export namespace CreateBalanceLimitRequest { + /** Defines whether the limit applies to transaction count or amount. */ + export const ConstraintType = { + Transaction: "transaction", + Amount: "amount", + } as const; + export type ConstraintType = (typeof ConstraintType)[keyof typeof ConstraintType]; + /** Unit of time for which the limit is applicable. */ + export const DurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit]; + /** Specifies whether the limit applies to credit or debit transactions. */ + export const TransactionType = { + Credit: "credit", + Debit: "debit", + } as const; + export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; +} diff --git a/src/api/resources/balance/client/requests/CreateBalanceOrderRequest.ts b/src/api/resources/balance/client/requests/CreateBalanceOrderRequest.ts new file mode 100644 index 0000000..126012a --- /dev/null +++ b/src/api/resources/balance/client/requests/CreateBalanceOrderRequest.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * amount: 1.1, + * balanceDefinitionId: "balanceDefinitionId", + * contactId: 1, + * dueAt: "dueAt", + * source: "source" + * } + */ +export interface CreateBalanceOrderRequest { + /** Loyalty Program Id */ + pid: string; + /** Order amount (must be non-zero). */ + amount: number; + /** Unique identifier (UUID) of the associated balance definition. */ + balanceDefinitionId: string; + /** Unique identifier of the contact placing the order (must be ≥ 1). */ + contactId: number; + /** RFC3339 timestamp specifying when the order is due. */ + dueAt: string; + /** Optional RFC3339 timestamp defining order expiration. */ + expiresAt?: string; + /** Optional metadata associated with the order. */ + meta?: Record; + /** Specifies the origin of the order (`engine` or `user`). */ + source: string; +} diff --git a/src/api/resources/balance/client/requests/DeleteBalanceDefinitionRequest.ts b/src/api/resources/balance/client/requests/DeleteBalanceDefinitionRequest.ts new file mode 100644 index 0000000..87dc611 --- /dev/null +++ b/src/api/resources/balance/client/requests/DeleteBalanceDefinitionRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * bdid: "bdid" + * } + */ +export interface DeleteBalanceDefinitionRequest { + /** Loyalty Program Id */ + pid: string; + /** Balance Definition Id */ + bdid: string; +} diff --git a/src/api/resources/balance/client/requests/DeleteBalanceLimitRequest.ts b/src/api/resources/balance/client/requests/DeleteBalanceLimitRequest.ts new file mode 100644 index 0000000..510af34 --- /dev/null +++ b/src/api/resources/balance/client/requests/DeleteBalanceLimitRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * bdid: "bdid", + * blid: "blid" + * } + */ +export interface DeleteBalanceLimitRequest { + /** Loyalty Program Id */ + pid: string; + /** Balance Definition Id */ + bdid: string; + /** Balance Limit Id */ + blid: string; +} diff --git a/src/api/resources/balance/client/requests/GetBalanceDefinitionListRequest.ts b/src/api/resources/balance/client/requests/GetBalanceDefinitionListRequest.ts new file mode 100644 index 0000000..ac37f51 --- /dev/null +++ b/src/api/resources/balance/client/requests/GetBalanceDefinitionListRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface GetBalanceDefinitionListRequest { + /** Loyalty Program Id */ + pid: string; + /** Limit the number of records returned */ + limit?: number; + /** Offset to paginate records */ + offset?: number; + /** Field to sort by */ + sortField?: Brevo.GetBalanceDefinitionListRequestSortField; + /** Sort direction */ + sort?: Brevo.GetBalanceDefinitionListRequestSort; + /** Version */ + version?: Brevo.GetBalanceDefinitionListRequestVersion; +} diff --git a/src/api/resources/balance/client/requests/GetBalanceDefinitionRequest.ts b/src/api/resources/balance/client/requests/GetBalanceDefinitionRequest.ts new file mode 100644 index 0000000..8254331 --- /dev/null +++ b/src/api/resources/balance/client/requests/GetBalanceDefinitionRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid", + * bdid: "bdid" + * } + */ +export interface GetBalanceDefinitionRequest { + /** Loyalty Program Id */ + pid: string; + /** Balance Definition Id */ + bdid: string; + /** Version */ + version?: Brevo.GetBalanceDefinitionRequestVersion; +} diff --git a/src/api/resources/balance/client/requests/GetBalanceLimitRequest.ts b/src/api/resources/balance/client/requests/GetBalanceLimitRequest.ts new file mode 100644 index 0000000..4d84129 --- /dev/null +++ b/src/api/resources/balance/client/requests/GetBalanceLimitRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid", + * bdid: "bdid", + * blid: "blid" + * } + */ +export interface GetBalanceLimitRequest { + /** Loyalty Program Id */ + pid: string; + /** Balance Definition Id */ + bdid: string; + /** Balance Limit Id */ + blid: string; + /** Version */ + version?: Brevo.GetBalanceLimitRequestVersion; +} diff --git a/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts b/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts new file mode 100644 index 0000000..01d4037 --- /dev/null +++ b/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface GetContactBalancesRequest { + /** Loyalty Program Id */ + pid: string; +} diff --git a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts new file mode 100644 index 0000000..9dea331 --- /dev/null +++ b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * contact_id: 1, + * balance_definition_id: "balance_definition_id" + * } + */ +export interface GetLoyaltyBalanceProgramsPidActiveBalanceRequest { + /** Loyalty Program Id */ + pid: string; + /** Limit */ + limit?: number; + /** Offset */ + offset?: number; + /** Sort Field */ + sort_field?: string; + /** Sort Order */ + sort?: string; + /** Contact ID */ + contact_id: number; + /** Balance Definition ID */ + balance_definition_id: string; +} diff --git a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts new file mode 100644 index 0000000..0f78401 --- /dev/null +++ b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid", + * contact_id: 1, + * balance_definition_id: "balance_definition_id" + * } + */ +export interface GetLoyaltyBalanceProgramsPidTransactionHistoryRequest { + /** Loyalty Program Id */ + pid: string; + /** Limit the number of records returned */ + limit?: number; + /** Skip a number of records */ + offset?: number; + /** Field to sort by */ + sort_field?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField; + /** Sort order, either asc or desc */ + sort?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort; + /** Contact ID */ + contact_id: number; + /** Balance Definition ID */ + balance_definition_id: string; + /** Filters to apply */ + filters?: string | string[]; +} diff --git a/src/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.ts b/src/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.ts new file mode 100644 index 0000000..b939c3d --- /dev/null +++ b/src/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * cid: "cid" + * } + */ +export interface GetSubscriptionBalancesRequest { + /** Loyalty Program Id */ + pid: string; + /** Contact Id */ + cid: string; +} diff --git a/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.ts b/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.ts new file mode 100644 index 0000000..705a0a5 --- /dev/null +++ b/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.ts @@ -0,0 +1,110 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * name: "name", + * unit: "POINTS" + * } + */ +export interface PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest { + /** Loyalty Program Id */ + pid: string; + /** Defines when the balance expires within the selected duration. */ + balanceAvailabilityDurationModifier?: PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.BalanceAvailabilityDurationModifier; + /** Unit of time for balance validity. */ + balanceAvailabilityDurationUnit?: PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.BalanceAvailabilityDurationUnit; + /** Number of time units before the balance expires. */ + balanceAvailabilityDurationValue?: number; + /** Fixed expiration date (`dd/mm` format) as an alternative to duration-based expiry. */ + balanceExpirationDate?: string; + /** Defines whether partial credit is allowed when reaching max balance. */ + balanceOptionAmountOvertakingStrategy?: PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.BalanceOptionAmountOvertakingStrategy; + /** Defines rounding strategy for credit transactions. */ + balanceOptionCreditRounding?: PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.BalanceOptionCreditRounding; + /** Defines rounding strategy for debit transactions. */ + balanceOptionDebitRounding?: PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.BalanceOptionDebitRounding; + /** Short description of the balance definition. */ + description?: string; + /** URL of an optional image reference. */ + imageRef?: string; + /** Maximum allowable balance amount. */ + maxAmount?: number; + /** Maximum credit allowed per operation. */ + maxCreditAmountLimit?: number; + /** Maximum debit allowed per operation. */ + maxDebitAmountLimit?: number; + /** Additional metadata for the balance definition. */ + meta?: Record; + /** Minimum allowable balance amount. */ + minAmount?: number; + /** Name of the balance definition. */ + name: string; + /** Unit of balance measurement. */ + unit: PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.Unit; +} + +export namespace PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest { + /** Defines when the balance expires within the selected duration. */ + export const BalanceAvailabilityDurationModifier = { + NoModification: "noModification", + StartOfPeriod: "startOfPeriod", + EndOfPeriod: "endOfPeriod", + } as const; + export type BalanceAvailabilityDurationModifier = + (typeof BalanceAvailabilityDurationModifier)[keyof typeof BalanceAvailabilityDurationModifier]; + /** Unit of time for balance validity. */ + export const BalanceAvailabilityDurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type BalanceAvailabilityDurationUnit = + (typeof BalanceAvailabilityDurationUnit)[keyof typeof BalanceAvailabilityDurationUnit]; + /** Defines whether partial credit is allowed when reaching max balance. */ + export const BalanceOptionAmountOvertakingStrategy = { + Strict: "strict", + Partial: "partial", + } as const; + export type BalanceOptionAmountOvertakingStrategy = + (typeof BalanceOptionAmountOvertakingStrategy)[keyof typeof BalanceOptionAmountOvertakingStrategy]; + /** Defines rounding strategy for credit transactions. */ + export const BalanceOptionCreditRounding = { + Lower: "lower", + Upper: "upper", + Natural: "natural", + } as const; + export type BalanceOptionCreditRounding = + (typeof BalanceOptionCreditRounding)[keyof typeof BalanceOptionCreditRounding]; + /** Defines rounding strategy for debit transactions. */ + export const BalanceOptionDebitRounding = { + Lower: "lower", + Upper: "upper", + Natural: "natural", + } as const; + export type BalanceOptionDebitRounding = + (typeof BalanceOptionDebitRounding)[keyof typeof BalanceOptionDebitRounding]; + /** Unit of balance measurement. */ + export const Unit = { + Points: "POINTS", + Eur: "EUR", + Usd: "USD", + Mxn: "MXN", + Gbp: "GBP", + Inr: "INR", + Cad: "CAD", + Sgd: "SGD", + Ron: "RON", + Jpy: "JPY", + Myr: "MYR", + Clp: "CLP", + Pen: "PEN", + Mad: "MAD", + Aud: "AUD", + Chf: "CHF", + Brl: "BRL", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; +} diff --git a/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest.ts b/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest.ts new file mode 100644 index 0000000..1481bb9 --- /dev/null +++ b/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * cid: "cid", + * balanceDefinitionId: "balanceDefinitionId" + * } + */ +export interface PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest { + /** Loyalty Program Id */ + pid: string; + /** Contact Id */ + cid: string; + /** Unique identifier (UUID) of the balance definition associated with the new balance. */ + balanceDefinitionId: string; +} diff --git a/src/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.ts b/src/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.ts new file mode 100644 index 0000000..1c1970a --- /dev/null +++ b/src/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.ts @@ -0,0 +1,113 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * bdid: "bdid", + * name: "name", + * unit: "POINTS" + * } + */ +export interface UpdateBalanceDefinitionRequest { + /** Loyalty Program Id */ + pid: string; + /** Balance Definition Id */ + bdid: string; + /** Defines when the balance expires within the selected duration. */ + balanceAvailabilityDurationModifier?: UpdateBalanceDefinitionRequest.BalanceAvailabilityDurationModifier; + /** Unit of time for balance validity. */ + balanceAvailabilityDurationUnit?: UpdateBalanceDefinitionRequest.BalanceAvailabilityDurationUnit; + /** Number of time units before the balance expires. */ + balanceAvailabilityDurationValue?: number; + /** Expiration date (`dd/mm` format) or empty if not applicable. */ + balanceExpirationDate?: string; + /** Defines whether partial credit is allowed when reaching max balance. */ + balanceOptionAmountOvertakingStrategy?: UpdateBalanceDefinitionRequest.BalanceOptionAmountOvertakingStrategy; + /** Rounding strategy for credit transactions. */ + balanceOptionCreditRounding?: UpdateBalanceDefinitionRequest.BalanceOptionCreditRounding; + /** Rounding strategy for debit transactions. */ + balanceOptionDebitRounding?: UpdateBalanceDefinitionRequest.BalanceOptionDebitRounding; + /** Short description of the balance definition. */ + description?: string; + /** URL of an optional image reference. */ + imageRef?: string; + /** Maximum allowable balance amount. */ + maxAmount?: number; + /** Maximum credit allowed per operation. */ + maxCreditAmountLimit?: number; + /** Maximum debit allowed per operation. */ + maxDebitAmountLimit?: number; + /** Optional metadata for the balance definition. */ + meta?: Record; + /** Minimum allowable balance amount. */ + minAmount?: number; + /** Name of the balance definition. */ + name: string; + /** Unit of balance measurement. */ + unit: UpdateBalanceDefinitionRequest.Unit; +} + +export namespace UpdateBalanceDefinitionRequest { + /** Defines when the balance expires within the selected duration. */ + export const BalanceAvailabilityDurationModifier = { + NoModification: "noModification", + StartOfPeriod: "startOfPeriod", + EndOfPeriod: "endOfPeriod", + } as const; + export type BalanceAvailabilityDurationModifier = + (typeof BalanceAvailabilityDurationModifier)[keyof typeof BalanceAvailabilityDurationModifier]; + /** Unit of time for balance validity. */ + export const BalanceAvailabilityDurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type BalanceAvailabilityDurationUnit = + (typeof BalanceAvailabilityDurationUnit)[keyof typeof BalanceAvailabilityDurationUnit]; + /** Defines whether partial credit is allowed when reaching max balance. */ + export const BalanceOptionAmountOvertakingStrategy = { + Strict: "strict", + Partial: "partial", + } as const; + export type BalanceOptionAmountOvertakingStrategy = + (typeof BalanceOptionAmountOvertakingStrategy)[keyof typeof BalanceOptionAmountOvertakingStrategy]; + /** Rounding strategy for credit transactions. */ + export const BalanceOptionCreditRounding = { + Lower: "lower", + Upper: "upper", + Natural: "natural", + } as const; + export type BalanceOptionCreditRounding = + (typeof BalanceOptionCreditRounding)[keyof typeof BalanceOptionCreditRounding]; + /** Rounding strategy for debit transactions. */ + export const BalanceOptionDebitRounding = { + Lower: "lower", + Upper: "upper", + Natural: "natural", + } as const; + export type BalanceOptionDebitRounding = + (typeof BalanceOptionDebitRounding)[keyof typeof BalanceOptionDebitRounding]; + /** Unit of balance measurement. */ + export const Unit = { + Points: "POINTS", + Eur: "EUR", + Usd: "USD", + Mxn: "MXN", + Gbp: "GBP", + Inr: "INR", + Cad: "CAD", + Sgd: "SGD", + Ron: "RON", + Jpy: "JPY", + Myr: "MYR", + Clp: "CLP", + Pen: "PEN", + Mad: "MAD", + Aud: "AUD", + Chf: "CHF", + Brl: "BRL", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; +} diff --git a/src/api/resources/balance/client/requests/UpdateBalanceLimitRequest.ts b/src/api/resources/balance/client/requests/UpdateBalanceLimitRequest.ts new file mode 100644 index 0000000..6101487 --- /dev/null +++ b/src/api/resources/balance/client/requests/UpdateBalanceLimitRequest.ts @@ -0,0 +1,58 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * bdid: "bdid", + * blid: "blid", + * constraintType: "transaction", + * durationUnit: "day", + * durationValue: 1, + * transactionType: "credit", + * value: 1 + * } + */ +export interface UpdateBalanceLimitRequest { + /** Loyalty Program Id */ + pid: string; + /** Balance Definition Id */ + bdid: string; + /** Balance Limit Id */ + blid: string; + /** Defines whether the limit applies to transaction count or amount. */ + constraintType: UpdateBalanceLimitRequest.ConstraintType; + /** Unit of time for which the limit is applicable. */ + durationUnit: UpdateBalanceLimitRequest.DurationUnit; + /** Number of time units for the balance limit. */ + durationValue: number; + /** Determines if the limit resets on a rolling schedule. */ + slidingSchedule?: boolean; + /** Specifies whether the limit applies to credit or debit transactions. */ + transactionType: UpdateBalanceLimitRequest.TransactionType; + /** Maximum allowed value for the specified constraint type. */ + value: number; +} + +export namespace UpdateBalanceLimitRequest { + /** Defines whether the limit applies to transaction count or amount. */ + export const ConstraintType = { + Transaction: "transaction", + Amount: "amount", + } as const; + export type ConstraintType = (typeof ConstraintType)[keyof typeof ConstraintType]; + /** Unit of time for which the limit is applicable. */ + export const DurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit]; + /** Specifies whether the limit applies to credit or debit transactions. */ + export const TransactionType = { + Credit: "credit", + Debit: "debit", + } as const; + export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; +} diff --git a/src/api/resources/balance/client/requests/index.ts b/src/api/resources/balance/client/requests/index.ts new file mode 100644 index 0000000..a782eb4 --- /dev/null +++ b/src/api/resources/balance/client/requests/index.ts @@ -0,0 +1,18 @@ +export type { BeginTransactionRequest } from "./BeginTransactionRequest.js"; +export type { CancelTransactionRequest } from "./CancelTransactionRequest.js"; +export type { CompleteTransactionRequest } from "./CompleteTransactionRequest.js"; +export { CreateBalanceLimitRequest } from "./CreateBalanceLimitRequest.js"; +export type { CreateBalanceOrderRequest } from "./CreateBalanceOrderRequest.js"; +export type { DeleteBalanceDefinitionRequest } from "./DeleteBalanceDefinitionRequest.js"; +export type { DeleteBalanceLimitRequest } from "./DeleteBalanceLimitRequest.js"; +export type { GetBalanceDefinitionListRequest } from "./GetBalanceDefinitionListRequest.js"; +export type { GetBalanceDefinitionRequest } from "./GetBalanceDefinitionRequest.js"; +export type { GetBalanceLimitRequest } from "./GetBalanceLimitRequest.js"; +export type { GetContactBalancesRequest } from "./GetContactBalancesRequest.js"; +export type { GetLoyaltyBalanceProgramsPidActiveBalanceRequest } from "./GetLoyaltyBalanceProgramsPidActiveBalanceRequest.js"; +export type { GetLoyaltyBalanceProgramsPidTransactionHistoryRequest } from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.js"; +export type { GetSubscriptionBalancesRequest } from "./GetSubscriptionBalancesRequest.js"; +export { PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest } from "./PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.js"; +export type { PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest } from "./PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest.js"; +export { UpdateBalanceDefinitionRequest } from "./UpdateBalanceDefinitionRequest.js"; +export { UpdateBalanceLimitRequest } from "./UpdateBalanceLimitRequest.js"; diff --git a/src/api/resources/balance/index.ts b/src/api/resources/balance/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/balance/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/balance/types/CreateBalanceOrderResponse.ts b/src/api/resources/balance/types/CreateBalanceOrderResponse.ts new file mode 100644 index 0000000..4f89892 --- /dev/null +++ b/src/api/resources/balance/types/CreateBalanceOrderResponse.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Represents an order linked to a balance definition, including amount, due date, and transaction details. + */ +export interface CreateBalanceOrderResponse { + /** Order amount (must not be zero). */ + amount: number; + /** Optional unique identifier (UUID) of the associated balance definition. */ + balanceDefinitionId?: string; + /** Unique identifier of the contact placing the order (must be ≥ 1). */ + contactId: number; + /** RFC3339 timestamp indicating when the order was created. */ + createdAt: string; + /** RFC3339 timestamp specifying when the order is due in the future. */ + dueAt: string; + /** Optional RFC3339 timestamp defining order expiration in the future. */ + expiresAt?: string; + /** Unique identifier for the balance order. */ + id?: string; + /** Unique identifier of the loyalty program associated with the order. */ + loyaltyProgramId: string; + /** Optional metadata associated with the order. */ + meta?: Record; + /** Optional RFC3339 timestamp indicating when the order was processed. */ + processedAt?: string; + /** Optional reference to the associated transaction ID. */ + transactionid?: string; + /** RFC3339 timestamp indicating the last update to the order. */ + updatedAt: string; +} diff --git a/src/api/resources/balance/types/GetBalanceDefinitionListRequestSort.ts b/src/api/resources/balance/types/GetBalanceDefinitionListRequestSort.ts new file mode 100644 index 0000000..6ccaef2 --- /dev/null +++ b/src/api/resources/balance/types/GetBalanceDefinitionListRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetBalanceDefinitionListRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetBalanceDefinitionListRequestSort = + (typeof GetBalanceDefinitionListRequestSort)[keyof typeof GetBalanceDefinitionListRequestSort]; diff --git a/src/api/resources/balance/types/GetBalanceDefinitionListRequestSortField.ts b/src/api/resources/balance/types/GetBalanceDefinitionListRequestSortField.ts new file mode 100644 index 0000000..658208f --- /dev/null +++ b/src/api/resources/balance/types/GetBalanceDefinitionListRequestSortField.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetBalanceDefinitionListRequestSortField = { + Name: "name", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} as const; +export type GetBalanceDefinitionListRequestSortField = + (typeof GetBalanceDefinitionListRequestSortField)[keyof typeof GetBalanceDefinitionListRequestSortField]; diff --git a/src/api/resources/balance/types/GetBalanceDefinitionListRequestVersion.ts b/src/api/resources/balance/types/GetBalanceDefinitionListRequestVersion.ts new file mode 100644 index 0000000..3d2863f --- /dev/null +++ b/src/api/resources/balance/types/GetBalanceDefinitionListRequestVersion.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetBalanceDefinitionListRequestVersion = { + Active: "active", + Draft: "draft", +} as const; +export type GetBalanceDefinitionListRequestVersion = + (typeof GetBalanceDefinitionListRequestVersion)[keyof typeof GetBalanceDefinitionListRequestVersion]; diff --git a/src/api/resources/balance/types/GetBalanceDefinitionListResponse.ts b/src/api/resources/balance/types/GetBalanceDefinitionListResponse.ts new file mode 100644 index 0000000..3ec0a7c --- /dev/null +++ b/src/api/resources/balance/types/GetBalanceDefinitionListResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetBalanceDefinitionListResponse { + /** list of balance definitions */ + items?: Brevo.BalanceDefinition[]; +} diff --git a/src/api/resources/balance/types/GetBalanceDefinitionRequestVersion.ts b/src/api/resources/balance/types/GetBalanceDefinitionRequestVersion.ts new file mode 100644 index 0000000..66fdaee --- /dev/null +++ b/src/api/resources/balance/types/GetBalanceDefinitionRequestVersion.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetBalanceDefinitionRequestVersion = { + Active: "active", + Draft: "draft", +} as const; +export type GetBalanceDefinitionRequestVersion = + (typeof GetBalanceDefinitionRequestVersion)[keyof typeof GetBalanceDefinitionRequestVersion]; diff --git a/src/api/resources/balance/types/GetBalanceLimitRequestVersion.ts b/src/api/resources/balance/types/GetBalanceLimitRequestVersion.ts new file mode 100644 index 0000000..64c6cdf --- /dev/null +++ b/src/api/resources/balance/types/GetBalanceLimitRequestVersion.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetBalanceLimitRequestVersion = { + Active: "active", + Draft: "draft", +} as const; +export type GetBalanceLimitRequestVersion = + (typeof GetBalanceLimitRequestVersion)[keyof typeof GetBalanceLimitRequestVersion]; diff --git a/src/api/resources/balance/types/GetContactBalancesResponse.ts b/src/api/resources/balance/types/GetContactBalancesResponse.ts new file mode 100644 index 0000000..111c129 --- /dev/null +++ b/src/api/resources/balance/types/GetContactBalancesResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetContactBalancesResponse { + balanceDefinitionId?: string; + balances?: GetContactBalancesResponse.Balances.Item[]; + count?: number; + loyaltyProgramId?: string; +} + +export namespace GetContactBalancesResponse { + export type Balances = Balances.Item[]; + + export namespace Balances { + export interface Item { + contactId?: number; + loyaltySubscriptionId?: string; + updatedAt?: string; + value?: number; + } + } +} diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.ts new file mode 100644 index 0000000..7f246c4 --- /dev/null +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort = + (typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort)[keyof typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort]; diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts new file mode 100644 index 0000000..06c550c --- /dev/null +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField = { + Name: "name", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} as const; +export type GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField = + (typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField)[keyof typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField]; diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts new file mode 100644 index 0000000..3ed6fcc --- /dev/null +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts @@ -0,0 +1,49 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Response containing transaction history details for a specific balance and contact. + */ +export interface GetLoyaltyBalanceProgramsPidTransactionHistoryResponse { + /** Unique identifier of the associated balance definition. */ + balanceDefinitionId?: string; + /** Unique identifier of the contact related to the transactions. */ + contactId?: number; + /** Total number of transactions in the history. */ + count?: number; + /** Unique identifier of the associated loyalty program. */ + loyaltyProgramId?: string; + /** List of past transactions associated with the balance. */ + transactionHistory?: GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.TransactionHistory.Item[]; +} + +export namespace GetLoyaltyBalanceProgramsPidTransactionHistoryResponse { + export type TransactionHistory = TransactionHistory.Item[]; + + export namespace TransactionHistory { + /** + * Represents a record of a past transaction, including status and key timestamps. + */ + export interface Item { + /** The transaction amount. */ + amount?: number; + /** Expiration date of the balance associated with this transaction. */ + balanceExpirationDate?: string; + /** Timestamp when the transaction was canceled, if applicable. */ + cancelledAt?: string; + /** Timestamp when the transaction was successfully completed. */ + completedAt?: string; + /** Timestamp when the transaction was initiated. */ + createdAt?: string; + /** Unique identifier of the transaction. */ + id?: string; + /** Optional metadata associated with the transaction. */ + meta?: Record; + /** Reason for rejection, if the transaction was declined. */ + rejectReason?: string; + /** Timestamp when the transaction was rejected. */ + rejectedAt?: string; + /** Current status of the transaction (e.g., pending, completed, rejected). */ + status?: string; + } + } +} diff --git a/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts b/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts new file mode 100644 index 0000000..9291437 --- /dev/null +++ b/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSubscriptionBalancesResponse { + balance?: GetSubscriptionBalancesResponse.Balance.Item[]; +} + +export namespace GetSubscriptionBalancesResponse { + export type Balance = Balance.Item[]; + + export namespace Balance { + export interface Item { + /** balance definition ID */ + balanceDefinitionId?: string; + /** Unique identifier for the balance definition associated with this aggregate balance */ + value?: number; + } + } +} diff --git a/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts b/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts new file mode 100644 index 0000000..b32ae22 --- /dev/null +++ b/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse { + /** The current amount available in the balance */ + amount?: number; + /** balance definition ID */ + balanceDefinitionId?: string; + /** Timestamp of when the balance was last consumed */ + consumedAt?: string; + /** contact ID */ + contactId?: number; + /** Timestamp of when the balance was created */ + createdAt?: string; + /** Expiration timestamp of the balance */ + expiresAt?: string; + /** Unique identifier for the balance */ + id?: string; + /** loyalty program ID */ + loyaltyProgramId?: string; + /** organization ID */ + organizationId?: number; +} diff --git a/src/api/resources/balance/types/index.ts b/src/api/resources/balance/types/index.ts new file mode 100644 index 0000000..80b736d --- /dev/null +++ b/src/api/resources/balance/types/index.ts @@ -0,0 +1,13 @@ +export * from "./CreateBalanceOrderResponse.js"; +export * from "./GetBalanceDefinitionListRequestSort.js"; +export * from "./GetBalanceDefinitionListRequestSortField.js"; +export * from "./GetBalanceDefinitionListRequestVersion.js"; +export * from "./GetBalanceDefinitionListResponse.js"; +export * from "./GetBalanceDefinitionRequestVersion.js"; +export * from "./GetBalanceLimitRequestVersion.js"; +export * from "./GetContactBalancesResponse.js"; +export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.js"; +export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.js"; +export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.js"; +export * from "./GetSubscriptionBalancesResponse.js"; +export * from "./PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.js"; diff --git a/src/api/resources/companies/client/Client.ts b/src/api/resources/companies/client/Client.ts new file mode 100644 index 0000000..e10046a --- /dev/null +++ b/src/api/resources/companies/client/Client.ts @@ -0,0 +1,647 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace CompaniesClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class CompaniesClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: CompaniesClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetCompaniesRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.companies.getAllCompanies() + */ + public getAllCompanies( + request: Brevo.GetCompaniesRequest = {}, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAllCompanies(request, requestOptions)); + } + + private async __getAllCompanies( + request: Brevo.GetCompaniesRequest = {}, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { filters, linkedContactsIds, linkedDealsIds, modifiedSince, createdSince, page, limit, sort, sortBy } = + request; + const _queryParams: Record = { + filters, + linkedContactsIds, + linkedDealsIds, + modifiedSince, + createdSince, + page, + limit, + sort: sort != null ? sort : undefined, + sortBy, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "companies", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCompaniesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/companies"); + } + + /** + * @param {Brevo.PostCompaniesRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.companies.createACompany({ + * name: "company" + * }) + */ + public createACompany( + request: Brevo.PostCompaniesRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createACompany(request, requestOptions)); + } + + private async __createACompany( + request: Brevo.PostCompaniesRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "companies", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostCompaniesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/companies"); + } + + /** + * Import companies from a CSV file with mapping options. + * + * @param {Brevo.PostCompaniesImportRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * import { createReadStream } from "fs"; + * await client.companies.importCompaniesCreationAndUpdation({}) + */ + public importCompaniesCreationAndUpdation( + request: Brevo.PostCompaniesImportRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__importCompaniesCreationAndUpdation(request, requestOptions)); + } + + private async __importCompaniesCreationAndUpdation( + request: Brevo.PostCompaniesImportRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const _body = await core.newFormData(); + if (request.file != null) { + await _body.appendFile("file", request.file); + } + + if (request.mapping != null) { + _body.append("mapping", toJson(request.mapping)); + } + + const _maybeEncodedRequest = await _body.getRequest(); + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ ..._maybeEncodedRequest.headers }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "companies/import", + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + requestType: "file", + duplex: _maybeEncodedRequest.duplex, + body: _maybeEncodedRequest.body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostCompaniesImportResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/companies/import"); + } + + /** + * @param {Brevo.PatchCompaniesLinkUnlinkIdRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.companies.linkAndUnlinkCompanyWithContactAndDeal({ + * id: "id" + * }) + */ + public linkAndUnlinkCompanyWithContactAndDeal( + request: Brevo.PatchCompaniesLinkUnlinkIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__linkAndUnlinkCompanyWithContactAndDeal(request, requestOptions), + ); + } + + private async __linkAndUnlinkCompanyWithContactAndDeal( + request: Brevo.PatchCompaniesLinkUnlinkIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `companies/link-unlink/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/companies/link-unlink/{id}"); + } + + /** + * @param {Brevo.GetCompaniesIdRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.companies.getACompany({ + * id: "id" + * }) + */ + public getACompany( + request: Brevo.GetCompaniesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getACompany(request, requestOptions)); + } + + private async __getACompany( + request: Brevo.GetCompaniesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `companies/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Company, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/companies/{id}"); + } + + /** + * @param {Brevo.DeleteCompaniesIdRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.companies.deleteACompany({ + * id: "id" + * }) + */ + public deleteACompany( + request: Brevo.DeleteCompaniesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteACompany(request, requestOptions)); + } + + private async __deleteACompany( + request: Brevo.DeleteCompaniesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `companies/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/companies/{id}"); + } + + /** + * @param {Brevo.PatchCompaniesIdRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.companies.updateACompany({ + * id: "id" + * }) + */ + public updateACompany( + request: Brevo.PatchCompaniesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateACompany(request, requestOptions)); + } + + private async __updateACompany( + request: Brevo.PatchCompaniesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `companies/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Company, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/companies/{id}"); + } + + /** + * @param {Brevo.PostCrmAttributesRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.companies.createACompanyDealAttribute({ + * attributeType: "text", + * label: "Attribute Label", + * objectType: "companies" + * }) + */ + public createACompanyDealAttribute( + request: Brevo.PostCrmAttributesRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createACompanyDealAttribute(request, requestOptions)); + } + + private async __createACompanyDealAttribute( + request: Brevo.PostCrmAttributesRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/attributes", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostCrmAttributesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/attributes"); + } + + /** + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.companies.getCompanyAttributes() + */ + public getCompanyAttributes( + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCompanyAttributes(requestOptions)); + } + + private async __getCompanyAttributes( + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/attributes/companies", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetCrmAttributesCompaniesResponseItem[], + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/attributes/companies"); + } +} diff --git a/src/api/resources/companies/client/index.ts b/src/api/resources/companies/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/companies/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/companies/client/requests/DeleteCompaniesIdRequest.ts b/src/api/resources/companies/client/requests/DeleteCompaniesIdRequest.ts new file mode 100644 index 0000000..d45af5c --- /dev/null +++ b/src/api/resources/companies/client/requests/DeleteCompaniesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteCompaniesIdRequest { + /** Company ID to delete */ + id: string; +} diff --git a/src/api/resources/companies/client/requests/GetCompaniesIdRequest.ts b/src/api/resources/companies/client/requests/GetCompaniesIdRequest.ts new file mode 100644 index 0000000..3b2f5df --- /dev/null +++ b/src/api/resources/companies/client/requests/GetCompaniesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCompaniesIdRequest { + /** Get Company Details */ + id: string; +} diff --git a/src/api/resources/companies/client/requests/GetCompaniesRequest.ts b/src/api/resources/companies/client/requests/GetCompaniesRequest.ts new file mode 100644 index 0000000..3e9bb7a --- /dev/null +++ b/src/api/resources/companies/client/requests/GetCompaniesRequest.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetCompaniesRequest { + /** Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"6299dcf3874a14eacbc65c46"} */ + filters?: string; + /** Filter by linked contacts ids */ + linkedContactsIds?: number; + /** Filter by linked Deals ids */ + linkedDealsIds?: string; + /** Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ + modifiedSince?: string; + /** Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ + createdSince?: string; + /** Index of the first document of the page */ + page?: number; + /** Number of documents per page */ + limit?: number; + /** Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed */ + sort?: Brevo.GetCompaniesRequestSort; + /** The field used to sort field names. */ + sortBy?: string; +} diff --git a/src/api/resources/companies/client/requests/PatchCompaniesIdRequest.ts b/src/api/resources/companies/client/requests/PatchCompaniesIdRequest.ts new file mode 100644 index 0000000..c4cc485 --- /dev/null +++ b/src/api/resources/companies/client/requests/PatchCompaniesIdRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface PatchCompaniesIdRequest { + id: string; + /** Attributes for company update */ + attributes?: Record; + /** Country code if phone_number is passed in attributes. */ + countryCode?: number; + /** Warning - Using PATCH on linkedContactIds replaces the list of linked contacts. Omitted IDs will be removed. */ + linkedContactsIds?: number[]; + /** Warning - Using PATCH on linkedDealsIds replaces the list of linked contacts. Omitted IDs will be removed. */ + linkedDealsIds?: string[]; + /** Name of company */ + name?: string; +} diff --git a/src/api/resources/companies/client/requests/PatchCompaniesLinkUnlinkIdRequest.ts b/src/api/resources/companies/client/requests/PatchCompaniesLinkUnlinkIdRequest.ts new file mode 100644 index 0000000..07bda08 --- /dev/null +++ b/src/api/resources/companies/client/requests/PatchCompaniesLinkUnlinkIdRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface PatchCompaniesLinkUnlinkIdRequest { + id: string; + /** Contact ids for contacts to be linked with company */ + linkContactIds?: number[]; + /** Deal ids for deals to be linked with company */ + linkDealsIds?: string[]; + /** Contact ids for contacts to be unlinked from company */ + unlinkContactIds?: number[]; + /** Deal ids for deals to be unlinked from company */ + unlinkDealsIds?: string[]; +} diff --git a/src/api/resources/companies/client/requests/PostCompaniesImportRequest.ts b/src/api/resources/companies/client/requests/PostCompaniesImportRequest.ts new file mode 100644 index 0000000..212b9d3 --- /dev/null +++ b/src/api/resources/companies/client/requests/PostCompaniesImportRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../../../../core/index.js"; + +/** + * @example + * {} + */ +export interface PostCompaniesImportRequest { + /** The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name */ + file?: core.file.Uploadable | undefined; + /** + * The mapping options in JSON format. Here is an example of the JSON structure: ```json { + * "link_entities": true, // Determines whether to link related entities during the import process + * "unlink_entities": false, // Determines whether to unlink related entities during the import process + * "update_existing_records": true, // Determines whether to update based on company ID or treat every row as create + * "unset_empty_attributes": false // Determines whether to unset a specific attribute during update if the values input is blank + * } ``` + */ + mapping?: Record; +} diff --git a/src/api/resources/companies/client/requests/PostCompaniesRequest.ts b/src/api/resources/companies/client/requests/PostCompaniesRequest.ts new file mode 100644 index 0000000..655c494 --- /dev/null +++ b/src/api/resources/companies/client/requests/PostCompaniesRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * name: "company" + * } + */ +export interface PostCompaniesRequest { + /** Attributes for company creation */ + attributes?: Record; + /** Country code if phone_number is passed in attributes. */ + countryCode?: number; + /** Contact ids to be linked with company */ + linkedContactsIds?: number[]; + /** Deal ids to be linked with company */ + linkedDealsIds?: string[]; + /** Name of company */ + name: string; +} diff --git a/src/api/resources/companies/client/requests/PostCrmAttributesRequest.ts b/src/api/resources/companies/client/requests/PostCrmAttributesRequest.ts new file mode 100644 index 0000000..8a617eb --- /dev/null +++ b/src/api/resources/companies/client/requests/PostCrmAttributesRequest.ts @@ -0,0 +1,42 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * attributeType: "text", + * label: "Attribute Label", + * objectType: "companies" + * } + */ +export interface PostCrmAttributesRequest { + /** The type of attribute (must be one of the defined enums) */ + attributeType: PostCrmAttributesRequest.AttributeType; + /** A description of the attribute */ + description?: string; + /** The label for the attribute (max 50 characters, cannot be empty) */ + label: string; + /** The type of object the attribute belongs to (prefilled with `companies`, mandatory) */ + objectType: PostCrmAttributesRequest.ObjectType; + /** Options for multi-choice or single-select attributes */ + optionsLabels?: string[]; +} + +export namespace PostCrmAttributesRequest { + /** The type of attribute (must be one of the defined enums) */ + export const AttributeType = { + Text: "text", + User: "user", + Number: "number", + SingleSelect: "single-select", + Date: "date", + Boolean: "boolean", + MultiChoice: "multi-choice", + } as const; + export type AttributeType = (typeof AttributeType)[keyof typeof AttributeType]; + /** The type of object the attribute belongs to (prefilled with `companies`, mandatory) */ + export const ObjectType = { + Companies: "companies", + Deals: "deals", + } as const; + export type ObjectType = (typeof ObjectType)[keyof typeof ObjectType]; +} diff --git a/src/api/resources/companies/client/requests/index.ts b/src/api/resources/companies/client/requests/index.ts new file mode 100644 index 0000000..0d519c9 --- /dev/null +++ b/src/api/resources/companies/client/requests/index.ts @@ -0,0 +1,8 @@ +export type { DeleteCompaniesIdRequest } from "./DeleteCompaniesIdRequest.js"; +export type { GetCompaniesIdRequest } from "./GetCompaniesIdRequest.js"; +export type { GetCompaniesRequest } from "./GetCompaniesRequest.js"; +export type { PatchCompaniesIdRequest } from "./PatchCompaniesIdRequest.js"; +export type { PatchCompaniesLinkUnlinkIdRequest } from "./PatchCompaniesLinkUnlinkIdRequest.js"; +export type { PostCompaniesImportRequest } from "./PostCompaniesImportRequest.js"; +export type { PostCompaniesRequest } from "./PostCompaniesRequest.js"; +export { PostCrmAttributesRequest } from "./PostCrmAttributesRequest.js"; diff --git a/src/api/resources/companies/index.ts b/src/api/resources/companies/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/companies/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/companies/types/GetCompaniesRequestSort.ts b/src/api/resources/companies/types/GetCompaniesRequestSort.ts new file mode 100644 index 0000000..a982d82 --- /dev/null +++ b/src/api/resources/companies/types/GetCompaniesRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCompaniesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetCompaniesRequestSort = (typeof GetCompaniesRequestSort)[keyof typeof GetCompaniesRequestSort]; diff --git a/src/api/resources/companies/types/GetCompaniesResponse.ts b/src/api/resources/companies/types/GetCompaniesResponse.ts new file mode 100644 index 0000000..f96461e --- /dev/null +++ b/src/api/resources/companies/types/GetCompaniesResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +/** + * List of companies + */ +export interface GetCompaniesResponse { + /** List of companies */ + items?: Brevo.Company[]; +} diff --git a/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts b/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts new file mode 100644 index 0000000..409194b --- /dev/null +++ b/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * List of attributes + */ +export interface GetCrmAttributesCompaniesResponseItem { + attributeOptions?: Record[]; + attributeTypeName?: string; + internalName?: string; + isRequired?: boolean; + label?: string; +} diff --git a/src/api/resources/companies/types/PostCompaniesImportResponse.ts b/src/api/resources/companies/types/PostCompaniesImportResponse.ts new file mode 100644 index 0000000..4722463 --- /dev/null +++ b/src/api/resources/companies/types/PostCompaniesImportResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostCompaniesImportResponse { + /** The ID of the import process */ + processId?: number; +} diff --git a/src/api/resources/companies/types/PostCompaniesResponse.ts b/src/api/resources/companies/types/PostCompaniesResponse.ts new file mode 100644 index 0000000..dea897f --- /dev/null +++ b/src/api/resources/companies/types/PostCompaniesResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Created company id + */ +export interface PostCompaniesResponse { + /** Unique company id */ + id: string; +} diff --git a/src/api/resources/companies/types/PostCrmAttributesResponse.ts b/src/api/resources/companies/types/PostCrmAttributesResponse.ts new file mode 100644 index 0000000..a72614f --- /dev/null +++ b/src/api/resources/companies/types/PostCrmAttributesResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostCrmAttributesResponse { + /** Unique ID of the created attribute */ + id: string; +} diff --git a/src/api/resources/companies/types/index.ts b/src/api/resources/companies/types/index.ts new file mode 100644 index 0000000..f2208fd --- /dev/null +++ b/src/api/resources/companies/types/index.ts @@ -0,0 +1,6 @@ +export * from "./GetCompaniesRequestSort.js"; +export * from "./GetCompaniesResponse.js"; +export * from "./GetCrmAttributesCompaniesResponseItem.js"; +export * from "./PostCompaniesImportResponse.js"; +export * from "./PostCompaniesResponse.js"; +export * from "./PostCrmAttributesResponse.js"; diff --git a/src/api/resources/contacts/client/Client.ts b/src/api/resources/contacts/client/Client.ts new file mode 100644 index 0000000..535274e --- /dev/null +++ b/src/api/resources/contacts/client/Client.ts @@ -0,0 +1,2295 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace ContactsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ContactsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ContactsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * + * Accepted Number Formats + * + * 91xxxxxxxxxx + * +91xxxxxxxxxx + * 0091xxxxxxxxxx + * + * + * @param {Brevo.GetContactsRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.TooManyRequestsError} + * + * @example + * await client.contacts.getContacts() + */ + public getContacts( + request: Brevo.GetContactsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getContacts(request, requestOptions)); + } + + private async __getContacts( + request: Brevo.GetContactsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { limit, offset, modifiedSince, createdSince, sort, segmentId, listIds, filter } = request; + const _queryParams: Record = { + limit, + offset, + modifiedSince, + createdSince, + sort: sort != null ? sort : undefined, + segmentId, + listIds, + filter, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetContacts, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Brevo.TooManyRequestsError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts"); + } + + /** + * Creates new contacts on Brevo. Contacts can be created by passing either -

1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
+ * + * @param {Brevo.CreateContactRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.TooEarlyError} + * + * @example + * await client.contacts.createContact() + */ + public createContact( + request: Brevo.CreateContactRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createContact(request, requestOptions)); + } + + private async __createContact( + request: Brevo.CreateContactRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateContactResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 425: + throw new Brevo.TooEarlyError( + _response.error.body as Brevo.ContactErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/contacts"); + } + + /** + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.contacts.getAttributes() + */ + public getAttributes( + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAttributes(requestOptions)); + } + + private async __getAttributes( + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/attributes", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetAttributesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/attributes"); + } + + /** + * @param {Brevo.CreateAttributeRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.createAttribute({ + * attributeCategory: "normal", + * attributeName: "attributeName" + * }) + */ + public createAttribute( + request: Brevo.CreateAttributeRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createAttribute(request, requestOptions)); + } + + private async __createAttribute( + request: Brevo.CreateAttributeRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { attributeCategory, attributeName, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/attributes/${core.url.encodePathParam(attributeCategory)}/${core.url.encodePathParam(attributeName)}`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/contacts/attributes/{attributeCategory}/{attributeName}", + ); + } + + /** + * @param {Brevo.UpdateAttributeRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.updateAttribute({ + * attributeCategory: "category", + * attributeName: "attributeName" + * }) + */ + public updateAttribute( + request: Brevo.UpdateAttributeRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateAttribute(request, requestOptions)); + } + + private async __updateAttribute( + request: Brevo.UpdateAttributeRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { attributeCategory, attributeName, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/attributes/${core.url.encodePathParam(attributeCategory)}/${core.url.encodePathParam(attributeName)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/contacts/attributes/{attributeCategory}/{attributeName}", + ); + } + + /** + * @param {Brevo.DeleteAttributeRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.deleteAttribute({ + * attributeCategory: "normal", + * attributeName: "attributeName" + * }) + */ + public deleteAttribute( + request: Brevo.DeleteAttributeRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteAttribute(request, requestOptions)); + } + + private async __deleteAttribute( + request: Brevo.DeleteAttributeRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { attributeCategory, attributeName } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/attributes/${core.url.encodePathParam(attributeCategory)}/${core.url.encodePathParam(attributeName)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/contacts/attributes/{attributeCategory}/{attributeName}", + ); + } + + /** + * @param {Brevo.DeleteMultiAttributeOptionsRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.deleteMultiAttributeOptions({ + * attributeType: "multiple-choice", + * multipleChoiceAttribute: "multipleChoiceAttribute", + * multipleChoiceAttributeOption: "multipleChoiceAttributeOption" + * }) + */ + public deleteMultiAttributeOptions( + request: Brevo.DeleteMultiAttributeOptionsRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteMultiAttributeOptions(request, requestOptions)); + } + + private async __deleteMultiAttributeOptions( + request: Brevo.DeleteMultiAttributeOptionsRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { attributeType, multipleChoiceAttribute, multipleChoiceAttributeOption } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/attributes/${core.url.encodePathParam(attributeType)}/${core.url.encodePathParam(multipleChoiceAttribute)}/${core.url.encodePathParam(multipleChoiceAttributeOption)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/contacts/attributes/{attributeType}/{multipleChoiceAttribute}/{multipleChoiceAttributeOption}", + ); + } + + /** + * @param {Brevo.UpdateBatchContactsRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.updateBatchContacts() + */ + public updateBatchContacts( + request: Brevo.UpdateBatchContactsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateBatchContacts(request, requestOptions)); + } + + private async __updateBatchContacts( + request: Brevo.UpdateBatchContactsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/batch", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/contacts/batch"); + } + + /** + * + * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. + * + * + * @param {Brevo.CreateDoiContactRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.createDoiContact({ + * email: "elly@example.com", + * includeListIds: [36], + * redirectionUrl: "http://requestb.in/173lyyx1", + * templateId: 2 + * }) + */ + public createDoiContact( + request: Brevo.CreateDoiContactRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createDoiContact(request, requestOptions)); + } + + private async __createDoiContact( + request: Brevo.CreateDoiContactRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/doubleOptinConfirmation", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/contacts/doubleOptinConfirmation", + ); + } + + /** + * It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. + * + * @param {Brevo.RequestContactExportRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.TooManyRequestsError} + * + * @example + * await client.contacts.requestContactExport({ + * customContactFilter: {} + * }) + */ + public requestContactExport( + request: Brevo.RequestContactExportRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__requestContactExport(request, requestOptions)); + } + + private async __requestContactExport( + request: Brevo.RequestContactExportRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/export", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.RequestContactExportResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Brevo.TooManyRequestsError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/contacts/export"); + } + + /** + * + * Ongoing changes for this endpoint + * + * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + * + * These are non breaking changes. + * + * The default value for the attributes will be 0. + * + * The uniqueSubscribers field is deprecated + * + * + * @param {Brevo.GetFoldersRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.getFolders() + */ + public getFolders( + request: Brevo.GetFoldersRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getFolders(request, requestOptions)); + } + + private async __getFolders( + request: Brevo.GetFoldersRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { limit, offset, sort } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/folders", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetFoldersResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/folders"); + } + + /** + * @param {Brevo.CreateUpdateFolder} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.createFolder({}) + */ + public createFolder( + request: Brevo.CreateUpdateFolder, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions)); + } + + private async __createFolder( + request: Brevo.CreateUpdateFolder, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/folders", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateFolderResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/contacts/folders"); + } + + /** + * + * Ongoing changes for this endpoint. + * + * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + * + * These are non breaking changes. The default value for the attributes will be 0. + * + * + * @param {Brevo.GetFolderRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.getFolder({ + * folderId: 1000000 + * }) + */ + public getFolder( + request: Brevo.GetFolderRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getFolder(request, requestOptions)); + } + + private async __getFolder( + request: Brevo.GetFolderRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { folderId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/folders/${core.url.encodePathParam(folderId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetFolder, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/folders/{folderId}"); + } + + /** + * @param {Brevo.UpdateFolderRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.updateFolder({ + * folderId: 1000000, + * body: {} + * }) + */ + public updateFolder( + request: Brevo.UpdateFolderRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateFolder(request, requestOptions)); + } + + private async __updateFolder( + request: Brevo.UpdateFolderRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { folderId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/folders/${core.url.encodePathParam(folderId)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/contacts/folders/{folderId}"); + } + + /** + * @param {Brevo.DeleteFolderRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.deleteFolder({ + * folderId: 1000000 + * }) + */ + public deleteFolder( + request: Brevo.DeleteFolderRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteFolder(request, requestOptions)); + } + + private async __deleteFolder( + request: Brevo.DeleteFolderRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { folderId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/folders/${core.url.encodePathParam(folderId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/contacts/folders/{folderId}", + ); + } + + /** + * + * Ongoing changes for this endpoint. + * + * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + * + * These are non breaking changes. The default value for the attributes will be 0. + * + * + * @param {Brevo.GetFolderListsRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.getFolderLists({ + * folderId: 1000000 + * }) + */ + public getFolderLists( + request: Brevo.GetFolderListsRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getFolderLists(request, requestOptions)); + } + + private async __getFolderLists( + request: Brevo.GetFolderListsRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { folderId, limit, offset, sort } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/folders/${core.url.encodePathParam(folderId)}/lists`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetFolderListsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/contacts/folders/{folderId}/lists", + ); + } + + /** + * It returns the background process ID which on completion calls the notify URL that you have set in the input. **Note**: - Any contact attribute that doesn't exist in your account will be ignored at import end. + * + * @param {Brevo.ImportContactsRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.importContacts() + */ + public importContacts( + request: Brevo.ImportContactsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__importContacts(request, requestOptions)); + } + + private async __importContacts( + request: Brevo.ImportContactsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/import", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ImportContactsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/contacts/import"); + } + + /** + * + * Ongoing changes for this endpoint. + * + * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + * + * These are non breaking changes. The default value for the attributes will be 0. + * + * + * @param {Brevo.GetListsRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.getLists() + */ + public getLists( + request: Brevo.GetListsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getLists(request, requestOptions)); + } + + private async __getLists( + request: Brevo.GetListsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { limit, offset, sort } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/lists", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetListsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/lists"); + } + + /** + * @param {Brevo.CreateListRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.createList({ + * folderId: 2, + * name: "Magento Customer - ES" + * }) + */ + public createList( + request: Brevo.CreateListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createList(request, requestOptions)); + } + + private async __createList( + request: Brevo.CreateListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/lists", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateListResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/contacts/lists"); + } + + /** + * @param {Brevo.GetListRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.getList({ + * listId: 1000000 + * }) + */ + public getList( + request: Brevo.GetListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getList(request, requestOptions)); + } + + private async __getList( + request: Brevo.GetListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { listId, startDate, endDate } = request; + const _queryParams: Record = { + startDate, + endDate, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/lists/${core.url.encodePathParam(listId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetListResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/lists/{listId}"); + } + + /** + * @param {Brevo.UpdateListRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.updateList({ + * listId: 1000000 + * }) + */ + public updateList( + request: Brevo.UpdateListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateList(request, requestOptions)); + } + + private async __updateList( + request: Brevo.UpdateListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { listId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/lists/${core.url.encodePathParam(listId)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/contacts/lists/{listId}"); + } + + /** + * @param {Brevo.DeleteListRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.deleteList({ + * listId: 1000000 + * }) + */ + public deleteList( + request: Brevo.DeleteListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteList(request, requestOptions)); + } + + private async __deleteList( + request: Brevo.DeleteListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { listId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/lists/${core.url.encodePathParam(listId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/contacts/lists/{listId}"); + } + + /** + * @param {Brevo.GetContactsFromListRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.getContactsFromList({ + * listId: 1000000 + * }) + */ + public getContactsFromList( + request: Brevo.GetContactsFromListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getContactsFromList(request, requestOptions)); + } + + private async __getContactsFromList( + request: Brevo.GetContactsFromListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { listId, modifiedSince, limit, offset, sort } = request; + const _queryParams: Record = { + modifiedSince, + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/lists/${core.url.encodePathParam(listId)}/contacts`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetContacts, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/contacts/lists/{listId}/contacts", + ); + } + + /** + * @param {Brevo.AddContactToListRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.addContactToList({ + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * }) + * + * @example + * await client.contacts.addContactToList({ + * listId: 1000000, + * body: { + * extIds: ["ext234", "ext456"] + * } + * }) + * + * @example + * await client.contacts.addContactToList({ + * listId: 1000000, + * body: { + * ids: [1, 2] + * } + * }) + */ + public addContactToList( + request: Brevo.AddContactToListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__addContactToList(request, requestOptions)); + } + + private async __addContactToList( + request: Brevo.AddContactToListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { listId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/lists/${core.url.encodePathParam(listId)}/contacts/add`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostContactInfo, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/contacts/lists/{listId}/contacts/add", + ); + } + + /** + * @param {Brevo.RemoveContactFromListRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.removeContactFromList({ + * listId: 1000000, + * body: { + * all: true + * } + * }) + * + * @example + * await client.contacts.removeContactFromList({ + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * }) + * + * @example + * await client.contacts.removeContactFromList({ + * listId: 1000000, + * body: { + * extIds: ["ext234", "ext456"] + * } + * }) + * + * @example + * await client.contacts.removeContactFromList({ + * listId: 1000000, + * body: { + * ids: [1, 2] + * } + * }) + */ + public removeContactFromList( + request: Brevo.RemoveContactFromListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__removeContactFromList(request, requestOptions)); + } + + private async __removeContactFromList( + request: Brevo.RemoveContactFromListRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { listId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/lists/${core.url.encodePathParam(listId)}/contacts/remove`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostContactInfo, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/contacts/lists/{listId}/contacts/remove", + ); + } + + /** + * @param {Brevo.GetSegmentsRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.contacts.getSegments() + */ + public getSegments( + request: Brevo.GetSegmentsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSegments(request, requestOptions)); + } + + private async __getSegments( + request: Brevo.GetSegmentsRequest = {}, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { limit, offset, sort } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "contacts/segments", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSegmentsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/segments"); + } + + /** + * + * Accepted Number Formats + * + * 91xxxxxxxxxx + * +91xxxxxxxxxx + * 0091xxxxxxxxxx + * + * + * There are 2 ways to get a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges. + * + * @param {Brevo.GetContactInfoRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.getContactInfo({ + * identifier: "identifier" + * }) + */ + public getContactInfo( + request: Brevo.GetContactInfoRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getContactInfo(request, requestOptions)); + } + + private async __getContactInfo( + request: Brevo.GetContactInfoRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { identifier, identifierType, startDate, endDate } = request; + const _queryParams: Record = { + identifierType: identifierType != null ? identifierType : undefined, + startDate, + endDate, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/${core.url.encodePathParam(identifier)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetContactInfoResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/{identifier}"); + } + + /** + * There are 2 ways to update a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute + * + * @param {Brevo.UpdateContactRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.TooEarlyError} + * + * @example + * await client.contacts.updateContact({ + * identifier: "identifier" + * }) + */ + public updateContact( + request: Brevo.UpdateContactRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateContact(request, requestOptions)); + } + + private async __updateContact( + request: Brevo.UpdateContactRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { identifier, identifierType, ..._body } = request; + const _queryParams: Record = { + identifierType: identifierType != null ? identifierType : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/${core.url.encodePathParam(identifier)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 425: + throw new Brevo.TooEarlyError( + _response.error.body as Brevo.ContactErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/contacts/{identifier}"); + } + + /** + * There are 2 ways to delete a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute. + * + * @param {Brevo.DeleteContactRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.MethodNotAllowedError} + * + * @example + * await client.contacts.deleteContact({ + * identifier: "identifier" + * }) + */ + public deleteContact( + request: Brevo.DeleteContactRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteContact(request, requestOptions)); + } + + private async __deleteContact( + request: Brevo.DeleteContactRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { identifier, identifierType } = request; + const _queryParams: Record = { + identifierType: identifierType != null ? identifierType : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/${core.url.encodePathParam(identifier)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 405: + throw new Brevo.MethodNotAllowedError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/contacts/{identifier}"); + } + + /** + * @param {Brevo.GetContactStatsRequest} request + * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.contacts.getContactStats({ + * identifier: "identifier" + * }) + */ + public getContactStats( + request: Brevo.GetContactStatsRequest, + requestOptions?: ContactsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getContactStats(request, requestOptions)); + } + + private async __getContactStats( + request: Brevo.GetContactStatsRequest, + requestOptions?: ContactsClient.RequestOptions, + ): Promise> { + const { identifier, startDate, endDate } = request; + const _queryParams: Record = { + startDate, + endDate, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `contacts/${core.url.encodePathParam(identifier)}/campaignStats`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetContactStatsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/contacts/{identifier}/campaignStats", + ); + } +} diff --git a/src/api/resources/contacts/client/index.ts b/src/api/resources/contacts/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/contacts/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/contacts/client/requests/AddContactToListRequest.ts b/src/api/resources/contacts/client/requests/AddContactToListRequest.ts new file mode 100644 index 0000000..0cfa627 --- /dev/null +++ b/src/api/resources/contacts/client/requests/AddContactToListRequest.ts @@ -0,0 +1,58 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * extIds: ["ext234", "ext456"] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * ids: [1, 2] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * } + */ +export interface AddContactToListRequest { + /** Id of the list */ + listId: number; + body: Brevo.AddContactToListRequestBody; +} diff --git a/src/api/resources/contacts/client/requests/CreateAttributeRequest.ts b/src/api/resources/contacts/client/requests/CreateAttributeRequest.ts new file mode 100644 index 0000000..38fa48d --- /dev/null +++ b/src/api/resources/contacts/client/requests/CreateAttributeRequest.ts @@ -0,0 +1,53 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * attributeCategory: "normal", + * attributeName: "attributeName" + * } + */ +export interface CreateAttributeRequest { + /** Category of the attribute */ + attributeCategory: Brevo.CreateAttributeRequestAttributeCategory; + /** Name of the attribute */ + attributeName: string; + /** List of values and labels that the attribute can take. **Use only if the attribute's category is "category"**. None of the category options can exceed max 200 characters. For example: **[{"value":1, "label":"male"}, {"value":2, "label":"female"}]** */ + enumeration?: CreateAttributeRequest.Enumeration.Item[]; + /** Type of the attribute. **Use only if the attribute's category is 'calculated' or 'global'** */ + isRecurring?: boolean; + /** List of options you want to add for multiple-choice attribute. **Use only if the attribute's category is "normal" and attribute's type is "multiple-choice". None of the multicategory options can exceed max 200 characters.** For example: **["USA","INDIA"]** */ + multiCategoryOptions?: string[]; + /** Type of the attribute. **Use only if the attribute's category is 'normal', 'category' or 'transactional'** Type **user and multiple-choice** is only available if the category is **normal** attribute Type **id** is only available if the category is **transactional** attribute Type **category** is only available if the category is **category** attribute */ + type?: CreateAttributeRequest.Type; + /** Value of the attribute. **Use only if the attribute's category is 'calculated' or 'global'** */ + value?: string; +} + +export namespace CreateAttributeRequest { + export type Enumeration = Enumeration.Item[]; + + export namespace Enumeration { + export interface Item { + /** Label of the value */ + label: string; + /** Id of the value */ + value: number; + } + } + + /** Type of the attribute. **Use only if the attribute's category is 'normal', 'category' or 'transactional'** Type **user and multiple-choice** is only available if the category is **normal** attribute Type **id** is only available if the category is **transactional** attribute Type **category** is only available if the category is **category** attribute */ + export const Type = { + Text: "text", + Date: "date", + Float: "float", + Boolean: "boolean", + Id: "id", + Category: "category", + MultipleChoice: "multiple-choice", + User: "user", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; +} diff --git a/src/api/resources/contacts/client/requests/CreateContactRequest.ts b/src/api/resources/contacts/client/requests/CreateContactRequest.ts new file mode 100644 index 0000000..c9ca9e7 --- /dev/null +++ b/src/api/resources/contacts/client/requests/CreateContactRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface CreateContactRequest { + /** Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. **These attributes must be present in your Brevo account**. For eg: **{"FNAME":"Elly", "LNAME":"Roger", "COUNTRIES": ["India","China"]}** */ + attributes?: Record; + /** Email address of the user. **Mandatory if "ext_id" & "SMS" field is not passed.** */ + email?: string; + /** Set this field to blacklist the contact for emails (emailBlacklisted = true) */ + emailBlacklisted?: boolean; + /** Pass your own Id to create a contact. */ + ext_id?: string; + /** Ids of the lists to add the contact to */ + listIds?: number[]; + /** Set this field to blacklist the contact for SMS (smsBlacklisted = true) */ + smsBlacklisted?: boolean; + /** transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) */ + smtpBlacklistSender?: string[]; + /** Facilitate to update the existing contact in the same request (updateEnabled = true) */ + updateEnabled?: boolean; +} + +export namespace CreateContactRequest { + export namespace Attributes { + export type Value = number | string | boolean | string[]; + } +} diff --git a/src/api/resources/contacts/client/requests/CreateDoiContactRequest.ts b/src/api/resources/contacts/client/requests/CreateDoiContactRequest.ts new file mode 100644 index 0000000..1a9851c --- /dev/null +++ b/src/api/resources/contacts/client/requests/CreateDoiContactRequest.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "elly@example.com", + * includeListIds: [36], + * redirectionUrl: "http://requestb.in/173lyyx1", + * templateId: 2 + * } + */ +export interface CreateDoiContactRequest { + /** Pass the set of attributes and their values. **These attributes must be present in your Brevo account**. For eg. **{'FNAME':'Elly', 'LNAME':'Roger', 'COUNTRIES': ['India','China']}** */ + attributes?: Record; + /** Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. */ + email: string; + /** Lists under user account where contact should not be added */ + excludeListIds?: number[]; + /** Lists under user account where contact should be added */ + includeListIds: number[]; + /** URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag **{{ params.DOIurl }}**. */ + redirectionUrl: string; + /** Id of the Double opt-in (DOI) template */ + templateId: number; +} + +export namespace CreateDoiContactRequest { + export namespace Attributes { + export type Value = number | string | boolean | string[]; + } +} diff --git a/src/api/resources/contacts/client/requests/CreateListRequest.ts b/src/api/resources/contacts/client/requests/CreateListRequest.ts new file mode 100644 index 0000000..2710ee8 --- /dev/null +++ b/src/api/resources/contacts/client/requests/CreateListRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * folderId: 2, + * name: "Magento Customer - ES" + * } + */ +export interface CreateListRequest { + /** Id of the parent folder in which this list is to be created */ + folderId: number; + /** Name of the list */ + name: string; +} diff --git a/src/api/resources/contacts/client/requests/DeleteAttributeRequest.ts b/src/api/resources/contacts/client/requests/DeleteAttributeRequest.ts new file mode 100644 index 0000000..54ba4d5 --- /dev/null +++ b/src/api/resources/contacts/client/requests/DeleteAttributeRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * attributeCategory: "normal", + * attributeName: "attributeName" + * } + */ +export interface DeleteAttributeRequest { + /** Category of the attribute */ + attributeCategory: Brevo.DeleteAttributeRequestAttributeCategory; + /** Name of the existing attribute */ + attributeName: string; +} diff --git a/src/api/resources/contacts/client/requests/DeleteContactRequest.ts b/src/api/resources/contacts/client/requests/DeleteContactRequest.ts new file mode 100644 index 0000000..560f968 --- /dev/null +++ b/src/api/resources/contacts/client/requests/DeleteContactRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * identifier: "identifier" + * } + */ +export interface DeleteContactRequest { + /** Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) */ + identifier: Brevo.DeleteContactRequestIdentifier; + /** email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute */ + identifierType?: Brevo.DeleteContactRequestIdentifierType; +} diff --git a/src/api/resources/contacts/client/requests/DeleteFolderRequest.ts b/src/api/resources/contacts/client/requests/DeleteFolderRequest.ts new file mode 100644 index 0000000..f728d9d --- /dev/null +++ b/src/api/resources/contacts/client/requests/DeleteFolderRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * folderId: 1000000 + * } + */ +export interface DeleteFolderRequest { + /** Id of the folder */ + folderId: number; +} diff --git a/src/api/resources/contacts/client/requests/DeleteListRequest.ts b/src/api/resources/contacts/client/requests/DeleteListRequest.ts new file mode 100644 index 0000000..cbf6637 --- /dev/null +++ b/src/api/resources/contacts/client/requests/DeleteListRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * listId: 1000000 + * } + */ +export interface DeleteListRequest { + /** Id of the list */ + listId: number; +} diff --git a/src/api/resources/contacts/client/requests/DeleteMultiAttributeOptionsRequest.ts b/src/api/resources/contacts/client/requests/DeleteMultiAttributeOptionsRequest.ts new file mode 100644 index 0000000..7bc8831 --- /dev/null +++ b/src/api/resources/contacts/client/requests/DeleteMultiAttributeOptionsRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * attributeType: "multiple-choice", + * multipleChoiceAttribute: "multipleChoiceAttribute", + * multipleChoiceAttributeOption: "multipleChoiceAttributeOption" + * } + */ +export interface DeleteMultiAttributeOptionsRequest { + /** Type of the attribute */ + attributeType: "multiple-choice"; + /** Name of the existing multiple-choice attribute */ + multipleChoiceAttribute: string; + /** Name of the existing multiple-choice attribute option that you want to delete */ + multipleChoiceAttributeOption: string; +} diff --git a/src/api/resources/contacts/client/requests/GetContactInfoRequest.ts b/src/api/resources/contacts/client/requests/GetContactInfoRequest.ts new file mode 100644 index 0000000..0df5b8e --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetContactInfoRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * identifier: "identifier" + * } + */ +export interface GetContactInfoRequest { + /** Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded) */ + identifier: Brevo.GetContactInfoRequestIdentifier; + /** email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute */ + identifierType?: Brevo.GetContactInfoRequestIdentifierType; + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. */ + endDate?: string; +} diff --git a/src/api/resources/contacts/client/requests/GetContactStatsRequest.ts b/src/api/resources/contacts/client/requests/GetContactStatsRequest.ts new file mode 100644 index 0000000..0324ab0 --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetContactStatsRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * identifier: "identifier" + * } + */ +export interface GetContactStatsRequest { + /** Email (urlencoded) OR ID of the contact */ + identifier: Brevo.GetContactStatsRequestIdentifier; + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days */ + endDate?: string; +} diff --git a/src/api/resources/contacts/client/requests/GetContactsFromListRequest.ts b/src/api/resources/contacts/client/requests/GetContactsFromListRequest.ts new file mode 100644 index 0000000..1a9d520 --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetContactsFromListRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * listId: 1000000 + * } + */ +export interface GetContactsFromListRequest { + /** Id of the list */ + listId: number; + /** Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + modifiedSince?: string; + /** Number of documents per page */ + limit?: number; + /** Index of the first document of the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetContactsFromListRequestSort; +} diff --git a/src/api/resources/contacts/client/requests/GetContactsRequest.ts b/src/api/resources/contacts/client/requests/GetContactsRequest.ts new file mode 100644 index 0000000..fad0d39 --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetContactsRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetContactsRequest { + /** Number of documents per page */ + limit?: number; + /** Index of the first document of the page */ + offset?: number; + /** Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + modifiedSince?: string; + /** Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + createdSince?: string; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetContactsRequestSort; + /** Id of the segment. **Either listIds or segmentId can be passed.** */ + segmentId?: number; + /** Ids of the list. **Either listIds or segmentId can be passed.** */ + listIds?: number | number[]; + /** Filter the contacts on the basis of attributes. **Allowed operator: equals. For multiple-choice options, the filter will apply an AND condition between the options. For category attributes, the filter will work with both id and value. (e.g. filter=equals(FIRSTNAME,"Antoine"), filter=equals(B1, true), filter=equals(DOB, "1989-11-23"), filter=equals(GENDER, "1"), filter=equals(GENDER, "MALE"), filter=equals(COUNTRY,"USA, INDIA")** */ + filter?: string; +} diff --git a/src/api/resources/contacts/client/requests/GetFolderListsRequest.ts b/src/api/resources/contacts/client/requests/GetFolderListsRequest.ts new file mode 100644 index 0000000..263e67a --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetFolderListsRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * folderId: 1000000 + * } + */ +export interface GetFolderListsRequest { + /** Id of the folder */ + folderId: number; + /** Number of documents per page */ + limit?: number; + /** Index of the first document of the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetFolderListsRequestSort; +} diff --git a/src/api/resources/contacts/client/requests/GetFolderRequest.ts b/src/api/resources/contacts/client/requests/GetFolderRequest.ts new file mode 100644 index 0000000..60727e9 --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetFolderRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * folderId: 1000000 + * } + */ +export interface GetFolderRequest { + /** id of the folder */ + folderId: number; +} diff --git a/src/api/resources/contacts/client/requests/GetFoldersRequest.ts b/src/api/resources/contacts/client/requests/GetFoldersRequest.ts new file mode 100644 index 0000000..1917eac --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetFoldersRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetFoldersRequest { + /** Number of documents per page */ + limit?: number; + /** Index of the first document of the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetFoldersRequestSort; +} diff --git a/src/api/resources/contacts/client/requests/GetListRequest.ts b/src/api/resources/contacts/client/requests/GetListRequest.ts new file mode 100644 index 0000000..8a5f023 --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetListRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * listId: 1000000 + * } + */ +export interface GetListRequest { + /** Id of the list */ + listId: number; + /** **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** */ + startDate?: string; + /** **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** */ + endDate?: string; +} diff --git a/src/api/resources/contacts/client/requests/GetListsRequest.ts b/src/api/resources/contacts/client/requests/GetListsRequest.ts new file mode 100644 index 0000000..52f7c43 --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetListsRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetListsRequest { + /** Number of documents per page */ + limit?: number; + /** Index of the first document of the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetListsRequestSort; +} diff --git a/src/api/resources/contacts/client/requests/GetSegmentsRequest.ts b/src/api/resources/contacts/client/requests/GetSegmentsRequest.ts new file mode 100644 index 0000000..29b565c --- /dev/null +++ b/src/api/resources/contacts/client/requests/GetSegmentsRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetSegmentsRequest { + /** Number of documents per page */ + limit?: number; + /** Index of the first document of the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetSegmentsRequestSort; +} diff --git a/src/api/resources/contacts/client/requests/ImportContactsRequest.ts b/src/api/resources/contacts/client/requests/ImportContactsRequest.ts new file mode 100644 index 0000000..bad0dd7 --- /dev/null +++ b/src/api/resources/contacts/client/requests/ImportContactsRequest.ts @@ -0,0 +1,52 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface ImportContactsRequest { + /** To disable email notification */ + disableNotification?: boolean; + /** To blacklist all the contacts for email */ + emailBlacklist?: boolean; + /** To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in Brevo, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( **only available if `updateExistingContacts` set to true **) */ + emptyContactsAttributes?: boolean; + /** **Mandatory if fileUrl and jsonBody is not defined.** CSV content to be imported. Use semicolon to separate multiple attributes. **Maximum allowed file body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. */ + fileBody?: string; + /** **Mandatory if fileBody and jsonBody is not defined.** URL of the file to be imported (**no local file**). Possible file formats: #### .txt, .csv, .json */ + fileUrl?: string; + /** **Mandatory if fileUrl and fileBody is not defined.** JSON content to be imported. **Maximum allowed json body size is 10MB** . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of json body size while parsing. Please use fileUrl instead to import bigger files. */ + jsonBody?: ImportContactsRequest.JsonBody.Item[]; + /** **Mandatory if newList is not defined.** Ids of the lists in which the contacts shall be imported. For example, **[2, 4, 7]**. */ + listIds?: number[]; + /** To create a new list and import the contacts into it, pass the listName and an optional folderId. */ + newList?: ImportContactsRequest.NewList; + /** URL that will be called once the import process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 */ + notifyUrl?: string; + /** To blacklist all the contacts for sms */ + smsBlacklist?: boolean; + /** To facilitate the choice to update the existing contacts */ + updateExistingContacts?: boolean; +} + +export namespace ImportContactsRequest { + export type JsonBody = JsonBody.Item[]; + + export namespace JsonBody { + export interface Item { + /** List of attributes to be imported */ + attributes?: Record; + email?: string; + } + } + + /** + * To create a new list and import the contacts into it, pass the listName and an optional folderId. + */ + export interface NewList { + /** Id of the folder where this new list shall be created. **Mandatory if listName is not empty** */ + folderId?: number; + /** List with listName will be created first and users will be imported in it. **Mandatory if listIds is empty**. */ + listName?: string; + } +} diff --git a/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts b/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts new file mode 100644 index 0000000..860544a --- /dev/null +++ b/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts @@ -0,0 +1,74 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * extIds: ["ext234", "ext456"] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * ids: [1, 2] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } + */ +export interface RemoveContactFromListRequest { + /** Id of the list */ + listId: number; + body: Brevo.RemoveContactFromListRequestBody; +} diff --git a/src/api/resources/contacts/client/requests/RequestContactExportRequest.ts b/src/api/resources/contacts/client/requests/RequestContactExportRequest.ts new file mode 100644 index 0000000..0e45977 --- /dev/null +++ b/src/api/resources/contacts/client/requests/RequestContactExportRequest.ts @@ -0,0 +1,77 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * customContactFilter: {} + * } + */ +export interface RequestContactExportRequest { + /** Set the filter for the contacts to be exported. */ + customContactFilter: RequestContactExportRequest.CustomContactFilter; + /** To avoid generating the email notification upon contact export, pass **true** */ + disableNotification?: boolean; + /** List of all the attributes that you want to export. **These attributes must be present in your contact database. It is required if exportMandatoryAttributes is set false. ** For example: **['fname', 'lname', 'email']** */ + exportAttributes?: string[]; + /** To export mandatory attributes like EMAIL, ADDED_TIME, MODIFIED_TIME */ + exportMandatoryAttributes?: boolean; + /** Export metadata of contacts such as _listIds, ADDED_TIME, MODIFIED_TIME. */ + exportMetadata?: string[]; + /** Specifies whether the date fields createdAt, modifiedAt in the exported data should be returned in UTC format. */ + exportDateInUTC?: boolean; + /** Export subscription status of contacts for email & sms marketting. Pass email_marketing to obtain the marketing email subscription status & sms_marketing to retrieve the marketing SMS status of the contact. */ + exportSubscriptionStatus?: string[]; + /** Webhook that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 */ + notifyUrl?: string; +} + +export namespace RequestContactExportRequest { + /** + * Set the filter for the contacts to be exported. + */ + export interface CustomContactFilter { + /** **Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on contacts as per the list id. * **allContacts** - Fetch the list of all contacts for a particular list. * **subscribed & unsubscribed** - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * **unsubscribedPerList** - Fetch the list of contacts that are unsubscribed from a particular list only. */ + actionForContacts?: CustomContactFilter.ActionForContacts; + /** **Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on email campaigns. * **openers & nonOpeners** - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * **clickers & nonClickers** - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * **unsubscribed** - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * **hardBounces & softBounces** - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). */ + actionForEmailCampaigns?: CustomContactFilter.ActionForEmailCampaigns; + /** **Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed.** This will export the contacts on the basis of provided action applied on sms campaigns. * **unsubscribed** - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * **hardBounces & softBounces** - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. */ + actionForSmsCampaigns?: CustomContactFilter.ActionForSmsCampaigns; + /** Considered only if **actionForEmailCampaigns** is passed, ignored otherwise. **Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed.** The id of the email campaign for which the corresponding action shall be applied in the filter. */ + emailCampaignId?: number; + /** ID of the list. This is mandatory if actionForContacts is specified and segmentId is not provided. Either segmentId or listId must be included. */ + listId?: number; + /** ID of the segment. This is mandatory if actionForContacts is specified and listId is not provided. Either segmentId or listId must be included. */ + segmentId?: number; + /** Considered only if **actionForSmsCampaigns** is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. */ + smsCampaignId?: number; + } + + export namespace CustomContactFilter { + /** **Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on contacts as per the list id. * **allContacts** - Fetch the list of all contacts for a particular list. * **subscribed & unsubscribed** - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * **unsubscribedPerList** - Fetch the list of contacts that are unsubscribed from a particular list only. */ + export const ActionForContacts = { + AllContacts: "allContacts", + Subscribed: "subscribed", + Unsubscribed: "unsubscribed", + UnsubscribedPerList: "unsubscribedPerList", + } as const; + export type ActionForContacts = (typeof ActionForContacts)[keyof typeof ActionForContacts]; + /** **Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on email campaigns. * **openers & nonOpeners** - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * **clickers & nonClickers** - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * **unsubscribed** - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * **hardBounces & softBounces** - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). */ + export const ActionForEmailCampaigns = { + Openers: "openers", + NonOpeners: "nonOpeners", + Clickers: "clickers", + NonClickers: "nonClickers", + Unsubscribed: "unsubscribed", + HardBounces: "hardBounces", + SoftBounces: "softBounces", + } as const; + export type ActionForEmailCampaigns = (typeof ActionForEmailCampaigns)[keyof typeof ActionForEmailCampaigns]; + /** **Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed.** This will export the contacts on the basis of provided action applied on sms campaigns. * **unsubscribed** - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * **hardBounces & softBounces** - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. */ + export const ActionForSmsCampaigns = { + HardBounces: "hardBounces", + SoftBounces: "softBounces", + Unsubscribed: "unsubscribed", + } as const; + export type ActionForSmsCampaigns = (typeof ActionForSmsCampaigns)[keyof typeof ActionForSmsCampaigns]; + } +} diff --git a/src/api/resources/contacts/client/requests/UpdateAttributeRequest.ts b/src/api/resources/contacts/client/requests/UpdateAttributeRequest.ts new file mode 100644 index 0000000..89ee8a3 --- /dev/null +++ b/src/api/resources/contacts/client/requests/UpdateAttributeRequest.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * attributeCategory: "category", + * attributeName: "attributeName" + * } + */ +export interface UpdateAttributeRequest { + /** Category of the attribute */ + attributeCategory: Brevo.UpdateAttributeRequestAttributeCategory; + /** Name of the existing attribute */ + attributeName: string; + /** List of the values and labels that the attribute can take. **Use only if the attribute's category is "category"** None of the category options can exceed max 200 characters. For example, **[{"value":1, "label":"male"}, {"value":2, "label":"female"}]** */ + enumeration?: UpdateAttributeRequest.Enumeration.Item[]; + /** Use this option to add multiple-choice attributes options only if the attribute's category is "normal". **This option is specifically designed for updating multiple-choice attributes. None of the multicategory options can exceed max 200 characters.**. For example: **["USA","INDIA"]** */ + multiCategoryOptions?: string[]; + /** Value of the attribute to update. **Use only if the attribute's category is 'calculated' or 'global'** */ + value?: string; +} + +export namespace UpdateAttributeRequest { + export type Enumeration = Enumeration.Item[]; + + export namespace Enumeration { + export interface Item { + /** Label of the value */ + label: string; + /** Id of the value */ + value: number; + } + } +} diff --git a/src/api/resources/contacts/client/requests/UpdateBatchContactsRequest.ts b/src/api/resources/contacts/client/requests/UpdateBatchContactsRequest.ts new file mode 100644 index 0000000..6ae4575 --- /dev/null +++ b/src/api/resources/contacts/client/requests/UpdateBatchContactsRequest.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface UpdateBatchContactsRequest { + /** List of contacts to be updated */ + contacts?: UpdateBatchContactsRequest.Contacts.Item[]; +} + +export namespace UpdateBatchContactsRequest { + export type Contacts = Contacts.Item[]; + + export namespace Contacts { + export interface Item { + /** Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ "EMAIL":"newemail@domain.com", "FNAME":"Ellie", "LNAME":"Roger"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}** */ + attributes?: Record; + /** Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) */ + email?: string; + /** Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) */ + emailBlacklisted?: boolean; + /** Pass your own Id to update ext_id of a contact. */ + ext_id?: string; + /** id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) */ + id?: number; + /** Ids of the lists to add the contact to */ + listIds?: number[]; + /** SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) */ + sms?: string; + /** Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) */ + smsBlacklisted?: boolean; + /** transactional email forbidden sender for contact. Use only for email Contact */ + smtpBlacklistSender?: string[]; + /** Ids of the lists to remove the contact from */ + unlinkListIds?: number[]; + } + } +} diff --git a/src/api/resources/contacts/client/requests/UpdateContactRequest.ts b/src/api/resources/contacts/client/requests/UpdateContactRequest.ts new file mode 100644 index 0000000..3ef5221 --- /dev/null +++ b/src/api/resources/contacts/client/requests/UpdateContactRequest.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * identifier: "identifier" + * } + */ +export interface UpdateContactRequest { + /** Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value */ + identifier: Brevo.UpdateContactRequestIdentifier; + /** email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute */ + identifierType?: Brevo.UpdateContactRequestIdentifierType; + /** Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, **{ "EMAIL":"newemail@domain.com", "FNAME":"Ellie", "LNAME":"Roger", "COUNTRIES":["India","China"]}**. The attribute's parameter should be passed in capital letter while updating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored .Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}** */ + attributes?: Record; + /** Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) */ + emailBlacklisted?: boolean; + /** Pass your own Id to update ext_id of a contact. */ + ext_id?: string; + /** Ids of the lists to add the contact to */ + listIds?: number[]; + /** Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) */ + smsBlacklisted?: boolean; + /** transactional email forbidden sender for contact. Use only for email Contact */ + smtpBlacklistSender?: string[]; + /** Ids of the lists to remove the contact from */ + unlinkListIds?: number[]; +} + +export namespace UpdateContactRequest { + export namespace Attributes { + export type Value = number | string | boolean | string[]; + } +} diff --git a/src/api/resources/contacts/client/requests/UpdateFolderRequest.ts b/src/api/resources/contacts/client/requests/UpdateFolderRequest.ts new file mode 100644 index 0000000..0f4ff78 --- /dev/null +++ b/src/api/resources/contacts/client/requests/UpdateFolderRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * folderId: 1000000, + * body: {} + * } + */ +export interface UpdateFolderRequest { + /** Id of the folder */ + folderId: number; + body: Brevo.CreateUpdateFolder; +} diff --git a/src/api/resources/contacts/client/requests/UpdateListRequest.ts b/src/api/resources/contacts/client/requests/UpdateListRequest.ts new file mode 100644 index 0000000..1aa479f --- /dev/null +++ b/src/api/resources/contacts/client/requests/UpdateListRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * listId: 1000000 + * } + */ +export interface UpdateListRequest { + /** Id of the list */ + listId: number; + /** Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. */ + folderId?: number; + /** Name of the list. Either of the two parameters (name, folderId) can be updated at a time. */ + name?: string; +} diff --git a/src/api/resources/contacts/client/requests/index.ts b/src/api/resources/contacts/client/requests/index.ts new file mode 100644 index 0000000..77deeb2 --- /dev/null +++ b/src/api/resources/contacts/client/requests/index.ts @@ -0,0 +1,28 @@ +export type { AddContactToListRequest } from "./AddContactToListRequest.js"; +export { CreateAttributeRequest } from "./CreateAttributeRequest.js"; +export type { CreateContactRequest } from "./CreateContactRequest.js"; +export type { CreateDoiContactRequest } from "./CreateDoiContactRequest.js"; +export type { CreateListRequest } from "./CreateListRequest.js"; +export type { DeleteAttributeRequest } from "./DeleteAttributeRequest.js"; +export type { DeleteContactRequest } from "./DeleteContactRequest.js"; +export type { DeleteFolderRequest } from "./DeleteFolderRequest.js"; +export type { DeleteListRequest } from "./DeleteListRequest.js"; +export type { DeleteMultiAttributeOptionsRequest } from "./DeleteMultiAttributeOptionsRequest.js"; +export type { GetContactInfoRequest } from "./GetContactInfoRequest.js"; +export type { GetContactStatsRequest } from "./GetContactStatsRequest.js"; +export type { GetContactsFromListRequest } from "./GetContactsFromListRequest.js"; +export type { GetContactsRequest } from "./GetContactsRequest.js"; +export type { GetFolderListsRequest } from "./GetFolderListsRequest.js"; +export type { GetFolderRequest } from "./GetFolderRequest.js"; +export type { GetFoldersRequest } from "./GetFoldersRequest.js"; +export type { GetListRequest } from "./GetListRequest.js"; +export type { GetListsRequest } from "./GetListsRequest.js"; +export type { GetSegmentsRequest } from "./GetSegmentsRequest.js"; +export type { ImportContactsRequest } from "./ImportContactsRequest.js"; +export type { RemoveContactFromListRequest } from "./RemoveContactFromListRequest.js"; +export { RequestContactExportRequest } from "./RequestContactExportRequest.js"; +export type { UpdateAttributeRequest } from "./UpdateAttributeRequest.js"; +export type { UpdateBatchContactsRequest } from "./UpdateBatchContactsRequest.js"; +export type { UpdateContactRequest } from "./UpdateContactRequest.js"; +export type { UpdateFolderRequest } from "./UpdateFolderRequest.js"; +export type { UpdateListRequest } from "./UpdateListRequest.js"; diff --git a/src/api/resources/contacts/index.ts b/src/api/resources/contacts/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/contacts/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/contacts/types/AddContactToListRequestBody.ts b/src/api/resources/contacts/types/AddContactToListRequestBody.ts new file mode 100644 index 0000000..63a5a92 --- /dev/null +++ b/src/api/resources/contacts/types/AddContactToListRequestBody.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export type AddContactToListRequestBody = + | { + emails?: string[] | undefined; + } + | { + ids?: number[] | undefined; + } + | { + extIds?: string[] | undefined; + }; diff --git a/src/api/resources/contacts/types/CreateAttributeRequestAttributeCategory.ts b/src/api/resources/contacts/types/CreateAttributeRequestAttributeCategory.ts new file mode 100644 index 0000000..3f4241d --- /dev/null +++ b/src/api/resources/contacts/types/CreateAttributeRequestAttributeCategory.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +export const CreateAttributeRequestAttributeCategory = { + Normal: "normal", + Transactional: "transactional", + Category: "category", + Calculated: "calculated", + Global: "global", +} as const; +export type CreateAttributeRequestAttributeCategory = + (typeof CreateAttributeRequestAttributeCategory)[keyof typeof CreateAttributeRequestAttributeCategory]; diff --git a/src/api/resources/contacts/types/CreateContactResponse.ts b/src/api/resources/contacts/types/CreateContactResponse.ts new file mode 100644 index 0000000..a783fdd --- /dev/null +++ b/src/api/resources/contacts/types/CreateContactResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateContactResponse { + /** ID of the contact when a new contact is created */ + id?: number; +} diff --git a/src/api/resources/contacts/types/CreateFolderResponse.ts b/src/api/resources/contacts/types/CreateFolderResponse.ts new file mode 100644 index 0000000..5c7b66d --- /dev/null +++ b/src/api/resources/contacts/types/CreateFolderResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateFolderResponse { + /** ID of the object created */ + id: number; +} diff --git a/src/api/resources/contacts/types/CreateListResponse.ts b/src/api/resources/contacts/types/CreateListResponse.ts new file mode 100644 index 0000000..69652e0 --- /dev/null +++ b/src/api/resources/contacts/types/CreateListResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateListResponse { + /** ID of the object created */ + id: number; +} diff --git a/src/api/resources/contacts/types/DeleteAttributeRequestAttributeCategory.ts b/src/api/resources/contacts/types/DeleteAttributeRequestAttributeCategory.ts new file mode 100644 index 0000000..5ab3060 --- /dev/null +++ b/src/api/resources/contacts/types/DeleteAttributeRequestAttributeCategory.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +export const DeleteAttributeRequestAttributeCategory = { + Normal: "normal", + Transactional: "transactional", + Category: "category", + Calculated: "calculated", + Global: "global", +} as const; +export type DeleteAttributeRequestAttributeCategory = + (typeof DeleteAttributeRequestAttributeCategory)[keyof typeof DeleteAttributeRequestAttributeCategory]; diff --git a/src/api/resources/contacts/types/DeleteContactRequestIdentifier.ts b/src/api/resources/contacts/types/DeleteContactRequestIdentifier.ts new file mode 100644 index 0000000..f377aac --- /dev/null +++ b/src/api/resources/contacts/types/DeleteContactRequestIdentifier.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type DeleteContactRequestIdentifier = string | number; diff --git a/src/api/resources/contacts/types/DeleteContactRequestIdentifierType.ts b/src/api/resources/contacts/types/DeleteContactRequestIdentifierType.ts new file mode 100644 index 0000000..e594be2 --- /dev/null +++ b/src/api/resources/contacts/types/DeleteContactRequestIdentifierType.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export const DeleteContactRequestIdentifierType = { + EmailId: "email_id", + ContactId: "contact_id", + ExtId: "ext_id", + PhoneId: "phone_id", + WhatsappId: "whatsapp_id", + LandlineNumberId: "landline_number_id", +} as const; +export type DeleteContactRequestIdentifierType = + (typeof DeleteContactRequestIdentifierType)[keyof typeof DeleteContactRequestIdentifierType]; diff --git a/src/api/resources/contacts/types/GetAttributesResponse.ts b/src/api/resources/contacts/types/GetAttributesResponse.ts new file mode 100644 index 0000000..0db90c5 --- /dev/null +++ b/src/api/resources/contacts/types/GetAttributesResponse.ts @@ -0,0 +1,61 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetAttributesResponse { + /** Listing of available contact attributes in your account */ + attributes: GetAttributesResponse.Attributes.Item[]; +} + +export namespace GetAttributesResponse { + export type Attributes = Attributes.Item[]; + + export namespace Attributes { + export interface Item { + /** Calculated value formula */ + calculatedValue?: string; + /** Category of the attribute */ + category: Item.Category; + /** Parameter only available for "category" type attributes. */ + enumeration?: Item.Enumeration.Item[]; + /** Parameter only available for "multiple-choice" type attributes. */ + multiCategoryOptions?: string[]; + /** Name of the attribute */ + name: string; + /** Type of the attribute */ + type?: Item.Type; + } + + export namespace Item { + /** Category of the attribute */ + export const Category = { + Normal: "normal", + Transactional: "transactional", + Category: "category", + Calculated: "calculated", + Global: "global", + } as const; + export type Category = (typeof Category)[keyof typeof Category]; + export type Enumeration = Enumeration.Item[]; + + export namespace Enumeration { + export interface Item { + /** Label of the "category" type attribute */ + label: string; + /** ID of Value of the "category" type attribute */ + value: number; + } + } + + /** Type of the attribute */ + export const Type = { + Text: "text", + Date: "date", + Float: "float", + Id: "id", + Boolean: "boolean", + MultipleChoice: "multiple-choice", + User: "user", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; + } + } +} diff --git a/src/api/resources/contacts/types/GetContactInfoRequestIdentifier.ts b/src/api/resources/contacts/types/GetContactInfoRequestIdentifier.ts new file mode 100644 index 0000000..2914a28 --- /dev/null +++ b/src/api/resources/contacts/types/GetContactInfoRequestIdentifier.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type GetContactInfoRequestIdentifier = string | number; diff --git a/src/api/resources/contacts/types/GetContactInfoRequestIdentifierType.ts b/src/api/resources/contacts/types/GetContactInfoRequestIdentifierType.ts new file mode 100644 index 0000000..58250c3 --- /dev/null +++ b/src/api/resources/contacts/types/GetContactInfoRequestIdentifierType.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetContactInfoRequestIdentifierType = { + EmailId: "email_id", + PhoneId: "phone_id", + ContactId: "contact_id", + ExtId: "ext_id", + WhatsappId: "whatsapp_id", + LandlineNumberId: "landline_number_id", +} as const; +export type GetContactInfoRequestIdentifierType = + (typeof GetContactInfoRequestIdentifierType)[keyof typeof GetContactInfoRequestIdentifierType]; diff --git a/src/api/resources/contacts/types/GetContactInfoResponse.ts b/src/api/resources/contacts/types/GetContactInfoResponse.ts new file mode 100644 index 0000000..3091f0c --- /dev/null +++ b/src/api/resources/contacts/types/GetContactInfoResponse.ts @@ -0,0 +1,195 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetContactInfoResponse { + /** Set of attributes of the contact */ + attributes: GetContactInfoResponse.Attributes; + /** Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Email address of the contact for which you requested the details */ + email?: string; + /** Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) */ + emailBlacklisted: boolean; + /** ID of the contact for which you requested the details */ + id: number; + listIds: number[]; + listUnsubscribed?: number[]; + /** Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) */ + smsBlacklisted: boolean; + /** Campaign statistics of the contact */ + statistics: GetContactInfoResponse.Statistics; +} + +export namespace GetContactInfoResponse { + /** + * Set of attributes of the contact + */ + export type Attributes = {}; + + /** + * Campaign statistics of the contact + */ + export interface Statistics { + /** Listing of the clicks generated by the contact */ + clicked?: Statistics.Clicked.Item[]; + /** Listing of the complaints generated by the contact */ + complaints?: Statistics.Complaints.Item[]; + /** Listing of the delivered campaign for the contact */ + delivered?: Statistics.Delivered.Item[]; + /** Listing of the hardbounes generated by the contact */ + hardBounces?: Statistics.HardBounces.Item[]; + /** Listing of the sent campaign for the contact */ + messagesSent?: Statistics.MessagesSent.Item[]; + /** Listing of the openings generated by the contact */ + opened?: Statistics.Opened.Item[]; + /** Listing of the softbounes generated by the contact */ + softBounces?: Statistics.SoftBounces.Item[]; + /** Listing of the transactional attributes for the contact */ + transacAttributes?: Statistics.TransacAttributes.Item[]; + /** Listing of the unsubscription for the contact */ + unsubscriptions?: Statistics.Unsubscriptions; + } + + export namespace Statistics { + export type Clicked = Clicked.Item[]; + + export namespace Clicked { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** Listing of the clicked links for the campaign */ + links: Item.Links.Item[]; + } + + export namespace Item { + export type Links = Links.Item[]; + + export namespace Links { + export interface Item { + /** Number of clicks on this link for the campaign */ + count: number; + /** UTC date-time of the event */ + eventTime: string; + /** IP from which the user has clicked on the link */ + ip: string; + /** URL of the clicked link */ + url: string; + } + } + } + } + + export type Complaints = Complaints.Item[]; + + export namespace Complaints { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type Delivered = Delivered.Item[]; + + export namespace Delivered { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type HardBounces = HardBounces.Item[]; + + export namespace HardBounces { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type MessagesSent = MessagesSent.Item[]; + + export namespace MessagesSent { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type Opened = Opened.Item[]; + + export namespace Opened { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** Number of openings for the campaign */ + count: number; + /** UTC date-time of the event */ + eventTime: string; + /** IP from which the user has opened the email */ + ip: string; + } + } + + export type SoftBounces = SoftBounces.Item[]; + + export namespace SoftBounces { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type TransacAttributes = TransacAttributes.Item[]; + + export namespace TransacAttributes { + export type Item = {}; + } + + /** + * Listing of the unsubscription for the contact + */ + export interface Unsubscriptions { + /** Contact has been unsubscribed from the administrator */ + adminUnsubscription: Unsubscriptions.AdminUnsubscription.Item[]; + /** Contact unsubscribe via unsubscription link in a campaign */ + userUnsubscription: Unsubscriptions.UserUnsubscription.Item[]; + } + + export namespace Unsubscriptions { + export type AdminUnsubscription = AdminUnsubscription.Item[]; + + export namespace AdminUnsubscription { + export interface Item { + /** UTC date-time of the event */ + eventTime: string; + /** IP from which the user has been unsubscribed */ + ip?: string; + } + } + + export type UserUnsubscription = UserUnsubscription.Item[]; + + export namespace UserUnsubscription { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + /** IP from which the user has unsubscribed */ + ip?: string; + } + } + } + } +} diff --git a/src/api/resources/contacts/types/GetContactStatsRequestIdentifier.ts b/src/api/resources/contacts/types/GetContactStatsRequestIdentifier.ts new file mode 100644 index 0000000..cca45f6 --- /dev/null +++ b/src/api/resources/contacts/types/GetContactStatsRequestIdentifier.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type GetContactStatsRequestIdentifier = string | number; diff --git a/src/api/resources/contacts/types/GetContactStatsResponse.ts b/src/api/resources/contacts/types/GetContactStatsResponse.ts new file mode 100644 index 0000000..43c6723 --- /dev/null +++ b/src/api/resources/contacts/types/GetContactStatsResponse.ts @@ -0,0 +1,161 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Campaign Statistics for the contact + */ +export interface GetContactStatsResponse { + clicked?: GetContactStatsResponse.Clicked.Item[]; + complaints?: GetContactStatsResponse.Complaints.Item[]; + delivered?: GetContactStatsResponse.Delivered.Item[]; + hardBounces?: GetContactStatsResponse.HardBounces.Item[]; + messagesSent?: GetContactStatsResponse.MessagesSent.Item[]; + opened?: GetContactStatsResponse.Opened.Item[]; + softBounces?: GetContactStatsResponse.SoftBounces.Item[]; + transacAttributes?: GetContactStatsResponse.TransacAttributes.Item[]; + unsubscriptions?: GetContactStatsResponse.Unsubscriptions; +} + +export namespace GetContactStatsResponse { + export type Clicked = Clicked.Item[]; + + export namespace Clicked { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + links: Item.Links.Item[]; + } + + export namespace Item { + export type Links = Links.Item[]; + + export namespace Links { + export interface Item { + /** Number of clicks on this link for the campaign */ + count: number; + /** UTC date-time of the event */ + eventTime: string; + /** IP from which the user has clicked on the link */ + ip: string; + /** URL of the clicked link */ + url: string; + } + } + } + } + + export type Complaints = Complaints.Item[]; + + export namespace Complaints { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type Delivered = Delivered.Item[]; + + export namespace Delivered { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type HardBounces = HardBounces.Item[]; + + export namespace HardBounces { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type MessagesSent = MessagesSent.Item[]; + + export namespace MessagesSent { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type Opened = Opened.Item[]; + + export namespace Opened { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** Number of openings of the campaign */ + count: number; + /** UTC date-time of the event */ + eventTime: string; + /** IP from which the user has opened the campaign */ + ip: string; + } + } + + export type SoftBounces = SoftBounces.Item[]; + + export namespace SoftBounces { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + } + } + + export type TransacAttributes = TransacAttributes.Item[]; + + export namespace TransacAttributes { + export interface Item { + /** Date of the order */ + orderDate: string; + /** ID of the order */ + orderId: number; + /** Price of the order */ + orderPrice: number; + } + } + + export interface Unsubscriptions { + /** Contact has been unsubscribed from the administrator */ + adminUnsubscription: Unsubscriptions.AdminUnsubscription.Item[]; + /** Contact has unsubscribed via the unsubscription link in the email */ + userUnsubscription: Unsubscriptions.UserUnsubscription.Item[]; + } + + export namespace Unsubscriptions { + export type AdminUnsubscription = AdminUnsubscription.Item[]; + + export namespace AdminUnsubscription { + export interface Item { + /** UTC date-time of the event */ + eventTime: string; + /** IP from which the user has been unsubscribed */ + ip?: string; + } + } + + export type UserUnsubscription = UserUnsubscription.Item[]; + + export namespace UserUnsubscription { + export interface Item { + /** ID of the campaign which generated the event */ + campaignId: number; + /** UTC date-time of the event */ + eventTime: string; + /** IP from which the user has unsubscribed */ + ip?: string; + } + } + } +} diff --git a/src/api/resources/contacts/types/GetContactsFromListRequestSort.ts b/src/api/resources/contacts/types/GetContactsFromListRequestSort.ts new file mode 100644 index 0000000..a51d744 --- /dev/null +++ b/src/api/resources/contacts/types/GetContactsFromListRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetContactsFromListRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetContactsFromListRequestSort = + (typeof GetContactsFromListRequestSort)[keyof typeof GetContactsFromListRequestSort]; diff --git a/src/api/resources/contacts/types/GetContactsRequestSort.ts b/src/api/resources/contacts/types/GetContactsRequestSort.ts new file mode 100644 index 0000000..98fe661 --- /dev/null +++ b/src/api/resources/contacts/types/GetContactsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetContactsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetContactsRequestSort = (typeof GetContactsRequestSort)[keyof typeof GetContactsRequestSort]; diff --git a/src/api/resources/contacts/types/GetFolderListsRequestSort.ts b/src/api/resources/contacts/types/GetFolderListsRequestSort.ts new file mode 100644 index 0000000..1fa02e0 --- /dev/null +++ b/src/api/resources/contacts/types/GetFolderListsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetFolderListsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetFolderListsRequestSort = (typeof GetFolderListsRequestSort)[keyof typeof GetFolderListsRequestSort]; diff --git a/src/api/resources/contacts/types/GetFolderListsResponse.ts b/src/api/resources/contacts/types/GetFolderListsResponse.ts new file mode 100644 index 0000000..230d223 --- /dev/null +++ b/src/api/resources/contacts/types/GetFolderListsResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetFolderListsResponse { + /** Number of lists in the folder */ + count?: number; + lists?: Brevo.GetList[]; +} diff --git a/src/api/resources/contacts/types/GetFoldersRequestSort.ts b/src/api/resources/contacts/types/GetFoldersRequestSort.ts new file mode 100644 index 0000000..52e1940 --- /dev/null +++ b/src/api/resources/contacts/types/GetFoldersRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetFoldersRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetFoldersRequestSort = (typeof GetFoldersRequestSort)[keyof typeof GetFoldersRequestSort]; diff --git a/src/api/resources/contacts/types/GetFoldersResponse.ts b/src/api/resources/contacts/types/GetFoldersResponse.ts new file mode 100644 index 0000000..205ce9d --- /dev/null +++ b/src/api/resources/contacts/types/GetFoldersResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetFoldersResponse { + /** Number of folders available in your account */ + count?: number; + folders?: Brevo.GetFolder[]; +} diff --git a/src/api/resources/contacts/types/GetListResponse.ts b/src/api/resources/contacts/types/GetListResponse.ts new file mode 100644 index 0000000..76c80a2 --- /dev/null +++ b/src/api/resources/contacts/types/GetListResponse.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetListResponse { + /** ID of the list */ + id: number; + /** Name of the list */ + name: string; + /** Number of blacklisted contacts in the list */ + totalBlacklisted: number; + /** Number of contacts in the list */ + totalSubscribers: number; + /** Number of unique contacts in the list */ + uniqueSubscribers: number; + campaignStats?: GetListResponse.CampaignStats.Item[]; + /** Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) */ + dynamicList?: boolean; + /** ID of the folder */ + folderId: number; +} + +export namespace GetListResponse { + export type CampaignStats = CampaignStats.Item[]; + + export namespace CampaignStats { + export interface Item { + /** ID of the campaign */ + campaignId: number; + stats: Brevo.GetCampaignStats; + } + } +} diff --git a/src/api/resources/contacts/types/GetListsRequestSort.ts b/src/api/resources/contacts/types/GetListsRequestSort.ts new file mode 100644 index 0000000..d7067b0 --- /dev/null +++ b/src/api/resources/contacts/types/GetListsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetListsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetListsRequestSort = (typeof GetListsRequestSort)[keyof typeof GetListsRequestSort]; diff --git a/src/api/resources/contacts/types/GetListsResponse.ts b/src/api/resources/contacts/types/GetListsResponse.ts new file mode 100644 index 0000000..ced961c --- /dev/null +++ b/src/api/resources/contacts/types/GetListsResponse.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetListsResponse { + /** Number of lists in your account */ + count?: number; + /** Listing of all the lists available in your account */ + lists?: GetListsResponse.Lists.Item[]; +} + +export namespace GetListsResponse { + export type Lists = Lists.Item[]; + + export namespace Lists { + export interface Item { + /** ID of the list */ + id: number; + /** Name of the list */ + name: string; + /** Number of blacklisted contacts in the list */ + totalBlacklisted: number; + /** Number of contacts in the list */ + totalSubscribers: number; + /** Number of unique contacts in the list */ + uniqueSubscribers: number; + /** ID of the folder */ + folderId: number; + } + } +} diff --git a/src/api/resources/contacts/types/GetSegmentsRequestSort.ts b/src/api/resources/contacts/types/GetSegmentsRequestSort.ts new file mode 100644 index 0000000..4c2252e --- /dev/null +++ b/src/api/resources/contacts/types/GetSegmentsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetSegmentsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetSegmentsRequestSort = (typeof GetSegmentsRequestSort)[keyof typeof GetSegmentsRequestSort]; diff --git a/src/api/resources/contacts/types/GetSegmentsResponse.ts b/src/api/resources/contacts/types/GetSegmentsResponse.ts new file mode 100644 index 0000000..e851c8c --- /dev/null +++ b/src/api/resources/contacts/types/GetSegmentsResponse.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSegmentsResponse { + /** Number of Segments in your account */ + count?: number; + /** Listing of all the segments available in your account */ + segments?: GetSegmentsResponse.Segments.Item[]; +} + +export namespace GetSegmentsResponse { + export type Segments = Segments.Item[]; + + export namespace Segments { + export interface Item { + /** Name of the Segment Category */ + categoryName: string; + /** ID of the list */ + id: number; + /** Name of the Segment */ + segmentName: string; + /** Updation UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + updatedAt?: string; + } + } +} diff --git a/src/api/resources/contacts/types/ImportContactsResponse.ts b/src/api/resources/contacts/types/ImportContactsResponse.ts new file mode 100644 index 0000000..65233ca --- /dev/null +++ b/src/api/resources/contacts/types/ImportContactsResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ImportContactsResponse { + /** Id of the process created */ + processId: number; +} diff --git a/src/api/resources/contacts/types/RemoveContactFromListRequestBody.ts b/src/api/resources/contacts/types/RemoveContactFromListRequestBody.ts new file mode 100644 index 0000000..eec27f7 --- /dev/null +++ b/src/api/resources/contacts/types/RemoveContactFromListRequestBody.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +export type RemoveContactFromListRequestBody = + | { + emails?: string[] | undefined; + } + | { + ids?: number[] | undefined; + } + | { + all?: boolean | undefined; + } + | { + extIds?: string[] | undefined; + }; diff --git a/src/api/resources/contacts/types/RequestContactExportResponse.ts b/src/api/resources/contacts/types/RequestContactExportResponse.ts new file mode 100644 index 0000000..bf984a8 --- /dev/null +++ b/src/api/resources/contacts/types/RequestContactExportResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface RequestContactExportResponse { + /** Id of the process created */ + processId: number; +} diff --git a/src/api/resources/contacts/types/UpdateAttributeRequestAttributeCategory.ts b/src/api/resources/contacts/types/UpdateAttributeRequestAttributeCategory.ts new file mode 100644 index 0000000..51c50c1 --- /dev/null +++ b/src/api/resources/contacts/types/UpdateAttributeRequestAttributeCategory.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export const UpdateAttributeRequestAttributeCategory = { + Category: "category", + Calculated: "calculated", + Global: "global", + Normal: "normal", +} as const; +export type UpdateAttributeRequestAttributeCategory = + (typeof UpdateAttributeRequestAttributeCategory)[keyof typeof UpdateAttributeRequestAttributeCategory]; diff --git a/src/api/resources/contacts/types/UpdateContactRequestIdentifier.ts b/src/api/resources/contacts/types/UpdateContactRequestIdentifier.ts new file mode 100644 index 0000000..9dbd9e8 --- /dev/null +++ b/src/api/resources/contacts/types/UpdateContactRequestIdentifier.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type UpdateContactRequestIdentifier = string | number; diff --git a/src/api/resources/contacts/types/UpdateContactRequestIdentifierType.ts b/src/api/resources/contacts/types/UpdateContactRequestIdentifierType.ts new file mode 100644 index 0000000..5b14826 --- /dev/null +++ b/src/api/resources/contacts/types/UpdateContactRequestIdentifierType.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export const UpdateContactRequestIdentifierType = { + EmailId: "email_id", + ContactId: "contact_id", + ExtId: "ext_id", + PhoneId: "phone_id", + WhatsappId: "whatsapp_id", + LandlineNumberId: "landline_number_id", +} as const; +export type UpdateContactRequestIdentifierType = + (typeof UpdateContactRequestIdentifierType)[keyof typeof UpdateContactRequestIdentifierType]; diff --git a/src/api/resources/contacts/types/index.ts b/src/api/resources/contacts/types/index.ts new file mode 100644 index 0000000..85ce14c --- /dev/null +++ b/src/api/resources/contacts/types/index.ts @@ -0,0 +1,31 @@ +export * from "./AddContactToListRequestBody.js"; +export * from "./CreateAttributeRequestAttributeCategory.js"; +export * from "./CreateContactResponse.js"; +export * from "./CreateFolderResponse.js"; +export * from "./CreateListResponse.js"; +export * from "./DeleteAttributeRequestAttributeCategory.js"; +export * from "./DeleteContactRequestIdentifier.js"; +export * from "./DeleteContactRequestIdentifierType.js"; +export * from "./GetAttributesResponse.js"; +export * from "./GetContactInfoRequestIdentifier.js"; +export * from "./GetContactInfoRequestIdentifierType.js"; +export * from "./GetContactInfoResponse.js"; +export * from "./GetContactStatsRequestIdentifier.js"; +export * from "./GetContactStatsResponse.js"; +export * from "./GetContactsFromListRequestSort.js"; +export * from "./GetContactsRequestSort.js"; +export * from "./GetFolderListsRequestSort.js"; +export * from "./GetFolderListsResponse.js"; +export * from "./GetFoldersRequestSort.js"; +export * from "./GetFoldersResponse.js"; +export * from "./GetListResponse.js"; +export * from "./GetListsRequestSort.js"; +export * from "./GetListsResponse.js"; +export * from "./GetSegmentsRequestSort.js"; +export * from "./GetSegmentsResponse.js"; +export * from "./ImportContactsResponse.js"; +export * from "./RemoveContactFromListRequestBody.js"; +export * from "./RequestContactExportResponse.js"; +export * from "./UpdateAttributeRequestAttributeCategory.js"; +export * from "./UpdateContactRequestIdentifier.js"; +export * from "./UpdateContactRequestIdentifierType.js"; diff --git a/src/api/resources/conversations/client/Client.ts b/src/api/resources/conversations/client/Client.ts new file mode 100644 index 0000000..72a8a7c --- /dev/null +++ b/src/api/resources/conversations/client/Client.ts @@ -0,0 +1,797 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace ConversationsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ConversationsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ConversationsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * We recommend pinging this endpoint every minute for as long as the agent has to be considered online. + * + * @param {Brevo.PostConversationsAgentOnlinePingRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.conversations.setsAgentsStatusToOnlineFor23Minutes({ + * agentId: "d9nKoegKSjmCtyK78" + * }) + * + * @example + * await client.conversations.setsAgentsStatusToOnlineFor23Minutes({ + * agentEmail: "liz@getwear.com", + * agentName: "Liz", + * receivedFrom: "SuperAwesomeHelpdesk" + * }) + */ + public setsAgentsStatusToOnlineFor23Minutes( + request: Brevo.PostConversationsAgentOnlinePingRequest = {}, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__setsAgentsStatusToOnlineFor23Minutes(request, requestOptions), + ); + } + + private async __setsAgentsStatusToOnlineFor23Minutes( + request: Brevo.PostConversationsAgentOnlinePingRequest = {}, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "conversations/agentOnlinePing", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/conversations/agentOnlinePing", + ); + } + + /** + * @param {Brevo.PostConversationsMessagesRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.conversations.sendAMessageAsAnAgent({ + * agentId: "d9nKoegKSjmCtyK78", + * text: "Hello! How can I help you?", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * }) + * + * @example + * await client.conversations.sendAMessageAsAnAgent({ + * agentEmail: "liz@getwear.com", + * agentName: "Liz", + * receivedFrom: "SuperAwesomeHelpdesk", + * text: "Hello! How can I help you?", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * }) + * + * @example + * await client.conversations.sendAMessageAsAnAgent({ + * agentId: "d9nKoegKSjmCtyK78", + * receivedFrom: "SuperAwesomeHelpdesk", + * text: "Hello! How can I help you?", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * }) + */ + public sendAMessageAsAnAgent( + request: Brevo.PostConversationsMessagesRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendAMessageAsAnAgent(request, requestOptions)); + } + + private async __sendAMessageAsAnAgent( + request: Brevo.PostConversationsMessagesRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "conversations/messages", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ConversationsMessage, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/conversations/messages"); + } + + /** + * @param {Brevo.GetConversationsMessagesIdRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.conversations.getAMessage({ + * id: "id" + * }) + */ + public getAMessage( + request: Brevo.GetConversationsMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAMessage(request, requestOptions)); + } + + private async __getAMessage( + request: Brevo.GetConversationsMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `conversations/messages/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ConversationsMessage, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/conversations/messages/{id}"); + } + + /** + * Only agents’ messages can be edited. + * + * @param {Brevo.PutConversationsMessagesIdRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.conversations.updateAMessageSentByAnAgent({ + * id: "id", + * text: "Good morning! How can I help you?" + * }) + */ + public updateAMessageSentByAnAgent( + request: Brevo.PutConversationsMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateAMessageSentByAnAgent(request, requestOptions)); + } + + private async __updateAMessageSentByAnAgent( + request: Brevo.PutConversationsMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `conversations/messages/${core.url.encodePathParam(id)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ConversationsMessage, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/conversations/messages/{id}"); + } + + /** + * Only agents’ messages can be deleted. + * + * @param {Brevo.DeleteConversationsMessagesIdRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.conversations.deleteAMessageSentByAnAgent({ + * id: "id" + * }) + */ + public deleteAMessageSentByAnAgent( + request: Brevo.DeleteConversationsMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteAMessageSentByAnAgent(request, requestOptions)); + } + + private async __deleteAMessageSentByAnAgent( + request: Brevo.DeleteConversationsMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `conversations/messages/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/conversations/messages/{id}", + ); + } + + /** + * Example of automated messages: order status, announce new features in your web app, etc. + * + * @param {Brevo.PostConversationsPushedMessagesRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.conversations.sendAnAutomatedMessageToAVisitor({ + * groupId: "PjRBMhWGen6aRHjif", + * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * }) + * + * @example + * await client.conversations.sendAnAutomatedMessageToAVisitor({ + * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * }) + * + * @example + * await client.conversations.sendAnAutomatedMessageToAVisitor({ + * agentId: "d9nKoegKSjmCtyK78", + * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * }) + */ + public sendAnAutomatedMessageToAVisitor( + request: Brevo.PostConversationsPushedMessagesRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendAnAutomatedMessageToAVisitor(request, requestOptions)); + } + + private async __sendAnAutomatedMessageToAVisitor( + request: Brevo.PostConversationsPushedMessagesRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "conversations/pushedMessages", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ConversationsMessage, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/conversations/pushedMessages", + ); + } + + /** + * @param {Brevo.GetConversationsPushedMessagesIdRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.conversations.getAnAutomatedMessage({ + * id: "id" + * }) + */ + public getAnAutomatedMessage( + request: Brevo.GetConversationsPushedMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAnAutomatedMessage(request, requestOptions)); + } + + private async __getAnAutomatedMessage( + request: Brevo.GetConversationsPushedMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `conversations/pushedMessages/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ConversationsMessage, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/conversations/pushedMessages/{id}", + ); + } + + /** + * @param {Brevo.PutConversationsPushedMessagesIdRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.conversations.updateAnAutomatedMessage({ + * id: "id", + * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54" + * }) + */ + public updateAnAutomatedMessage( + request: Brevo.PutConversationsPushedMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateAnAutomatedMessage(request, requestOptions)); + } + + private async __updateAnAutomatedMessage( + request: Brevo.PutConversationsPushedMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `conversations/pushedMessages/${core.url.encodePathParam(id)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ConversationsMessage, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/conversations/pushedMessages/{id}", + ); + } + + /** + * @param {Brevo.DeleteConversationsPushedMessagesIdRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.conversations.deleteAnAutomatedMessage({ + * id: "id" + * }) + */ + public deleteAnAutomatedMessage( + request: Brevo.DeleteConversationsPushedMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteAnAutomatedMessage(request, requestOptions)); + } + + private async __deleteAnAutomatedMessage( + request: Brevo.DeleteConversationsPushedMessagesIdRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `conversations/pushedMessages/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/conversations/pushedMessages/{id}", + ); + } + + /** + * Assigns a visitor to a specific agent group or removes them from their current group. + * + * @param {Brevo.PutConversationsVisitorGroupRequest} request + * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.conversations.setVisitorGroupAssignment({ + * groupId: "PjRBMhWGen6aRHjif" + * }) + */ + public setVisitorGroupAssignment( + request: Brevo.PutConversationsVisitorGroupRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__setVisitorGroupAssignment(request, requestOptions)); + } + + private async __setVisitorGroupAssignment( + request: Brevo.PutConversationsVisitorGroupRequest, + requestOptions?: ConversationsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "conversations/visitorGroup", + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.PutConversationsVisitorGroupResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/conversations/visitorGroup"); + } +} diff --git a/src/api/resources/conversations/client/index.ts b/src/api/resources/conversations/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/conversations/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/conversations/client/requests/DeleteConversationsMessagesIdRequest.ts b/src/api/resources/conversations/client/requests/DeleteConversationsMessagesIdRequest.ts new file mode 100644 index 0000000..2f0293d --- /dev/null +++ b/src/api/resources/conversations/client/requests/DeleteConversationsMessagesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteConversationsMessagesIdRequest { + /** ID of the message */ + id: string; +} diff --git a/src/api/resources/conversations/client/requests/DeleteConversationsPushedMessagesIdRequest.ts b/src/api/resources/conversations/client/requests/DeleteConversationsPushedMessagesIdRequest.ts new file mode 100644 index 0000000..ff72a40 --- /dev/null +++ b/src/api/resources/conversations/client/requests/DeleteConversationsPushedMessagesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteConversationsPushedMessagesIdRequest { + /** ID of the message */ + id: string; +} diff --git a/src/api/resources/conversations/client/requests/GetConversationsMessagesIdRequest.ts b/src/api/resources/conversations/client/requests/GetConversationsMessagesIdRequest.ts new file mode 100644 index 0000000..f5188fb --- /dev/null +++ b/src/api/resources/conversations/client/requests/GetConversationsMessagesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetConversationsMessagesIdRequest { + /** ID of the message */ + id: string; +} diff --git a/src/api/resources/conversations/client/requests/GetConversationsPushedMessagesIdRequest.ts b/src/api/resources/conversations/client/requests/GetConversationsPushedMessagesIdRequest.ts new file mode 100644 index 0000000..7bdf404 --- /dev/null +++ b/src/api/resources/conversations/client/requests/GetConversationsPushedMessagesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetConversationsPushedMessagesIdRequest { + /** ID of the message sent previously */ + id: string; +} diff --git a/src/api/resources/conversations/client/requests/PostConversationsAgentOnlinePingRequest.ts b/src/api/resources/conversations/client/requests/PostConversationsAgentOnlinePingRequest.ts new file mode 100644 index 0000000..83ed09b --- /dev/null +++ b/src/api/resources/conversations/client/requests/PostConversationsAgentOnlinePingRequest.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * agentId: "d9nKoegKSjmCtyK78" + * } + * + * @example + * { + * agentEmail: "liz@getwear.com", + * agentName: "Liz", + * receivedFrom: "SuperAwesomeHelpdesk" + * } + */ +export interface PostConversationsAgentOnlinePingRequest { + /** agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. */ + agentEmail?: unknown; + /** agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). */ + agentId?: unknown; + /** agent name */ + agentName?: unknown; + /** mark your messages to distinguish messages created by you from the others. */ + receivedFrom?: unknown; +} diff --git a/src/api/resources/conversations/client/requests/PostConversationsMessagesRequest.ts b/src/api/resources/conversations/client/requests/PostConversationsMessagesRequest.ts new file mode 100644 index 0000000..a42ca62 --- /dev/null +++ b/src/api/resources/conversations/client/requests/PostConversationsMessagesRequest.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * agentId: "d9nKoegKSjmCtyK78", + * text: "Hello! How can I help you?", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * } + * + * @example + * { + * agentEmail: "liz@getwear.com", + * agentName: "Liz", + * receivedFrom: "SuperAwesomeHelpdesk", + * text: "Hello! How can I help you?", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * } + * + * @example + * { + * agentId: "d9nKoegKSjmCtyK78", + * receivedFrom: "SuperAwesomeHelpdesk", + * text: "Hello! How can I help you?", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * } + */ +export interface PostConversationsMessagesRequest { + /** agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. */ + agentEmail?: unknown; + /** agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). */ + agentId?: unknown; + /** agent name */ + agentName?: unknown; + /** mark your messages to distinguish messages created by you from the others. */ + receivedFrom?: unknown; + text?: unknown; + visitorId?: unknown; +} diff --git a/src/api/resources/conversations/client/requests/PostConversationsPushedMessagesRequest.ts b/src/api/resources/conversations/client/requests/PostConversationsPushedMessagesRequest.ts new file mode 100644 index 0000000..fb466bf --- /dev/null +++ b/src/api/resources/conversations/client/requests/PostConversationsPushedMessagesRequest.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * groupId: "PjRBMhWGen6aRHjif", + * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * } + * + * @example + * { + * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * } + * + * @example + * { + * agentId: "d9nKoegKSjmCtyK78", + * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" + * } + */ +export interface PostConversationsPushedMessagesRequest { + /** agent ID. It can be found on agent’s page or received from a webhook. */ + agentId?: unknown; + /** group ID. It can be found on group’s page. */ + groupId?: unknown; + text?: unknown; + visitorId?: unknown; +} diff --git a/src/api/resources/conversations/client/requests/PutConversationsMessagesIdRequest.ts b/src/api/resources/conversations/client/requests/PutConversationsMessagesIdRequest.ts new file mode 100644 index 0000000..881c908 --- /dev/null +++ b/src/api/resources/conversations/client/requests/PutConversationsMessagesIdRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id", + * text: "Good morning! How can I help you?" + * } + */ +export interface PutConversationsMessagesIdRequest { + /** ID of the message */ + id: string; + /** edited message text */ + text: string; +} diff --git a/src/api/resources/conversations/client/requests/PutConversationsPushedMessagesIdRequest.ts b/src/api/resources/conversations/client/requests/PutConversationsPushedMessagesIdRequest.ts new file mode 100644 index 0000000..a66209a --- /dev/null +++ b/src/api/resources/conversations/client/requests/PutConversationsPushedMessagesIdRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id", + * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54" + * } + */ +export interface PutConversationsPushedMessagesIdRequest { + /** ID of the message */ + id: string; + /** edited message text */ + text: string; +} diff --git a/src/api/resources/conversations/client/requests/PutConversationsVisitorGroupRequest.ts b/src/api/resources/conversations/client/requests/PutConversationsVisitorGroupRequest.ts new file mode 100644 index 0000000..af74e32 --- /dev/null +++ b/src/api/resources/conversations/client/requests/PutConversationsVisitorGroupRequest.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * groupId: "PjRBMhWGen6aRHjif" + * } + */ +export interface PutConversationsVisitorGroupRequest { + groupId?: unknown; +} diff --git a/src/api/resources/conversations/client/requests/index.ts b/src/api/resources/conversations/client/requests/index.ts new file mode 100644 index 0000000..eda4e59 --- /dev/null +++ b/src/api/resources/conversations/client/requests/index.ts @@ -0,0 +1,10 @@ +export type { DeleteConversationsMessagesIdRequest } from "./DeleteConversationsMessagesIdRequest.js"; +export type { DeleteConversationsPushedMessagesIdRequest } from "./DeleteConversationsPushedMessagesIdRequest.js"; +export type { GetConversationsMessagesIdRequest } from "./GetConversationsMessagesIdRequest.js"; +export type { GetConversationsPushedMessagesIdRequest } from "./GetConversationsPushedMessagesIdRequest.js"; +export type { PostConversationsAgentOnlinePingRequest } from "./PostConversationsAgentOnlinePingRequest.js"; +export type { PostConversationsMessagesRequest } from "./PostConversationsMessagesRequest.js"; +export type { PostConversationsPushedMessagesRequest } from "./PostConversationsPushedMessagesRequest.js"; +export type { PutConversationsMessagesIdRequest } from "./PutConversationsMessagesIdRequest.js"; +export type { PutConversationsPushedMessagesIdRequest } from "./PutConversationsPushedMessagesIdRequest.js"; +export type { PutConversationsVisitorGroupRequest } from "./PutConversationsVisitorGroupRequest.js"; diff --git a/src/api/resources/conversations/index.ts b/src/api/resources/conversations/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/conversations/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/conversations/types/PutConversationsVisitorGroupResponse.ts b/src/api/resources/conversations/types/PutConversationsVisitorGroupResponse.ts new file mode 100644 index 0000000..e27638a --- /dev/null +++ b/src/api/resources/conversations/types/PutConversationsVisitorGroupResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PutConversationsVisitorGroupResponse { + /** group ID the visitor was assigned to */ + groupId?: unknown; + /** visitor ID */ + visitorId?: unknown; +} diff --git a/src/api/resources/conversations/types/index.ts b/src/api/resources/conversations/types/index.ts new file mode 100644 index 0000000..85485dc --- /dev/null +++ b/src/api/resources/conversations/types/index.ts @@ -0,0 +1 @@ +export * from "./PutConversationsVisitorGroupResponse.js"; diff --git a/src/api/resources/coupons/client/Client.ts b/src/api/resources/coupons/client/Client.ts new file mode 100644 index 0000000..64331ff --- /dev/null +++ b/src/api/resources/coupons/client/Client.ts @@ -0,0 +1,383 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace CouponsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class CouponsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: CouponsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetCouponCollectionsRequest} request + * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * + * @example + * await client.coupons.getCouponCollections() + */ + public getCouponCollections( + request: Brevo.GetCouponCollectionsRequest = {}, + requestOptions?: CouponsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCouponCollections(request, requestOptions)); + } + + private async __getCouponCollections( + request: Brevo.GetCouponCollectionsRequest = {}, + requestOptions?: CouponsClient.RequestOptions, + ): Promise> { + const { limit, offset, sort, sortBy } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + sortBy: sortBy != null ? sortBy : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "couponCollections", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCouponCollection, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/couponCollections"); + } + + /** + * @param {Brevo.CreateCouponCollectionRequest} request + * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * + * @example + * await client.coupons.createCouponCollection({ + * defaultCoupon: "Winter", + * name: "10%OFF" + * }) + */ + public createCouponCollection( + request: Brevo.CreateCouponCollectionRequest, + requestOptions?: CouponsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createCouponCollection(request, requestOptions)); + } + + private async __createCouponCollection( + request: Brevo.CreateCouponCollectionRequest, + requestOptions?: CouponsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "couponCollections", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateCouponCollectionResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/couponCollections"); + } + + /** + * @param {Brevo.GetCouponCollectionRequest} request + * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.coupons.getCouponCollection({ + * id: "id" + * }) + */ + public getCouponCollection( + request: Brevo.GetCouponCollectionRequest, + requestOptions?: CouponsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCouponCollection(request, requestOptions)); + } + + private async __getCouponCollection( + request: Brevo.GetCouponCollectionRequest, + requestOptions?: CouponsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `couponCollections/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCouponCollection, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/couponCollections/{id}"); + } + + /** + * @param {Brevo.UpdateCouponCollectionRequest} request + * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * + * @example + * await client.coupons.updateCouponCollection({ + * id: "id" + * }) + */ + public updateCouponCollection( + request: Brevo.UpdateCouponCollectionRequest, + requestOptions?: CouponsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateCouponCollection(request, requestOptions)); + } + + private async __updateCouponCollection( + request: Brevo.UpdateCouponCollectionRequest, + requestOptions?: CouponsClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `couponCollections/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.UpdateCouponCollectionResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/couponCollections/{id}"); + } + + /** + * @param {Brevo.CreateCouponsRequest} request + * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.coupons.createCoupons({ + * collectionId: "23befbae-1505-47a8-bd27-e30ef739f32c", + * coupons: ["Uf12AF"] + * }) + */ + public createCoupons( + request: Brevo.CreateCouponsRequest, + requestOptions?: CouponsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createCoupons(request, requestOptions)); + } + + private async __createCoupons( + request: Brevo.CreateCouponsRequest, + requestOptions?: CouponsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "coupons", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/coupons"); + } +} diff --git a/src/api/resources/coupons/client/index.ts b/src/api/resources/coupons/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/coupons/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/coupons/client/requests/CreateCouponCollectionRequest.ts b/src/api/resources/coupons/client/requests/CreateCouponCollectionRequest.ts new file mode 100644 index 0000000..86829c5 --- /dev/null +++ b/src/api/resources/coupons/client/requests/CreateCouponCollectionRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * defaultCoupon: "Winter", + * name: "10%OFF" + * } + */ +export interface CreateCouponCollectionRequest { + /** Default coupons collection name */ + defaultCoupon: string; + /** Specify an expiration date for the coupon collection in RFC3339 format. Use null to remove the expiration date. */ + expirationDate?: string; + /** Name of the coupons collection */ + name: string; + /** Send a notification alert (email) when the remaining coupons count is equal or fall bellow this number. Use null to disable alerts. */ + remainingCouponsAlert?: number; + /** Send a notification alert (email) when the remaining days until the expiration date are equal or fall bellow this number. Use null to disable alerts. */ + remainingDaysAlert?: number; +} diff --git a/src/api/resources/coupons/client/requests/CreateCouponsRequest.ts b/src/api/resources/coupons/client/requests/CreateCouponsRequest.ts new file mode 100644 index 0000000..b08f107 --- /dev/null +++ b/src/api/resources/coupons/client/requests/CreateCouponsRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * collectionId: "23befbae-1505-47a8-bd27-e30ef739f32c", + * coupons: ["Uf12AF"] + * } + */ +export interface CreateCouponsRequest { + /** The id of the coupon collection for which the coupons will be created */ + collectionId: string; + coupons: string[]; +} diff --git a/src/api/resources/coupons/client/requests/GetCouponCollectionRequest.ts b/src/api/resources/coupons/client/requests/GetCouponCollectionRequest.ts new file mode 100644 index 0000000..05e6e9d --- /dev/null +++ b/src/api/resources/coupons/client/requests/GetCouponCollectionRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCouponCollectionRequest { + /** Id of the collection to return */ + id: string; +} diff --git a/src/api/resources/coupons/client/requests/GetCouponCollectionsRequest.ts b/src/api/resources/coupons/client/requests/GetCouponCollectionsRequest.ts new file mode 100644 index 0000000..7427858 --- /dev/null +++ b/src/api/resources/coupons/client/requests/GetCouponCollectionsRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetCouponCollectionsRequest { + /** Number of documents returned per page */ + limit?: number; + /** Index of the first document on the page */ + offset?: number; + /** Sort the results by creation time in ascending/descending order */ + sort?: Brevo.GetCouponCollectionsRequestSort; + /** The field used to sort coupon collections */ + sortBy?: Brevo.GetCouponCollectionsRequestSortBy; +} diff --git a/src/api/resources/coupons/client/requests/UpdateCouponCollectionRequest.ts b/src/api/resources/coupons/client/requests/UpdateCouponCollectionRequest.ts new file mode 100644 index 0000000..5186386 --- /dev/null +++ b/src/api/resources/coupons/client/requests/UpdateCouponCollectionRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface UpdateCouponCollectionRequest { + /** Id of the collection to update */ + id: string; + /** A default coupon to be used in case there are no coupons left */ + defaultCoupon?: string; + /** Specify an expiration date for the coupon collection in RFC3339 format. Use null to remove the expiration date. */ + expirationDate?: string; + /** Send a notification alert (email) when the remaining coupons count is equal or fall bellow this number. Use null to disable alerts. */ + remainingCouponsAlert?: number; + /** Send a notification alert (email) when the remaining days until the expiration date are equal or fall bellow this number. Use null to disable alerts. */ + remainingDaysAlert?: number; +} diff --git a/src/api/resources/coupons/client/requests/index.ts b/src/api/resources/coupons/client/requests/index.ts new file mode 100644 index 0000000..9f707f1 --- /dev/null +++ b/src/api/resources/coupons/client/requests/index.ts @@ -0,0 +1,5 @@ +export type { CreateCouponCollectionRequest } from "./CreateCouponCollectionRequest.js"; +export type { CreateCouponsRequest } from "./CreateCouponsRequest.js"; +export type { GetCouponCollectionRequest } from "./GetCouponCollectionRequest.js"; +export type { GetCouponCollectionsRequest } from "./GetCouponCollectionsRequest.js"; +export type { UpdateCouponCollectionRequest } from "./UpdateCouponCollectionRequest.js"; diff --git a/src/api/resources/coupons/index.ts b/src/api/resources/coupons/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/coupons/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/coupons/types/CreateCouponCollectionResponse.ts b/src/api/resources/coupons/types/CreateCouponCollectionResponse.ts new file mode 100644 index 0000000..260074a --- /dev/null +++ b/src/api/resources/coupons/types/CreateCouponCollectionResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateCouponCollectionResponse { + /** The id of the created collection */ + id: string; +} diff --git a/src/api/resources/coupons/types/GetCouponCollectionsRequestSort.ts b/src/api/resources/coupons/types/GetCouponCollectionsRequestSort.ts new file mode 100644 index 0000000..55ae412 --- /dev/null +++ b/src/api/resources/coupons/types/GetCouponCollectionsRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCouponCollectionsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetCouponCollectionsRequestSort = + (typeof GetCouponCollectionsRequestSort)[keyof typeof GetCouponCollectionsRequestSort]; diff --git a/src/api/resources/coupons/types/GetCouponCollectionsRequestSortBy.ts b/src/api/resources/coupons/types/GetCouponCollectionsRequestSortBy.ts new file mode 100644 index 0000000..c613ab7 --- /dev/null +++ b/src/api/resources/coupons/types/GetCouponCollectionsRequestSortBy.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCouponCollectionsRequestSortBy = { + CreatedAt: "createdAt", + RemainingCoupons: "remainingCoupons", + ExpirationDate: "expirationDate", +} as const; +export type GetCouponCollectionsRequestSortBy = + (typeof GetCouponCollectionsRequestSortBy)[keyof typeof GetCouponCollectionsRequestSortBy]; diff --git a/src/api/resources/coupons/types/UpdateCouponCollectionResponse.ts b/src/api/resources/coupons/types/UpdateCouponCollectionResponse.ts new file mode 100644 index 0000000..7c86a62 --- /dev/null +++ b/src/api/resources/coupons/types/UpdateCouponCollectionResponse.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface UpdateCouponCollectionResponse { + /** The default coupon of the collection */ + defaultCoupon: string; + /** The id of the collection */ + id: string; + /** The name of the collection */ + name: string; +} diff --git a/src/api/resources/coupons/types/index.ts b/src/api/resources/coupons/types/index.ts new file mode 100644 index 0000000..23e2d4a --- /dev/null +++ b/src/api/resources/coupons/types/index.ts @@ -0,0 +1,4 @@ +export * from "./CreateCouponCollectionResponse.js"; +export * from "./GetCouponCollectionsRequestSort.js"; +export * from "./GetCouponCollectionsRequestSortBy.js"; +export * from "./UpdateCouponCollectionResponse.js"; diff --git a/src/api/resources/customObjects/client/Client.ts b/src/api/resources/customObjects/client/Client.ts new file mode 100644 index 0000000..4d8d8ff --- /dev/null +++ b/src/api/resources/customObjects/client/Client.ts @@ -0,0 +1,319 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace CustomObjectsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class CustomObjectsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: CustomObjectsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * + * Custom objects are only available to Enterprise plans. + * + * This feature is in beta. These are subject to change. + * + * + * This API allows bulk upsert of object records in a single request. Each object record may include + * - Attributes + * - Identifiers + * - Associations + * **Response:** + * The API processes the request asynchronously and returns a processId that you can use to track the background process status. + * **API and Schema Limitation:** + * - Size: + * - Max 1000 objects records per request + * - Max request body size: 1 MB + * - Max 500 attributes defined per object record upsert request + * - This is coherent with schema limitation: an object cannot have more than 500 attributes. + * - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) + * - Max 10 associations defined per object record upsert request + * - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. + * **Errors:** + * - Make sure both object records exist before associating them, else the API will return an error. + * - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". + * + * @param {Brevo.UpsertrecordsRequest} request + * @param {CustomObjectsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.customObjects.upsertrecords({ + * object_type: "vehicle", + * records: [{}] + * }) + */ + public upsertrecords( + request: Brevo.UpsertrecordsRequest, + requestOptions?: CustomObjectsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__upsertrecords(request, requestOptions)); + } + + private async __upsertrecords( + request: Brevo.UpsertrecordsRequest, + requestOptions?: CustomObjectsClient.RequestOptions, + ): Promise> { + const { object_type: objectType, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `objects/${core.url.encodePathParam(objectType)}/batch/upsert`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.UpsertrecordsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/objects/{object_type}/batch/upsert", + ); + } + + /** + * + * Custom objects are only available to Enterprise plans. + * + * This feature is in beta. These are subject to change. + * + * + * This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint. + * + * @param {Brevo.GetrecordsRequest} request + * @param {CustomObjectsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.FailedDependencyError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.customObjects.getrecords({ + * object_type: "vehicle", + * limit: 1000000, + * page_num: 1000000 + * }) + */ + public getrecords( + request: Brevo.GetrecordsRequest, + requestOptions?: CustomObjectsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getrecords(request, requestOptions)); + } + + private async __getrecords( + request: Brevo.GetrecordsRequest, + requestOptions?: CustomObjectsClient.RequestOptions, + ): Promise> { + const { object_type: objectType, limit, page_num: pageNum, sort, association } = request; + const _queryParams: Record = { + limit, + page_num: pageNum, + sort: sort != null ? sort : undefined, + association: association != null ? association : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `objects/${core.url.encodePathParam(objectType)}/records`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetrecordsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 424: + throw new Brevo.FailedDependencyError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/objects/{object_type}/records", + ); + } + + /** + * Use this endpoint to delete multiple object records of the same object-type in one request. + * The request is accepted and processed asynchronously. You can track the status of the deletion process using the returned **processId**. + * **API and Schema Limitations:** - Each request can contain up to **1000** object record identifiers - If more records must be deleted → send multiple batch requests + * + * @param {Brevo.BatchDeleteObjectRecordsRequest} request + * @param {CustomObjectsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.customObjects.batchDeleteObjectRecords({ + * object_type: "vehicle", + * identifiers: { + * ext_ids: ["ext-001", "ext-002"] + * } + * }) + */ + public batchDeleteObjectRecords( + request: Brevo.BatchDeleteObjectRecordsRequest, + requestOptions?: CustomObjectsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__batchDeleteObjectRecords(request, requestOptions)); + } + + private async __batchDeleteObjectRecords( + request: Brevo.BatchDeleteObjectRecordsRequest, + requestOptions?: CustomObjectsClient.RequestOptions, + ): Promise> { + const { object_type: objectType, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `objects/${core.url.encodePathParam(objectType)}/batch/delete`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.BatchDeleteObjectRecordsResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/objects/{object_type}/batch/delete", + ); + } +} diff --git a/src/api/resources/customObjects/client/index.ts b/src/api/resources/customObjects/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/customObjects/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/customObjects/client/requests/BatchDeleteObjectRecordsRequest.ts b/src/api/resources/customObjects/client/requests/BatchDeleteObjectRecordsRequest.ts new file mode 100644 index 0000000..cb95008 --- /dev/null +++ b/src/api/resources/customObjects/client/requests/BatchDeleteObjectRecordsRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * object_type: "vehicle", + * identifiers: { + * ext_ids: ["ext-001", "ext-002"] + * } + * } + */ +export interface BatchDeleteObjectRecordsRequest { + /** Object type for the records to delete */ + object_type: string; + /** One of the below must be provided */ + identifiers?: BatchDeleteObjectRecordsRequest.Identifiers; +} + +export namespace BatchDeleteObjectRecordsRequest { + /** + * One of the below must be provided + */ + export type Identifiers = + | { + ids: number[]; + } + | { + ext_ids: string[]; + }; +} diff --git a/src/api/resources/customObjects/client/requests/GetrecordsRequest.ts b/src/api/resources/customObjects/client/requests/GetrecordsRequest.ts new file mode 100644 index 0000000..029f0c8 --- /dev/null +++ b/src/api/resources/customObjects/client/requests/GetrecordsRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * object_type: "vehicle", + * limit: 1000000, + * page_num: 1000000 + * } + */ +export interface GetrecordsRequest { + /** object type for the attribute */ + object_type: string; + /** Number of records returned per page */ + limit: number; + /** Page number for pagination. It's used to fetch the object records on a provided page number. Must be a valid positive integer. */ + page_num: number; + /** Sort order, must be 'asc' or 'desc'. Default to 'desc' if not provided. */ + sort?: Brevo.GetrecordsRequestSort; + /** Whether to include associations, must be 'true' or 'false'. Default to 'false' if not provided. */ + association?: Brevo.GetrecordsRequestAssociation; +} diff --git a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts new file mode 100644 index 0000000..9cc6f47 --- /dev/null +++ b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts @@ -0,0 +1,78 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * object_type: "vehicle", + * records: [{}] + * } + */ +export interface UpsertrecordsRequest { + /** object type for the attribute */ + object_type: string; + /** List of object records to be upsert. Each record can have attributes, identifiers, and associations. */ + records: UpsertrecordsRequest.Records.Item[]; +} + +export namespace UpsertrecordsRequest { + export type Records = Records.Item[]; + + export namespace Records { + export interface Item { + associations?: Item.Associations.Item[]; + /** Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required. */ + attributes?: Record; + /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request. */ + identifiers?: Item.Identifiers; + } + + export namespace Item { + export type Associations = Associations.Item[]; + + export namespace Associations { + export type Item = + | { + object_type?: string | undefined; + records?: + | { + identifiers?: + | { + ext_id?: string | undefined; + id?: number | undefined; + } + | undefined; + }[] + | undefined; + } + | { + object_type?: string | undefined; + records?: + | ( + | { + identifiers?: + | { + ext_id?: string | undefined; + id?: number | undefined; + } + | undefined; + } + | { + identifiers?: Record | undefined; + } + )[] + | undefined; + }; + } + + /** + * Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request. + */ + export interface Identifiers { + /** ext_id is ID of record in the external system that client_dev want to store in the object system. */ + ext_id?: string; + /** Internal ID of the object record generated by Brevo */ + id?: number; + } + } + } +} diff --git a/src/api/resources/customObjects/client/requests/index.ts b/src/api/resources/customObjects/client/requests/index.ts new file mode 100644 index 0000000..ba83d4f --- /dev/null +++ b/src/api/resources/customObjects/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { BatchDeleteObjectRecordsRequest } from "./BatchDeleteObjectRecordsRequest.js"; +export type { GetrecordsRequest } from "./GetrecordsRequest.js"; +export type { UpsertrecordsRequest } from "./UpsertrecordsRequest.js"; diff --git a/src/api/resources/customObjects/index.ts b/src/api/resources/customObjects/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/customObjects/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/customObjects/types/BatchDeleteObjectRecordsResponse.ts b/src/api/resources/customObjects/types/BatchDeleteObjectRecordsResponse.ts new file mode 100644 index 0000000..32e287c --- /dev/null +++ b/src/api/resources/customObjects/types/BatchDeleteObjectRecordsResponse.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface BatchDeleteObjectRecordsResponse { + /** Identifier for batch process tracking */ + processId?: number; + message?: string; +} diff --git a/src/api/resources/customObjects/types/GetrecordsRequestAssociation.ts b/src/api/resources/customObjects/types/GetrecordsRequestAssociation.ts new file mode 100644 index 0000000..44a81d6 --- /dev/null +++ b/src/api/resources/customObjects/types/GetrecordsRequestAssociation.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetrecordsRequestAssociation = { + True: "true", + False: "false", +} as const; +export type GetrecordsRequestAssociation = + (typeof GetrecordsRequestAssociation)[keyof typeof GetrecordsRequestAssociation]; diff --git a/src/api/resources/customObjects/types/GetrecordsRequestSort.ts b/src/api/resources/customObjects/types/GetrecordsRequestSort.ts new file mode 100644 index 0000000..0aabdd9 --- /dev/null +++ b/src/api/resources/customObjects/types/GetrecordsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetrecordsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetrecordsRequestSort = (typeof GetrecordsRequestSort)[keyof typeof GetrecordsRequestSort]; diff --git a/src/api/resources/customObjects/types/GetrecordsResponse.ts b/src/api/resources/customObjects/types/GetrecordsResponse.ts new file mode 100644 index 0000000..f841060 --- /dev/null +++ b/src/api/resources/customObjects/types/GetrecordsResponse.ts @@ -0,0 +1,86 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetrecordsResponse { + /** Total number of object records for an object type. */ + count?: number; + records?: GetrecordsResponse.Records.Item[]; +} + +export namespace GetrecordsResponse { + export type Records = Records.Item[]; + + export namespace Records { + export interface Item { + /** List of associations for the object record. If association query param is true it will return 5 associated records per association. */ + associations?: Item.Associations.Item[]; + /** Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required. */ + attributes?: Record; + /** Timestamp when the object record was created */ + createdAt?: string; + /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. */ + identifiers?: Item.Identifiers; + /** Timestamp when the object record was last updated */ + updatedAt?: string; + } + + export namespace Item { + export type Associations = Associations.Item[]; + + export namespace Associations { + export type Item = + | { + object_type?: string | undefined; + records?: + | ( + | { + identifiers?: + | { + id?: number | undefined; + } + | undefined; + } + | { + identifiers?: + | { + id?: number | undefined; + } + | undefined; + } + )[] + | undefined; + } + | { + object_type?: string | undefined; + records?: + | ( + | { + identifiers?: + | { + id?: number | undefined; + } + | undefined; + } + | { + identifiers?: + | { + id?: number | undefined; + } + | undefined; + } + )[] + | undefined; + }; + } + + /** + * Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. + */ + export interface Identifiers { + /** ext_id is ID of record in the external system that client_dev want to store in the object system. */ + ext_id?: string; + /** Internal ID of the object record generated by Brevo */ + id?: number; + } + } + } +} diff --git a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts new file mode 100644 index 0000000..dff7dba --- /dev/null +++ b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface UpsertrecordsResponse { + message?: string; + /** Unique Id for the batch process used to track the status of the batch. */ + processId?: number; +} diff --git a/src/api/resources/customObjects/types/index.ts b/src/api/resources/customObjects/types/index.ts new file mode 100644 index 0000000..cbc3e6d --- /dev/null +++ b/src/api/resources/customObjects/types/index.ts @@ -0,0 +1,5 @@ +export * from "./BatchDeleteObjectRecordsResponse.js"; +export * from "./GetrecordsRequestAssociation.js"; +export * from "./GetrecordsRequestSort.js"; +export * from "./GetrecordsResponse.js"; +export * from "./UpsertrecordsResponse.js"; diff --git a/src/api/resources/deals/client/Client.ts b/src/api/resources/deals/client/Client.ts new file mode 100644 index 0000000..ffb26c4 --- /dev/null +++ b/src/api/resources/deals/client/Client.ts @@ -0,0 +1,764 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace DealsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class DealsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: DealsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.deals.getDealAttributes() + */ + public getDealAttributes( + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getDealAttributes(requestOptions)); + } + + private async __getDealAttributes( + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/attributes/deals", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetCrmAttributesDealsResponseItem[], + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/attributes/deals"); + } + + /** + * @param {Brevo.GetCrmDealsRequest} request + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.deals.getAllDeals() + */ + public getAllDeals( + request: Brevo.GetCrmDealsRequest = {}, + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAllDeals(request, requestOptions)); + } + + private async __getAllDeals( + request: Brevo.GetCrmDealsRequest = {}, + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const { + "filters[attributes.deal_name]": filtersAttributesDealName, + "filters[linkedCompaniesIds]": filtersLinkedCompaniesIds, + "filters[linkedContactsIds]": filtersLinkedContactsIds, + modifiedSince, + createdSince, + offset, + limit, + sort, + } = request; + const _queryParams: Record = { + "filters[attributes.deal_name]": filtersAttributesDealName, + "filters[linkedCompaniesIds]": filtersLinkedCompaniesIds, + "filters[linkedContactsIds]": filtersLinkedContactsIds, + modifiedSince, + createdSince, + offset, + limit, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/deals", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCrmDealsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/deals"); + } + + /** + * @param {Brevo.PostCrmDealsRequest} request + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.deals.createADeal({ + * name: "Deal: Connect with company" + * }) + */ + public createADeal( + request: Brevo.PostCrmDealsRequest, + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createADeal(request, requestOptions)); + } + + private async __createADeal( + request: Brevo.PostCrmDealsRequest, + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/deals", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostCrmDealsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/deals"); + } + + /** + * Import deals from a CSV file with mapping options. + * + * @param {Brevo.PostCrmDealsImportRequest} request + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * import { createReadStream } from "fs"; + * await client.deals.importDealsCreationAndUpdation({}) + */ + public importDealsCreationAndUpdation( + request: Brevo.PostCrmDealsImportRequest, + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__importDealsCreationAndUpdation(request, requestOptions)); + } + + private async __importDealsCreationAndUpdation( + request: Brevo.PostCrmDealsImportRequest, + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const _body = await core.newFormData(); + if (request.file != null) { + await _body.appendFile("file", request.file); + } + + if (request.mapping != null) { + _body.append("mapping", toJson(request.mapping)); + } + + const _maybeEncodedRequest = await _body.getRequest(); + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ ..._maybeEncodedRequest.headers }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/deals/import", + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + requestType: "file", + duplex: _maybeEncodedRequest.duplex, + body: _maybeEncodedRequest.body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostCrmDealsImportResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/deals/import"); + } + + /** + * @param {Brevo.PatchCrmDealsLinkUnlinkIdRequest} request + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.deals.linkAndUnlinkADealWithContactsAndCompanies({ + * id: "id" + * }) + */ + public linkAndUnlinkADealWithContactsAndCompanies( + request: Brevo.PatchCrmDealsLinkUnlinkIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__linkAndUnlinkADealWithContactsAndCompanies(request, requestOptions), + ); + } + + private async __linkAndUnlinkADealWithContactsAndCompanies( + request: Brevo.PatchCrmDealsLinkUnlinkIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/deals/link-unlink/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/crm/deals/link-unlink/{id}"); + } + + /** + * @param {Brevo.GetCrmDealsIdRequest} request + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.deals.getADeal({ + * id: "id" + * }) + */ + public getADeal( + request: Brevo.GetCrmDealsIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getADeal(request, requestOptions)); + } + + private async __getADeal( + request: Brevo.GetCrmDealsIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/deals/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Deal, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/deals/{id}"); + } + + /** + * @param {Brevo.DeleteCrmDealsIdRequest} request + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.deals.deleteADeal({ + * id: "id" + * }) + */ + public deleteADeal( + request: Brevo.DeleteCrmDealsIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteADeal(request, requestOptions)); + } + + private async __deleteADeal( + request: Brevo.DeleteCrmDealsIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/deals/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/crm/deals/{id}"); + } + + /** + * @param {Brevo.PatchCrmDealsIdRequest} request + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.deals.updateADeal({ + * id: "id" + * }) + */ + public updateADeal( + request: Brevo.PatchCrmDealsIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateADeal(request, requestOptions)); + } + + private async __updateADeal( + request: Brevo.PatchCrmDealsIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/deals/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/crm/deals/{id}"); + } + + /** + * This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. + * + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.deals.getPipelineStages() + */ + public getPipelineStages(requestOptions?: DealsClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getPipelineStages(requestOptions)); + } + + private async __getPipelineStages( + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/pipeline/details", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Pipeline, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/pipeline/details"); + } + + /** + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.deals.getAllPipelines() + */ + public getAllPipelines(requestOptions?: DealsClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAllPipelines(requestOptions)); + } + + private async __getAllPipelines( + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/pipeline/details/all", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Pipelines, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/pipeline/details/all"); + } + + /** + * @param {Brevo.GetCrmPipelineDetailsPipelineIdRequest} request + * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.deals.getAPipeline({ + * pipelineID: "pipelineID" + * }) + */ + public getAPipeline( + request: Brevo.GetCrmPipelineDetailsPipelineIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAPipeline(request, requestOptions)); + } + + private async __getAPipeline( + request: Brevo.GetCrmPipelineDetailsPipelineIdRequest, + requestOptions?: DealsClient.RequestOptions, + ): Promise> { + const { pipelineID: pipelineId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/pipeline/details/${core.url.encodePathParam(pipelineId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Pipelines, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/crm/pipeline/details/{pipelineID}", + ); + } +} diff --git a/src/api/resources/deals/client/index.ts b/src/api/resources/deals/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/deals/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/deals/client/requests/DeleteCrmDealsIdRequest.ts b/src/api/resources/deals/client/requests/DeleteCrmDealsIdRequest.ts new file mode 100644 index 0000000..1056345 --- /dev/null +++ b/src/api/resources/deals/client/requests/DeleteCrmDealsIdRequest.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteCrmDealsIdRequest { + id: string; +} diff --git a/src/api/resources/deals/client/requests/GetCrmDealsIdRequest.ts b/src/api/resources/deals/client/requests/GetCrmDealsIdRequest.ts new file mode 100644 index 0000000..97c2dc7 --- /dev/null +++ b/src/api/resources/deals/client/requests/GetCrmDealsIdRequest.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCrmDealsIdRequest { + id: string; +} diff --git a/src/api/resources/deals/client/requests/GetCrmDealsRequest.ts b/src/api/resources/deals/client/requests/GetCrmDealsRequest.ts new file mode 100644 index 0000000..cfda0b9 --- /dev/null +++ b/src/api/resources/deals/client/requests/GetCrmDealsRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetCrmDealsRequest { + /** Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering. */ + "filters[attributes.deal_name]"?: string; + /** Filter by linked companies ids */ + "filters[linkedCompaniesIds]"?: string; + /** Filter by linked companies ids */ + "filters[linkedContactsIds]"?: string; + /** Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ + modifiedSince?: string; + /** Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ + createdSince?: string; + /** Index of the first document of the page */ + offset?: number; + /** Number of documents per page */ + limit?: number; + /** Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed */ + sort?: Brevo.GetCrmDealsRequestSort; +} diff --git a/src/api/resources/deals/client/requests/GetCrmPipelineDetailsPipelineIdRequest.ts b/src/api/resources/deals/client/requests/GetCrmPipelineDetailsPipelineIdRequest.ts new file mode 100644 index 0000000..5843d99 --- /dev/null +++ b/src/api/resources/deals/client/requests/GetCrmPipelineDetailsPipelineIdRequest.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pipelineID: "pipelineID" + * } + */ +export interface GetCrmPipelineDetailsPipelineIdRequest { + pipelineID: string; +} diff --git a/src/api/resources/deals/client/requests/PatchCrmDealsIdRequest.ts b/src/api/resources/deals/client/requests/PatchCrmDealsIdRequest.ts new file mode 100644 index 0000000..b71c9cb --- /dev/null +++ b/src/api/resources/deals/client/requests/PatchCrmDealsIdRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface PatchCrmDealsIdRequest { + id: string; + /** Attributes for deal update To assign owner of a Deal you can send attributes.deal_owner and utilize the account email or ID. If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage` Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` */ + attributes?: Record; + /** Warning - Using PATCH on linkedCompaniesIds replaces the list of linked contacts. Omitted IDs will be removed. */ + linkedCompaniesIds?: string[]; + /** Warning - Using PATCH on linkedContactIds replaces the list of linked contacts. Omitted IDs will be removed. */ + linkedContactsIds?: number[]; + /** Name of deal */ + name?: string; +} diff --git a/src/api/resources/deals/client/requests/PatchCrmDealsLinkUnlinkIdRequest.ts b/src/api/resources/deals/client/requests/PatchCrmDealsLinkUnlinkIdRequest.ts new file mode 100644 index 0000000..fa453e1 --- /dev/null +++ b/src/api/resources/deals/client/requests/PatchCrmDealsLinkUnlinkIdRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface PatchCrmDealsLinkUnlinkIdRequest { + id: string; + /** Company ids to be linked with deal */ + linkCompanyIds?: string[]; + /** Contact ids for contacts to be linked with deal */ + linkContactIds?: number[]; + /** Company ids to be unlinked from deal */ + unlinkCompanyIds?: string[]; + /** Contact ids for contacts to be unlinked from deal */ + unlinkContactIds?: number[]; +} diff --git a/src/api/resources/deals/client/requests/PostCrmDealsImportRequest.ts b/src/api/resources/deals/client/requests/PostCrmDealsImportRequest.ts new file mode 100644 index 0000000..5910b03 --- /dev/null +++ b/src/api/resources/deals/client/requests/PostCrmDealsImportRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../../../../core/index.js"; + +/** + * @example + * {} + */ +export interface PostCrmDealsImportRequest { + /** The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name */ + file?: core.file.Uploadable | undefined; + /** + * The mapping options in JSON format. Here is an example of the JSON structure: ```json { + * "link_entities": true, // Determines whether to link related entities during the import process + * "unlink_entities": false, // Determines whether to unlink related entities during the import process + * "update_existing_records": true, // Determines whether to update based on company ID or treat every row as create + * "unset_empty_attributes": false // Determines whether to unset a specific attribute during update if the values input is blank + * } ``` + */ + mapping?: Record; +} diff --git a/src/api/resources/deals/client/requests/PostCrmDealsRequest.ts b/src/api/resources/deals/client/requests/PostCrmDealsRequest.ts new file mode 100644 index 0000000..50b7364 --- /dev/null +++ b/src/api/resources/deals/client/requests/PostCrmDealsRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * name: "Deal: Connect with company" + * } + */ +export interface PostCrmDealsRequest { + /** Attributes for deal creation To assign owner of a Deal you can send attributes.deal_owner and utilize the account email or ID. If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` */ + attributes?: Record; + /** Company ids to be linked with deal */ + linkedCompaniesIds?: string[]; + /** Contact ids to be linked with deal */ + linkedContactsIds?: number[]; + /** Name of deal */ + name: string; +} diff --git a/src/api/resources/deals/client/requests/index.ts b/src/api/resources/deals/client/requests/index.ts new file mode 100644 index 0000000..53f6042 --- /dev/null +++ b/src/api/resources/deals/client/requests/index.ts @@ -0,0 +1,8 @@ +export type { DeleteCrmDealsIdRequest } from "./DeleteCrmDealsIdRequest.js"; +export type { GetCrmDealsIdRequest } from "./GetCrmDealsIdRequest.js"; +export type { GetCrmDealsRequest } from "./GetCrmDealsRequest.js"; +export type { GetCrmPipelineDetailsPipelineIdRequest } from "./GetCrmPipelineDetailsPipelineIdRequest.js"; +export type { PatchCrmDealsIdRequest } from "./PatchCrmDealsIdRequest.js"; +export type { PatchCrmDealsLinkUnlinkIdRequest } from "./PatchCrmDealsLinkUnlinkIdRequest.js"; +export type { PostCrmDealsImportRequest } from "./PostCrmDealsImportRequest.js"; +export type { PostCrmDealsRequest } from "./PostCrmDealsRequest.js"; diff --git a/src/api/resources/deals/index.ts b/src/api/resources/deals/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/deals/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts b/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts new file mode 100644 index 0000000..f1c5309 --- /dev/null +++ b/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * List of attributes + */ +export interface GetCrmAttributesDealsResponseItem { + attributeOptions?: Record[]; + attributeTypeName?: string; + internalName?: string; + isRequired?: boolean; + label?: string; +} diff --git a/src/api/resources/deals/types/GetCrmDealsRequestSort.ts b/src/api/resources/deals/types/GetCrmDealsRequestSort.ts new file mode 100644 index 0000000..7e0e5db --- /dev/null +++ b/src/api/resources/deals/types/GetCrmDealsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCrmDealsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetCrmDealsRequestSort = (typeof GetCrmDealsRequestSort)[keyof typeof GetCrmDealsRequestSort]; diff --git a/src/api/resources/deals/types/GetCrmDealsResponse.ts b/src/api/resources/deals/types/GetCrmDealsResponse.ts new file mode 100644 index 0000000..932cbc0 --- /dev/null +++ b/src/api/resources/deals/types/GetCrmDealsResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +/** + * List of Deals + */ +export interface GetCrmDealsResponse { + /** List of deals */ + items?: Brevo.Deal[]; +} diff --git a/src/api/resources/deals/types/PostCrmDealsImportResponse.ts b/src/api/resources/deals/types/PostCrmDealsImportResponse.ts new file mode 100644 index 0000000..1a46d86 --- /dev/null +++ b/src/api/resources/deals/types/PostCrmDealsImportResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostCrmDealsImportResponse { + /** The ID of the import process */ + processId?: number; +} diff --git a/src/api/resources/deals/types/PostCrmDealsResponse.ts b/src/api/resources/deals/types/PostCrmDealsResponse.ts new file mode 100644 index 0000000..251ccfd --- /dev/null +++ b/src/api/resources/deals/types/PostCrmDealsResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Created deal id + */ +export interface PostCrmDealsResponse { + /** Unique deal id */ + id: string; +} diff --git a/src/api/resources/deals/types/index.ts b/src/api/resources/deals/types/index.ts new file mode 100644 index 0000000..fb1d604 --- /dev/null +++ b/src/api/resources/deals/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetCrmAttributesDealsResponseItem.js"; +export * from "./GetCrmDealsRequestSort.js"; +export * from "./GetCrmDealsResponse.js"; +export * from "./PostCrmDealsImportResponse.js"; +export * from "./PostCrmDealsResponse.js"; diff --git a/src/api/resources/domains/client/Client.ts b/src/api/resources/domains/client/Client.ts new file mode 100644 index 0000000..de247ae --- /dev/null +++ b/src/api/resources/domains/client/Client.ts @@ -0,0 +1,439 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace DomainsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class DomainsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: DomainsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Retrieves all domains associated with the account. + * + * Use this to: + * - List all domains + * - Verify domain existence + * - Check domain authentication and verification status + * - Monitor domain configuration and provider information + * - Review domain creation history and ownership + * + * Key information returned: + * - Domain details (ID, name, authentication status) + * - Verification and authentication states + * - Associated IP addresses and DNS providers + * - Creator information and creation timestamps + * - Pagination information for large domain lists + * + * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.domains.getDomains() + */ + public getDomains( + requestOptions?: DomainsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getDomains(requestOptions)); + } + + private async __getDomains( + requestOptions?: DomainsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "senders/domains", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetDomainsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/senders/domains"); + } + + /** + * Creates a new domain in Brevo. + * + * Use this to: + * - Add new domains for sending emails + * - Set up domain authentication for better deliverability + * - Configure DNS records for email authentication + * - Establish domain-based sender identities + * + * Key information returned: + * - Created domain ID and configuration + * - Required DNS records for authentication + * - Domain provider detection results + * - Setup instructions and next steps + * + * @param {Brevo.CreateDomainRequest} request + * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.domains.createDomain({ + * name: "mycompany.com" + * }) + * + * @example + * await client.domains.createDomain({ + * name: "newsletter.mycompany.com" + * }) + * + * @example + * await client.domains.createDomain({ + * name: "test.example.com" + * }) + */ + public createDomain( + request: Brevo.CreateDomainRequest, + requestOptions?: DomainsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createDomain(request, requestOptions)); + } + + private async __createDomain( + request: Brevo.CreateDomainRequest, + requestOptions?: DomainsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "senders/domains", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateDomainResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/senders/domains"); + } + + /** + * Retrieves configuration of a specific domain, to know if the domain is valid or not. + * + * Use this to: + * - Check domain configuration + * - Validate a domain configuration + * - Monitor DNS record status + * - Troubleshoot authentication issues + * + * Key information returned: + * - Domain verification and authentication status + * - DNS records configuration and validation status + * - Detailed authentication requirements + * + * @param {Brevo.GetDomainConfigurationRequest} request + * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.domains.getDomainConfiguration({ + * domainName: "domainName" + * }) + */ + public getDomainConfiguration( + request: Brevo.GetDomainConfigurationRequest, + requestOptions?: DomainsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getDomainConfiguration(request, requestOptions)); + } + + private async __getDomainConfiguration( + request: Brevo.GetDomainConfigurationRequest, + requestOptions?: DomainsClient.RequestOptions, + ): Promise> { + const { domainName } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `senders/domains/${core.url.encodePathParam(domainName)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetDomainConfigurationResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/senders/domains/{domainName}"); + } + + /** + * Deletes a domain from Brevo. + * + * Use this to: + * - Remove existing domains + * - Clean up unused domain configurations + * - Remove test domains + * + * Key information returned: + * - Success confirmation message + * + * @param {Brevo.DeleteDomainRequest} request + * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.domains.deleteDomain({ + * domainName: "domainName" + * }) + */ + public deleteDomain( + request: Brevo.DeleteDomainRequest, + requestOptions?: DomainsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteDomain(request, requestOptions)); + } + + private async __deleteDomain( + request: Brevo.DeleteDomainRequest, + requestOptions?: DomainsClient.RequestOptions, + ): Promise> { + const { domainName } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `senders/domains/${core.url.encodePathParam(domainName)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/senders/domains/{domainName}", + ); + } + + /** + * Authenticates a specific domain. + * + * Use this to: + * - Authenticate a domain + * - Verify DNS record configuration + * - Complete domain setup for sending + * - Enable domain for email authentication + * + * Key information returned: + * - Authentication success confirmation + * - Domain readiness status for email sending + * + * @param {Brevo.AuthenticateDomainRequest} request + * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.domains.authenticateDomain({ + * domainName: "domainName" + * }) + */ + public authenticateDomain( + request: Brevo.AuthenticateDomainRequest, + requestOptions?: DomainsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__authenticateDomain(request, requestOptions)); + } + + private async __authenticateDomain( + request: Brevo.AuthenticateDomainRequest, + requestOptions?: DomainsClient.RequestOptions, + ): Promise> { + const { domainName } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `senders/domains/${core.url.encodePathParam(domainName)}/authenticate`, + ), + method: "PUT", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.AuthenticateDomainResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/senders/domains/{domainName}/authenticate", + ); + } +} diff --git a/src/api/resources/domains/client/index.ts b/src/api/resources/domains/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/domains/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts b/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts new file mode 100644 index 0000000..7b80387 --- /dev/null +++ b/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * domainName: "domainName" + * } + * + * @example + * { + * domainName: "domainName" + * } + */ +export interface AuthenticateDomainRequest { + /** Domain name */ + domainName: string; +} diff --git a/src/api/resources/domains/client/requests/CreateDomainRequest.ts b/src/api/resources/domains/client/requests/CreateDomainRequest.ts new file mode 100644 index 0000000..acb9725 --- /dev/null +++ b/src/api/resources/domains/client/requests/CreateDomainRequest.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * name: "mycompany.com" + * } + * + * @example + * { + * name: "newsletter.mycompany.com" + * } + * + * @example + * { + * name: "test.example.com" + * } + * + * @example + * { + * name: "mycompany.com" + * } + * + * @example + * { + * name: "mycompany.com" + * } + */ +export interface CreateDomainRequest { + /** Domain name to be added */ + name: string; +} diff --git a/src/api/resources/domains/client/requests/DeleteDomainRequest.ts b/src/api/resources/domains/client/requests/DeleteDomainRequest.ts new file mode 100644 index 0000000..602afc0 --- /dev/null +++ b/src/api/resources/domains/client/requests/DeleteDomainRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * domainName: "domainName" + * } + */ +export interface DeleteDomainRequest { + /** Domain name */ + domainName: string; +} diff --git a/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts b/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts new file mode 100644 index 0000000..03b367f --- /dev/null +++ b/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * domainName: "domainName" + * } + * + * @example + * { + * domainName: "domainName" + * } + */ +export interface GetDomainConfigurationRequest { + /** Domain name */ + domainName: string; +} diff --git a/src/api/resources/domains/client/requests/index.ts b/src/api/resources/domains/client/requests/index.ts new file mode 100644 index 0000000..42d939e --- /dev/null +++ b/src/api/resources/domains/client/requests/index.ts @@ -0,0 +1,4 @@ +export type { AuthenticateDomainRequest } from "./AuthenticateDomainRequest.js"; +export type { CreateDomainRequest } from "./CreateDomainRequest.js"; +export type { DeleteDomainRequest } from "./DeleteDomainRequest.js"; +export type { GetDomainConfigurationRequest } from "./GetDomainConfigurationRequest.js"; diff --git a/src/api/resources/domains/index.ts b/src/api/resources/domains/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/domains/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/domains/types/AuthenticateDomainResponse.ts b/src/api/resources/domains/types/AuthenticateDomainResponse.ts new file mode 100644 index 0000000..1d2d20f --- /dev/null +++ b/src/api/resources/domains/types/AuthenticateDomainResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AuthenticateDomainResponse { + /** Domain name that was authenticated */ + domain_name: string; + /** Success message confirming authentication */ + message: string; +} diff --git a/src/api/resources/domains/types/CreateDomainResponse.ts b/src/api/resources/domains/types/CreateDomainResponse.ts new file mode 100644 index 0000000..da67de7 --- /dev/null +++ b/src/api/resources/domains/types/CreateDomainResponse.ts @@ -0,0 +1,72 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateDomainResponse { + /** ID of the Domain created */ + id: number; + /** Domain name */ + domain_name: string; + /** Detected domain provider */ + domain_provider?: string; + /** Success message with next steps */ + message: string; + /** DNS records required for domain authentication */ + dns_records?: CreateDomainResponse.DnsRecords; +} + +export namespace CreateDomainResponse { + /** + * DNS records required for domain authentication + */ + export interface DnsRecords { + /** Brevo verification code record */ + brevo_code: DnsRecords.BrevoCode; + /** DKIM authentication record */ + dkim_record: DnsRecords.DkimRecord; + /** DMARC policy record */ + dmarc_record: DnsRecords.DmarcRecord; + } + + export namespace DnsRecords { + /** + * Brevo verification code record + */ + export interface BrevoCode { + /** DNS record hostname */ + host_name: string; + /** DNS record type */ + type: string; + /** DNS record value */ + value: string; + /** Whether the record is properly configured */ + status: boolean; + } + + /** + * DKIM authentication record + */ + export interface DkimRecord { + /** DNS record hostname */ + host_name: string; + /** DNS record type */ + type: string; + /** DNS record value */ + value: string; + /** Whether the record is properly configured */ + status: boolean; + } + + /** + * DMARC policy record + */ + export interface DmarcRecord { + /** DNS record hostname */ + host_name: string; + /** DNS record type */ + type: string; + /** DNS record value */ + value: string; + /** Whether the record is properly configured */ + status: boolean; + } + } +} diff --git a/src/api/resources/domains/types/GetDomainConfigurationResponse.ts b/src/api/resources/domains/types/GetDomainConfigurationResponse.ts new file mode 100644 index 0000000..a10e8bc --- /dev/null +++ b/src/api/resources/domains/types/GetDomainConfigurationResponse.ts @@ -0,0 +1,76 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetDomainConfigurationResponse { + /** Domain name */ + domain: string; + /** + * Status of domain verification (true=verified, false=non + * verified) + */ + verified: boolean; + /** + * Status of domain authentication (true=authenticated, false=non + * authenticated) + */ + authenticated: boolean; + /** DNS records configuration and status */ + dns_records: GetDomainConfigurationResponse.DnsRecords; +} + +export namespace GetDomainConfigurationResponse { + /** + * DNS records configuration and status + */ + export interface DnsRecords { + /** Brevo verification code record */ + brevo_code: DnsRecords.BrevoCode; + /** DKIM authentication record */ + dkim_record: DnsRecords.DkimRecord; + /** DMARC policy record */ + dmarc_record: DnsRecords.DmarcRecord; + } + + export namespace DnsRecords { + /** + * Brevo verification code record + */ + export interface BrevoCode { + /** DNS record hostname */ + host_name: string; + /** DNS record type */ + type: string; + /** DNS record value */ + value: string; + /** Whether the record is properly configured */ + status: boolean; + } + + /** + * DKIM authentication record + */ + export interface DkimRecord { + /** DNS record hostname */ + host_name: string; + /** DNS record type */ + type: string; + /** DNS record value */ + value: string; + /** Whether the record is properly configured */ + status: boolean; + } + + /** + * DMARC policy record + */ + export interface DmarcRecord { + /** DNS record hostname */ + host_name: string; + /** DNS record type */ + type: string; + /** DNS record value */ + value: string; + /** Whether the record is properly configured */ + status: boolean; + } + } +} diff --git a/src/api/resources/domains/types/GetDomainsResponse.ts b/src/api/resources/domains/types/GetDomainsResponse.ts new file mode 100644 index 0000000..f992a3d --- /dev/null +++ b/src/api/resources/domains/types/GetDomainsResponse.ts @@ -0,0 +1,55 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetDomainsResponse { + /** List of the domains available in your account */ + domains: GetDomainsResponse.Domains.Item[]; + /** Total number of domains */ + count: number; + /** Current page number */ + current_page: number; + /** Total number of pages */ + total_pages: number; +} + +export namespace GetDomainsResponse { + export type Domains = Domains.Item[]; + + export namespace Domains { + export interface Item { + /** Unique identifier of the domain */ + id: string; + /** Domain name */ + domain_name: string; + /** + * Status of domain authentication (true=authenticated, + * false=non authenticated) + */ + authenticated: boolean; + /** + * Status of domain verification (true=verified, false=non + * verified) + */ + verified: boolean; + /** Dedicated IP associated with domain (null if none) */ + ip?: string | null; + /** DNS provider for the domain */ + provider: string; + /** Information about who created the domain */ + creator: Item.Creator; + } + + export namespace Item { + /** + * Information about who created the domain + */ + export interface Creator { + /** Creator's user ID */ + id: string; + /** Creator's email address */ + email: string; + /** Domain creation date */ + creationDate: string; + } + } + } +} diff --git a/src/api/resources/domains/types/index.ts b/src/api/resources/domains/types/index.ts new file mode 100644 index 0000000..2fef3dd --- /dev/null +++ b/src/api/resources/domains/types/index.ts @@ -0,0 +1,4 @@ +export * from "./AuthenticateDomainResponse.js"; +export * from "./CreateDomainResponse.js"; +export * from "./GetDomainConfigurationResponse.js"; +export * from "./GetDomainsResponse.js"; diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts new file mode 100644 index 0000000..a3b3a4a --- /dev/null +++ b/src/api/resources/ecommerce/client/Client.ts @@ -0,0 +1,1384 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace EcommerceClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class EcommerceClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: EcommerceClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetCategoriesRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.getCategories() + */ + public getCategories( + request: Brevo.GetCategoriesRequest = {}, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCategories(request, requestOptions)); + } + + private async __getCategories( + request: Brevo.GetCategoriesRequest = {}, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { limit, offset, sort, ids, name, modifiedSince, createdSince, isDeleted } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + ids, + name, + modifiedSince, + createdSince, + isDeleted, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "categories", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCategoriesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/categories"); + } + + /** + * @param {Brevo.CreateUpdateCategoryRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.createUpdateCategory({ + * id: "CAT123" + * }) + */ + public createUpdateCategory( + request: Brevo.CreateUpdateCategoryRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createUpdateCategory(request, requestOptions)); + } + + private async __createUpdateCategory( + request: Brevo.CreateUpdateCategoryRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "categories", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateUpdateCategoryResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/categories"); + } + + /** + * @param {Brevo.CreateUpdateBatchCategoryRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.createUpdateBatchCategory({ + * categories: [{ + * id: "CAT123" + * }] + * }) + */ + public createUpdateBatchCategory( + request: Brevo.CreateUpdateBatchCategoryRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createUpdateBatchCategory(request, requestOptions)); + } + + private async __createUpdateBatchCategory( + request: Brevo.CreateUpdateBatchCategoryRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "categories/batch", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.CreateUpdateBatchCategoryResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/categories/batch"); + } + + /** + * @param {Brevo.GetCategoryInfoRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.ecommerce.getCategoryInfo({ + * id: "id" + * }) + */ + public getCategoryInfo( + request: Brevo.GetCategoryInfoRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCategoryInfo(request, requestOptions)); + } + + private async __getCategoryInfo( + request: Brevo.GetCategoryInfoRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `categories/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCategoryDetails, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/categories/{id}"); + } + + /** + * Getting access to Brevo eCommerce. + * + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.ecommerce.activateTheECommerceApp() + */ + public activateTheECommerceApp(requestOptions?: EcommerceClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__activateTheECommerceApp(requestOptions)); + } + + private async __activateTheECommerceApp( + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "ecommerce/activate", + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/ecommerce/activate"); + } + + /** + * @param {Brevo.GetEcommerceAttributionMetricsRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows({ + * periodFrom: "2022-01-02T00:00:00Z", + * periodTo: "2022-01-03T00:00:00Z" + * }) + */ + public getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows( + request: Brevo.GetEcommerceAttributionMetricsRequest = {}, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows(request, requestOptions), + ); + } + + private async __getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows( + request: Brevo.GetEcommerceAttributionMetricsRequest = {}, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { + periodFrom, + periodTo, + "emailCampaignId[]": emailCampaignIdArray, + "smsCampaignId[]": smsCampaignIdArray, + "automationWorkflowEmailId[]": automationWorkflowEmailIdArray, + "automationWorkflowSmsId[]": automationWorkflowSmsIdArray, + } = request; + const _queryParams: Record = { + periodFrom: periodFrom != null ? periodFrom : undefined, + periodTo: periodTo != null ? periodTo : undefined, + "emailCampaignId[]": emailCampaignIdArray, + "smsCampaignId[]": smsCampaignIdArray, + "automationWorkflowEmailId[]": automationWorkflowEmailIdArray, + "automationWorkflowSmsId[]": automationWorkflowSmsIdArray, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "ecommerce/attribution/metrics", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetEcommerceAttributionMetricsResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/ecommerce/attribution/metrics", + ); + } + + /** + * @param {Brevo.GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow({ + * conversionSource: "email_campaign", + * conversionSourceId: "sale" + * }) + */ + public getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow( + request: Brevo.GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow(request, requestOptions), + ); + } + + private async __getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow( + request: Brevo.GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { conversionSource, conversionSourceId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `ecommerce/attribution/metrics/${core.url.encodePathParam(conversionSource)}/${core.url.encodePathParam(conversionSourceId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/ecommerce/attribution/metrics/{conversionSource}/{conversionSourceId}", + ); + } + + /** + * @param {Brevo.GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.getAttributedProductSalesForASingleBrevoCampaignOrWorkflow({ + * conversionSource: "email_campaign", + * conversionSourceId: "sale" + * }) + */ + public getAttributedProductSalesForASingleBrevoCampaignOrWorkflow( + request: Brevo.GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__getAttributedProductSalesForASingleBrevoCampaignOrWorkflow(request, requestOptions), + ); + } + + private async __getAttributedProductSalesForASingleBrevoCampaignOrWorkflow( + request: Brevo.GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { conversionSource, conversionSourceId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `ecommerce/attribution/products/${core.url.encodePathParam(conversionSource)}/${core.url.encodePathParam(conversionSourceId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/ecommerce/attribution/products/{conversionSource}/{conversionSourceId}", + ); + } + + /** + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount() + */ + public getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount( + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(requestOptions), + ); + } + + private async __getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount( + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "ecommerce/config/displayCurrency", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetEcommerceConfigDisplayCurrencyResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/ecommerce/config/displayCurrency", + ); + } + + /** + * @param {Brevo.SetConfigDisplayCurrencyRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.UnprocessableEntityError} + * + * @example + * await client.ecommerce.setConfigDisplayCurrency({ + * code: "EUR" + * }) + */ + public setConfigDisplayCurrency( + request: Brevo.SetConfigDisplayCurrencyRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__setConfigDisplayCurrency(request, requestOptions)); + } + + private async __setConfigDisplayCurrency( + request: Brevo.SetConfigDisplayCurrencyRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "ecommerce/config/displayCurrency", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.SetConfigDisplayCurrencyResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/ecommerce/config/displayCurrency", + ); + } + + /** + * Get all the orders + * + * @param {Brevo.GetOrdersRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.getOrders() + */ + public getOrders( + request: Brevo.GetOrdersRequest = {}, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getOrders(request, requestOptions)); + } + + private async __getOrders( + request: Brevo.GetOrdersRequest = {}, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { limit, offset, sort, modifiedSince, createdSince } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + modifiedSince, + createdSince, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "orders", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/orders"); + } + + /** + * Manages the transactional status of the order + * + * @param {Brevo.Order} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.createOrder({ + * amount: 308.42, + * createdAt: "2021-07-29T20:59:23.383Z", + * id: "14", + * products: [{ + * price: 99.99, + * productId: "P1", + * quantity: 10 + * }], + * status: "completed", + * updatedAt: "2021-07-30T10:59:23.383Z" + * }) + */ + public createOrder( + request: Brevo.Order, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createOrder(request, requestOptions)); + } + + private async __createOrder( + request: Brevo.Order, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "orders/status", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/orders/status"); + } + + /** + * Create multiple orders at one time instead of one order at a time + * + * @param {Brevo.CreateBatchOrderRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.createBatchOrder({ + * orders: [{ + * amount: 308.42, + * createdAt: "2021-07-29T20:59:23.383Z", + * id: "14", + * products: [{ + * price: 99.99, + * productId: "P1", + * quantity: 10 + * }], + * status: "completed", + * updatedAt: "2021-07-30T10:59:23.383Z" + * }] + * }) + */ + public createBatchOrder( + request: Brevo.CreateBatchOrderRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createBatchOrder(request, requestOptions)); + } + + private async __createBatchOrder( + request: Brevo.CreateBatchOrderRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "orders/status/batch", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateBatchOrderResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/orders/status/batch"); + } + + /** + * @param {Brevo.GetProductsRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.getProducts() + */ + public getProducts( + request: Brevo.GetProductsRequest = {}, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getProducts(request, requestOptions)); + } + + private async __getProducts( + request: Brevo.GetProductsRequest = {}, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { + limit, + offset, + sort, + ids, + name, + "price[lte]": priceLte, + "price[gte]": priceGte, + "price[lt]": priceLt, + "price[gt]": priceGt, + "price[eq]": priceEq, + "price[ne]": priceNe, + categories, + modifiedSince, + createdSince, + isDeleted, + } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + ids, + name, + "price[lte]": priceLte, + "price[gte]": priceGte, + "price[lt]": priceLt, + "price[gt]": priceGt, + "price[eq]": priceEq, + "price[ne]": priceNe, + categories, + modifiedSince, + createdSince, + isDeleted, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "products", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetProductsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/products"); + } + + /** + * @param {Brevo.CreateUpdateProductRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.createUpdateProduct({ + * id: "P11", + * name: "Iphone 11" + * }) + */ + public createUpdateProduct( + request: Brevo.CreateUpdateProductRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createUpdateProduct(request, requestOptions)); + } + + private async __createUpdateProduct( + request: Brevo.CreateUpdateProductRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "products", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateUpdateProductResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/products"); + } + + /** + * @param {Brevo.CreateUpdateBatchProductsRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.ecommerce.createUpdateBatchProducts({ + * products: [{ + * id: "P11", + * name: "Iphone 11" + * }] + * }) + */ + public createUpdateBatchProducts( + request: Brevo.CreateUpdateBatchProductsRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createUpdateBatchProducts(request, requestOptions)); + } + + private async __createUpdateBatchProducts( + request: Brevo.CreateUpdateBatchProductsRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "products/batch", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.CreateUpdateBatchProductsResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/products/batch"); + } + + /** + * @param {Brevo.GetProductInfoRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.ecommerce.getProductInfo({ + * id: "id" + * }) + */ + public getProductInfo( + request: Brevo.GetProductInfoRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getProductInfo(request, requestOptions)); + } + + private async __getProductInfo( + request: Brevo.GetProductInfoRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `products/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetProductDetails, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/products/{id}"); + } + + /** + * @param {Brevo.CreateProductAlertRequest} request + * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.ecommerce.createProductAlert({ + * id: "id", + * type: "back_in_stock" + * }) + */ + public createProductAlert( + request: Brevo.CreateProductAlertRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createProductAlert(request, requestOptions)); + } + + private async __createProductAlert( + request: Brevo.CreateProductAlertRequest, + requestOptions?: EcommerceClient.RequestOptions, + ): Promise> { + const { id, type: type_, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `products/${core.url.encodePathParam(id)}/alerts/${core.url.encodePathParam(type_)}`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/products/{id}/alerts/{type}"); + } +} diff --git a/src/api/resources/ecommerce/client/index.ts b/src/api/resources/ecommerce/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/ecommerce/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts new file mode 100644 index 0000000..fcecd5a --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * orders: [{ + * amount: 308.42, + * createdAt: "2021-07-29T20:59:23.383Z", + * id: "14", + * products: [{ + * price: 99.99, + * productId: "P1", + * quantity: 10 + * }], + * status: "completed", + * updatedAt: "2021-07-30T10:59:23.383Z" + * }] + * } + */ +export interface CreateBatchOrderRequest { + /** Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual. */ + historical?: boolean; + /** Notify Url provided by client_dev to get the status of batch request */ + notifyUrl?: string; + /** array of order objects */ + orders: Brevo.Order[]; +} diff --git a/src/api/resources/ecommerce/client/requests/CreateProductAlertRequest.ts b/src/api/resources/ecommerce/client/requests/CreateProductAlertRequest.ts new file mode 100644 index 0000000..0193678 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/CreateProductAlertRequest.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id", + * type: "back_in_stock" + * } + */ +export interface CreateProductAlertRequest { + /** Product ID */ + id: string; + /** Alert type */ + type: "back_in_stock"; + contactIdentifiers?: CreateProductAlertRequest.ContactIdentifiers; +} + +export namespace CreateProductAlertRequest { + export interface ContactIdentifiers { + /** Email address of the contact */ + email?: string; + /** Contact ID in your system */ + ext_id?: string; + /** Sms of the contact */ + sms?: string; + } +} diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchCategoryRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchCategoryRequest.ts new file mode 100644 index 0000000..8859c35 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchCategoryRequest.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * categories: [{ + * id: "CAT123" + * }] + * } + */ +export interface CreateUpdateBatchCategoryRequest { + /** array of categories objects */ + categories: CreateUpdateBatchCategoryRequest.Categories.Item[]; + /** Facilitate to update the existing categories in the same request (updateEnabled = true) */ + updateEnabled?: boolean; +} + +export namespace CreateUpdateBatchCategoryRequest { + export type Categories = Categories.Item[]; + + export namespace Categories { + export interface Item { + /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database */ + deletedAt?: string; + /** Unique Category ID as saved in the shop */ + id: string; + /** category deleted from the shop's database */ + isDeleted?: boolean; + /** **Mandatory in case of creation**. Name of the Category, as displayed in the shop */ + name?: string; + /** URL to the category */ + url?: string; + } + } +} diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts new file mode 100644 index 0000000..57589a7 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts @@ -0,0 +1,56 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * products: [{ + * id: "P11", + * name: "Iphone 11" + * }] + * } + */ +export interface CreateUpdateBatchProductsRequest { + /** array of products objects */ + products: CreateUpdateBatchProductsRequest.Products.Item[]; + /** Facilitate to update the existing categories in the same request (updateEnabled = true) */ + updateEnabled?: boolean; +} + +export namespace CreateUpdateBatchProductsRequest { + export type Products = Products.Item[]; + + export namespace Products { + export interface Item { + /** Category ID-s of the product */ + categories?: string[]; + /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database */ + deletedAt?: string; + /** Product ID for which you requested the details */ + id: string; + /** Absolute URL to the cover image of the product */ + imageUrl?: string; + /** product deleted from the shop's database */ + isDeleted?: boolean; + /** Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20. */ + metaInfo?: Record; + /** Mandatory in case of creation**. Name of the product for which you requested the details */ + name: string; + /** Parent product id of the product */ + parentId?: string; + /** Price of the product */ + price?: number; + /** Product identifier from the shop */ + sku?: string; + /** Current stock value of the product from the shop's database */ + stock?: number; + /** URL to the product */ + url?: string; + } + + export namespace Item { + export namespace MetaInfo { + export type Value = string | number; + } + } + } +} diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateCategoryRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateCategoryRequest.ts new file mode 100644 index 0000000..6d03ac9 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateCategoryRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "CAT123" + * } + */ +export interface CreateUpdateCategoryRequest { + /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database */ + deletedAt?: string; + /** Unique Category ID as saved in the shop */ + id: string; + /** category deleted from the shop's database */ + isDeleted?: boolean; + /** **Mandatory in case of creation**. Name of the Category, as displayed in the shop */ + name?: string; + /** Facilitate to update the existing category in the same request (updateEnabled = true) */ + updateEnabled?: boolean; + /** URL to the category */ + url?: string; +} diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts new file mode 100644 index 0000000..0e471a0 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts @@ -0,0 +1,43 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "P11", + * name: "Iphone 11" + * } + */ +export interface CreateUpdateProductRequest { + /** Category ID-s of the product */ + categories?: string[]; + /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database */ + deletedAt?: string; + /** Product ID for which you requested the details */ + id: string; + /** Absolute URL to the cover image of the product */ + imageUrl?: string; + /** product deleted from the shop's database */ + isDeleted?: boolean; + /** Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20. */ + metaInfo?: Record; + /** Mandatory in case of creation**. Name of the product for which you requested the details */ + name: string; + /** Parent product id of the product */ + parentId?: string; + /** Price of the product */ + price?: number; + /** Product identifier from the shop */ + sku?: string; + /** Current stock value of the product from the shop's database */ + stock?: number; + /** Facilitate to update the existing category in the same request (updateEnabled = true) */ + updateEnabled?: boolean; + /** URL to the product */ + url?: string; +} + +export namespace CreateUpdateProductRequest { + export namespace MetaInfo { + export type Value = string | number; + } +} diff --git a/src/api/resources/ecommerce/client/requests/GetCategoriesRequest.ts b/src/api/resources/ecommerce/client/requests/GetCategoriesRequest.ts new file mode 100644 index 0000000..c02d589 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/GetCategoriesRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetCategoriesRequest { + /** Number of documents per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetCategoriesRequestSort; + /** Filter by category ids */ + ids?: string | string[]; + /** Filter by category name */ + name?: string; + /** Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + modifiedSince?: string; + /** Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + createdSince?: string; + /** Filter categories by their deletion status. If `false` is passed, only categories that are not deleted will be returned. */ + isDeleted?: string; +} diff --git a/src/api/resources/ecommerce/client/requests/GetCategoryInfoRequest.ts b/src/api/resources/ecommerce/client/requests/GetCategoryInfoRequest.ts new file mode 100644 index 0000000..eaf063b --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/GetCategoryInfoRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCategoryInfoRequest { + /** Category ID */ + id: string; +} diff --git a/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest.ts b/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest.ts new file mode 100644 index 0000000..ab2f209 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * conversionSource: "email_campaign", + * conversionSourceId: "sale" + * } + */ +export interface GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest { + /** The Brevo campaign type or workflow type for which data will be retrieved */ + conversionSource: Brevo.GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource; + /** The Brevo campaign or automation workflow id for which data will be retrieved */ + conversionSourceId: string; +} diff --git a/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsRequest.ts b/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsRequest.ts new file mode 100644 index 0000000..a715215 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsRequest.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * periodFrom: "2022-01-02T00:00:00Z", + * periodTo: "2022-01-03T00:00:00Z" + * } + */ +export interface GetEcommerceAttributionMetricsRequest { + /** When getting metrics for a specific period, define the starting datetime in RFC3339 format */ + periodFrom?: string; + /** When getting metrics for a specific period, define the end datetime in RFC3339 format */ + periodTo?: string; + /** The email campaign ID(s) to get metrics for */ + "emailCampaignId[]"?: string | string[]; + /** The SMS campaign ID(s) to get metrics for */ + "smsCampaignId[]"?: string | string[]; + /** The automation workflow ID(s) to get email attribution metrics for */ + "automationWorkflowEmailId[]"?: string | string[]; + /** The automation workflow ID(s) to get SMS attribution metrics for */ + "automationWorkflowSmsId[]"?: string | string[]; +} diff --git a/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest.ts b/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest.ts new file mode 100644 index 0000000..e5b301d --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * conversionSource: "email_campaign", + * conversionSourceId: "sale" + * } + */ +export interface GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest { + /** The Brevo campaign or automation workflow type for which data will be retrieved */ + conversionSource: Brevo.GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource; + /** The Brevo campaign or automation workflow id for which data will be retrieved */ + conversionSourceId: string; +} diff --git a/src/api/resources/ecommerce/client/requests/GetOrdersRequest.ts b/src/api/resources/ecommerce/client/requests/GetOrdersRequest.ts new file mode 100644 index 0000000..18b1cfd --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/GetOrdersRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetOrdersRequest { + /** Number of documents per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetOrdersRequestSort; + /** Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + modifiedSince?: string; + /** Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + createdSince?: string; +} diff --git a/src/api/resources/ecommerce/client/requests/GetProductInfoRequest.ts b/src/api/resources/ecommerce/client/requests/GetProductInfoRequest.ts new file mode 100644 index 0000000..aac6959 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/GetProductInfoRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetProductInfoRequest { + /** Product ID */ + id: string; +} diff --git a/src/api/resources/ecommerce/client/requests/GetProductsRequest.ts b/src/api/resources/ecommerce/client/requests/GetProductsRequest.ts new file mode 100644 index 0000000..c2b6aa0 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/GetProductsRequest.ts @@ -0,0 +1,40 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetProductsRequest { + /** Number of documents per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetProductsRequestSort; + /** Filter by product ids */ + ids?: string | string[]; + /** Filter by product name, minimum 3 characters should be present for search. */ + name?: string; + /** Price filter for products less than and equals to particular amount */ + "price[lte]"?: number; + /** Price filter for products greater than and equals to particular amount */ + "price[gte]"?: number; + /** Price filter for products less than particular amount */ + "price[lt]"?: number; + /** Price filter for products greater than particular amount */ + "price[gt]"?: number; + /** Price filter for products equals to particular amount */ + "price[eq]"?: number; + /** Price filter for products not equals to particular amount */ + "price[ne]"?: number; + /** Filter by categories ids */ + categories?: string | string[]; + /** Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + modifiedSince?: string; + /** Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + createdSince?: string; + /** Filter products by their deletion status. If `false` is passed, only products that are not deleted will be returned. */ + isDeleted?: string; +} diff --git a/src/api/resources/ecommerce/client/requests/SetConfigDisplayCurrencyRequest.ts b/src/api/resources/ecommerce/client/requests/SetConfigDisplayCurrencyRequest.ts new file mode 100644 index 0000000..000c7ca --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/SetConfigDisplayCurrencyRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * code: "EUR" + * } + */ +export interface SetConfigDisplayCurrencyRequest { + /** ISO 4217 compliant display currency code */ + code: string; +} diff --git a/src/api/resources/ecommerce/client/requests/index.ts b/src/api/resources/ecommerce/client/requests/index.ts new file mode 100644 index 0000000..ecd3d97 --- /dev/null +++ b/src/api/resources/ecommerce/client/requests/index.ts @@ -0,0 +1,15 @@ +export type { CreateBatchOrderRequest } from "./CreateBatchOrderRequest.js"; +export type { CreateProductAlertRequest } from "./CreateProductAlertRequest.js"; +export type { CreateUpdateBatchCategoryRequest } from "./CreateUpdateBatchCategoryRequest.js"; +export type { CreateUpdateBatchProductsRequest } from "./CreateUpdateBatchProductsRequest.js"; +export type { CreateUpdateCategoryRequest } from "./CreateUpdateCategoryRequest.js"; +export type { CreateUpdateProductRequest } from "./CreateUpdateProductRequest.js"; +export type { GetCategoriesRequest } from "./GetCategoriesRequest.js"; +export type { GetCategoryInfoRequest } from "./GetCategoryInfoRequest.js"; +export type { GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest } from "./GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest.js"; +export type { GetEcommerceAttributionMetricsRequest } from "./GetEcommerceAttributionMetricsRequest.js"; +export type { GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest } from "./GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest.js"; +export type { GetOrdersRequest } from "./GetOrdersRequest.js"; +export type { GetProductInfoRequest } from "./GetProductInfoRequest.js"; +export type { GetProductsRequest } from "./GetProductsRequest.js"; +export type { SetConfigDisplayCurrencyRequest } from "./SetConfigDisplayCurrencyRequest.js"; diff --git a/src/api/resources/ecommerce/index.ts b/src/api/resources/ecommerce/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/ecommerce/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/ecommerce/types/CreateBatchOrderResponse.ts b/src/api/resources/ecommerce/types/CreateBatchOrderResponse.ts new file mode 100644 index 0000000..2845f76 --- /dev/null +++ b/src/api/resources/ecommerce/types/CreateBatchOrderResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateBatchOrderResponse { + /** Batch ID of the request */ + batchId: number; + /** Number of orders */ + count?: number; +} diff --git a/src/api/resources/ecommerce/types/CreateUpdateBatchCategoryResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateBatchCategoryResponse.ts new file mode 100644 index 0000000..452f5a3 --- /dev/null +++ b/src/api/resources/ecommerce/types/CreateUpdateBatchCategoryResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateUpdateBatchCategoryResponse { + /** Number of the new created categories */ + createdCount?: number; + /** Number of the existing categories updated */ + updatedCount?: number; +} diff --git a/src/api/resources/ecommerce/types/CreateUpdateBatchProductsResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateBatchProductsResponse.ts new file mode 100644 index 0000000..0c96f06 --- /dev/null +++ b/src/api/resources/ecommerce/types/CreateUpdateBatchProductsResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateUpdateBatchProductsResponse { + /** Number of the new created products */ + createdCount?: number; + /** Number of the existing products updated */ + updatedCount?: number; +} diff --git a/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts new file mode 100644 index 0000000..fbd1718 --- /dev/null +++ b/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateUpdateCategoryResponse { + /** ID of the category when a new category is created */ + id?: number; +} diff --git a/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts new file mode 100644 index 0000000..8610341 --- /dev/null +++ b/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateUpdateProductResponse { + /** ID of the Product when a new product is created */ + id?: number; +} diff --git a/src/api/resources/ecommerce/types/GetCategoriesRequestSort.ts b/src/api/resources/ecommerce/types/GetCategoriesRequestSort.ts new file mode 100644 index 0000000..598204a --- /dev/null +++ b/src/api/resources/ecommerce/types/GetCategoriesRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCategoriesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetCategoriesRequestSort = (typeof GetCategoriesRequestSort)[keyof typeof GetCategoriesRequestSort]; diff --git a/src/api/resources/ecommerce/types/GetCategoriesResponse.ts b/src/api/resources/ecommerce/types/GetCategoriesResponse.ts new file mode 100644 index 0000000..11b26ab --- /dev/null +++ b/src/api/resources/ecommerce/types/GetCategoriesResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetCategoriesResponse { + categories: Brevo.GetCategoryDetails[]; + /** Number of categories */ + count: number; +} diff --git a/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource.ts b/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource.ts new file mode 100644 index 0000000..80a76bd --- /dev/null +++ b/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource = { + EmailCampaign: "email_campaign", + SmsCampaign: "sms_campaign", + AutomationWorkflowEmail: "automation_workflow_email", + AutomationWorkflowSms: "automation_workflow_sms", +} as const; +export type GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource = + (typeof GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource)[keyof typeof GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource]; diff --git a/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse.ts b/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse.ts new file mode 100644 index 0000000..7c3b0f5 --- /dev/null +++ b/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse { + averageBasket: number; + conversionSource: GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse.ConversionSource; + id: number; + ordersCount: number; + revenue: number; + newCustomersCount: number; +} + +export namespace GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse { + export const ConversionSource = { + EmailCampaign: "email_campaign", + SmsCampaign: "sms_campaign", + AutomationWorkflowEmail: "automation_workflow_email", + AutomationWorkflowSms: "automation_workflow_sms", + } as const; + export type ConversionSource = (typeof ConversionSource)[keyof typeof ConversionSource]; +} diff --git a/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsResponse.ts b/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsResponse.ts new file mode 100644 index 0000000..a16d227 --- /dev/null +++ b/src/api/resources/ecommerce/types/GetEcommerceAttributionMetricsResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetEcommerceAttributionMetricsResponse { + /** List of conversion attribution metrics */ + results: Brevo.ConversionSourceMetrics[]; + /** Attribution list aggregated totals */ + totals: GetEcommerceAttributionMetricsResponse.Totals; +} + +export namespace GetEcommerceAttributionMetricsResponse { + /** + * Attribution list aggregated totals + */ + export interface Totals { + averageBasket: number; + ordersCount: number; + revenue: number; + } +} diff --git a/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource.ts b/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource.ts new file mode 100644 index 0000000..9eb6b61 --- /dev/null +++ b/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource = { + EmailCampaign: "email_campaign", + SmsCampaign: "sms_campaign", + AutomationWorkflowEmail: "automation_workflow_email", + AutomationWorkflowSms: "automation_workflow_sms", +} as const; +export type GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource = + (typeof GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource)[keyof typeof GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource]; diff --git a/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.ts b/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.ts new file mode 100644 index 0000000..60f1c1e --- /dev/null +++ b/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse { + /** List of attributed products */ + products: GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.Products.Item[]; +} + +export namespace GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse { + export type Products = Products.Item[]; + + export namespace Products { + export interface Item { + id: string; + imageUrl?: string; + name?: string; + ordersCount?: number; + price?: number; + revenue?: number; + sku?: string; + url?: string; + } + } +} diff --git a/src/api/resources/ecommerce/types/GetEcommerceConfigDisplayCurrencyResponse.ts b/src/api/resources/ecommerce/types/GetEcommerceConfigDisplayCurrencyResponse.ts new file mode 100644 index 0000000..fea9c70 --- /dev/null +++ b/src/api/resources/ecommerce/types/GetEcommerceConfigDisplayCurrencyResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetEcommerceConfigDisplayCurrencyResponse { + /** ISO 4217 compliant display currency code */ + code: string; +} diff --git a/src/api/resources/ecommerce/types/GetOrdersRequestSort.ts b/src/api/resources/ecommerce/types/GetOrdersRequestSort.ts new file mode 100644 index 0000000..5f26b53 --- /dev/null +++ b/src/api/resources/ecommerce/types/GetOrdersRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetOrdersRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetOrdersRequestSort = (typeof GetOrdersRequestSort)[keyof typeof GetOrdersRequestSort]; diff --git a/src/api/resources/ecommerce/types/GetProductsRequestSort.ts b/src/api/resources/ecommerce/types/GetProductsRequestSort.ts new file mode 100644 index 0000000..347f9c5 --- /dev/null +++ b/src/api/resources/ecommerce/types/GetProductsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetProductsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetProductsRequestSort = (typeof GetProductsRequestSort)[keyof typeof GetProductsRequestSort]; diff --git a/src/api/resources/ecommerce/types/GetProductsResponse.ts b/src/api/resources/ecommerce/types/GetProductsResponse.ts new file mode 100644 index 0000000..f4afbb8 --- /dev/null +++ b/src/api/resources/ecommerce/types/GetProductsResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetProductsResponse { + /** Number of products */ + count: number; + products: Brevo.GetProductDetails[]; +} diff --git a/src/api/resources/ecommerce/types/SetConfigDisplayCurrencyResponse.ts b/src/api/resources/ecommerce/types/SetConfigDisplayCurrencyResponse.ts new file mode 100644 index 0000000..f75e51c --- /dev/null +++ b/src/api/resources/ecommerce/types/SetConfigDisplayCurrencyResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SetConfigDisplayCurrencyResponse { + /** ISO 4217 compliant display currency code */ + code: string; +} diff --git a/src/api/resources/ecommerce/types/index.ts b/src/api/resources/ecommerce/types/index.ts new file mode 100644 index 0000000..45ea6ad --- /dev/null +++ b/src/api/resources/ecommerce/types/index.ts @@ -0,0 +1,17 @@ +export * from "./CreateBatchOrderResponse.js"; +export * from "./CreateUpdateBatchCategoryResponse.js"; +export * from "./CreateUpdateBatchProductsResponse.js"; +export * from "./CreateUpdateCategoryResponse.js"; +export * from "./CreateUpdateProductResponse.js"; +export * from "./GetCategoriesRequestSort.js"; +export * from "./GetCategoriesResponse.js"; +export * from "./GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource.js"; +export * from "./GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse.js"; +export * from "./GetEcommerceAttributionMetricsResponse.js"; +export * from "./GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource.js"; +export * from "./GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.js"; +export * from "./GetEcommerceConfigDisplayCurrencyResponse.js"; +export * from "./GetOrdersRequestSort.js"; +export * from "./GetProductsRequestSort.js"; +export * from "./GetProductsResponse.js"; +export * from "./SetConfigDisplayCurrencyResponse.js"; diff --git a/src/api/resources/emailCampaigns/client/Client.ts b/src/api/resources/emailCampaigns/client/Client.ts new file mode 100644 index 0000000..29f1aa1 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/Client.ts @@ -0,0 +1,1017 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace EmailCampaignsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class EmailCampaignsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: EmailCampaignsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * + * The response payload for this endpoint has changed + * + * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). + * + * + * @param {Brevo.GetEmailCampaignsRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.emailCampaigns.getEmailCampaigns() + */ + public getEmailCampaigns( + request: Brevo.GetEmailCampaignsRequest = {}, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getEmailCampaigns(request, requestOptions)); + } + + private async __getEmailCampaigns( + request: Brevo.GetEmailCampaignsRequest = {}, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { + type: type_, + status, + statistics, + startDate, + endDate, + limit, + offset, + sort, + excludeHtmlContent, + } = request; + const _queryParams: Record = { + type: type_ != null ? type_ : undefined, + status: status != null ? status : undefined, + statistics: statistics != null ? statistics : undefined, + startDate, + endDate, + limit, + offset, + sort: sort != null ? sort : undefined, + excludeHtmlContent, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "emailCampaigns", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetEmailCampaignsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/emailCampaigns"); + } + + /** + * @param {Brevo.CreateEmailCampaignRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.emailCampaigns.createEmailCampaign({ + * name: "Newsletter - May 2017", + * sender: {} + * }) + */ + public createEmailCampaign( + request: Brevo.CreateEmailCampaignRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createEmailCampaign(request, requestOptions)); + } + + private async __createEmailCampaign( + request: Brevo.CreateEmailCampaignRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "emailCampaigns", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateEmailCampaignResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/emailCampaigns"); + } + + /** + * @param {Brevo.UploadImageToGalleryRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.emailCampaigns.uploadImageToGallery({ + * imageUrl: "https://somedomain.com/image1.jpg" + * }) + */ + public uploadImageToGallery( + request: Brevo.UploadImageToGalleryRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__uploadImageToGallery(request, requestOptions)); + } + + private async __uploadImageToGallery( + request: Brevo.UploadImageToGalleryRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "emailCampaigns/images", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.UploadImageToGalleryResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/emailCampaigns/images"); + } + + /** + * @param {Brevo.GetEmailCampaignRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.getEmailCampaign({ + * campaignId: 1000000 + * }) + */ + public getEmailCampaign( + request: Brevo.GetEmailCampaignRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getEmailCampaign(request, requestOptions)); + } + + private async __getEmailCampaign( + request: Brevo.GetEmailCampaignRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, statistics } = request; + const _queryParams: Record = { + statistics: statistics != null ? statistics : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetEmailCampaignResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/emailCampaigns/{campaignId}"); + } + + /** + * @param {Brevo.UpdateEmailCampaignRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.updateEmailCampaign({ + * campaignId: 1000000 + * }) + */ + public updateEmailCampaign( + request: Brevo.UpdateEmailCampaignRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateEmailCampaign(request, requestOptions)); + } + + private async __updateEmailCampaign( + request: Brevo.UpdateEmailCampaignRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/emailCampaigns/{campaignId}"); + } + + /** + * @param {Brevo.DeleteEmailCampaignRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.deleteEmailCampaign({ + * campaignId: 1000000 + * }) + */ + public deleteEmailCampaign( + request: Brevo.DeleteEmailCampaignRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteEmailCampaign(request, requestOptions)); + } + + private async __deleteEmailCampaign( + request: Brevo.DeleteEmailCampaignRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/emailCampaigns/{campaignId}", + ); + } + + /** + * Obtain winning version of an A/B test email campaign + * + * @param {Brevo.GetAbTestCampaignResultRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.getAbTestCampaignResult({ + * campaignId: 1000000 + * }) + */ + public getAbTestCampaignResult( + request: Brevo.GetAbTestCampaignResultRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAbTestCampaignResult(request, requestOptions)); + } + + private async __getAbTestCampaignResult( + request: Brevo.GetAbTestCampaignResultRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}/abTestCampaignResult`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetAbTestCampaignResultResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/emailCampaigns/{campaignId}/abTestCampaignResult", + ); + } + + /** + * @param {Brevo.EmailExportRecipientsRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.emailExportRecipients({ + * campaignId: 1000000, + * recipientsType: "all" + * }) + */ + public emailExportRecipients( + request: Brevo.EmailExportRecipientsRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__emailExportRecipients(request, requestOptions)); + } + + private async __emailExportRecipients( + request: Brevo.EmailExportRecipientsRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}/exportRecipients`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.EmailExportRecipientsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/emailCampaigns/{campaignId}/exportRecipients", + ); + } + + /** + * @param {Brevo.SendEmailCampaignNowRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.PaymentRequiredError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.sendEmailCampaignNow({ + * campaignId: 1000000 + * }) + */ + public sendEmailCampaignNow( + request: Brevo.SendEmailCampaignNowRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendEmailCampaignNow(request, requestOptions)); + } + + private async __sendEmailCampaignNow( + request: Brevo.SendEmailCampaignNowRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}/sendNow`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 402: + throw new Brevo.PaymentRequiredError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/emailCampaigns/{campaignId}/sendNow", + ); + } + + /** + * A PDF will be sent to the specified email addresses + * + * @param {Brevo.SendReportRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.sendReport({ + * campaignId: 1000000, + * body: { + * email: { + * body: "Please find attached the report of our last email campaign.", + * to: ["jim.suehan@example.com"] + * } + * } + * }) + */ + public sendReport( + request: Brevo.SendReportRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendReport(request, requestOptions)); + } + + private async __sendReport( + request: Brevo.SendReportRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}/sendReport`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/emailCampaigns/{campaignId}/sendReport", + ); + } + + /** + * @param {Brevo.SendTestEmailRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.sendTestEmail({ + * campaignId: 1000000, + * body: {} + * }) + */ + public sendTestEmail( + request: Brevo.SendTestEmailRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendTestEmail(request, requestOptions)); + } + + private async __sendTestEmail( + request: Brevo.SendTestEmailRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}/sendTest`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/emailCampaigns/{campaignId}/sendTest", + ); + } + + /** + * Get a unique URL to share & import an email template from one Brevo account to another. + * + * @param {Brevo.GetSharedTemplateUrlRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.MethodNotAllowedError} + * + * @example + * await client.emailCampaigns.getSharedTemplateUrl({ + * campaignId: 1000000 + * }) + */ + public getSharedTemplateUrl( + request: Brevo.GetSharedTemplateUrlRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSharedTemplateUrl(request, requestOptions)); + } + + private async __getSharedTemplateUrl( + request: Brevo.GetSharedTemplateUrlRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}/sharedUrl`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSharedTemplateUrlResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 405: + throw new Brevo.MethodNotAllowedError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/emailCampaigns/{campaignId}/sharedUrl", + ); + } + + /** + * @param {Brevo.UpdateCampaignStatusRequest} request + * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.emailCampaigns.updateCampaignStatus({ + * campaignId: 1000000, + * body: {} + * }) + */ + public updateCampaignStatus( + request: Brevo.UpdateCampaignStatusRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateCampaignStatus(request, requestOptions)); + } + + private async __updateCampaignStatus( + request: Brevo.UpdateCampaignStatusRequest, + requestOptions?: EmailCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `emailCampaigns/${core.url.encodePathParam(campaignId)}/status`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/emailCampaigns/{campaignId}/status", + ); + } +} diff --git a/src/api/resources/emailCampaigns/client/index.ts b/src/api/resources/emailCampaigns/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/emailCampaigns/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts new file mode 100644 index 0000000..72b2e74 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts @@ -0,0 +1,130 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * name: "Newsletter - May 2017", + * sender: {} + * } + */ +export interface CreateEmailCampaignRequest { + /** Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B */ + abTesting?: boolean; + /** Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps */ + attachmentUrl?: string; + /** To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy. Learn more about setting an email expiration date. For reference , ``https://help.brevo.com/hc/en-us/articles/4413566705298-Create-an-email-campaign`` */ + emailExpirationDate?: CreateEmailCampaignRequest.EmailExpirationDate; + /** Footer of the email campaign */ + footer?: string; + /** Header of the email campaign */ + header?: string; + /** Mandatory if htmlUrl and templateId are empty. Body of the message (HTML). */ + htmlContent?: string; + /** **Mandatory if htmlContent and templateId are empty**. Url to the message (HTML). For example: **https://html.domain.com** */ + htmlUrl?: string; + /** **Mandatory if ipWarmupEnable is set to true**. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. */ + increaseRate?: number; + /** **Mandatory if ipWarmupEnable is set to true**. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. */ + initialQuota?: number; + /** Use true to embedded the images in your email. Final size of the email should be less than **4MB**. Campaigns with embedded images can _not be sent to more than 5000 contacts_ */ + inlineImageActivation?: boolean; + /** **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip. */ + ipWarmupEnable?: boolean; + /** Use true to enable the mirror link */ + mirrorActive?: boolean; + /** Name of the campaign */ + name: string; + /** Pass the set of attributes to customize the type classic campaign. For example: **{"FNAME":"Joe", "LNAME":"Doe"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField** */ + params?: Record; + /** Preview text or preheader of the email campaign */ + previewText?: string; + /** Segment ids and List ids to include/exclude from campaign */ + recipients?: CreateEmailCampaignRequest.Recipients; + /** Email on which the campaign recipients will be able to reply to */ + replyTo?: string; + /** Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result**. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). For example: **2017-06-01T12:30:00+02:00** */ + scheduledAt?: string; + /** Set this to true if you want to send your campaign at best time. */ + sendAtBestTime?: boolean; + /** Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** */ + sender: CreateEmailCampaignRequest.Sender; + /** Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else */ + splitRule?: number; + /** Subject of the campaign. **Mandatory if abTesting is false**. Ignored if abTesting is true. */ + subject?: string; + /** Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value */ + subjectA?: string; + /** Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value */ + subjectB?: string; + /** Tag of the campaign */ + tag?: string; + /** **Mandatory if htmlContent and htmlUrl are empty**. Id of the transactional email template with status _active_. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. */ + templateId?: number; + /** To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization */ + toField?: string; + /** Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used. */ + unsubscriptionPageId?: string; + /** **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used. */ + updateFormId?: string; + /** Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed */ + utmCampaign?: string; + /** Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed */ + winnerCriteria?: CreateEmailCampaignRequest.WinnerCriteria; + /** Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed */ + winnerDelay?: number; +} + +export namespace CreateEmailCampaignRequest { + /** + * To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy. Learn more about setting an email expiration date. For reference , ``https://help.brevo.com/hc/en-us/articles/4413566705298-Create-an-email-campaign`` + */ + export interface EmailExpirationDate { + /** Duration of the email expiry. maximum duration can be 3600 days or 480 weeks or 120 months. */ + duration?: number; + /** unit of the duration */ + unit?: EmailExpirationDate.Unit; + } + + export namespace EmailExpirationDate { + /** unit of the duration */ + export const Unit = { + Days: "days", + Weeks: "weeks", + Months: "months", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; + } + + /** + * Segment ids and List ids to include/exclude from campaign + */ + export interface Recipients { + /** List ids to exclude from the campaign */ + exclusionListIds?: number[]; + /** Segment ids which have to be excluded from a campaign. */ + exclusionSegmentIds?: number[]; + /** **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to */ + listIds?: number[]; + /** **Mandatory if listIds are not used**. Segment ids to send the campaign to. */ + segmentIds?: number[]; + } + + /** + * Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** + */ + export interface Sender { + /** Sender email */ + email?: string; + /** Select the sender for the campaign on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. */ + id?: number; + /** Sender Name */ + name?: string; + } + + /** Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed */ + export const WinnerCriteria = { + Open: "open", + Click: "click", + } as const; + export type WinnerCriteria = (typeof WinnerCriteria)[keyof typeof WinnerCriteria]; +} diff --git a/src/api/resources/emailCampaigns/client/requests/DeleteEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/DeleteEmailCampaignRequest.ts new file mode 100644 index 0000000..10cae9c --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/DeleteEmailCampaignRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface DeleteEmailCampaignRequest { + /** id of the campaign */ + campaignId: number; +} diff --git a/src/api/resources/emailCampaigns/client/requests/EmailExportRecipientsRequest.ts b/src/api/resources/emailCampaigns/client/requests/EmailExportRecipientsRequest.ts new file mode 100644 index 0000000..ca264c2 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/EmailExportRecipientsRequest.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000, + * recipientsType: "all" + * } + */ +export interface EmailExportRecipientsRequest { + /** Id of the campaign */ + campaignId: number; + /** Webhook called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 */ + notifyURL?: string; + /** Type of recipients to export for a campaign */ + recipientsType: EmailExportRecipientsRequest.RecipientsType; +} + +export namespace EmailExportRecipientsRequest { + /** Type of recipients to export for a campaign */ + export const RecipientsType = { + All: "all", + NonClickers: "nonClickers", + NonOpeners: "nonOpeners", + Clickers: "clickers", + Openers: "openers", + SoftBounces: "softBounces", + HardBounces: "hardBounces", + Unsubscribed: "unsubscribed", + } as const; + export type RecipientsType = (typeof RecipientsType)[keyof typeof RecipientsType]; +} diff --git a/src/api/resources/emailCampaigns/client/requests/GetAbTestCampaignResultRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetAbTestCampaignResultRequest.ts new file mode 100644 index 0000000..96d21aa --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/GetAbTestCampaignResultRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface GetAbTestCampaignResultRequest { + /** Id of the A/B test campaign */ + campaignId: number; +} diff --git a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts new file mode 100644 index 0000000..d77d4ef --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface GetEmailCampaignRequest { + /** Id of the campaign */ + campaignId: number; + /** Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. */ + statistics?: Brevo.GetEmailCampaignRequestStatistics; +} diff --git a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignsRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignsRequest.ts new file mode 100644 index 0000000..9eb4bda --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignsRequest.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetEmailCampaignsRequest { + /** Filter on the type of the campaigns */ + type?: Brevo.GetEmailCampaignsRequestType; + /** Filter on the status of the campaign */ + status?: Brevo.GetEmailCampaignsRequestStatus; + /** Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. */ + statistics?: Brevo.GetEmailCampaignsRequestStatistics; + /** **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) */ + startDate?: string; + /** **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) */ + endDate?: string; + /** Number of documents per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetEmailCampaignsRequestSort; + /** Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body */ + excludeHtmlContent?: boolean; +} diff --git a/src/api/resources/emailCampaigns/client/requests/GetSharedTemplateUrlRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetSharedTemplateUrlRequest.ts new file mode 100644 index 0000000..21fc3e7 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/GetSharedTemplateUrlRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface GetSharedTemplateUrlRequest { + /** Id of the campaign or template */ + campaignId: number; +} diff --git a/src/api/resources/emailCampaigns/client/requests/SendEmailCampaignNowRequest.ts b/src/api/resources/emailCampaigns/client/requests/SendEmailCampaignNowRequest.ts new file mode 100644 index 0000000..7925108 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/SendEmailCampaignNowRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface SendEmailCampaignNowRequest { + /** Id of the campaign */ + campaignId: number; +} diff --git a/src/api/resources/emailCampaigns/client/requests/SendReportRequest.ts b/src/api/resources/emailCampaigns/client/requests/SendReportRequest.ts new file mode 100644 index 0000000..de60590 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/SendReportRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * campaignId: 1000000, + * body: { + * email: { + * body: "Please find attached the report of our last email campaign.", + * to: ["jim.suehan@example.com"] + * } + * } + * } + */ +export interface SendReportRequest { + /** Id of the campaign */ + campaignId: number; + body: Brevo.SendReport; +} diff --git a/src/api/resources/emailCampaigns/client/requests/SendTestEmailRequest.ts b/src/api/resources/emailCampaigns/client/requests/SendTestEmailRequest.ts new file mode 100644 index 0000000..2eeb9fd --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/SendTestEmailRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * campaignId: 1000000, + * body: {} + * } + */ +export interface SendTestEmailRequest { + /** Id of the campaign */ + campaignId: number; + body: Brevo.SendTestEmail; +} diff --git a/src/api/resources/emailCampaigns/client/requests/UpdateCampaignStatusRequest.ts b/src/api/resources/emailCampaigns/client/requests/UpdateCampaignStatusRequest.ts new file mode 100644 index 0000000..8bc0f41 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/UpdateCampaignStatusRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * campaignId: 1000000, + * body: {} + * } + */ +export interface UpdateCampaignStatusRequest { + /** Id of the campaign */ + campaignId: number; + body: Brevo.UpdateCampaignStatus; +} diff --git a/src/api/resources/emailCampaigns/client/requests/UpdateEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/UpdateEmailCampaignRequest.ts new file mode 100644 index 0000000..c8d98d6 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/UpdateEmailCampaignRequest.ts @@ -0,0 +1,131 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface UpdateEmailCampaignRequest { + /** Id of the campaign */ + campaignId: number; + /** Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B */ + abTesting?: boolean; + /** Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps' */ + attachmentUrl?: string; + /** To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy. */ + emailExpirationDate?: UpdateEmailCampaignRequest.EmailExpirationDate; + /** Footer of the email campaign */ + footer?: string; + /** Header of the email campaign */ + header?: string; + /** Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. **REQUIRED if htmlUrl is empty** */ + htmlContent?: string; + /** Url which contents the body of the email message. **REQUIRED if htmlContent is empty** */ + htmlUrl?: string; + /** Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. */ + increaseRate?: number; + /** Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. */ + initialQuota?: number; + /** Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than **4MB** with images embedded in the email. Campaigns with the images embedded in the email _must be sent to less than 5000 contacts_. */ + inlineImageActivation?: boolean; + /** **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip. */ + ipWarmupEnable?: boolean; + /** Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign */ + mirrorActive?: boolean; + /** Name of the campaign */ + name?: string; + /** Pass the set of attributes to customize the type classic campaign. For example: **{"FNAME":"Joe", "LNAME":"Doe"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField** */ + params?: Record; + /** Preview text or preheader of the email campaign */ + previewText?: string; + /** Segment ids and List ids to include/exclude from campaign */ + recipients?: UpdateEmailCampaignRequest.Recipients; + /** **FOR TRIGGER ONLY !** Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times */ + recurring?: boolean; + /** Email on which campaign recipients will be able to reply to */ + replyTo?: string; + /** UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). */ + scheduledAt?: string; + /** Set this to true if you want to send your campaign at best time. Note:- **if true, warmup ip will be disabled.** */ + sendAtBestTime?: boolean; + /** Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** */ + sender?: UpdateEmailCampaignRequest.Sender; + /** Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else */ + splitRule?: number; + /** Subject of the campaign */ + subject?: string; + /** Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value */ + subjectA?: string; + /** Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value */ + subjectB?: string; + /** Tag of the campaign */ + tag?: string; + /** To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization */ + toField?: string; + /** Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. */ + unsubscriptionPageId?: string; + /** **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. */ + updateFormId?: string; + /** Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed */ + utmCampaign?: string; + /** Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed */ + winnerCriteria?: UpdateEmailCampaignRequest.WinnerCriteria; + /** Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed */ + winnerDelay?: number; +} + +export namespace UpdateEmailCampaignRequest { + /** + * To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy. + */ + export interface EmailExpirationDate { + /** Duration of the email expiry. maximum duration can be 3600 days or 480 weeks or 120 months. */ + duration?: number; + /** unit of the duration */ + unit?: EmailExpirationDate.Unit; + } + + export namespace EmailExpirationDate { + /** unit of the duration */ + export const Unit = { + Days: "days", + Weeks: "weeks", + Months: "months", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; + } + + /** + * Segment ids and List ids to include/exclude from campaign + */ + export interface Recipients { + /** List ids which have to be excluded from a campaign */ + exclusionListIds?: number[]; + /** Segment ids which have to be excluded from a campaign. */ + exclusionSegmentIds?: number[]; + /** Lists Ids to send the campaign to. **Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty** */ + listIds?: number[]; + /** **Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it.** Segment ids to send the campaign to. */ + segmentIds?: number[]; + } + + /** + * Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** + */ + export interface Sender { + /** Sender email from which the campaign emails are sent */ + email?: string; + /** Select the sender for the campaign on the basis of sender id. **In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)**. */ + id?: number; + /** Sender Name from which the campaign emails are sent */ + name?: string; + } + + /** Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed */ + export const WinnerCriteria = { + Open: "open", + Click: "click", + } as const; + export type WinnerCriteria = (typeof WinnerCriteria)[keyof typeof WinnerCriteria]; +} diff --git a/src/api/resources/emailCampaigns/client/requests/UploadImageToGalleryRequest.ts b/src/api/resources/emailCampaigns/client/requests/UploadImageToGalleryRequest.ts new file mode 100644 index 0000000..941a40a --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/UploadImageToGalleryRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * imageUrl: "https://somedomain.com/image1.jpg" + * } + */ +export interface UploadImageToGalleryRequest { + /** The absolute url of the image (**no local file**). Maximum allowed size for image is **2MB**. Allowed extensions for images are: #### jpeg, jpg, png, bmp, gif. */ + imageUrl: string; + /** Name of the image. */ + name?: string; +} diff --git a/src/api/resources/emailCampaigns/client/requests/index.ts b/src/api/resources/emailCampaigns/client/requests/index.ts new file mode 100644 index 0000000..9489cc7 --- /dev/null +++ b/src/api/resources/emailCampaigns/client/requests/index.ts @@ -0,0 +1,13 @@ +export { CreateEmailCampaignRequest } from "./CreateEmailCampaignRequest.js"; +export type { DeleteEmailCampaignRequest } from "./DeleteEmailCampaignRequest.js"; +export { EmailExportRecipientsRequest } from "./EmailExportRecipientsRequest.js"; +export type { GetAbTestCampaignResultRequest } from "./GetAbTestCampaignResultRequest.js"; +export type { GetEmailCampaignRequest } from "./GetEmailCampaignRequest.js"; +export type { GetEmailCampaignsRequest } from "./GetEmailCampaignsRequest.js"; +export type { GetSharedTemplateUrlRequest } from "./GetSharedTemplateUrlRequest.js"; +export type { SendEmailCampaignNowRequest } from "./SendEmailCampaignNowRequest.js"; +export type { SendReportRequest } from "./SendReportRequest.js"; +export type { SendTestEmailRequest } from "./SendTestEmailRequest.js"; +export type { UpdateCampaignStatusRequest } from "./UpdateCampaignStatusRequest.js"; +export { UpdateEmailCampaignRequest } from "./UpdateEmailCampaignRequest.js"; +export type { UploadImageToGalleryRequest } from "./UploadImageToGalleryRequest.js"; diff --git a/src/api/resources/emailCampaigns/index.ts b/src/api/resources/emailCampaigns/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/emailCampaigns/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/emailCampaigns/types/CreateEmailCampaignResponse.ts b/src/api/resources/emailCampaigns/types/CreateEmailCampaignResponse.ts new file mode 100644 index 0000000..a2f0d7a --- /dev/null +++ b/src/api/resources/emailCampaigns/types/CreateEmailCampaignResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateEmailCampaignResponse { + /** ID of the object created */ + id: number; +} diff --git a/src/api/resources/emailCampaigns/types/EmailExportRecipientsResponse.ts b/src/api/resources/emailCampaigns/types/EmailExportRecipientsResponse.ts new file mode 100644 index 0000000..0114af0 --- /dev/null +++ b/src/api/resources/emailCampaigns/types/EmailExportRecipientsResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface EmailExportRecipientsResponse { + /** Id of the process created */ + processId: number; +} diff --git a/src/api/resources/emailCampaigns/types/GetAbTestCampaignResultResponse.ts b/src/api/resources/emailCampaigns/types/GetAbTestCampaignResultResponse.ts new file mode 100644 index 0000000..42b523b --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetAbTestCampaignResultResponse.ts @@ -0,0 +1,52 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetAbTestCampaignResultResponse { + /** Click rate for current winning version */ + clickRate?: string; + clickedLinks?: GetAbTestCampaignResultResponse.ClickedLinks; + /** Open rate for current winning version */ + openRate?: string; + statistics?: GetAbTestCampaignResultResponse.Statistics; + /** Criteria chosen for winning version (Open/Click) */ + winningCriteria?: GetAbTestCampaignResultResponse.WinningCriteria; + /** Subject Line of current winning version */ + winningSubjectLine?: string; + /** Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. */ + winningVersion?: GetAbTestCampaignResultResponse.WinningVersion; + /** Open/Click rate for the winner version */ + winningVersionRate?: string; +} + +export namespace GetAbTestCampaignResultResponse { + export interface ClickedLinks { + "Version A": Brevo.AbTestVersionClicks; + "Version B": Brevo.AbTestVersionClicks; + } + + export interface Statistics { + clicks: Brevo.AbTestVersionStats; + complaints: Brevo.AbTestVersionStats; + hardBounces: Brevo.AbTestVersionStats; + openers: Brevo.AbTestVersionStats; + softBounces: Brevo.AbTestVersionStats; + unsubscribed: Brevo.AbTestVersionStats; + } + + /** Criteria chosen for winning version (Open/Click) */ + export const WinningCriteria = { + Open: "Open", + Click: "Click", + } as const; + export type WinningCriteria = (typeof WinningCriteria)[keyof typeof WinningCriteria]; + /** Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. */ + export const WinningVersion = { + NotAvailable: "notAvailable", + Pending: "pending", + Tie: "tie", + A: "A", + B: "B", + } as const; + export type WinningVersion = (typeof WinningVersion)[keyof typeof WinningVersion]; +} diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignRequestStatistics.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignRequestStatistics.ts new file mode 100644 index 0000000..b5645d0 --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignRequestStatistics.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEmailCampaignRequestStatistics = { + GlobalStats: "globalStats", + LinksStats: "linksStats", + StatsByDomain: "statsByDomain", + StatsByDevice: "statsByDevice", + StatsByBrowser: "statsByBrowser", +} as const; +export type GetEmailCampaignRequestStatistics = + (typeof GetEmailCampaignRequestStatistics)[keyof typeof GetEmailCampaignRequestStatistics]; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts new file mode 100644 index 0000000..71a7e33 --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts @@ -0,0 +1,102 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetEmailCampaignResponse { + /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ + abTesting?: boolean; + /** ID of the campaign */ + id: number; + /** Name of the campaign */ + name: string; + /** Preview text or preheader of the email campaign */ + previewText?: string; + /** UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + scheduledAt?: string; + /** It is true if you have chosen to send your campaign at best time, otherwise it is false */ + sendAtBestTime?: boolean; + /** The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` */ + splitRule?: number; + /** Status of the campaign */ + status: GetEmailCampaignResponse.Status; + /** Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` */ + subject?: string; + /** Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ + subjectA?: string; + /** Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ + subjectB?: string; + /** Type of campaign */ + type: GetEmailCampaignResponse.Type; + /** Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` */ + winnerCriteria?: string; + /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ + winnerDelay?: number; + /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Footer of the campaign */ + footer: string; + /** Header of the campaign */ + header: string; + /** HTML content of the campaign */ + htmlContent: string; + /** Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. */ + inlineImageActivation?: boolean; + /** Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign */ + mirrorActive?: boolean; + /** UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times */ + recurring?: boolean; + /** Email defined as the "Reply to" of the campaign */ + replyTo: string; + /** Total number of non-delivered campaigns for a particular campaign id. */ + returnBounce?: number; + sender: GetEmailCampaignResponse.Sender; + /** Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' */ + sentDate?: string; + /** Link to share the campaign on social medias */ + shareLink?: string; + /** Tag of the campaign */ + tag?: string; + /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ + testSent: boolean; + /** Customisation of the "to" field of the campaign */ + toField?: string; + /** utm parameter associated with campaign */ + utmCampaignValue?: string; + /** utm id active */ + utmIDActive?: boolean; + utmMedium?: string; + /** source of utm */ + utmSource?: string; + recipients: Brevo.GetCampaignRecipients; + statistics: Brevo.GetExtendedCampaignStats; +} + +export namespace GetEmailCampaignResponse { + /** Status of the campaign */ + export const Status = { + Draft: "draft", + Sent: "sent", + Archive: "archive", + Queued: "queued", + Suspended: "suspended", + InProcess: "in_process", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; + /** Type of campaign */ + export const Type = { + Classic: "classic", + Trigger: "trigger", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; + + export interface Sender { + /** Sender email of the campaign */ + email?: string; + /** Sender id of the campaign */ + id?: number; + /** Sender name of the campaign */ + name?: string; + } +} diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestSort.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestSort.ts new file mode 100644 index 0000000..4acd7cb --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEmailCampaignsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetEmailCampaignsRequestSort = + (typeof GetEmailCampaignsRequestSort)[keyof typeof GetEmailCampaignsRequestSort]; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatistics.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatistics.ts new file mode 100644 index 0000000..5d6c921 --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatistics.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEmailCampaignsRequestStatistics = { + GlobalStats: "globalStats", + LinksStats: "linksStats", + StatsByDomain: "statsByDomain", +} as const; +export type GetEmailCampaignsRequestStatistics = + (typeof GetEmailCampaignsRequestStatistics)[keyof typeof GetEmailCampaignsRequestStatistics]; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts new file mode 100644 index 0000000..a7f4447 --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEmailCampaignsRequestStatus = { + Suspended: "suspended", + Archive: "archive", + Sent: "sent", + Queued: "queued", + Draft: "draft", + InProcess: "inProcess", + InReview: "inReview", +} as const; +export type GetEmailCampaignsRequestStatus = + (typeof GetEmailCampaignsRequestStatus)[keyof typeof GetEmailCampaignsRequestStatus]; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestType.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestType.ts new file mode 100644 index 0000000..792453c --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestType.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEmailCampaignsRequestType = { + Classic: "classic", + Trigger: "trigger", +} as const; +export type GetEmailCampaignsRequestType = + (typeof GetEmailCampaignsRequestType)[keyof typeof GetEmailCampaignsRequestType]; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts new file mode 100644 index 0000000..a1a9012 --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts @@ -0,0 +1,114 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetEmailCampaignsResponse { + campaigns?: GetEmailCampaignsResponse.Campaigns.Item[]; + /** Number of Email campaigns retrieved */ + count?: number; +} + +export namespace GetEmailCampaignsResponse { + export type Campaigns = Campaigns.Item[]; + + export namespace Campaigns { + export interface Item { + /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ + abTesting?: boolean; + /** ID of the campaign */ + id: number; + /** Name of the campaign */ + name: string; + /** Preview text or preheader of the email campaign */ + previewText?: string; + /** UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + scheduledAt?: string; + /** It is true if you have chosen to send your campaign at best time, otherwise it is false */ + sendAtBestTime?: boolean; + /** The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` */ + splitRule?: number; + /** Status of the campaign */ + status: Item.Status; + /** Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` */ + subject?: string; + /** Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ + subjectA?: string; + /** Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ + subjectB?: string; + /** Type of campaign */ + type: Item.Type; + /** Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` */ + winnerCriteria?: string; + /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ + winnerDelay?: number; + /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Footer of the campaign */ + footer: string; + /** Header of the campaign */ + header: string; + /** HTML content of the campaign */ + htmlContent: string; + /** Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. */ + inlineImageActivation?: boolean; + /** Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign */ + mirrorActive?: boolean; + /** UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times */ + recurring?: boolean; + /** Email defined as the "Reply to" of the campaign */ + replyTo: string; + /** Total number of non-delivered campaigns for a particular campaign id. */ + returnBounce?: number; + sender: Item.Sender; + /** Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' */ + sentDate?: string; + /** Link to share the campaign on social medias */ + shareLink?: string; + /** Tag of the campaign */ + tag?: string; + /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ + testSent: boolean; + /** Customisation of the "to" field of the campaign */ + toField?: string; + /** utm parameter associated with campaign */ + utmCampaignValue?: string; + /** utm id active */ + utmIDActive?: boolean; + utmMedium?: string; + /** source of utm */ + utmSource?: string; + recipients: Brevo.GetCampaignRecipients; + statistics: Brevo.GetExtendedCampaignStats; + } + + export namespace Item { + /** Status of the campaign */ + export const Status = { + Draft: "draft", + Sent: "sent", + Archive: "archive", + Queued: "queued", + Suspended: "suspended", + InProcess: "in_process", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; + /** Type of campaign */ + export const Type = { + Classic: "classic", + Trigger: "trigger", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; + + export interface Sender { + /** Sender email of the campaign */ + email?: string; + /** Sender id of the campaign */ + id?: number; + /** Sender name of the campaign */ + name?: string; + } + } + } +} diff --git a/src/api/resources/emailCampaigns/types/GetSharedTemplateUrlResponse.ts b/src/api/resources/emailCampaigns/types/GetSharedTemplateUrlResponse.ts new file mode 100644 index 0000000..90d0990 --- /dev/null +++ b/src/api/resources/emailCampaigns/types/GetSharedTemplateUrlResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSharedTemplateUrlResponse { + /** A unique URL for the email campaign or transactional template. This URL can be shared with other Brevo users. */ + sharedUrl: string; +} diff --git a/src/api/resources/emailCampaigns/types/UploadImageToGalleryResponse.ts b/src/api/resources/emailCampaigns/types/UploadImageToGalleryResponse.ts new file mode 100644 index 0000000..7cd4abb --- /dev/null +++ b/src/api/resources/emailCampaigns/types/UploadImageToGalleryResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface UploadImageToGalleryResponse { + /** URL of the image uploaded */ + url?: string; +} diff --git a/src/api/resources/emailCampaigns/types/index.ts b/src/api/resources/emailCampaigns/types/index.ts new file mode 100644 index 0000000..df0e2a2 --- /dev/null +++ b/src/api/resources/emailCampaigns/types/index.ts @@ -0,0 +1,12 @@ +export * from "./CreateEmailCampaignResponse.js"; +export * from "./EmailExportRecipientsResponse.js"; +export * from "./GetAbTestCampaignResultResponse.js"; +export * from "./GetEmailCampaignRequestStatistics.js"; +export * from "./GetEmailCampaignResponse.js"; +export * from "./GetEmailCampaignsRequestSort.js"; +export * from "./GetEmailCampaignsRequestStatistics.js"; +export * from "./GetEmailCampaignsRequestStatus.js"; +export * from "./GetEmailCampaignsRequestType.js"; +export * from "./GetEmailCampaignsResponse.js"; +export * from "./GetSharedTemplateUrlResponse.js"; +export * from "./UploadImageToGalleryResponse.js"; diff --git a/src/api/resources/event/client/Client.ts b/src/api/resources/event/client/Client.ts new file mode 100644 index 0000000..3d70be3 --- /dev/null +++ b/src/api/resources/event/client/Client.ts @@ -0,0 +1,97 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace EventClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class EventClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: EventClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Create an event to track a contact's interaction. + * + * @param {Brevo.CreateEventRequest} request + * @param {EventClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * + * @example + * await client.event.createEvent({ + * event_name: "video_played", + * identifiers: {} + * }) + */ + public createEvent( + request: Brevo.CreateEventRequest, + requestOptions?: EventClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createEvent(request, requestOptions)); + } + + private async __createEvent( + request: Brevo.CreateEventRequest, + requestOptions?: EventClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "events", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/events"); + } +} diff --git a/src/api/resources/event/client/index.ts b/src/api/resources/event/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/event/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/event/client/requests/CreateEventRequest.ts b/src/api/resources/event/client/requests/CreateEventRequest.ts new file mode 100644 index 0000000..b43998e --- /dev/null +++ b/src/api/resources/event/client/requests/CreateEventRequest.ts @@ -0,0 +1,73 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * event_name: "video_played", + * identifiers: {} + * } + */ +export interface CreateEventRequest { + /** Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **"FIRSTNAME": "Jane" , "AGE": 37** */ + contact_properties?: Record; + /** Timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used. */ + event_date?: string; + /** The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. */ + event_name: string; + /** Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. */ + event_properties?: Record; + /** Identifies the contact associated with the event. At least one identifier is required. */ + identifiers: CreateEventRequest.Identifiers; + /** Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. */ + object?: CreateEventRequest.Object_; +} + +export namespace CreateEventRequest { + export namespace ContactProperties { + export type Value = string | number; + } + + export namespace EventProperties { + export type Value = string | number | Record | unknown[]; + } + + /** + * Identifies the contact associated with the event. At least one identifier is required. + */ + export interface Identifiers { + /** Internal unique contact ID. When present, this takes priority over all other identifiers for event attribution and contact resolution. */ + contact_id?: number; + /** Email Id associated with the event */ + email_id?: string; + /** ext_id associated with the event */ + ext_id?: string; + /** landline_number associated with the event */ + landline_number_id?: string; + /** SMS associated with the event */ + phone_id?: string; + /** whatsapp associated with the event */ + whatsapp_id?: string; + } + + /** + * Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. + */ + export interface Object_ { + /** Identifiers for the object. */ + identifiers?: Object_.Identifiers; + /** Type of object (e.g., subscription, vehicle, etc.) */ + type?: string; + } + + export namespace Object_ { + /** + * Identifiers for the object. + */ + export interface Identifiers { + /** External object ID */ + ext_id?: string; + /** Internal object ID */ + id?: string; + } + } +} diff --git a/src/api/resources/event/client/requests/index.ts b/src/api/resources/event/client/requests/index.ts new file mode 100644 index 0000000..dff2344 --- /dev/null +++ b/src/api/resources/event/client/requests/index.ts @@ -0,0 +1 @@ +export type { CreateEventRequest } from "./CreateEventRequest.js"; diff --git a/src/api/resources/event/index.ts b/src/api/resources/event/index.ts new file mode 100644 index 0000000..914b8c3 --- /dev/null +++ b/src/api/resources/event/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/externalFeeds/client/Client.ts b/src/api/resources/externalFeeds/client/Client.ts new file mode 100644 index 0000000..ad42ffd --- /dev/null +++ b/src/api/resources/externalFeeds/client/Client.ts @@ -0,0 +1,553 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace ExternalFeedsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ExternalFeedsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ExternalFeedsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Retrieves all external feeds from your Brevo account with filtering and pagination. + * + * **Use this to:** + * - Get an overview of all external data feeds + * - Find feeds by name using search functionality + * - Filter feeds by creation date range + * - Browse feeds by authentication type + * - Monitor feed library organization and usage + * + * **Key information returned:** + * - Feed details (UUID, name, URL, authentication type) + * - Feed configuration and settings + * - Creation and modification timestamps + * - Feed status and error information + * - Authentication and header configurations + * + * **Important considerations:** + * - External feeds enable dynamic content in email campaigns + * - Feeds must be accessible from Brevo servers + * - Authentication credentials are securely stored + * - Feed performance affects campaign delivery + * - Use pagination for accounts with many feeds + * - Date range filtering limited to 30 days maximum + * - Search functionality works on feed name matching + * - Internal feeds are system-managed and cannot be modified + * + * @param {Brevo.GetAllExternalFeedsRequest} request + * @param {ExternalFeedsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.externalFeeds.getAllExternalFeeds({ + * search: "product", + * startDate: "2024-01-01", + * endDate: "2024-01-31" + * }) + */ + public getAllExternalFeeds( + request: Brevo.GetAllExternalFeedsRequest = {}, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAllExternalFeeds(request, requestOptions)); + } + + private async __getAllExternalFeeds( + request: Brevo.GetAllExternalFeedsRequest = {}, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): Promise> { + const { search, startDate, endDate, sort, authType, limit, offset } = request; + const _queryParams: Record = { + search, + startDate: startDate != null ? startDate : undefined, + endDate: endDate != null ? endDate : undefined, + sort: sort != null ? sort : undefined, + authType: authType != null ? authType : undefined, + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "feeds", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetAllExternalFeedsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/feeds"); + } + + /** + * Creates a new external feed for dynamic content in email campaigns. + * + * **Use this to:** + * - Set up external data sources for dynamic content + * - Configure authentication for protected feeds + * - Enable real-time content updates in campaigns + * - Establish connections to product catalogs, blogs, or APIs + * + * **Key information returned:** + * - Created feed UUID for reference in campaigns + * - Success confirmation + * + * **Important considerations:** + * - Feed URL must be accessible from Brevo infrastructure + * - Authentication credentials are securely encrypted + * - Test feed accessibility before campaign use + * - Consider feed response time for campaign performance + * - Monitor feed reliability and uptime + * - Use caching for frequently accessed feeds + * - Maximum 5 retry attempts allowed for failed requests + * - Custom headers support for API integration requirements + * + * @param {Brevo.CreateExternalFeedRequest} request + * @param {ExternalFeedsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.externalFeeds.createExternalFeed({ + * name: "Public API Feed", + * url: "https://jsonplaceholder.typicode.com/posts", + * authType: "noAuth", + * maxRetries: 3, + * cache: true + * }) + * + * @example + * await client.externalFeeds.createExternalFeed({ + * name: "Product Catalog", + * url: "https://api.example.com/products", + * authType: "noAuth", + * maxRetries: 3, + * cache: true + * }) + * + * @example + * await client.externalFeeds.createExternalFeed({ + * name: "Internal Blog Feed", + * url: "https://blog.example.com/api/posts", + * authType: "noAuth", + * maxRetries: 3, + * cache: true + * }) + */ + public createExternalFeed( + request: Brevo.CreateExternalFeedRequest, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createExternalFeed(request, requestOptions)); + } + + private async __createExternalFeed( + request: Brevo.CreateExternalFeedRequest, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "feeds", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateExternalFeedResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/feeds"); + } + + /** + * Retrieves details of a specific external feed by its UUID. + * + * **Use this to:** + * - Get complete configuration of an external feed + * - Check feed authentication settings + * - Review feed personalization options + * - Verify feed URL and parameters + * - Monitor feed modification history + * + * **Key information returned:** + * - Complete feed configuration and settings + * - Authentication credentials and headers + * - Personalization and fallback settings + * - Creation and modification timestamps + * - Cache and retry configurations + * + * **Important considerations:** + * - UUID must exist in your account + * - Provides complete feed information for troubleshooting + * - Essential before making modifications + * - Shows current feed health status + * - Useful for debugging feed issues + * + * @param {Brevo.GetExternalFeedByUuidRequest} request + * @param {ExternalFeedsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.externalFeeds.getExternalFeedByUuid({ + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" + * }) + */ + public getExternalFeedByUuid( + request: Brevo.GetExternalFeedByUuidRequest, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getExternalFeedByUuid(request, requestOptions)); + } + + private async __getExternalFeedByUuid( + request: Brevo.GetExternalFeedByUuidRequest, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): Promise> { + const { uuid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `feeds/${core.url.encodePathParam(uuid)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetExternalFeedByUuidResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/feeds/{uuid}"); + } + + /** + * Updates configuration of an existing external feed. + * + * **Use this to:** + * - Update feed URLs when data sources change + * - Modify authentication credentials + * - Change cache and retry settings + * - Update custom headers + * - Rename feeds for better organization + * + * **Key information returned:** + * - Success confirmation message + * + * **Important considerations:** + * - Only provided fields will be updated + * - Feed UUID must exist in your account + * - Authentication changes require verification + * - URL changes should be tested before campaign use + * - Monitor campaigns using this feed after updates + * + * @param {Brevo.UpdateExternalFeedRequest} request + * @param {ExternalFeedsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.externalFeeds.updateExternalFeed({ + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * name: "Updated Product Catalog", + * url: "https://api.newstore.com/products/v2" + * }) + * + * @example + * await client.externalFeeds.updateExternalFeed({ + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * authType: "token", + * token: "newabc123token789" + * }) + * + * @example + * await client.externalFeeds.updateExternalFeed({ + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * maxRetries: 5, + * cache: true + * }) + * + * @example + * await client.externalFeeds.updateExternalFeed({ + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * headers: [{ + * name: "X-API-Version", + * value: "v2" + * }, { + * name: "User-Agent", + * value: "Brevo-Feed-Client/1.0" + * }] + * }) + * + * @example + * await client.externalFeeds.updateExternalFeed({ + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * name: "Enterprise Product Feed", + * url: "https://enterprise-api.company.com/catalog", + * authType: "token", + * token: "enterprise789token123", + * headers: [{ + * name: "Authorization", + * value: "Bearer enterprise789token123" + * }, { + * name: "Accept", + * value: "application/json" + * }], + * maxRetries: 3, + * cache: true + * }) + */ + public updateExternalFeed( + request: Brevo.UpdateExternalFeedRequest, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateExternalFeed(request, requestOptions)); + } + + private async __updateExternalFeed( + request: Brevo.UpdateExternalFeedRequest, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): Promise> { + const { uuid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `feeds/${core.url.encodePathParam(uuid)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/feeds/{uuid}"); + } + + /** + * Deletes an external feed from your Brevo account. + * + * **Use this to:** + * - Remove external feeds that are no longer needed + * - Clean up unused data sources + * - Remove test or outdated feeds + * - Maintain organized feed library + * + * **Key information returned:** + * - Success confirmation message + * + * **Important considerations:** + * - This action is PERMANENT and cannot be undone + * - Feed configuration and history will be lost + * - Check if feed is used in active campaigns before deletion + * - Remove feed references from email templates + * - Consider deactivating instead of deleting if unsure + * + * @param {Brevo.DeleteExternalFeedRequest} request + * @param {ExternalFeedsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.externalFeeds.deleteExternalFeed({ + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" + * }) + */ + public deleteExternalFeed( + request: Brevo.DeleteExternalFeedRequest, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteExternalFeed(request, requestOptions)); + } + + private async __deleteExternalFeed( + request: Brevo.DeleteExternalFeedRequest, + requestOptions?: ExternalFeedsClient.RequestOptions, + ): Promise> { + const { uuid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `feeds/${core.url.encodePathParam(uuid)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/feeds/{uuid}"); + } +} diff --git a/src/api/resources/externalFeeds/client/index.ts b/src/api/resources/externalFeeds/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/externalFeeds/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/externalFeeds/client/requests/CreateExternalFeedRequest.ts b/src/api/resources/externalFeeds/client/requests/CreateExternalFeedRequest.ts new file mode 100644 index 0000000..067c039 --- /dev/null +++ b/src/api/resources/externalFeeds/client/requests/CreateExternalFeedRequest.ts @@ -0,0 +1,70 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * name: "Public API Feed", + * url: "https://jsonplaceholder.typicode.com/posts", + * authType: "noAuth", + * maxRetries: 3, + * cache: true + * } + * + * @example + * { + * name: "Product Catalog", + * url: "https://api.example.com/products", + * authType: "noAuth", + * maxRetries: 3, + * cache: true + * } + * + * @example + * { + * name: "Internal Blog Feed", + * url: "https://blog.example.com/api/posts", + * authType: "noAuth", + * maxRetries: 3, + * cache: true + * } + */ +export interface CreateExternalFeedRequest { + /** Name of the feed */ + name: string; + /** URL of the external data source */ + url: string; + /** Authentication type for accessing the feed */ + authType?: CreateExternalFeedRequest.AuthType; + /** Username for basic authentication (required if authType is 'basic') */ + username?: string; + /** Password for basic authentication (required if authType is 'basic') */ + password?: string; + /** Token for token-based authentication (required if authType is 'token') */ + token?: string; + /** Maximum number of retry attempts for failed requests */ + maxRetries?: number; + /** Whether to cache the feed response */ + cache?: boolean; + /** Custom HTTP headers for the feed request */ + headers?: CreateExternalFeedRequest.Headers.Item[]; +} + +export namespace CreateExternalFeedRequest { + /** Authentication type for accessing the feed */ + export const AuthType = { + Basic: "basic", + Token: "token", + NoAuth: "noAuth", + } as const; + export type AuthType = (typeof AuthType)[keyof typeof AuthType]; + export type Headers = Headers.Item[]; + + export namespace Headers { + export interface Item { + /** Header name */ + name: string; + /** Header value */ + value: string; + } + } +} diff --git a/src/api/resources/externalFeeds/client/requests/DeleteExternalFeedRequest.ts b/src/api/resources/externalFeeds/client/requests/DeleteExternalFeedRequest.ts new file mode 100644 index 0000000..2ef2237 --- /dev/null +++ b/src/api/resources/externalFeeds/client/requests/DeleteExternalFeedRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" + * } + */ +export interface DeleteExternalFeedRequest { + /** UUID of the feed to delete */ + uuid: string; +} diff --git a/src/api/resources/externalFeeds/client/requests/GetAllExternalFeedsRequest.ts b/src/api/resources/externalFeeds/client/requests/GetAllExternalFeedsRequest.ts new file mode 100644 index 0000000..63baed1 --- /dev/null +++ b/src/api/resources/externalFeeds/client/requests/GetAllExternalFeedsRequest.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * search: "product", + * startDate: "2024-01-01", + * endDate: "2024-01-31" + * } + */ +export interface GetAllExternalFeedsRequest { + /** Can be used to filter records by search keyword on feed name */ + search?: string; + /** + * Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which + * you want to fetch the list. Can be maximum 30 days older than current + * date. + */ + startDate?: string; + /** + * Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which + * you want to fetch the list. Maximum time period that can be selected is + * one month. + */ + endDate?: string; + /** + * Sort the results in the ascending/descending order of record creation. + * Default order is **descending** if `sort` is not passed. + */ + sort?: Brevo.GetAllExternalFeedsRequestSort; + /** Filter the records by `authType` of the feed. */ + authType?: Brevo.GetAllExternalFeedsRequestAuthType; + /** Number of documents returned per page. */ + limit?: number; + /** Index of the first document on the page. */ + offset?: number; +} diff --git a/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts b/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts new file mode 100644 index 0000000..4f01391 --- /dev/null +++ b/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" + * } + * + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" + * } + * + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" + * } + */ +export interface GetExternalFeedByUuidRequest { + /** UUID of the feed to fetch */ + uuid: string; +} diff --git a/src/api/resources/externalFeeds/client/requests/UpdateExternalFeedRequest.ts b/src/api/resources/externalFeeds/client/requests/UpdateExternalFeedRequest.ts new file mode 100644 index 0000000..93b0cb4 --- /dev/null +++ b/src/api/resources/externalFeeds/client/requests/UpdateExternalFeedRequest.ts @@ -0,0 +1,96 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * name: "Updated Product Catalog", + * url: "https://api.newstore.com/products/v2" + * } + * + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * authType: "token", + * token: "newabc123token789" + * } + * + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * maxRetries: 5, + * cache: true + * } + * + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * headers: [{ + * name: "X-API-Version", + * value: "v2" + * }, { + * name: "User-Agent", + * value: "Brevo-Feed-Client/1.0" + * }] + * } + * + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + * name: "Enterprise Product Feed", + * url: "https://enterprise-api.company.com/catalog", + * authType: "token", + * token: "enterprise789token123", + * headers: [{ + * name: "Authorization", + * value: "Bearer enterprise789token123" + * }, { + * name: "Accept", + * value: "application/json" + * }], + * maxRetries: 3, + * cache: true + * } + */ +export interface UpdateExternalFeedRequest { + /** UUID of the feed to update */ + uuid: string; + /** Name of the feed */ + name?: string; + /** URL of the external data source */ + url?: string; + /** Authentication type for accessing the feed */ + authType?: UpdateExternalFeedRequest.AuthType; + /** Username for basic authentication */ + username?: string; + /** Password for basic authentication */ + password?: string; + /** Token for token-based authentication */ + token?: string; + /** Custom HTTP headers for the feed request */ + headers?: UpdateExternalFeedRequest.Headers.Item[]; + /** Maximum number of retry attempts for failed requests */ + maxRetries?: number; + /** Whether to cache the feed response */ + cache?: boolean; +} + +export namespace UpdateExternalFeedRequest { + /** Authentication type for accessing the feed */ + export const AuthType = { + Basic: "basic", + Token: "token", + NoAuth: "noAuth", + } as const; + export type AuthType = (typeof AuthType)[keyof typeof AuthType]; + export type Headers = Headers.Item[]; + + export namespace Headers { + export interface Item { + /** Header name */ + name: string; + /** Header value */ + value: string; + } + } +} diff --git a/src/api/resources/externalFeeds/client/requests/index.ts b/src/api/resources/externalFeeds/client/requests/index.ts new file mode 100644 index 0000000..5d92dae --- /dev/null +++ b/src/api/resources/externalFeeds/client/requests/index.ts @@ -0,0 +1,5 @@ +export { CreateExternalFeedRequest } from "./CreateExternalFeedRequest.js"; +export type { DeleteExternalFeedRequest } from "./DeleteExternalFeedRequest.js"; +export type { GetAllExternalFeedsRequest } from "./GetAllExternalFeedsRequest.js"; +export type { GetExternalFeedByUuidRequest } from "./GetExternalFeedByUuidRequest.js"; +export { UpdateExternalFeedRequest } from "./UpdateExternalFeedRequest.js"; diff --git a/src/api/resources/externalFeeds/index.ts b/src/api/resources/externalFeeds/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/externalFeeds/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/externalFeeds/types/CreateExternalFeedResponse.ts b/src/api/resources/externalFeeds/types/CreateExternalFeedResponse.ts new file mode 100644 index 0000000..a6516d0 --- /dev/null +++ b/src/api/resources/externalFeeds/types/CreateExternalFeedResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateExternalFeedResponse { + /** UUID of the created feed */ + id: string; +} diff --git a/src/api/resources/externalFeeds/types/GetAllExternalFeedsRequestAuthType.ts b/src/api/resources/externalFeeds/types/GetAllExternalFeedsRequestAuthType.ts new file mode 100644 index 0000000..a93c74d --- /dev/null +++ b/src/api/resources/externalFeeds/types/GetAllExternalFeedsRequestAuthType.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetAllExternalFeedsRequestAuthType = { + Basic: "basic", + Token: "token", + NoAuth: "noAuth", +} as const; +export type GetAllExternalFeedsRequestAuthType = + (typeof GetAllExternalFeedsRequestAuthType)[keyof typeof GetAllExternalFeedsRequestAuthType]; diff --git a/src/api/resources/externalFeeds/types/GetAllExternalFeedsRequestSort.ts b/src/api/resources/externalFeeds/types/GetAllExternalFeedsRequestSort.ts new file mode 100644 index 0000000..10d638e --- /dev/null +++ b/src/api/resources/externalFeeds/types/GetAllExternalFeedsRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetAllExternalFeedsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetAllExternalFeedsRequestSort = + (typeof GetAllExternalFeedsRequestSort)[keyof typeof GetAllExternalFeedsRequestSort]; diff --git a/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts b/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts new file mode 100644 index 0000000..867ac44 --- /dev/null +++ b/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts @@ -0,0 +1,65 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetAllExternalFeedsResponse { + /** Total number of feeds */ + count: number; + /** List of external feeds */ + feeds: GetAllExternalFeedsResponse.Feeds.Item[]; +} + +export namespace GetAllExternalFeedsResponse { + export type Feeds = Feeds.Item[]; + + export namespace Feeds { + export interface Item { + /** Unique identifier of the feed */ + id: string; + /** Name of the feed */ + name: string; + /** URL-friendly alias for the feed */ + alias: string; + /** URL of the external data source */ + url: string; + /** Authentication type for accessing the feed */ + authType: Item.AuthType; + /** Username for basic authentication */ + username?: string; + /** Password for basic authentication */ + password?: string; + /** Token for token-based authentication */ + token?: string; + /** Maximum number of retry attempts for failed requests */ + maxRetries: number; + /** Whether to cache the feed response */ + cache: boolean; + /** Whether this is an internal Brevo system feed */ + isInternal: boolean; + /** Custom HTTP headers for the feed request */ + headers?: Item.Headers.Item[] | null; + /** Feed creation timestamp */ + createdAt: string; + /** Feed last modification timestamp */ + modifiedAt: string; + } + + export namespace Item { + /** Authentication type for accessing the feed */ + export const AuthType = { + Basic: "basic", + Token: "token", + NoAuth: "noAuth", + } as const; + export type AuthType = (typeof AuthType)[keyof typeof AuthType]; + export type Headers = Headers.Item[]; + + export namespace Headers { + export interface Item { + /** Header name */ + name: string; + /** Header value */ + value: string; + } + } + } + } +} diff --git a/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts b/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts new file mode 100644 index 0000000..f80bd2b --- /dev/null +++ b/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts @@ -0,0 +1,54 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetExternalFeedByUuidResponse { + /** Unique identifier of the feed */ + id: string; + /** Name of the feed */ + name: string; + /** URL of the external data source */ + url: string; + /** Authentication type for accessing the feed */ + authType: GetExternalFeedByUuidResponse.AuthType; + /** Username for basic authentication (null if not using basic auth) */ + username?: string | null; + /** Password for basic authentication (null if not using basic auth) */ + password?: string | null; + /** Token for token-based authentication (null if not using token auth) */ + token?: string | null; + /** Whether personalization is enabled for this feed */ + personalization: boolean; + /** Default attribute name for personalization fallback (empty string if not set) */ + defaultAttr: string; + /** Default contact email for personalization fallback (empty string if not set) */ + defaultContact: string; + /** Custom HTTP headers for the feed request */ + headers?: GetExternalFeedByUuidResponse.Headers.Item[] | null; + /** Maximum number of retry attempts for failed requests */ + maxRetries: number; + /** Whether to cache the feed response */ + cache: boolean; + /** Feed creation timestamp */ + createdAt: string; + /** Feed last modification timestamp */ + modifiedAt: string; +} + +export namespace GetExternalFeedByUuidResponse { + /** Authentication type for accessing the feed */ + export const AuthType = { + Basic: "basic", + Token: "token", + NoAuth: "noAuth", + } as const; + export type AuthType = (typeof AuthType)[keyof typeof AuthType]; + export type Headers = Headers.Item[]; + + export namespace Headers { + export interface Item { + /** Header name */ + name: string; + /** Header value */ + value: string; + } + } +} diff --git a/src/api/resources/externalFeeds/types/index.ts b/src/api/resources/externalFeeds/types/index.ts new file mode 100644 index 0000000..1e5c9be --- /dev/null +++ b/src/api/resources/externalFeeds/types/index.ts @@ -0,0 +1,5 @@ +export * from "./CreateExternalFeedResponse.js"; +export * from "./GetAllExternalFeedsRequestAuthType.js"; +export * from "./GetAllExternalFeedsRequestSort.js"; +export * from "./GetAllExternalFeedsResponse.js"; +export * from "./GetExternalFeedByUuidResponse.js"; diff --git a/src/api/resources/files/client/Client.ts b/src/api/resources/files/client/Client.ts new file mode 100644 index 0000000..2eed388 --- /dev/null +++ b/src/api/resources/files/client/Client.ts @@ -0,0 +1,384 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace FilesClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class FilesClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: FilesClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetCrmFilesRequest} request + * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.files.getAllFiles() + */ + public getAllFiles( + request: Brevo.GetCrmFilesRequest = {}, + requestOptions?: FilesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAllFiles(request, requestOptions)); + } + + private async __getAllFiles( + request: Brevo.GetCrmFilesRequest = {}, + requestOptions?: FilesClient.RequestOptions, + ): Promise> { + const { entity, entityIds, dateFrom, dateTo, offset, limit, sort } = request; + const _queryParams: Record = { + entity: entity != null ? entity : undefined, + entityIds, + dateFrom, + dateTo, + offset, + limit, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/files", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.FileData[], rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/files"); + } + + /** + * @param {Brevo.PostCrmFilesRequest} request + * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * import { createReadStream } from "fs"; + * await client.files.uploadAFile({ + * file: fs.createReadStream("/path/to/your/file") + * }) + */ + public uploadAFile( + request: Brevo.PostCrmFilesRequest, + requestOptions?: FilesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__uploadAFile(request, requestOptions)); + } + + private async __uploadAFile( + request: Brevo.PostCrmFilesRequest, + requestOptions?: FilesClient.RequestOptions, + ): Promise> { + const _body = await core.newFormData(); + if (request.companyId != null) { + _body.append("companyId", request.companyId); + } + + if (request.contactId != null) { + _body.append("contactId", request.contactId?.toString()); + } + + if (request.dealId != null) { + _body.append("dealId", request.dealId); + } + + await _body.appendFile("file", request.file); + const _maybeEncodedRequest = await _body.getRequest(); + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ ..._maybeEncodedRequest.headers }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/files", + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + requestType: "file", + duplex: _maybeEncodedRequest.duplex, + body: _maybeEncodedRequest.body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.FileData, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/files"); + } + + /** + * @param {Brevo.GetCrmFilesIdRequest} request + * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.files.downloadAFile({ + * id: "id" + * }) + */ + public downloadAFile( + request: Brevo.GetCrmFilesIdRequest, + requestOptions?: FilesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__downloadAFile(request, requestOptions)); + } + + private async __downloadAFile( + request: Brevo.GetCrmFilesIdRequest, + requestOptions?: FilesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/files/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCrmFilesIdResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/files/{id}"); + } + + /** + * @param {Brevo.DeleteCrmFilesIdRequest} request + * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.files.deleteAFile({ + * id: "id" + * }) + */ + public deleteAFile( + request: Brevo.DeleteCrmFilesIdRequest, + requestOptions?: FilesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteAFile(request, requestOptions)); + } + + private async __deleteAFile( + request: Brevo.DeleteCrmFilesIdRequest, + requestOptions?: FilesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/files/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/crm/files/{id}"); + } + + /** + * @param {Brevo.GetCrmFilesIdDataRequest} request + * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.files.getFileDetails({ + * id: "id" + * }) + */ + public getFileDetails( + request: Brevo.GetCrmFilesIdDataRequest, + requestOptions?: FilesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getFileDetails(request, requestOptions)); + } + + private async __getFileDetails( + request: Brevo.GetCrmFilesIdDataRequest, + requestOptions?: FilesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/files/${core.url.encodePathParam(id)}/data`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.FileData, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/files/{id}/data"); + } +} diff --git a/src/api/resources/files/client/index.ts b/src/api/resources/files/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/files/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/files/client/requests/DeleteCrmFilesIdRequest.ts b/src/api/resources/files/client/requests/DeleteCrmFilesIdRequest.ts new file mode 100644 index 0000000..5cd3e54 --- /dev/null +++ b/src/api/resources/files/client/requests/DeleteCrmFilesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteCrmFilesIdRequest { + /** File id to delete. */ + id: string; +} diff --git a/src/api/resources/files/client/requests/GetCrmFilesIdDataRequest.ts b/src/api/resources/files/client/requests/GetCrmFilesIdDataRequest.ts new file mode 100644 index 0000000..11260c8 --- /dev/null +++ b/src/api/resources/files/client/requests/GetCrmFilesIdDataRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCrmFilesIdDataRequest { + /** File id to get file data. */ + id: string; +} diff --git a/src/api/resources/files/client/requests/GetCrmFilesIdRequest.ts b/src/api/resources/files/client/requests/GetCrmFilesIdRequest.ts new file mode 100644 index 0000000..71168d6 --- /dev/null +++ b/src/api/resources/files/client/requests/GetCrmFilesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCrmFilesIdRequest { + /** File id to download. */ + id: string; +} diff --git a/src/api/resources/files/client/requests/GetCrmFilesRequest.ts b/src/api/resources/files/client/requests/GetCrmFilesRequest.ts new file mode 100644 index 0000000..71d9833 --- /dev/null +++ b/src/api/resources/files/client/requests/GetCrmFilesRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetCrmFilesRequest { + /** Filter by file entity type */ + entity?: Brevo.GetCrmFilesRequestEntity; + /** Filter by file entity IDs */ + entityIds?: string; + /** dateFrom to date range filter type (timestamp in milliseconds) */ + dateFrom?: number; + /** dateTo to date range filter type (timestamp in milliseconds) */ + dateTo?: number; + /** Index of the first document of the page */ + offset?: number; + /** Number of documents per page */ + limit?: number; + /** Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed */ + sort?: Brevo.GetCrmFilesRequestSort; +} diff --git a/src/api/resources/files/client/requests/PostCrmFilesRequest.ts b/src/api/resources/files/client/requests/PostCrmFilesRequest.ts new file mode 100644 index 0000000..03112ed --- /dev/null +++ b/src/api/resources/files/client/requests/PostCrmFilesRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../../../../../core/index.js"; + +/** + * @example + * { + * file: fs.createReadStream("/path/to/your/file") + * } + */ +export interface PostCrmFilesRequest { + companyId?: string; + contactId?: number; + dealId?: string; + /** File data to create a file. */ + file: core.file.Uploadable; +} diff --git a/src/api/resources/files/client/requests/index.ts b/src/api/resources/files/client/requests/index.ts new file mode 100644 index 0000000..73649be --- /dev/null +++ b/src/api/resources/files/client/requests/index.ts @@ -0,0 +1,5 @@ +export type { DeleteCrmFilesIdRequest } from "./DeleteCrmFilesIdRequest.js"; +export type { GetCrmFilesIdDataRequest } from "./GetCrmFilesIdDataRequest.js"; +export type { GetCrmFilesIdRequest } from "./GetCrmFilesIdRequest.js"; +export type { GetCrmFilesRequest } from "./GetCrmFilesRequest.js"; +export type { PostCrmFilesRequest } from "./PostCrmFilesRequest.js"; diff --git a/src/api/resources/files/index.ts b/src/api/resources/files/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/files/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/files/types/GetCrmFilesIdResponse.ts b/src/api/resources/files/types/GetCrmFilesIdResponse.ts new file mode 100644 index 0000000..32a2123 --- /dev/null +++ b/src/api/resources/files/types/GetCrmFilesIdResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Downloadable file link + */ +export interface GetCrmFilesIdResponse { + /** A unique link to download the requested file. */ + fileUrl?: string; +} diff --git a/src/api/resources/files/types/GetCrmFilesRequestEntity.ts b/src/api/resources/files/types/GetCrmFilesRequestEntity.ts new file mode 100644 index 0000000..da1efe8 --- /dev/null +++ b/src/api/resources/files/types/GetCrmFilesRequestEntity.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCrmFilesRequestEntity = { + Companies: "companies", + Deals: "deals", + Contacts: "contacts", +} as const; +export type GetCrmFilesRequestEntity = (typeof GetCrmFilesRequestEntity)[keyof typeof GetCrmFilesRequestEntity]; diff --git a/src/api/resources/files/types/GetCrmFilesRequestSort.ts b/src/api/resources/files/types/GetCrmFilesRequestSort.ts new file mode 100644 index 0000000..ca7b8d4 --- /dev/null +++ b/src/api/resources/files/types/GetCrmFilesRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCrmFilesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetCrmFilesRequestSort = (typeof GetCrmFilesRequestSort)[keyof typeof GetCrmFilesRequestSort]; diff --git a/src/api/resources/files/types/index.ts b/src/api/resources/files/types/index.ts new file mode 100644 index 0000000..e809cdd --- /dev/null +++ b/src/api/resources/files/types/index.ts @@ -0,0 +1,3 @@ +export * from "./GetCrmFilesIdResponse.js"; +export * from "./GetCrmFilesRequestEntity.js"; +export * from "./GetCrmFilesRequestSort.js"; diff --git a/src/api/resources/inboundParsing/client/Client.ts b/src/api/resources/inboundParsing/client/Client.ts new file mode 100644 index 0000000..c33ce9e --- /dev/null +++ b/src/api/resources/inboundParsing/client/Client.ts @@ -0,0 +1,234 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace InboundParsingClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class InboundParsingClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: InboundParsingClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * This endpoint will show the list of all the events for the received emails. + * + * @param {Brevo.GetInboundEmailEventsRequest} request + * @param {InboundParsingClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.inboundParsing.getInboundEmailEvents() + */ + public getInboundEmailEvents( + request: Brevo.GetInboundEmailEventsRequest = {}, + requestOptions?: InboundParsingClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getInboundEmailEvents(request, requestOptions)); + } + + private async __getInboundEmailEvents( + request: Brevo.GetInboundEmailEventsRequest = {}, + requestOptions?: InboundParsingClient.RequestOptions, + ): Promise> { + const { sender, startDate, endDate, limit, offset, sort } = request; + const _queryParams: Record = { + sender, + startDate, + endDate, + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "inbound/events", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetInboundEmailEventsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/inbound/events"); + } + + /** + * This endpoint will show the list of all events history for one particular received email. + * + * @param {Brevo.GetInboundEmailEventsByUuidRequest} request + * @param {InboundParsingClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.inboundParsing.getInboundEmailEventsByUuid({ + * uuid: "uuid" + * }) + */ + public getInboundEmailEventsByUuid( + request: Brevo.GetInboundEmailEventsByUuidRequest, + requestOptions?: InboundParsingClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getInboundEmailEventsByUuid(request, requestOptions)); + } + + private async __getInboundEmailEventsByUuid( + request: Brevo.GetInboundEmailEventsByUuidRequest, + requestOptions?: InboundParsingClient.RequestOptions, + ): Promise> { + const { uuid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `inbound/events/${core.url.encodePathParam(uuid)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetInboundEmailEventsByUuidResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/inbound/events/{uuid}"); + } + + /** + * This endpoint will retrieve inbound attachment with download token. + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + */ + public getInboundEmailAttachment( + request: Brevo.GetInboundEmailAttachmentRequest, + requestOptions?: InboundParsingClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getInboundEmailAttachment(request, requestOptions)); + } + + private async __getInboundEmailAttachment( + request: Brevo.GetInboundEmailAttachmentRequest, + requestOptions?: InboundParsingClient.RequestOptions, + ): Promise> { + const { downloadToken } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `inbound/attachments/${core.url.encodePathParam(downloadToken)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + responseType: "binary-response", + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/inbound/attachments/{downloadToken}", + ); + } +} diff --git a/src/api/resources/inboundParsing/client/index.ts b/src/api/resources/inboundParsing/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/inboundParsing/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/inboundParsing/client/requests/GetInboundEmailAttachmentRequest.ts b/src/api/resources/inboundParsing/client/requests/GetInboundEmailAttachmentRequest.ts new file mode 100644 index 0000000..2dbfe65 --- /dev/null +++ b/src/api/resources/inboundParsing/client/requests/GetInboundEmailAttachmentRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * downloadToken: "downloadToken" + * } + */ +export interface GetInboundEmailAttachmentRequest { + /** Token to fetch a particular attachment */ + downloadToken: string; +} diff --git a/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsByUuidRequest.ts b/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsByUuidRequest.ts new file mode 100644 index 0000000..9d648f5 --- /dev/null +++ b/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsByUuidRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * uuid: "uuid" + * } + */ +export interface GetInboundEmailEventsByUuidRequest { + /** UUID to fetch events specific to received email */ + uuid: string; +} diff --git a/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsRequest.ts b/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsRequest.ts new file mode 100644 index 0000000..39f2441 --- /dev/null +++ b/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetInboundEmailEventsRequest { + /** Email address of the sender. */ + sender?: string; + /** Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. */ + startDate?: string; + /** Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. */ + endDate?: string; + /** Number of documents returned per page */ + limit?: number; + /** Index of the first document on the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation */ + sort?: Brevo.GetInboundEmailEventsRequestSort; +} diff --git a/src/api/resources/inboundParsing/client/requests/index.ts b/src/api/resources/inboundParsing/client/requests/index.ts new file mode 100644 index 0000000..f113ef0 --- /dev/null +++ b/src/api/resources/inboundParsing/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { GetInboundEmailAttachmentRequest } from "./GetInboundEmailAttachmentRequest.js"; +export type { GetInboundEmailEventsByUuidRequest } from "./GetInboundEmailEventsByUuidRequest.js"; +export type { GetInboundEmailEventsRequest } from "./GetInboundEmailEventsRequest.js"; diff --git a/src/api/resources/inboundParsing/index.ts b/src/api/resources/inboundParsing/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/inboundParsing/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts b/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts new file mode 100644 index 0000000..e2bfecc --- /dev/null +++ b/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts @@ -0,0 +1,59 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetInboundEmailEventsByUuidResponse { + /** List of attachments of the email. This will be present only after the processing is done. */ + attachments?: GetInboundEmailEventsByUuidResponse.Attachments.Item[]; + /** Date when email was delivered successfully to client_dev’s webhook */ + deliveredAt?: string | null; + /** List of events/logs that describe the lifecycle of the email on SIB platform */ + logs?: GetInboundEmailEventsByUuidResponse.Logs.Item[]; + /** Value of the Message-ID header. This will be present only after the processing is done. */ + messageId?: string; + /** Date when email was received on SMTP relay */ + receivedAt?: string; + /** Recipient’s email address */ + recipient?: string; + /** Sender’s email address */ + sender?: string; + /** Value of the Subject header. This will be present only after the processing is done. */ + subject?: string; +} + +export namespace GetInboundEmailEventsByUuidResponse { + export type Attachments = Attachments.Item[]; + + export namespace Attachments { + export interface Item { + /** value of the Content-ID header of the attachment. */ + contentId?: string; + /** size of the attachment in bytes */ + contentLength?: number; + /** value of the Content-Type header of the attachment */ + contentType?: string; + /** filename specified in the Content-Disposition header of the attachment */ + name?: string; + } + } + + export type Logs = Logs.Item[]; + + export namespace Logs { + export interface Item { + /** Date of the event */ + date?: string; + /** Type of the event */ + type?: Item.Type; + } + + export namespace Item { + /** Type of the event */ + export const Type = { + Received: "received", + Processed: "processed", + WebhookFailed: "webhookFailed", + WebhookDelivered: "webhookDelivered", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; + } + } +} diff --git a/src/api/resources/inboundParsing/types/GetInboundEmailEventsRequestSort.ts b/src/api/resources/inboundParsing/types/GetInboundEmailEventsRequestSort.ts new file mode 100644 index 0000000..dec6edd --- /dev/null +++ b/src/api/resources/inboundParsing/types/GetInboundEmailEventsRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetInboundEmailEventsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetInboundEmailEventsRequestSort = + (typeof GetInboundEmailEventsRequestSort)[keyof typeof GetInboundEmailEventsRequestSort]; diff --git a/src/api/resources/inboundParsing/types/GetInboundEmailEventsResponse.ts b/src/api/resources/inboundParsing/types/GetInboundEmailEventsResponse.ts new file mode 100644 index 0000000..5cabadc --- /dev/null +++ b/src/api/resources/inboundParsing/types/GetInboundEmailEventsResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetInboundEmailEventsResponse { + events?: GetInboundEmailEventsResponse.Events.Item[]; +} + +export namespace GetInboundEmailEventsResponse { + export type Events = Events.Item[]; + + export namespace Events { + export interface Item { + /** Date when email was received on SMTP relay */ + date: string; + /** Recipient’s email address */ + recipient: string; + /** Sender’s email address */ + sender: string; + /** UUID that can be used to fetch additional data */ + uuid: string; + } + } +} diff --git a/src/api/resources/inboundParsing/types/index.ts b/src/api/resources/inboundParsing/types/index.ts new file mode 100644 index 0000000..588f3be --- /dev/null +++ b/src/api/resources/inboundParsing/types/index.ts @@ -0,0 +1,3 @@ +export * from "./GetInboundEmailEventsByUuidResponse.js"; +export * from "./GetInboundEmailEventsRequestSort.js"; +export * from "./GetInboundEmailEventsResponse.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts new file mode 100644 index 0000000..b4c41cb --- /dev/null +++ b/src/api/resources/index.ts @@ -0,0 +1,95 @@ +export * from "./account/client/requests/index.js"; +export * as account from "./account/index.js"; +export * from "./account/types/index.js"; +export * from "./balance/client/requests/index.js"; +export * as balance from "./balance/index.js"; +export * from "./balance/types/index.js"; +export * from "./companies/client/requests/index.js"; +export * as companies from "./companies/index.js"; +export * from "./companies/types/index.js"; +export * from "./contacts/client/requests/index.js"; +export * as contacts from "./contacts/index.js"; +export * from "./contacts/types/index.js"; +export * from "./conversations/client/requests/index.js"; +export * as conversations from "./conversations/index.js"; +export * from "./conversations/types/index.js"; +export * from "./coupons/client/requests/index.js"; +export * as coupons from "./coupons/index.js"; +export * from "./coupons/types/index.js"; +export * from "./customObjects/client/requests/index.js"; +export * as customObjects from "./customObjects/index.js"; +export * from "./customObjects/types/index.js"; +export * from "./deals/client/requests/index.js"; +export * as deals from "./deals/index.js"; +export * from "./deals/types/index.js"; +export * from "./domains/client/requests/index.js"; +export * as domains from "./domains/index.js"; +export * from "./domains/types/index.js"; +export * from "./ecommerce/client/requests/index.js"; +export * as ecommerce from "./ecommerce/index.js"; +export * from "./ecommerce/types/index.js"; +export * from "./emailCampaigns/client/requests/index.js"; +export * as emailCampaigns from "./emailCampaigns/index.js"; +export * from "./emailCampaigns/types/index.js"; +export * from "./event/client/requests/index.js"; +export * as event from "./event/index.js"; +export * from "./externalFeeds/client/requests/index.js"; +export * as externalFeeds from "./externalFeeds/index.js"; +export * from "./externalFeeds/types/index.js"; +export * from "./files/client/requests/index.js"; +export * as files from "./files/index.js"; +export * from "./files/types/index.js"; +export * from "./inboundParsing/client/requests/index.js"; +export * as inboundParsing from "./inboundParsing/index.js"; +export * from "./inboundParsing/types/index.js"; +export * from "./masterAccount/client/requests/index.js"; +export * as masterAccount from "./masterAccount/index.js"; +export * from "./masterAccount/types/index.js"; +export * from "./notes/client/requests/index.js"; +export * as notes from "./notes/index.js"; +export * from "./notes/types/index.js"; +export * from "./payments/client/requests/index.js"; +export * as payments from "./payments/index.js"; +export * from "./payments/types/index.js"; +export * from "./process/client/requests/index.js"; +export * as process from "./process/index.js"; +export * from "./process/types/index.js"; +export * from "./program/client/requests/index.js"; +export * as program from "./program/index.js"; +export * from "./program/types/index.js"; +export * from "./reward/client/requests/index.js"; +export * as reward from "./reward/index.js"; +export * from "./reward/types/index.js"; +export * from "./senders/client/requests/index.js"; +export * as senders from "./senders/index.js"; +export * from "./senders/types/index.js"; +export * from "./smsCampaigns/client/requests/index.js"; +export * as smsCampaigns from "./smsCampaigns/index.js"; +export * from "./smsCampaigns/types/index.js"; +export * from "./smsTemplates/client/requests/index.js"; +export * as smsTemplates from "./smsTemplates/index.js"; +export * from "./smsTemplates/types/index.js"; +export * from "./tasks/client/requests/index.js"; +export * as tasks from "./tasks/index.js"; +export * from "./tasks/types/index.js"; +export * from "./tier/client/requests/index.js"; +export * as tier from "./tier/index.js"; +export * from "./tier/types/index.js"; +export * from "./transactionalEmails/client/requests/index.js"; +export * as transactionalEmails from "./transactionalEmails/index.js"; +export * from "./transactionalEmails/types/index.js"; +export * from "./transactionalSms/client/requests/index.js"; +export * as transactionalSms from "./transactionalSms/index.js"; +export * from "./transactionalSms/types/index.js"; +export * from "./transactionalWhatsApp/client/requests/index.js"; +export * as transactionalWhatsApp from "./transactionalWhatsApp/index.js"; +export * from "./transactionalWhatsApp/types/index.js"; +export * from "./user/client/requests/index.js"; +export * as user from "./user/index.js"; +export * from "./user/types/index.js"; +export * from "./webhooks/client/requests/index.js"; +export * as webhooks from "./webhooks/index.js"; +export * from "./webhooks/types/index.js"; +export * from "./whatsAppCampaigns/client/requests/index.js"; +export * as whatsAppCampaigns from "./whatsAppCampaigns/index.js"; +export * from "./whatsAppCampaigns/types/index.js"; diff --git a/src/api/resources/masterAccount/client/Client.ts b/src/api/resources/masterAccount/client/Client.ts new file mode 100644 index 0000000..790e33c --- /dev/null +++ b/src/api/resources/masterAccount/client/Client.ts @@ -0,0 +1,1984 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace MasterAccountClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class MasterAccountClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: MasterAccountClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * This endpoint allows to create a group of sub-accounts + * + * @param {Brevo.PostCorporateGroupRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.createANewGroupOfSubAccounts({ + * groupName: "My group" + * }) + */ + public createANewGroupOfSubAccounts( + request: Brevo.PostCorporateGroupRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createANewGroupOfSubAccounts(request, requestOptions)); + } + + private async __createANewGroupOfSubAccounts( + request: Brevo.PostCorporateGroupRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/group", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostCorporateGroupResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/corporate/group"); + } + + /** + * This endpoint allows you to remove a sub-organization from a group. + * + * @param {Brevo.PutCorporateGroupUnlinkGroupIdSubAccountsRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.deleteSubAccountFromGroup({ + * groupId: "groupId", + * subAccountIds: [423432, 234323, 87678] + * }) + */ + public deleteSubAccountFromGroup( + request: Brevo.PutCorporateGroupUnlinkGroupIdSubAccountsRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteSubAccountFromGroup(request, requestOptions)); + } + + private async __deleteSubAccountFromGroup( + request: Brevo.PutCorporateGroupUnlinkGroupIdSubAccountsRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { groupId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/group/unlink/${core.url.encodePathParam(groupId)}/subAccounts`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/corporate/group/unlink/{groupId}/subAccounts", + ); + } + + /** + * This endpoint allows you to retrieve a specific group’s information such as + * the list of sub-organizations and the user associated with the group. + * + * @param {Brevo.GetCorporateGroupIdRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.masterAccount.getAGroupDetails({ + * id: "id" + * }) + */ + public getAGroupDetails( + request: Brevo.GetCorporateGroupIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAGroupDetails(request, requestOptions)); + } + + private async __getAGroupDetails( + request: Brevo.GetCorporateGroupIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/group/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCorporateGroupIdResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/group/{id}"); + } + + /** + * This endpoint allows to update a group of sub-accounts + * + * @param {Brevo.PutCorporateGroupIdRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.updateAGroupOfSubAccounts({ + * id: "id" + * }) + */ + public updateAGroupOfSubAccounts( + request: Brevo.PutCorporateGroupIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateAGroupOfSubAccounts(request, requestOptions)); + } + + private async __updateAGroupOfSubAccounts( + request: Brevo.PutCorporateGroupIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/group/${core.url.encodePathParam(id)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/corporate/group/{id}"); + } + + /** + * This endpoint allows you to delete a group of sub-organizations. When a + * group is deleted, the sub-organizations are no longer part of this group. + * The users associated with the group are no longer associated with the group + * once deleted. + * + * @param {Brevo.DeleteCorporateGroupIdRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.deleteAGroup({ + * id: "id" + * }) + */ + public deleteAGroup( + request: Brevo.DeleteCorporateGroupIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteAGroup(request, requestOptions)); + } + + private async __deleteAGroup( + request: Brevo.DeleteCorporateGroupIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/group/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/corporate/group/{id}"); + } + + /** + * This endpoint allows you to list all groups created on your Admin account. + * + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.masterAccount.getSubAccountGroups() + */ + public getSubAccountGroups( + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSubAccountGroups(requestOptions)); + } + + private async __getSubAccountGroups( + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/groups", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetSubAccountGroupsResponseItem[], + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/groups"); + } + + /** + * This endpoint allows you to list all Admin users of your Admin account. You + * can filter users by type (active or pending) and paginate results using + * offset and limit. + * + * @param {Brevo.GetCorporateInvitedUsersListRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.masterAccount.getCorporateInvitedUsersList() + */ + public getCorporateInvitedUsersList( + request: Brevo.GetCorporateInvitedUsersListRequest = {}, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCorporateInvitedUsersList(request, requestOptions)); + } + + private async __getCorporateInvitedUsersList( + request: Brevo.GetCorporateInvitedUsersListRequest = {}, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { type: type_, offset, limit } = request; + const _queryParams: Record = { + type: type_, + offset, + limit, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/invited/users", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetCorporateInvitedUsersListResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/invited/users"); + } + + /** + * This endpoint allows you to retrieve the list of active IPs on your Admin + * account + * + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.masterAccount.listOfAllIPs() + */ + public listOfAllIPs( + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listOfAllIPs(requestOptions)); + } + + private async __listOfAllIPs( + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/ip", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCorporateIpResponseItem[], rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/ip"); + } + + /** + * This endpoint will provide the details of the master account. + * + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.getTheDetailsOfRequestedMasterAccount() + */ + public getTheDetailsOfRequestedMasterAccount( + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTheDetailsOfRequestedMasterAccount(requestOptions)); + } + + private async __getTheDetailsOfRequestedMasterAccount( + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/masterAccount", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetCorporateMasterAccountResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/masterAccount"); + } + + /** + * This endpoint generates an SSO token to authenticate and access the admin + * account using the endpoint + * https://account-app.brevo.com/account/login/corporate/sso/[token], where + * [token] will be replaced by the actual token. + * + * @param {Brevo.PostCorporateSsoTokenRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.masterAccount.generateSsoTokenToAccessAdminAccount({ + * email: "vipin+ent-user@brevo.com" + * }) + */ + public generateSsoTokenToAccessAdminAccount( + request: Brevo.PostCorporateSsoTokenRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__generateSsoTokenToAccessAdminAccount(request, requestOptions), + ); + } + + private async __generateSsoTokenToAccessAdminAccount( + request: Brevo.PostCorporateSsoTokenRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/ssoToken", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSsoToken, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/corporate/ssoToken"); + } + + /** + * This endpoint will provide the list all the sub-accounts of the master + * account. + * + * @param {Brevo.GetCorporateSubAccountRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.getTheListOfAllTheSubAccountsOfTheMasterAccount({ + * offset: 1, + * limit: 1 + * }) + */ + public getTheListOfAllTheSubAccountsOfTheMasterAccount( + request: Brevo.GetCorporateSubAccountRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__getTheListOfAllTheSubAccountsOfTheMasterAccount(request, requestOptions), + ); + } + + private async __getTheListOfAllTheSubAccountsOfTheMasterAccount( + request: Brevo.GetCorporateSubAccountRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { offset, limit } = request; + const _queryParams: Record = { + offset, + limit, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/subAccount", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCorporateSubAccountResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/subAccount"); + } + + /** + * This endpoint will create a new sub-account under a master account + * + * @param {Brevo.PostCorporateSubAccountRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.createANewSubAccountUnderAMasterAccount({ + * companyName: "Test Sub-account", + * email: "test-sub@example.com", + * groupIds: ["5f8f8c3b5f56a02d4433b3a7", "5f8f8c3b5f56a02d4433b3a8"], + * language: "fr", + * timezone: "Europe/Paris" + * }) + */ + public createANewSubAccountUnderAMasterAccount( + request: Brevo.PostCorporateSubAccountRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__createANewSubAccountUnderAMasterAccount(request, requestOptions), + ); + } + + private async __createANewSubAccountUnderAMasterAccount( + request: Brevo.PostCorporateSubAccountRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/subAccount", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.PostCorporateSubAccountResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/corporate/subAccount"); + } + + /** + * This endpoint allows to associate an IP to sub-accounts + * + * @param {Brevo.PostCorporateSubAccountIpAssociateRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.associateAnIpToSubAccounts({ + * ids: [234322, 325553, 893432], + * ip: "103.11.32.88" + * }) + */ + public associateAnIpToSubAccounts( + request: Brevo.PostCorporateSubAccountIpAssociateRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise> { + return core.HttpResponsePromise.fromPromise(this.__associateAnIpToSubAccounts(request, requestOptions)); + } + + private async __associateAnIpToSubAccounts( + request: Brevo.PostCorporateSubAccountIpAssociateRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise>> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/subAccount/ip/associate", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Record, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/corporate/subAccount/ip/associate", + ); + } + + /** + * This endpoint allows to dissociate an IP from sub-accounts + * + * @param {Brevo.PutCorporateSubAccountIpDissociateRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.dissociateAnIpToSubAccounts({ + * ids: [234322, 325553, 893432], + * ip: "103.11.32.88" + * }) + */ + public dissociateAnIpToSubAccounts( + request: Brevo.PutCorporateSubAccountIpDissociateRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__dissociateAnIpToSubAccounts(request, requestOptions)); + } + + private async __dissociateAnIpToSubAccounts( + request: Brevo.PutCorporateSubAccountIpDissociateRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/subAccount/ip/dissociate", + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/corporate/subAccount/ip/dissociate", + ); + } + + /** + * This endpoint will generate an API v3 key for a sub-account + * + * @param {Brevo.PostCorporateSubAccountKeyRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.createAnApiKeyForASubAccount({ + * id: 3232323, + * name: "My Api Key" + * }) + */ + public createAnApiKeyForASubAccount( + request: Brevo.PostCorporateSubAccountKeyRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createAnApiKeyForASubAccount(request, requestOptions)); + } + + private async __createAnApiKeyForASubAccount( + request: Brevo.PostCorporateSubAccountKeyRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/subAccount/key", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.PostCorporateSubAccountKeyResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/corporate/subAccount/key"); + } + + /** + * This endpoint generates an sso token to authenticate and access a + * sub-account of the master using the account endpoint + * https://account-app.brevo.com/account/login/sub-account/sso/[token], where + * [token] will be replaced by the actual token. + * + * @param {Brevo.PostCorporateSubAccountSsoTokenRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.masterAccount.generateSsoTokenToAccessSubAccount({ + * id: 3232323 + * }) + */ + public generateSsoTokenToAccessSubAccount( + request: Brevo.PostCorporateSubAccountSsoTokenRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__generateSsoTokenToAccessSubAccount(request, requestOptions)); + } + + private async __generateSsoTokenToAccessSubAccount( + request: Brevo.PostCorporateSubAccountSsoTokenRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/subAccount/ssoToken", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSsoToken, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/corporate/subAccount/ssoToken", + ); + } + + /** + * This endpoint will provide the details for the specified sub-account company + * + * @param {Brevo.GetCorporateSubAccountIdRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.getSubAccountDetails({ + * id: 1000000 + * }) + */ + public getSubAccountDetails( + request: Brevo.GetCorporateSubAccountIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSubAccountDetails(request, requestOptions)); + } + + private async __getSubAccountDetails( + request: Brevo.GetCorporateSubAccountIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/subAccount/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetCorporateSubAccountIdResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/subAccount/{id}"); + } + + /** + * @param {Brevo.DeleteCorporateSubAccountIdRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.masterAccount.deleteASubAccount({ + * id: 1000000 + * }) + */ + public deleteASubAccount( + request: Brevo.DeleteCorporateSubAccountIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteASubAccount(request, requestOptions)); + } + + private async __deleteASubAccount( + request: Brevo.DeleteCorporateSubAccountIdRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/subAccount/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/corporate/subAccount/{id}"); + } + + /** + * API endpoint for the Corporate owner to enable/disable applications on the + * sub-account + * + * @param {Brevo.PutCorporateSubAccountIdApplicationsToggleRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.masterAccount.enableDisableSubAccountApplicationS({ + * id: 1000000, + * "landing-pages": true, + * meetings: true, + * "sms-campaigns": false, + * "web-push": false, + * whatsapp: true + * }) + */ + public enableDisableSubAccountApplicationS( + request: Brevo.PutCorporateSubAccountIdApplicationsToggleRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__enableDisableSubAccountApplicationS(request, requestOptions), + ); + } + + private async __enableDisableSubAccountApplicationS( + request: Brevo.PutCorporateSubAccountIdApplicationsToggleRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/subAccount/${core.url.encodePathParam(id)}/applications/toggle`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/corporate/subAccount/{id}/applications/toggle", + ); + } + + /** + * This endpoint will update the sub-account plan. On the Corporate solution + * new version v2, you can set an unlimited number of credits in your + * sub-organization. Please pass the value “-1" to set the consumable in + * unlimited mode. + * + * @param {Brevo.PutCorporateSubAccountIdPlanRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.masterAccount.updateSubAccountPlan({ + * id: 1000000, + * credits: { + * email: 5000, + * externalFeeds: 1, + * sms: 2000, + * whatsapp: 100, + * wpSubscribers: -1 + * }, + * features: { + * inbox: 10, + * landingPage: 20, + * salesUsers: 6, + * users: 15 + * } + * }) + */ + public updateSubAccountPlan( + request: Brevo.PutCorporateSubAccountIdPlanRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateSubAccountPlan(request, requestOptions)); + } + + private async __updateSubAccountPlan( + request: Brevo.PutCorporateSubAccountIdPlanRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/subAccount/${core.url.encodePathParam(id)}/plan`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/corporate/subAccount/{id}/plan", + ); + } + + /** + * This endpoint will update multiple sub-accounts plan. On the Corporate + * solution new version v2, you can set an unlimited number of credits in your + * sub-organization. Please pass the value “-1" to set the consumable in + * unlimited mode. + * + * @param {Brevo.PutCorporateSubAccountsPlanRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.masterAccount.updateSubAccountsPlan({ + * credits: { + * email: 5000, + * externalFeeds: 1, + * sms: 2000, + * whatsapp: 100, + * wpSubscribers: -1 + * }, + * features: { + * landingPage: 20, + * salesUsers: 6, + * users: 15 + * }, + * subAccountIds: [4534345, 987893, 876785] + * }) + */ + public updateSubAccountsPlan( + request: Brevo.PutCorporateSubAccountsPlanRequest = {}, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateSubAccountsPlan(request, requestOptions)); + } + + private async __updateSubAccountsPlan( + request: Brevo.PutCorporateSubAccountsPlanRequest = {}, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/subAccounts/plan", + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/corporate/subAccounts/plan"); + } + + /** + * `This endpoint allows you to invite a member to manage the Admin account + * Features and their respective permissions are as below: - `my_plan`: + * - "all" + * - `api`: + * - "none" + * - `user_management`: + * - "all" + * - `app_management` | Not available in ENTv2: + * - "all" + * - `sub_organization_groups` + * - "create" + * - "edit_delete" + * - `create_sub_organizations` + * - "all" + * - `manage_sub_organizations` + * - "all" + * - `analytics` + * - "download_data" + * - "create_alerts" + * - "my_looks" + * - "explore_create" + * - `security` + * - "all" + * **Note**: - If `all_features_access: false` then only privileges are + * required otherwise if `true` then it's assumed that all permissions will be + * there for the invited admin user. + * + * @param {Brevo.InviteAdminUserRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.inviteAdminUser({ + * all_features_access: true, + * email: "inviteuser@example.com", + * privileges: [{}] + * }) + */ + public inviteAdminUser( + request: Brevo.InviteAdminUserRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__inviteAdminUser(request, requestOptions)); + } + + private async __inviteAdminUser( + request: Brevo.InviteAdminUserRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "corporate/user/invitation/send", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.InviteAdminUserResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/corporate/user/invitation/send", + ); + } + + /** + * This endpoint will allow the user to: + * - Resend an admin user invitation + * - Cancel an admin user invitation + * + * @param {Brevo.PutCorporateUserInvitationActionEmailRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.resendCancelAdminUserInvitation({ + * action: "resend", + * email: "email" + * }) + */ + public resendCancelAdminUserInvitation( + request: Brevo.PutCorporateUserInvitationActionEmailRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__resendCancelAdminUserInvitation(request, requestOptions)); + } + + private async __resendCancelAdminUserInvitation( + request: Brevo.PutCorporateUserInvitationActionEmailRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { action, email } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/user/invitation/${core.url.encodePathParam(action)}/${core.url.encodePathParam(email)}`, + ), + method: "PUT", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.PutCorporateUserInvitationActionEmailResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/corporate/user/invitation/{action}/{email}", + ); + } + + /** + * This endpoint allows to revoke/remove an invited member of your Admin + * account + * + * @param {Brevo.DeleteCorporateUserRevokeEmailRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.revokeAnAdminUser({ + * email: "email" + * }) + */ + public revokeAnAdminUser( + request: Brevo.DeleteCorporateUserRevokeEmailRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__revokeAnAdminUser(request, requestOptions)); + } + + private async __revokeAnAdminUser( + request: Brevo.DeleteCorporateUserRevokeEmailRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { email } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/user/revoke/${core.url.encodePathParam(email)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/corporate/user/revoke/{email}", + ); + } + + /** + * This endpoint will provide the list of admin user permissions + * + * @param {Brevo.GetCorporateUserPermissionRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.getCorporateUserPermission({ + * email: "email" + * }) + */ + public getCorporateUserPermission( + request: Brevo.GetCorporateUserPermissionRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCorporateUserPermission(request, requestOptions)); + } + + private async __getCorporateUserPermission( + request: Brevo.GetCorporateUserPermissionRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { email } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/user/${core.url.encodePathParam(email)}/permissions`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetCorporateUserPermissionResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/corporate/user/{email}/permissions", + ); + } + + /** + * This endpoint will allow you to change the permissions of Admin users of + * your Admin account + * + * @param {Brevo.PutCorporateUserEmailPermissionsRequest} request + * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.masterAccount.changeAdminUserPermissions({ + * email: "email", + * all_features_access: false, + * privileges: [{ + * feature: "user_management", + * permissions: ["all"] + * }, { + * feature: "api", + * permissions: ["all"] + * }, { + * feature: "my_plan", + * permissions: ["none"] + * }, { + * feature: "apps_management", + * permissions: ["all"] + * }, { + * feature: "create_sub_organizations", + * permissions: ["all"] + * }, { + * feature: "sub_organization_groups", + * permissions: ["create", "edit_delete"] + * }, { + * feature: "manage_sub_organizations", + * permissions: ["all"] + * }, { + * feature: "security", + * permissions: ["none"] + * }, { + * feature: "analytics", + * permissions: ["create_alerts", "download_data", "my_looks", "explore_create"] + * }] + * }) + */ + public changeAdminUserPermissions( + request: Brevo.PutCorporateUserEmailPermissionsRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__changeAdminUserPermissions(request, requestOptions)); + } + + private async __changeAdminUserPermissions( + request: Brevo.PutCorporateUserEmailPermissionsRequest, + requestOptions?: MasterAccountClient.RequestOptions, + ): Promise> { + const { email, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `corporate/user/${core.url.encodePathParam(email)}/permissions`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/corporate/user/{email}/permissions", + ); + } +} diff --git a/src/api/resources/masterAccount/client/index.ts b/src/api/resources/masterAccount/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/masterAccount/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/masterAccount/client/requests/DeleteCorporateGroupIdRequest.ts b/src/api/resources/masterAccount/client/requests/DeleteCorporateGroupIdRequest.ts new file mode 100644 index 0000000..3c4c3e8 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/DeleteCorporateGroupIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteCorporateGroupIdRequest { + /** Id of the group */ + id: string; +} diff --git a/src/api/resources/masterAccount/client/requests/DeleteCorporateSubAccountIdRequest.ts b/src/api/resources/masterAccount/client/requests/DeleteCorporateSubAccountIdRequest.ts new file mode 100644 index 0000000..19f9386 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/DeleteCorporateSubAccountIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: 1000000 + * } + */ +export interface DeleteCorporateSubAccountIdRequest { + /** Id of the sub-account organization to be deleted */ + id: number; +} diff --git a/src/api/resources/masterAccount/client/requests/DeleteCorporateUserRevokeEmailRequest.ts b/src/api/resources/masterAccount/client/requests/DeleteCorporateUserRevokeEmailRequest.ts new file mode 100644 index 0000000..a2c63f0 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/DeleteCorporateUserRevokeEmailRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "email" + * } + */ +export interface DeleteCorporateUserRevokeEmailRequest { + /** Email of the invited user */ + email: string; +} diff --git a/src/api/resources/masterAccount/client/requests/GetCorporateGroupIdRequest.ts b/src/api/resources/masterAccount/client/requests/GetCorporateGroupIdRequest.ts new file mode 100644 index 0000000..69d3a82 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/GetCorporateGroupIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCorporateGroupIdRequest { + /** Id of the group of sub-organization */ + id: string; +} diff --git a/src/api/resources/masterAccount/client/requests/GetCorporateInvitedUsersListRequest.ts b/src/api/resources/masterAccount/client/requests/GetCorporateInvitedUsersListRequest.ts new file mode 100644 index 0000000..b0a09eb --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/GetCorporateInvitedUsersListRequest.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetCorporateInvitedUsersListRequest { + /** + * User type (active | pending). This is required if offset is provided for + * limited result. + */ + type?: string; + /** + * Page number for the result set. This is optional, default value will be + * the 1st page. + */ + offset?: number; + /** + * Number of users to be displayed on each page. This is optional, the + * default limit is 20, but max allowed limit is 100. + */ + limit?: number; +} diff --git a/src/api/resources/masterAccount/client/requests/GetCorporateSubAccountIdRequest.ts b/src/api/resources/masterAccount/client/requests/GetCorporateSubAccountIdRequest.ts new file mode 100644 index 0000000..cbb1f61 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/GetCorporateSubAccountIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: 1000000 + * } + */ +export interface GetCorporateSubAccountIdRequest { + /** Id of the sub-account organization */ + id: number; +} diff --git a/src/api/resources/masterAccount/client/requests/GetCorporateSubAccountRequest.ts b/src/api/resources/masterAccount/client/requests/GetCorporateSubAccountRequest.ts new file mode 100644 index 0000000..8415537 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/GetCorporateSubAccountRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * offset: 1, + * limit: 1 + * } + */ +export interface GetCorporateSubAccountRequest { + /** Index of the first sub-account in the page */ + offset: number; + /** Number of sub-accounts to be displayed on each page */ + limit: number; +} diff --git a/src/api/resources/masterAccount/client/requests/GetCorporateUserPermissionRequest.ts b/src/api/resources/masterAccount/client/requests/GetCorporateUserPermissionRequest.ts new file mode 100644 index 0000000..0621bfc --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/GetCorporateUserPermissionRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "email" + * } + */ +export interface GetCorporateUserPermissionRequest { + /** Email of the invited user. */ + email: string; +} diff --git a/src/api/resources/masterAccount/client/requests/InviteAdminUserRequest.ts b/src/api/resources/masterAccount/client/requests/InviteAdminUserRequest.ts new file mode 100644 index 0000000..c1b7258 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/InviteAdminUserRequest.ts @@ -0,0 +1,64 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * all_features_access: true, + * email: "inviteuser@example.com", + * privileges: [{}] + * } + */ +export interface InviteAdminUserRequest { + /** All access to the features */ + all_features_access: boolean; + /** Email address for the organization */ + email: string; + /** Ids of Group */ + groupIds?: string[]; + privileges: InviteAdminUserRequest.Privileges.Item[]; +} + +export namespace InviteAdminUserRequest { + export type Privileges = Privileges.Item[]; + + export namespace Privileges { + /** + * Privileges given to the user + */ + export interface Item { + /** Feature name */ + feature?: Item.Feature; + /** Permissions for a given feature */ + permissions?: Item.Permissions.Item[]; + } + + export namespace Item { + /** Feature name */ + export const Feature = { + MyPlan: "my_plan", + Api: "api", + UserManagement: "user_management", + AppManagement: "app_management", + SubOrganizationGroups: "sub_organization_groups", + CreateSubOrganizations: "create_sub_organizations", + ManageSubOrganizations: "manage_sub_organizations", + Analytics: "analytics", + Security: "security", + } as const; + export type Feature = (typeof Feature)[keyof typeof Feature]; + export type Permissions = Permissions.Item[]; + + export namespace Permissions { + export const Item = { + All: "all", + None: "none", + Create: "create", + EditDelete: "edit_delete", + DownloadData: "download_data", + CreateAlerts: "create_alerts", + } as const; + export type Item = (typeof Item)[keyof typeof Item]; + } + } + } +} diff --git a/src/api/resources/masterAccount/client/requests/PostCorporateGroupRequest.ts b/src/api/resources/masterAccount/client/requests/PostCorporateGroupRequest.ts new file mode 100644 index 0000000..9b961fb --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PostCorporateGroupRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * groupName: "My group" + * } + */ +export interface PostCorporateGroupRequest { + /** The name of the group of sub-accounts */ + groupName: string; + /** Pass the list of sub-account Ids to be included in the group */ + subAccountIds?: number[]; +} diff --git a/src/api/resources/masterAccount/client/requests/PostCorporateSsoTokenRequest.ts b/src/api/resources/masterAccount/client/requests/PostCorporateSsoTokenRequest.ts new file mode 100644 index 0000000..d6cfa1d --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PostCorporateSsoTokenRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "vipin+ent-user@brevo.com" + * } + */ +export interface PostCorporateSsoTokenRequest { + /** User email of admin account */ + email: string; +} diff --git a/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountIpAssociateRequest.ts b/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountIpAssociateRequest.ts new file mode 100644 index 0000000..fc393a8 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountIpAssociateRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * ids: [234322, 325553, 893432], + * ip: "103.11.32.88" + * } + */ +export interface PostCorporateSubAccountIpAssociateRequest { + /** + * Pass the list of sub-account Ids to be associated with the IP + * address + */ + ids: number[]; + /** IP address */ + ip: string; +} diff --git a/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountKeyRequest.ts b/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountKeyRequest.ts new file mode 100644 index 0000000..2af064d --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountKeyRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: 3232323, + * name: "My Api Key" + * } + */ +export interface PostCorporateSubAccountKeyRequest { + /** Id of the sub-account organization */ + id: number; + /** Name of the API key */ + name: string; +} diff --git a/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountRequest.ts b/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountRequest.ts new file mode 100644 index 0000000..2d5984c --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountRequest.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * companyName: "Test Sub-account", + * email: "test-sub@example.com", + * groupIds: ["5f8f8c3b5f56a02d4433b3a7", "5f8f8c3b5f56a02d4433b3a8"], + * language: "fr", + * timezone: "Europe/Paris" + * } + */ +export interface PostCorporateSubAccountRequest { + /** Set the name of the sub-account company */ + companyName: string; + /** Email address for the organization */ + email: string; + /** Set the group(s) for the sub-account */ + groupIds?: string[]; + /** Set the language of the sub-account */ + language?: PostCorporateSubAccountRequest.Language; + /** Set the timezone of the sub-account */ + timezone?: string; +} + +export namespace PostCorporateSubAccountRequest { + /** Set the language of the sub-account */ + export const Language = { + En: "en", + Fr: "fr", + It: "it", + Es: "es", + Pt: "pt", + De: "de", + } as const; + export type Language = (typeof Language)[keyof typeof Language]; +} diff --git a/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountSsoTokenRequest.ts b/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountSsoTokenRequest.ts new file mode 100644 index 0000000..c6fe426 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PostCorporateSubAccountSsoTokenRequest.ts @@ -0,0 +1,56 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: 3232323 + * } + */ +export interface PostCorporateSubAccountSsoTokenRequest { + /** User email of sub-account organization */ + email?: string; + /** Id of the sub-account organization */ + id: number; + /** + * **Set target after login success** * **automation** - Redirect + * to Automation after login * **email_campaign** - Redirect to + * Email Campaign after login * **contacts** - Redirect to Contacts + * after login * **landing_pages** - Redirect to Landing Pages + * after login * **email_transactional** - Redirect to Email + * Transactional after login * **senders** - Redirect to Senders + * after login * **sms_campaign** - Redirect to Sms Campaign after + * login * **sms_transactional** - Redirect to Sms Transactional + * after login + */ + target?: PostCorporateSubAccountSsoTokenRequest.Target; + /** + * Set the full target URL after login success. The user will land + * directly on this target URL after login + */ + url?: string; +} + +export namespace PostCorporateSubAccountSsoTokenRequest { + /** + * **Set target after login success** * **automation** - Redirect + * to Automation after login * **email_campaign** - Redirect to + * Email Campaign after login * **contacts** - Redirect to Contacts + * after login * **landing_pages** - Redirect to Landing Pages + * after login * **email_transactional** - Redirect to Email + * Transactional after login * **senders** - Redirect to Senders + * after login * **sms_campaign** - Redirect to Sms Campaign after + * login * **sms_transactional** - Redirect to Sms Transactional + * after login + */ + export const Target = { + Automation: "automation", + EmailCampaign: "email_campaign", + Contacts: "contacts", + LandingPages: "landing_pages", + EmailTransactional: "email_transactional", + Senders: "senders", + SmsCampaign: "sms_campaign", + SmsTransactional: "sms_transactional", + } as const; + export type Target = (typeof Target)[keyof typeof Target]; +} diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateGroupIdRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateGroupIdRequest.ts new file mode 100644 index 0000000..3a76065 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PutCorporateGroupIdRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface PutCorporateGroupIdRequest { + /** Id of the group */ + id: string; + /** The name of the group of sub-accounts */ + groupName?: string; + /** Pass the list of sub-account Ids to be included in the group */ + subAccountIds?: number[]; +} diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateGroupUnlinkGroupIdSubAccountsRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateGroupUnlinkGroupIdSubAccountsRequest.ts new file mode 100644 index 0000000..c92a58f --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PutCorporateGroupUnlinkGroupIdSubAccountsRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * groupId: "groupId", + * subAccountIds: [423432, 234323, 87678] + * } + */ +export interface PutCorporateGroupUnlinkGroupIdSubAccountsRequest { + /** Group id */ + groupId: string; + /** List of sub-account ids */ + subAccountIds: number[]; +} diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdApplicationsToggleRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdApplicationsToggleRequest.ts new file mode 100644 index 0000000..28a10b2 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdApplicationsToggleRequest.ts @@ -0,0 +1,73 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: 1000000, + * "landing-pages": true, + * meetings: true, + * "sms-campaigns": false, + * "web-push": false, + * whatsapp: true + * } + */ +export interface PutCorporateSubAccountIdApplicationsToggleRequest { + /** Id of the sub-account organization (mandatory) */ + id: number; + /** + * Set this field to enable or disable Automation on the + * sub-account + */ + automation?: boolean; + /** + * Set this field to enable or disable Conversations on the + * sub-account + */ + conversations?: boolean; + /** Set this field to enable or disable Sales CRM on the sub-account */ + crm?: boolean; + /** + * Set this field to enable or disable Email Campaigns on the + * sub-account + */ + "email-campaigns"?: boolean; + /** + * Set this field to enable or disable Facebook ads on the + * sub-account + */ + "facebook-ads"?: boolean; + /** + * Set this field to enable or disable Inbox on the sub-account / + * Not applicable on ENTv2 + */ + inbox?: boolean; + /** + * Set this field to enable or disable Landing pages on the + * sub-account + */ + "landing-pages"?: boolean; + /** Set this field to enable or disable Meetings on the sub-account */ + meetings?: boolean; + /** + * Set this field to enable or disable SMS Marketing on the + * sub-account + */ + "sms-campaigns"?: boolean; + /** + * Set this field to enable or disable Transactional Email on the + * sub-account + */ + "transactional-emails"?: boolean; + /** + * Set this field to enable or disable Transactional SMS on the + * sub-account + */ + "transactional-sms"?: boolean; + /** Set this field to enable or disable Web Push on the sub-account */ + "web-push"?: boolean; + /** + * Set this field to enable or disable Whatsapp campaigns on the + * sub-account + */ + whatsapp?: boolean; +} diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdPlanRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdPlanRequest.ts new file mode 100644 index 0000000..dd3e46b --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdPlanRequest.ts @@ -0,0 +1,76 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: 1000000, + * credits: { + * email: 5000, + * externalFeeds: 1, + * sms: 2000, + * whatsapp: 100, + * wpSubscribers: -1 + * }, + * features: { + * inbox: 10, + * landingPage: 20, + * salesUsers: 6, + * users: 15 + * } + * } + */ +export interface PutCorporateSubAccountIdPlanRequest { + /** Id of the sub-account organization */ + id: number; + /** Credit details to update */ + credits?: PutCorporateSubAccountIdPlanRequest.Credits; + /** Features details to update */ + features?: PutCorporateSubAccountIdPlanRequest.Features; +} + +export namespace PutCorporateSubAccountIdPlanRequest { + /** + * Credit details to update + */ + export interface Credits { + /** + * Number of email credits | Pass the value -1 for unlimited + * emails in ENTv2 only + */ + email?: number; + /** + * Number of externalFeeds credits, possible values are 0 or 1 + * |available in ENTv2 only + */ + externalFeeds?: number; + /** + * Number of SMS credits | Pass the value -1 for unlimited SMS + * in ENTv2 only + */ + sms?: number; + /** + * Number of whatsapp credits | Pass the value -1 for unlimited + * whatsapp in ENTv2 only + */ + whatsapp?: number; + /** + * Number of Push credits, possible value is 0 and -1 | + * available in ENT-v2 only + */ + wpSubscribers?: number; + } + + /** + * Features details to update + */ + export interface Features { + /** Number of inboxes / Not required on ENTv2 */ + inbox?: number; + /** Number of landing pages */ + landingPage?: number; + /** Number of sales and service users | only available in ENT-V2 */ + salesUsers?: number; + /** Number of multi-users */ + users?: number; + } +} diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIpDissociateRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIpDissociateRequest.ts new file mode 100644 index 0000000..6e36fb9 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIpDissociateRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * ids: [234322, 325553, 893432], + * ip: "103.11.32.88" + * } + */ +export interface PutCorporateSubAccountIpDissociateRequest { + /** + * Pass the list of sub-account Ids to be dissociated from the IP + * address + */ + ids: number[]; + /** IP address */ + ip: string; +} diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountsPlanRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountsPlanRequest.ts new file mode 100644 index 0000000..6edfc55 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountsPlanRequest.ts @@ -0,0 +1,73 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * credits: { + * email: 5000, + * externalFeeds: 1, + * sms: 2000, + * whatsapp: 100, + * wpSubscribers: -1 + * }, + * features: { + * landingPage: 20, + * salesUsers: 6, + * users: 15 + * }, + * subAccountIds: [4534345, 987893, 876785] + * } + */ +export interface PutCorporateSubAccountsPlanRequest { + /** Credit details to update */ + credits?: PutCorporateSubAccountsPlanRequest.Credits; + /** Features details to update */ + features?: PutCorporateSubAccountsPlanRequest.Features; + /** List of sub-account ids */ + subAccountIds?: number[]; +} + +export namespace PutCorporateSubAccountsPlanRequest { + /** + * Credit details to update + */ + export interface Credits { + /** + * Number of email credits | Pass the value -1 for unlimited + * emails in ENTv2 only + */ + email?: number; + /** + * Number of externalFeeds credits, possible values are 0 or 1 + * |available in ENTv2 only + */ + externalFeeds?: number; + /** + * Number of SMS credits | Pass the value -1 for unlimited SMS + * in ENTv2 only + */ + sms?: number; + /** + * Number of whatsapp credits | Pass the value -1 for unlimited + * whatsapp in ENTv2 only + */ + whatsapp?: number; + /** + * Number of Push credits, possible value is 0 and -1 | + * available in ENT-v2 only + */ + wpSubscribers?: number; + } + + /** + * Features details to update + */ + export interface Features { + /** Number of landing pages */ + landingPage?: number; + /** Number of sales and service users | only available in ENT-V2 */ + salesUsers?: number; + /** Number of multi-users */ + users?: number; + } +} diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateUserEmailPermissionsRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateUserEmailPermissionsRequest.ts new file mode 100644 index 0000000..a3f34f1 --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PutCorporateUserEmailPermissionsRequest.ts @@ -0,0 +1,91 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "email", + * all_features_access: false, + * privileges: [{ + * feature: "user_management", + * permissions: ["all"] + * }, { + * feature: "api", + * permissions: ["all"] + * }, { + * feature: "my_plan", + * permissions: ["none"] + * }, { + * feature: "apps_management", + * permissions: ["all"] + * }, { + * feature: "create_sub_organizations", + * permissions: ["all"] + * }, { + * feature: "sub_organization_groups", + * permissions: ["create", "edit_delete"] + * }, { + * feature: "manage_sub_organizations", + * permissions: ["all"] + * }, { + * feature: "security", + * permissions: ["none"] + * }, { + * feature: "analytics", + * permissions: ["create_alerts", "download_data", "my_looks", "explore_create"] + * }] + * } + */ +export interface PutCorporateUserEmailPermissionsRequest { + /** Email address of Admin user */ + email: string; + /** All access to the features */ + all_features_access: boolean; + privileges: PutCorporateUserEmailPermissionsRequest.Privileges.Item[]; +} + +export namespace PutCorporateUserEmailPermissionsRequest { + export type Privileges = Privileges.Item[]; + + export namespace Privileges { + /** + * Permission on features + */ + export interface Item { + /** feature name */ + feature?: Item.Feature; + /** Permission for the feature */ + permissions?: Item.Permissions.Item[]; + } + + export namespace Item { + /** feature name */ + export const Feature = { + UserManagement: "user_management", + Api: "api", + MyPlan: "my_plan", + AppsManagement: "apps_management", + Analytics: "analytics", + SubOrganizationGroups: "sub_organization_groups", + CreateSubOrganizations: "create_sub_organizations", + ManageSubOrganizations: "manage_sub_organizations", + Security: "security", + } as const; + export type Feature = (typeof Feature)[keyof typeof Feature]; + export type Permissions = Permissions.Item[]; + + export namespace Permissions { + export const Item = { + All: "all", + None: "none", + Create: "create", + EditDelete: "edit_delete", + CreateAlerts: "create_alerts", + DownloadData: "download_data", + MyLooks: "my_looks", + ExploreCreate: "explore_create", + } as const; + export type Item = (typeof Item)[keyof typeof Item]; + } + } + } +} diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateUserInvitationActionEmailRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateUserInvitationActionEmailRequest.ts new file mode 100644 index 0000000..a39463f --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/PutCorporateUserInvitationActionEmailRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * action: "resend", + * email: "email" + * } + */ +export interface PutCorporateUserInvitationActionEmailRequest { + /** Action to be performed (cancel / resend) */ + action: Brevo.PutCorporateUserInvitationActionEmailRequestAction; + /** Email address of the recipient */ + email: string; +} diff --git a/src/api/resources/masterAccount/client/requests/index.ts b/src/api/resources/masterAccount/client/requests/index.ts new file mode 100644 index 0000000..da5054d --- /dev/null +++ b/src/api/resources/masterAccount/client/requests/index.ts @@ -0,0 +1,23 @@ +export type { DeleteCorporateGroupIdRequest } from "./DeleteCorporateGroupIdRequest.js"; +export type { DeleteCorporateSubAccountIdRequest } from "./DeleteCorporateSubAccountIdRequest.js"; +export type { DeleteCorporateUserRevokeEmailRequest } from "./DeleteCorporateUserRevokeEmailRequest.js"; +export type { GetCorporateGroupIdRequest } from "./GetCorporateGroupIdRequest.js"; +export type { GetCorporateInvitedUsersListRequest } from "./GetCorporateInvitedUsersListRequest.js"; +export type { GetCorporateSubAccountIdRequest } from "./GetCorporateSubAccountIdRequest.js"; +export type { GetCorporateSubAccountRequest } from "./GetCorporateSubAccountRequest.js"; +export type { GetCorporateUserPermissionRequest } from "./GetCorporateUserPermissionRequest.js"; +export { InviteAdminUserRequest } from "./InviteAdminUserRequest.js"; +export type { PostCorporateGroupRequest } from "./PostCorporateGroupRequest.js"; +export type { PostCorporateSsoTokenRequest } from "./PostCorporateSsoTokenRequest.js"; +export type { PostCorporateSubAccountIpAssociateRequest } from "./PostCorporateSubAccountIpAssociateRequest.js"; +export type { PostCorporateSubAccountKeyRequest } from "./PostCorporateSubAccountKeyRequest.js"; +export { PostCorporateSubAccountRequest } from "./PostCorporateSubAccountRequest.js"; +export { PostCorporateSubAccountSsoTokenRequest } from "./PostCorporateSubAccountSsoTokenRequest.js"; +export type { PutCorporateGroupIdRequest } from "./PutCorporateGroupIdRequest.js"; +export type { PutCorporateGroupUnlinkGroupIdSubAccountsRequest } from "./PutCorporateGroupUnlinkGroupIdSubAccountsRequest.js"; +export type { PutCorporateSubAccountIdApplicationsToggleRequest } from "./PutCorporateSubAccountIdApplicationsToggleRequest.js"; +export type { PutCorporateSubAccountIdPlanRequest } from "./PutCorporateSubAccountIdPlanRequest.js"; +export type { PutCorporateSubAccountIpDissociateRequest } from "./PutCorporateSubAccountIpDissociateRequest.js"; +export type { PutCorporateSubAccountsPlanRequest } from "./PutCorporateSubAccountsPlanRequest.js"; +export { PutCorporateUserEmailPermissionsRequest } from "./PutCorporateUserEmailPermissionsRequest.js"; +export type { PutCorporateUserInvitationActionEmailRequest } from "./PutCorporateUserInvitationActionEmailRequest.js"; diff --git a/src/api/resources/masterAccount/index.ts b/src/api/resources/masterAccount/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/masterAccount/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/masterAccount/types/GetCorporateGroupIdResponse.ts b/src/api/resources/masterAccount/types/GetCorporateGroupIdResponse.ts new file mode 100644 index 0000000..1f35421 --- /dev/null +++ b/src/api/resources/masterAccount/types/GetCorporateGroupIdResponse.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCorporateGroupIdResponse { + group?: GetCorporateGroupIdResponse.Group; + "sub-accounts"?: GetCorporateGroupIdResponse.SubAccounts.Item[]; + users?: GetCorporateGroupIdResponse.Users.Item[]; +} + +export namespace GetCorporateGroupIdResponse { + export interface Group { + /** Group creation date */ + createdAt?: string; + /** Name of the group */ + groupName?: string; + /** Group id */ + id?: string; + } + + export type SubAccounts = SubAccounts.Item[]; + + export namespace SubAccounts { + export interface Item { + /** Name of the sub-account organzation */ + companyName?: string; + /** Creation date of the sub-account organzation */ + createdAt?: string; + /** Id of the sub-account organzation */ + id?: number; + } + } + + export type Users = Users.Item[]; + + export namespace Users { + export interface Item { + /** Email address of the user */ + email?: string; + /** First name of the user */ + firstName?: string; + /** Last name of the user */ + lastName?: string; + } + } +} diff --git a/src/api/resources/masterAccount/types/GetCorporateInvitedUsersListResponse.ts b/src/api/resources/masterAccount/types/GetCorporateInvitedUsersListResponse.ts new file mode 100644 index 0000000..2032284 --- /dev/null +++ b/src/api/resources/masterAccount/types/GetCorporateInvitedUsersListResponse.ts @@ -0,0 +1,77 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCorporateInvitedUsersListResponse { + /** Get invited users list */ + users?: GetCorporateInvitedUsersListResponse.Users.Item[]; +} + +export namespace GetCorporateInvitedUsersListResponse { + export type Users = Users.Item[]; + + export namespace Users { + export interface Item { + /** Email address of the user. */ + email: string; + /** + * Feature accessiblity given to the user. (Required only + * if status is active) + */ + feature_access: Item.FeatureAccess; + /** Admin user groups list */ + groups: Item.Groups; + /** Flag for indicating is user owner of the organization. */ + is_owner: string; + /** Status of the invited user. */ + status: string; + } + + export namespace Item { + /** + * Feature accessiblity given to the user. (Required only + * if status is active) + */ + export interface FeatureAccess { + /** Analytics dashboard accessibility */ + analytics?: string[]; + /** Api keys accessiblity. */ + api_keys?: string[]; + /** + * Apps management accessiblity | Not available in + * ENTv2 + */ + apps_management?: string[]; + /** + * Authorization to create sub-organization in the + * admin account. If the user creating the + * sub-organization, belongs to a group, the user must + * choose a group at the sub-organization creation. + */ + create_sub_organizations?: string[]; + /** + * Authorization to manage and access sub-organizations + * in the admin account. + */ + manage_sub_organizations?: string[]; + /** My plan accessiblity. */ + my_plan?: string[]; + /** + * Group creation, modification or deletion + * accessibility + */ + sub_organization_groups?: string[]; + /** User management accessiblity. */ + user_management?: string[]; + } + + /** + * Admin user groups list + */ + export interface Groups { + /** group id */ + id?: string; + /** group name */ + name?: string; + } + } + } +} diff --git a/src/api/resources/masterAccount/types/GetCorporateIpResponseItem.ts b/src/api/resources/masterAccount/types/GetCorporateIpResponseItem.ts new file mode 100644 index 0000000..379af18 --- /dev/null +++ b/src/api/resources/masterAccount/types/GetCorporateIpResponseItem.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCorporateIpResponseItem { + domain?: string; + ip?: string; + transactional?: boolean; +} diff --git a/src/api/resources/masterAccount/types/GetCorporateMasterAccountResponse.ts b/src/api/resources/masterAccount/types/GetCorporateMasterAccountResponse.ts new file mode 100644 index 0000000..3e1755c --- /dev/null +++ b/src/api/resources/masterAccount/types/GetCorporateMasterAccountResponse.ts @@ -0,0 +1,116 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCorporateMasterAccountResponse { + /** Billing details of the master account organization */ + billingInfo?: GetCorporateMasterAccountResponse.BillingInfo; + /** Company name of master account organization */ + companyName?: string; + /** Currency code of the master account organization */ + currencyCode?: string; + /** Email id of master account */ + email?: string; + /** Unique identifier of the master account organization */ + id?: number; + /** Plan details */ + planInfo?: GetCorporateMasterAccountResponse.PlanInfo; + /** Timezone of the master account organization */ + timezone?: string; +} + +export namespace GetCorporateMasterAccountResponse { + /** + * Billing details of the master account organization + */ + export interface BillingInfo { + /** Billing address of master account */ + address?: BillingInfo.Address; + /** Company name of master account */ + companyName?: string; + /** Billing email id of master account */ + email?: string; + /** Billing name of master account holder */ + name?: BillingInfo.Name; + } + + export namespace BillingInfo { + /** + * Billing address of master account + */ + export interface Address { + /** Country code */ + countryCode?: string; + /** Locality */ + locality?: string; + /** Postal code */ + postalCode?: string; + /** State code */ + stateCode?: string; + /** Street address */ + streetAddress?: string; + } + + /** + * Billing name of master account holder + */ + export interface Name { + /** Last name for billing */ + familyName?: string; + /** First name for billing */ + givenName?: string; + } + } + + /** + * Plan details + */ + export interface PlanInfo { + /** Plan currency */ + currencyCode?: string; + /** List of provided features in the plan */ + features?: PlanInfo.Features.Item[]; + /** Timestamp of next billing date */ + nextBillingAt?: number; + /** Plan period type */ + planPeriod?: PlanInfo.PlanPeriod; + /** Plan amount */ + price?: number; + /** Number of sub-accounts */ + subAccounts?: number; + } + + export namespace PlanInfo { + export type Features = Features.Item[]; + + export namespace Features { + export interface Item { + /** Name of the feature */ + name?: string; + /** Quantity provided in the plan */ + quantity?: number; + /** + * Quantity with overages provided in the plan (only + * applicable on ENTv2) + */ + quantityWithOverages?: number; + /** Quantity remaining in the plan */ + remaining?: number; + /** Unit value of the feature */ + unitValue?: string; + /** Quantity consumed by master */ + used?: number; + /** + * Quantity consumed by sub-organizations over the + * admin plan limit (only applicable on ENTv2) + */ + usedOverages?: number; + } + } + + /** Plan period type */ + export const PlanPeriod = { + Month: "month", + Year: "year", + } as const; + export type PlanPeriod = (typeof PlanPeriod)[keyof typeof PlanPeriod]; + } +} diff --git a/src/api/resources/masterAccount/types/GetCorporateSubAccountIdResponse.ts b/src/api/resources/masterAccount/types/GetCorporateSubAccountIdResponse.ts new file mode 100644 index 0000000..98cd3e5 --- /dev/null +++ b/src/api/resources/masterAccount/types/GetCorporateSubAccountIdResponse.ts @@ -0,0 +1,172 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCorporateSubAccountIdResponse { + /** Sub-account company name */ + companyName?: string; + /** Email id of the sub-account organization */ + email?: string; + /** List of groups associated with the sub-account */ + groups?: GetCorporateSubAccountIdResponse.Groups.Item[]; + /** Name of the sub-account user */ + name?: string; + /** Sub-account plan details */ + planInfo?: GetCorporateSubAccountIdResponse.PlanInfo; +} + +export namespace GetCorporateSubAccountIdResponse { + export type Groups = Groups.Item[]; + + export namespace Groups { + export interface Item { + /** Group id */ + id?: string; + /** Name of the group */ + name?: string; + } + } + + /** + * Sub-account plan details + */ + export interface PlanInfo { + /** Credits quota and remaining credits on the sub-account */ + credits?: PlanInfo.Credits; + /** Features available on the sub-account */ + features?: PlanInfo.Features; + /** type of the plan */ + planType?: string; + } + + export namespace PlanInfo { + /** + * Credits quota and remaining credits on the sub-account + */ + export interface Credits { + /** Email credits remaining on the sub-account */ + emails?: Credits.Emails; + /** externalFeeds credits remaining on the sub-account */ + externalFeeds?: Credits.ExternalFeeds; + /** SMS credits remaining on the sub-account */ + sms?: Credits.Sms; + /** Whatsapp credits remaining on the sub-account */ + whatsapp?: Credits.Whatsapp; + /** Push credits remaining on the sub-account */ + wpSubscribers?: Credits.WpSubscribers; + } + + export namespace Credits { + /** + * Email credits remaining on the sub-account + */ + export interface Emails { + /** Quantity of email messaging limits provided */ + quantity?: number; + /** Available email messaging limits for use */ + remaining?: number; + } + + /** + * externalFeeds credits remaining on the sub-account + */ + export interface ExternalFeeds { + /** + * Quantity of externalFeeds messaging limits + * provided + */ + quantity?: number; + /** Available externalFeeds messaging limits for use */ + remaining?: number; + } + + /** + * SMS credits remaining on the sub-account + */ + export interface Sms { + /** Quantity of SMS messaging limits provided */ + quantity?: number; + /** Available SMS messaging limits for use */ + remaining?: number; + } + + /** + * Whatsapp credits remaining on the sub-account + */ + export interface Whatsapp { + /** Quantity of whatsapp messaging limits provided */ + quantity?: number; + /** Available whatsapp messaging limits for use */ + remaining?: number; + } + + /** + * Push credits remaining on the sub-account + */ + export interface WpSubscribers { + /** Quantity of Push sending limits provided */ + quantity?: number; + /** Available Push sending limits for use */ + remaining?: number; + } + } + + /** + * Features available on the sub-account + */ + export interface Features { + /** Inbox details / Not applicable on ENTv2 */ + inbox?: Features.Inbox; + /** Landing page details / Not applicable on ENTv2 */ + landingPage?: Features.LandingPage; + /** + * Sales and service users to use phone, sales and + * conversations + */ + salesUsers?: Features.SalesUsers; + /** Marketing users to manage the marketing channels */ + users?: Features.Users; + } + + export namespace Features { + /** + * Inbox details / Not applicable on ENTv2 + */ + export interface Inbox { + /** Quantity of inbox provided */ + quantity?: number; + /** Available inboxes for use */ + remaining?: number; + } + + /** + * Landing page details / Not applicable on ENTv2 + */ + export interface LandingPage { + /** Quantity of landing pages provided */ + quantity?: number; + /** Available landing pages for use */ + remaining?: number; + } + + /** + * Sales and service users to use phone, sales and + * conversations + */ + export interface SalesUsers { + /** Quantity of sales users provided */ + quantity?: number; + /** Available sales users for use */ + remaining?: number; + } + + /** + * Marketing users to manage the marketing channels + */ + export interface Users { + /** Quantity of marketing users provided */ + quantity?: number; + /** Available marketing users for use */ + remaining?: number; + } + } + } +} diff --git a/src/api/resources/masterAccount/types/GetCorporateSubAccountResponse.ts b/src/api/resources/masterAccount/types/GetCorporateSubAccountResponse.ts new file mode 100644 index 0000000..36ccd8e --- /dev/null +++ b/src/api/resources/masterAccount/types/GetCorporateSubAccountResponse.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCorporateSubAccountResponse { + /** Total number of subaccounts */ + count?: number; + subAccounts?: GetCorporateSubAccountResponse.SubAccounts.Item[]; +} + +export namespace GetCorporateSubAccountResponse { + export type SubAccounts = SubAccounts.Item[]; + + export namespace SubAccounts { + export interface Item { + /** Whether the sub-account is active or not */ + active: boolean; + /** Name of the sub-account company */ + companyName: string; + /** Timestamp when the sub-account was created */ + createdAt: number; + /** Group details */ + groups: Item.Groups.Item[]; + /** id of the sub-account */ + id: number; + } + + export namespace Item { + export type Groups = Groups.Item[]; + + export namespace Groups { + export interface Item { + /** Group identifier */ + id?: string; + /** Name of the group */ + name?: string; + } + } + } + } +} diff --git a/src/api/resources/masterAccount/types/GetCorporateUserPermissionResponse.ts b/src/api/resources/masterAccount/types/GetCorporateUserPermissionResponse.ts new file mode 100644 index 0000000..6f01227 --- /dev/null +++ b/src/api/resources/masterAccount/types/GetCorporateUserPermissionResponse.ts @@ -0,0 +1,52 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Check admin user permissions + */ +export interface GetCorporateUserPermissionResponse { + /** Email address of the user. */ + email: string; + /** Granular feature permissions given to the user. */ + feature_access: GetCorporateUserPermissionResponse.FeatureAccess; + groups: GetCorporateUserPermissionResponse.Groups.Item[]; + /** Status of the invited user. */ + status: string; +} + +export namespace GetCorporateUserPermissionResponse { + /** + * Granular feature permissions given to the user. + */ + export interface FeatureAccess { + /** Permission on analytics */ + analytics?: string[]; + /** Permission on api keys */ + api_keys?: string[]; + /** Permission on apps management */ + apps_management?: string[]; + /** Permission on create sub-accounts */ + create_sub_organizations?: string[]; + /** Permission on manage sub-accounts */ + manage_sub_organizations?: string[]; + /** Permission on my plan */ + my_plan?: string[]; + /** Permission on groups */ + sub_organization_groups?: string[]; + /** Permission on user management */ + user_management?: string[]; + } + + export type Groups = Groups.Item[]; + + export namespace Groups { + /** + * Groups details + */ + export interface Item { + /** group identifier */ + id?: string; + /** Group name */ + name?: string; + } + } +} diff --git a/src/api/resources/masterAccount/types/GetSubAccountGroupsResponseItem.ts b/src/api/resources/masterAccount/types/GetSubAccountGroupsResponseItem.ts new file mode 100644 index 0000000..565b10f --- /dev/null +++ b/src/api/resources/masterAccount/types/GetSubAccountGroupsResponseItem.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSubAccountGroupsResponseItem { + /** The name of the group of sub-accounts */ + groupName?: string; + /** Unique id of the group */ + id?: string; +} diff --git a/src/api/resources/masterAccount/types/InviteAdminUserResponse.ts b/src/api/resources/masterAccount/types/InviteAdminUserResponse.ts new file mode 100644 index 0000000..c55abbc --- /dev/null +++ b/src/api/resources/masterAccount/types/InviteAdminUserResponse.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface InviteAdminUserResponse { + id?: string; +} diff --git a/src/api/resources/masterAccount/types/PostCorporateGroupResponse.ts b/src/api/resources/masterAccount/types/PostCorporateGroupResponse.ts new file mode 100644 index 0000000..b0cfbf7 --- /dev/null +++ b/src/api/resources/masterAccount/types/PostCorporateGroupResponse.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostCorporateGroupResponse { + id?: string; +} diff --git a/src/api/resources/masterAccount/types/PostCorporateSubAccountKeyResponse.ts b/src/api/resources/masterAccount/types/PostCorporateSubAccountKeyResponse.ts new file mode 100644 index 0000000..e6201e7 --- /dev/null +++ b/src/api/resources/masterAccount/types/PostCorporateSubAccountKeyResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostCorporateSubAccountKeyResponse { + /** API key */ + key: string; + /** Status of the API operation. */ + status: string; +} diff --git a/src/api/resources/masterAccount/types/PostCorporateSubAccountResponse.ts b/src/api/resources/masterAccount/types/PostCorporateSubAccountResponse.ts new file mode 100644 index 0000000..b2888d6 --- /dev/null +++ b/src/api/resources/masterAccount/types/PostCorporateSubAccountResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostCorporateSubAccountResponse { + /** ID of the sub-account created */ + id: number; +} diff --git a/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailRequestAction.ts b/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailRequestAction.ts new file mode 100644 index 0000000..9d01b42 --- /dev/null +++ b/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailRequestAction.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const PutCorporateUserInvitationActionEmailRequestAction = { + Resend: "resend", + Cancel: "cancel", +} as const; +export type PutCorporateUserInvitationActionEmailRequestAction = + (typeof PutCorporateUserInvitationActionEmailRequestAction)[keyof typeof PutCorporateUserInvitationActionEmailRequestAction]; diff --git a/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailResponse.ts b/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailResponse.ts new file mode 100644 index 0000000..d2033a0 --- /dev/null +++ b/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PutCorporateUserInvitationActionEmailResponse { + /** Action success message */ + message?: string; +} diff --git a/src/api/resources/masterAccount/types/index.ts b/src/api/resources/masterAccount/types/index.ts new file mode 100644 index 0000000..66fba3e --- /dev/null +++ b/src/api/resources/masterAccount/types/index.ts @@ -0,0 +1,14 @@ +export * from "./GetCorporateGroupIdResponse.js"; +export * from "./GetCorporateInvitedUsersListResponse.js"; +export * from "./GetCorporateIpResponseItem.js"; +export * from "./GetCorporateMasterAccountResponse.js"; +export * from "./GetCorporateSubAccountIdResponse.js"; +export * from "./GetCorporateSubAccountResponse.js"; +export * from "./GetCorporateUserPermissionResponse.js"; +export * from "./GetSubAccountGroupsResponseItem.js"; +export * from "./InviteAdminUserResponse.js"; +export * from "./PostCorporateGroupResponse.js"; +export * from "./PostCorporateSubAccountKeyResponse.js"; +export * from "./PostCorporateSubAccountResponse.js"; +export * from "./PutCorporateUserInvitationActionEmailRequestAction.js"; +export * from "./PutCorporateUserInvitationActionEmailResponse.js"; diff --git a/src/api/resources/notes/client/Client.ts b/src/api/resources/notes/client/Client.ts new file mode 100644 index 0000000..739efba --- /dev/null +++ b/src/api/resources/notes/client/Client.ts @@ -0,0 +1,385 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace NotesClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class NotesClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: NotesClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetCrmNotesRequest} request + * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.notes.getAllNotes() + */ + public getAllNotes( + request: Brevo.GetCrmNotesRequest = {}, + requestOptions?: NotesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAllNotes(request, requestOptions)); + } + + private async __getAllNotes( + request: Brevo.GetCrmNotesRequest = {}, + requestOptions?: NotesClient.RequestOptions, + ): Promise> { + const { entity, entityIds, dateFrom, dateTo, offset, limit, sort } = request; + const _queryParams: Record = { + entity: entity != null ? entity : undefined, + entityIds, + dateFrom, + dateTo, + offset, + limit, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/notes", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Note[], rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/notes"); + } + + /** + * @param {Brevo.NoteData} request + * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnsupportedMediaTypeError} + * + * @example + * await client.notes.createANote({ + * text: "In communication with client_dev for resolution of queries." + * }) + */ + public createANote( + request: Brevo.NoteData, + requestOptions?: NotesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createANote(request, requestOptions)); + } + + private async __createANote( + request: Brevo.NoteData, + requestOptions?: NotesClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/notes", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostCrmNotesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 415: + throw new Brevo.UnsupportedMediaTypeError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/notes"); + } + + /** + * @param {Brevo.GetCrmNotesIdRequest} request + * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.notes.getANote({ + * id: "id" + * }) + */ + public getANote( + request: Brevo.GetCrmNotesIdRequest, + requestOptions?: NotesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getANote(request, requestOptions)); + } + + private async __getANote( + request: Brevo.GetCrmNotesIdRequest, + requestOptions?: NotesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/notes/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Note, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/notes/{id}"); + } + + /** + * @param {Brevo.DeleteCrmNotesIdRequest} request + * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.notes.deleteANote({ + * id: "id" + * }) + */ + public deleteANote( + request: Brevo.DeleteCrmNotesIdRequest, + requestOptions?: NotesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteANote(request, requestOptions)); + } + + private async __deleteANote( + request: Brevo.DeleteCrmNotesIdRequest, + requestOptions?: NotesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/notes/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/crm/notes/{id}"); + } + + /** + * @param {Brevo.PatchCrmNotesIdRequest} request + * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnsupportedMediaTypeError} + * + * @example + * await client.notes.updateANote({ + * id: "id", + * body: { + * text: "In communication with client_dev for resolution of queries." + * } + * }) + */ + public updateANote( + request: Brevo.PatchCrmNotesIdRequest, + requestOptions?: NotesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateANote(request, requestOptions)); + } + + private async __updateANote( + request: Brevo.PatchCrmNotesIdRequest, + requestOptions?: NotesClient.RequestOptions, + ): Promise> { + const { id, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/notes/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 415: + throw new Brevo.UnsupportedMediaTypeError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/crm/notes/{id}"); + } +} diff --git a/src/api/resources/notes/client/index.ts b/src/api/resources/notes/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/notes/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/notes/client/requests/DeleteCrmNotesIdRequest.ts b/src/api/resources/notes/client/requests/DeleteCrmNotesIdRequest.ts new file mode 100644 index 0000000..73006db --- /dev/null +++ b/src/api/resources/notes/client/requests/DeleteCrmNotesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteCrmNotesIdRequest { + /** Note ID to delete */ + id: string; +} diff --git a/src/api/resources/notes/client/requests/GetCrmNotesIdRequest.ts b/src/api/resources/notes/client/requests/GetCrmNotesIdRequest.ts new file mode 100644 index 0000000..e1e5b6e --- /dev/null +++ b/src/api/resources/notes/client/requests/GetCrmNotesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCrmNotesIdRequest { + /** Note ID to get */ + id: string; +} diff --git a/src/api/resources/notes/client/requests/GetCrmNotesRequest.ts b/src/api/resources/notes/client/requests/GetCrmNotesRequest.ts new file mode 100644 index 0000000..60d5075 --- /dev/null +++ b/src/api/resources/notes/client/requests/GetCrmNotesRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetCrmNotesRequest { + /** Filter by note entity type */ + entity?: Brevo.GetCrmNotesRequestEntity; + /** Filter by note entity IDs */ + entityIds?: string; + /** dateFrom to date range filter type (timestamp in milliseconds) */ + dateFrom?: number; + /** dateTo to date range filter type (timestamp in milliseconds) */ + dateTo?: number; + /** Index of the first document of the page */ + offset?: number; + /** Number of documents per page */ + limit?: number; + /** Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed */ + sort?: Brevo.GetCrmNotesRequestSort; +} diff --git a/src/api/resources/notes/client/requests/PatchCrmNotesIdRequest.ts b/src/api/resources/notes/client/requests/PatchCrmNotesIdRequest.ts new file mode 100644 index 0000000..e5ee5c9 --- /dev/null +++ b/src/api/resources/notes/client/requests/PatchCrmNotesIdRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * id: "id", + * body: { + * text: "In communication with client_dev for resolution of queries." + * } + * } + */ +export interface PatchCrmNotesIdRequest { + /** Note ID to update */ + id: string; + body: Brevo.NoteData; +} diff --git a/src/api/resources/notes/client/requests/index.ts b/src/api/resources/notes/client/requests/index.ts new file mode 100644 index 0000000..85d9e66 --- /dev/null +++ b/src/api/resources/notes/client/requests/index.ts @@ -0,0 +1,4 @@ +export type { DeleteCrmNotesIdRequest } from "./DeleteCrmNotesIdRequest.js"; +export type { GetCrmNotesIdRequest } from "./GetCrmNotesIdRequest.js"; +export type { GetCrmNotesRequest } from "./GetCrmNotesRequest.js"; +export type { PatchCrmNotesIdRequest } from "./PatchCrmNotesIdRequest.js"; diff --git a/src/api/resources/notes/index.ts b/src/api/resources/notes/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/notes/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/notes/types/GetCrmNotesRequestEntity.ts b/src/api/resources/notes/types/GetCrmNotesRequestEntity.ts new file mode 100644 index 0000000..201bed1 --- /dev/null +++ b/src/api/resources/notes/types/GetCrmNotesRequestEntity.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCrmNotesRequestEntity = { + Companies: "companies", + Deals: "deals", + Contacts: "contacts", +} as const; +export type GetCrmNotesRequestEntity = (typeof GetCrmNotesRequestEntity)[keyof typeof GetCrmNotesRequestEntity]; diff --git a/src/api/resources/notes/types/GetCrmNotesRequestSort.ts b/src/api/resources/notes/types/GetCrmNotesRequestSort.ts new file mode 100644 index 0000000..a647202 --- /dev/null +++ b/src/api/resources/notes/types/GetCrmNotesRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCrmNotesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetCrmNotesRequestSort = (typeof GetCrmNotesRequestSort)[keyof typeof GetCrmNotesRequestSort]; diff --git a/src/api/resources/notes/types/PostCrmNotesResponse.ts b/src/api/resources/notes/types/PostCrmNotesResponse.ts new file mode 100644 index 0000000..ae1760f --- /dev/null +++ b/src/api/resources/notes/types/PostCrmNotesResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Updated Note ID + */ +export interface PostCrmNotesResponse { + /** Unique note Id */ + id?: string; +} diff --git a/src/api/resources/notes/types/index.ts b/src/api/resources/notes/types/index.ts new file mode 100644 index 0000000..e5ef918 --- /dev/null +++ b/src/api/resources/notes/types/index.ts @@ -0,0 +1,3 @@ +export * from "./GetCrmNotesRequestEntity.js"; +export * from "./GetCrmNotesRequestSort.js"; +export * from "./PostCrmNotesResponse.js"; diff --git a/src/api/resources/payments/client/Client.ts b/src/api/resources/payments/client/Client.ts new file mode 100644 index 0000000..90f2f7a --- /dev/null +++ b/src/api/resources/payments/client/Client.ts @@ -0,0 +1,247 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace PaymentsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class PaymentsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: PaymentsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.CreatePaymentRequestRequest} request + * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.payments.createPaymentRequest({ + * cart: { + * currency: "EUR", + * specificAmount: 1200 + * }, + * contactId: 43, + * reference: "Invoice #INV0001" + * }) + */ + public createPaymentRequest( + request: Brevo.CreatePaymentRequestRequest, + requestOptions?: PaymentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createPaymentRequest(request, requestOptions)); + } + + private async __createPaymentRequest( + request: Brevo.CreatePaymentRequestRequest, + requestOptions?: PaymentsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "payments/requests", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreatePaymentRequestResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/payments/requests"); + } + + /** + * @param {Brevo.GetPaymentRequestRequest} request + * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.payments.getPaymentRequest({ + * id: "050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc" + * }) + */ + public getPaymentRequest( + request: Brevo.GetPaymentRequestRequest, + requestOptions?: PaymentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getPaymentRequest(request, requestOptions)); + } + + private async __getPaymentRequest( + request: Brevo.GetPaymentRequestRequest, + requestOptions?: PaymentsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `payments/requests/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetPaymentRequestResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/payments/requests/{id}"); + } + + /** + * @param {Brevo.DeletePaymentRequestRequest} request + * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.payments.deletePaymentRequest({ + * id: "9ae7d68a-565c-4695-9381-d8fb3e3a14cc" + * }) + */ + public deletePaymentRequest( + request: Brevo.DeletePaymentRequestRequest, + requestOptions?: PaymentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deletePaymentRequest(request, requestOptions)); + } + + private async __deletePaymentRequest( + request: Brevo.DeletePaymentRequestRequest, + requestOptions?: PaymentsClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `payments/requests/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/payments/requests/{id}"); + } +} diff --git a/src/api/resources/payments/client/index.ts b/src/api/resources/payments/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/payments/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/payments/client/requests/CreatePaymentRequestRequest.ts b/src/api/resources/payments/client/requests/CreatePaymentRequestRequest.ts new file mode 100644 index 0000000..59edfd3 --- /dev/null +++ b/src/api/resources/payments/client/requests/CreatePaymentRequestRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * cart: { + * currency: "EUR", + * specificAmount: 1200 + * }, + * contactId: 43, + * reference: "Invoice #INV0001" + * } + */ +export interface CreatePaymentRequestRequest { + cart: Brevo.Cart; + configuration?: Brevo.Configuration; + /** Brevo ID of the contact requested to pay. */ + contactId: number; + /** Description of payment request. */ + description?: string; + notification?: Brevo.Notification; + /** Reference of the payment request, it will appear on the payment page. */ + reference: string; +} diff --git a/src/api/resources/payments/client/requests/DeletePaymentRequestRequest.ts b/src/api/resources/payments/client/requests/DeletePaymentRequestRequest.ts new file mode 100644 index 0000000..6432cea --- /dev/null +++ b/src/api/resources/payments/client/requests/DeletePaymentRequestRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "9ae7d68a-565c-4695-9381-d8fb3e3a14cc" + * } + */ +export interface DeletePaymentRequestRequest { + /** ID of the payment request. */ + id: string; +} diff --git a/src/api/resources/payments/client/requests/GetPaymentRequestRequest.ts b/src/api/resources/payments/client/requests/GetPaymentRequestRequest.ts new file mode 100644 index 0000000..2c2f2ea --- /dev/null +++ b/src/api/resources/payments/client/requests/GetPaymentRequestRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc" + * } + */ +export interface GetPaymentRequestRequest { + /** Id of the payment Request */ + id: string; +} diff --git a/src/api/resources/payments/client/requests/index.ts b/src/api/resources/payments/client/requests/index.ts new file mode 100644 index 0000000..007b803 --- /dev/null +++ b/src/api/resources/payments/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { CreatePaymentRequestRequest } from "./CreatePaymentRequestRequest.js"; +export type { DeletePaymentRequestRequest } from "./DeletePaymentRequestRequest.js"; +export type { GetPaymentRequestRequest } from "./GetPaymentRequestRequest.js"; diff --git a/src/api/resources/payments/index.ts b/src/api/resources/payments/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/payments/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/payments/types/CreatePaymentRequestResponse.ts b/src/api/resources/payments/types/CreatePaymentRequestResponse.ts new file mode 100644 index 0000000..e59a851 --- /dev/null +++ b/src/api/resources/payments/types/CreatePaymentRequestResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreatePaymentRequestResponse { + /** ID of the object created */ + id: number; + /** URL of the payment request created */ + url?: string; +} diff --git a/src/api/resources/payments/types/GetPaymentRequestResponse.ts b/src/api/resources/payments/types/GetPaymentRequestResponse.ts new file mode 100644 index 0000000..a02d924 --- /dev/null +++ b/src/api/resources/payments/types/GetPaymentRequestResponse.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetPaymentRequestResponse { + cart: Brevo.Cart; + configuration?: Brevo.Configuration; + /** Brevo ID of the contact requested to pay. */ + contactId?: number; + notification: Brevo.Notification; + /** number of reminders sent. */ + numberOfRemindersSent?: number; + /** Reference of the payment request, it will appear on the payment page. */ + reference: string; + /** Status of the payment request. */ + status: GetPaymentRequestResponse.Status; +} + +export namespace GetPaymentRequestResponse { + /** Status of the payment request. */ + export const Status = { + Created: "created", + Sent: "sent", + ReminderSent: "reminderSent", + Paid: "paid", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; +} diff --git a/src/api/resources/payments/types/index.ts b/src/api/resources/payments/types/index.ts new file mode 100644 index 0000000..5707c84 --- /dev/null +++ b/src/api/resources/payments/types/index.ts @@ -0,0 +1,2 @@ +export * from "./CreatePaymentRequestResponse.js"; +export * from "./GetPaymentRequestResponse.js"; diff --git a/src/api/resources/process/client/Client.ts b/src/api/resources/process/client/Client.ts new file mode 100644 index 0000000..2e24f26 --- /dev/null +++ b/src/api/resources/process/client/Client.ts @@ -0,0 +1,209 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace ProcessClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ProcessClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ProcessClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Retrieves a list of background processes from your Brevo account with filtering and pagination. + * + * **Use this to:** + * - Monitor background process activity and status + * - Track long-running operations and tasks + * - Find process IDs for detailed status checking + * - Review process history and performance + * - Identify failed or stuck processes for troubleshooting + * + * **Key information returned:** + * - Process details (ID, name, type, status) + * - Process creation and completion timestamps + * - Process progress and completion status + * - Error information for failed processes + * - Process result data and download links + * + * **Important considerations:** + * - Background processes handle long-running operations like imports and exports + * - Process status indicates current state (queued, processing, completed, failed, cancelled) + * - Export processes provide download URLs when completed + * - Failed processes include error messages for troubleshooting + * - Use pagination for accounts with many historical processes + * - Sort options available for creation order (ascending or descending) + * - Different process types handle specific operations (imports, exports, calculations) + * + * @param {Brevo.GetProcessesRequest} request + * @param {ProcessClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.process.getProcesses() + */ + public getProcesses( + request: Brevo.GetProcessesRequest = {}, + requestOptions?: ProcessClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getProcesses(request, requestOptions)); + } + + private async __getProcesses( + request: Brevo.GetProcessesRequest = {}, + requestOptions?: ProcessClient.RequestOptions, + ): Promise> { + const { limit, offset, sort } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "processes", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetProcessesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/processes"); + } + + /** + * Retrieves detailed information about a specific background process. + * + * **Use this to:** + * - Get detailed status of a specific process + * - Monitor process progress and completion + * - Download results from completed export processes + * - Check error details for failed processes + * - Track process execution times + * + * **Key information returned:** + * - Complete process details and status + * - Import/export statistics and results + * - Error information for troubleshooting + * - Download URLs for export processes + * - Process timing and performance data + * + * **Important considerations:** + * - Process ID must exist in your account + * - Completed processes provide detailed statistics and results + * - Export processes include download URLs when successful + * - Failed processes contain error messages for debugging + * - Timing information helps with performance analysis + * - Different process types return different result structures + * + * @param {Brevo.GetProcessRequest} request + * @param {ProcessClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.process.getProcess({ + * processId: 1000000 + * }) + */ + public getProcess( + request: Brevo.GetProcessRequest, + requestOptions?: ProcessClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getProcess(request, requestOptions)); + } + + private async __getProcess( + request: Brevo.GetProcessRequest, + requestOptions?: ProcessClient.RequestOptions, + ): Promise> { + const { processId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `processes/${core.url.encodePathParam(processId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetProcessResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/processes/{processId}"); + } +} diff --git a/src/api/resources/process/client/index.ts b/src/api/resources/process/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/process/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/process/client/requests/GetProcessRequest.ts b/src/api/resources/process/client/requests/GetProcessRequest.ts new file mode 100644 index 0000000..8ead15f --- /dev/null +++ b/src/api/resources/process/client/requests/GetProcessRequest.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * processId: 1000000 + * } + * + * @example + * { + * processId: 1000000 + * } + * + * @example + * { + * processId: 1000000 + * } + * + * @example + * { + * processId: 1000000 + * } + */ +export interface GetProcessRequest { + /** Id of the process */ + processId: number; +} diff --git a/src/api/resources/process/client/requests/GetProcessesRequest.ts b/src/api/resources/process/client/requests/GetProcessesRequest.ts new file mode 100644 index 0000000..00e5603 --- /dev/null +++ b/src/api/resources/process/client/requests/GetProcessesRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetProcessesRequest { + /** Number limitation for the result returned */ + limit?: number; + /** Beginning point in the list to retrieve from. */ + offset?: number; + /** + * Sort the results in the ascending/descending order of record creation. + * Default order is **descending** if `sort` is not passed + */ + sort?: Brevo.GetProcessesRequestSort; +} diff --git a/src/api/resources/process/client/requests/index.ts b/src/api/resources/process/client/requests/index.ts new file mode 100644 index 0000000..bb7db56 --- /dev/null +++ b/src/api/resources/process/client/requests/index.ts @@ -0,0 +1,2 @@ +export type { GetProcessesRequest } from "./GetProcessesRequest.js"; +export type { GetProcessRequest } from "./GetProcessRequest.js"; diff --git a/src/api/resources/process/index.ts b/src/api/resources/process/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/process/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/process/types/GetProcessResponse.ts b/src/api/resources/process/types/GetProcessResponse.ts new file mode 100644 index 0000000..7b283c8 --- /dev/null +++ b/src/api/resources/process/types/GetProcessResponse.ts @@ -0,0 +1,85 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetProcessResponse { + /** Unique identifier of the process */ + id: number; + /** Name/type of the process */ + name: GetProcessResponse.Name; + /** Current status of the process */ + status: GetProcessResponse.Status; + /** Additional process information (for completed processes) */ + info?: GetProcessResponse.Info | null; + /** Download URL for completed export processes */ + export_url?: string | null; + /** Error message for failed processes */ + error?: string | null; + /** Process creation timestamp */ + created_at?: string | null; + /** Process completion timestamp */ + completed_at?: string | null; +} + +export namespace GetProcessResponse { + /** Name/type of the process */ + export const Name = { + Importuser: "IMPORTUSER", + SearchExportUsers: "SEARCH_EXPORT_USERS", + TransCalc: "TRANS-CALC", + TransGlobalCalc: "TRANS-GLOBAL-CALC", + CampaignProcessing: "CAMPAIGN_PROCESSING", + ListExport: "LIST_EXPORT", + ContactExport: "CONTACT_EXPORT", + } as const; + export type Name = (typeof Name)[keyof typeof Name]; + /** Current status of the process */ + export const Status = { + Queued: "queued", + Processing: "processing", + Completed: "completed", + Failed: "failed", + Cancelled: "cancelled", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; + + /** + * Additional process information (for completed processes) + */ + export interface Info { + /** Import process details */ + import?: Info.Import; + /** Export process details */ + export?: Info.Export; + } + + export namespace Info { + /** + * Import process details + */ + export interface Import { + /** Number of invalid email addresses */ + invalid_emails?: number | null; + /** Number of duplicate contact IDs */ + duplicate_contact_id?: number | null; + /** Number of duplicate external IDs */ + duplicate_ext_id?: number | null; + /** Number of duplicate email IDs */ + duplicate_email_id?: number | null; + /** Number of duplicate phone numbers */ + duplicate_phone_id?: number | null; + /** Number of duplicate WhatsApp numbers */ + duplicate_whatsapp_id?: number | null; + /** Number of duplicate landline numbers */ + duplicate_landline_number_id?: number | null; + } + + /** + * Export process details + */ + export interface Export { + /** Total number of exported records */ + total_records?: number; + /** Size of exported file in bytes */ + file_size?: number; + } + } +} diff --git a/src/api/resources/process/types/GetProcessesRequestSort.ts b/src/api/resources/process/types/GetProcessesRequestSort.ts new file mode 100644 index 0000000..fce9174 --- /dev/null +++ b/src/api/resources/process/types/GetProcessesRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetProcessesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetProcessesRequestSort = (typeof GetProcessesRequestSort)[keyof typeof GetProcessesRequestSort]; diff --git a/src/api/resources/process/types/GetProcessesResponse.ts b/src/api/resources/process/types/GetProcessesResponse.ts new file mode 100644 index 0000000..ada1b5e --- /dev/null +++ b/src/api/resources/process/types/GetProcessesResponse.ts @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetProcessesResponse { + /** Total number of processes available on your account */ + count: number; + /** List of background processes on your account */ + processes: GetProcessesResponse.Processes.Item[]; +} + +export namespace GetProcessesResponse { + export type Processes = Processes.Item[]; + + export namespace Processes { + export interface Item { + /** Unique identifier of the process */ + id: number; + /** Name/type of the process */ + name: Item.Name; + /** Current status of the process */ + status: Item.Status; + /** Additional process information (for completed processes) */ + info?: Item.Info | null; + /** Download URL for completed export processes */ + export_url?: string | null; + /** Error message for failed processes */ + error?: string | null; + /** Process creation timestamp */ + created_at?: string | null; + /** Process completion timestamp */ + completed_at?: string | null; + } + + export namespace Item { + /** Name/type of the process */ + export const Name = { + Importuser: "IMPORTUSER", + SearchExportUsers: "SEARCH_EXPORT_USERS", + TransCalc: "TRANS-CALC", + TransGlobalCalc: "TRANS-GLOBAL-CALC", + CampaignProcessing: "CAMPAIGN_PROCESSING", + ListExport: "LIST_EXPORT", + ContactExport: "CONTACT_EXPORT", + } as const; + export type Name = (typeof Name)[keyof typeof Name]; + /** Current status of the process */ + export const Status = { + Queued: "queued", + Processing: "processing", + Completed: "completed", + Failed: "failed", + Cancelled: "cancelled", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; + + /** + * Additional process information (for completed processes) + */ + export interface Info { + /** Import process details */ + import?: Info.Import; + /** Export process details */ + export?: Info.Export; + } + + export namespace Info { + /** + * Import process details + */ + export interface Import { + /** Number of invalid email addresses */ + invalid_emails?: number | null; + /** Number of duplicate contact IDs */ + duplicate_contact_id?: number | null; + /** Number of duplicate external IDs */ + duplicate_ext_id?: number | null; + /** Number of duplicate email IDs */ + duplicate_email_id?: number | null; + /** Number of duplicate phone numbers */ + duplicate_phone_id?: number | null; + /** Number of duplicate WhatsApp numbers */ + duplicate_whatsapp_id?: number | null; + /** Number of duplicate landline numbers */ + duplicate_landline_number_id?: number | null; + } + + /** + * Export process details + */ + export interface Export { + /** Total number of exported records */ + total_records?: number; + /** Size of exported file in bytes */ + file_size?: number; + } + } + } + } +} diff --git a/src/api/resources/process/types/index.ts b/src/api/resources/process/types/index.ts new file mode 100644 index 0000000..6b93a00 --- /dev/null +++ b/src/api/resources/process/types/index.ts @@ -0,0 +1,3 @@ +export * from "./GetProcessesRequestSort.js"; +export * from "./GetProcessesResponse.js"; +export * from "./GetProcessResponse.js"; diff --git a/src/api/resources/program/client/Client.ts b/src/api/resources/program/client/Client.ts new file mode 100644 index 0000000..35e679a --- /dev/null +++ b/src/api/resources/program/client/Client.ts @@ -0,0 +1,1028 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace ProgramClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class ProgramClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: ProgramClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Returns list of loyalty programs + * + * @param {Brevo.GetLpListRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.getLpList() + */ + public getLpList( + request: Brevo.GetLpListRequest = {}, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getLpList(request, requestOptions)); + } + + private async __getLpList( + request: Brevo.GetLpListRequest = {}, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { limit, offset, sort_field: sortField, sort } = request; + const _queryParams: Record = { + limit, + offset, + sort_field: sortField != null ? sortField : undefined, + sort, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "loyalty/config/programs", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetLpListResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/loyalty/config/programs"); + } + + /** + * Creates loyalty program + * + * @param {Brevo.CreateNewLpRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.ConflictError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.createNewLp({ + * name: "name" + * }) + */ + public createNewLp( + request: Brevo.CreateNewLpRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createNewLp(request, requestOptions)); + } + + private async __createNewLp( + request: Brevo.CreateNewLpRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "loyalty/config/programs", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.LoyaltyProgram, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Brevo.ConflictError(_response.error.body as Brevo.ErrorModel, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/loyalty/config/programs"); + } + + /** + * Returns loyalty program + * + * @param {Brevo.GetLoyaltyProgramInfoRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.getLoyaltyProgramInfo({ + * pid: "pid" + * }) + */ + public getLoyaltyProgramInfo( + request: Brevo.GetLoyaltyProgramInfoRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getLoyaltyProgramInfo(request, requestOptions)); + } + + private async __getLoyaltyProgramInfo( + request: Brevo.GetLoyaltyProgramInfoRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.LoyaltyProgram, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/config/programs/{pid}", + ); + } + + /** + * Updates loyalty program + * + * @param {Brevo.UpdateLoyaltyProgramRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.ConflictError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.updateLoyaltyProgram({ + * pid: "pid", + * name: "name" + * }) + */ + public updateLoyaltyProgram( + request: Brevo.UpdateLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateLoyaltyProgram(request, requestOptions)); + } + + private async __updateLoyaltyProgram( + request: Brevo.UpdateLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.LoyaltyProgram, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Brevo.ConflictError(_response.error.body as Brevo.ErrorModel, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/loyalty/config/programs/{pid}", + ); + } + + /** + * Deletes Loyalty Program + * + * @param {Brevo.DeleteLoyaltyProgramRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.deleteLoyaltyProgram({ + * pid: "pid" + * }) + */ + public deleteLoyaltyProgram( + request: Brevo.DeleteLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteLoyaltyProgram(request, requestOptions)); + } + + private async __deleteLoyaltyProgram( + request: Brevo.DeleteLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/config/programs/{pid}", + ); + } + + /** + * Partially updates loyalty program + * + * @param {Brevo.PartiallyUpdateLoyaltyProgramRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.ConflictError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.partiallyUpdateLoyaltyProgram({ + * pid: "pid" + * }) + */ + public partiallyUpdateLoyaltyProgram( + request: Brevo.PartiallyUpdateLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__partiallyUpdateLoyaltyProgram(request, requestOptions)); + } + + private async __partiallyUpdateLoyaltyProgram( + request: Brevo.PartiallyUpdateLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.LoyaltyProgram, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Brevo.ConflictError(_response.error.body as Brevo.ErrorModel, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/loyalty/config/programs/{pid}", + ); + } + + /** + * Get Information of balances, tiers, rewards and subscription members for a subscription + * + * @param {Brevo.GetParameterSubscriptionInfoRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.getParameterSubscriptionInfo({ + * pid: "pid" + * }) + */ + public getParameterSubscriptionInfo( + request: Brevo.GetParameterSubscriptionInfoRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getParameterSubscriptionInfo(request, requestOptions)); + } + + private async __getParameterSubscriptionInfo( + request: Brevo.GetParameterSubscriptionInfoRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid, contactId, params, loyaltySubscriptionId } = request; + const _queryParams: Record = { + contactId, + params, + loyaltySubscriptionId, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}/account-info`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetParameterSubscriptionInfoResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/config/programs/{pid}/account-info", + ); + } + + /** + * Publishes loyalty program + * + * @param {Brevo.PublishLoyaltyProgramRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.publishLoyaltyProgram({ + * pid: "pid" + * }) + */ + public publishLoyaltyProgram( + request: Brevo.PublishLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__publishLoyaltyProgram(request, requestOptions)); + } + + private async __publishLoyaltyProgram( + request: Brevo.PublishLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}/publish`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/config/programs/{pid}/publish", + ); + } + + /** + * Add member to a subscription + * + * @param {Brevo.SubscribeMemberToASubscriptionRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.ConflictError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.subscribeMemberToASubscription({ + * pid: "pid", + * memberContactIds: [1] + * }) + */ + public subscribeMemberToASubscription( + request: Brevo.SubscribeMemberToASubscriptionRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__subscribeMemberToASubscription(request, requestOptions)); + } + + private async __subscribeMemberToASubscription( + request: Brevo.SubscribeMemberToASubscriptionRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}/subscription-members`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.SubscribeMemberToASubscriptionResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Brevo.ConflictError(_response.error.body as Brevo.ErrorModel, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/config/programs/{pid}/subscription-members", + ); + } + + /** + * Deletes member from a subscription + * + * @param {Brevo.DeleteContactMembersRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.deleteContactMembers({ + * pid: "pid", + * memberContactIds: "memberContactIds" + * }) + */ + public deleteContactMembers( + request: Brevo.DeleteContactMembersRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteContactMembers(request, requestOptions)); + } + + private async __deleteContactMembers( + request: Brevo.DeleteContactMembersRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid, memberContactIds } = request; + const _queryParams: Record = { + memberContactIds, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}/subscription-members`, + ), + method: "DELETE", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/config/programs/{pid}/subscription-members", + ); + } + + /** + * Subscribes to a loyalty program + * + * @param {Brevo.SubscribeToLoyaltyProgramRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.subscribeToLoyaltyProgram({ + * pid: "pid", + * contactId: 1 + * }) + */ + public subscribeToLoyaltyProgram( + request: Brevo.SubscribeToLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__subscribeToLoyaltyProgram(request, requestOptions)); + } + + private async __subscribeToLoyaltyProgram( + request: Brevo.SubscribeToLoyaltyProgramRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}/subscriptions`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.SubscribeToLoyaltyProgramResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/config/programs/{pid}/subscriptions", + ); + } +} diff --git a/src/api/resources/program/client/index.ts b/src/api/resources/program/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/program/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/program/client/requests/CreateNewLpRequest.ts b/src/api/resources/program/client/requests/CreateNewLpRequest.ts new file mode 100644 index 0000000..f51d150 --- /dev/null +++ b/src/api/resources/program/client/requests/CreateNewLpRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * name: "name" + * } + */ +export interface CreateNewLpRequest { + /** Optional description of the loyalty program (max 256 chars). */ + description?: string; + /** Optional unique document ID. */ + documentId?: string; + /** Optional metadata related to the loyalty program. */ + meta?: Record; + /** Required name of the loyalty program (max 128 chars). */ + name: string; +} diff --git a/src/api/resources/program/client/requests/DeleteContactMembersRequest.ts b/src/api/resources/program/client/requests/DeleteContactMembersRequest.ts new file mode 100644 index 0000000..ac7c466 --- /dev/null +++ b/src/api/resources/program/client/requests/DeleteContactMembersRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * memberContactIds: "memberContactIds" + * } + */ +export interface DeleteContactMembersRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; + /** Comma-separated list of member contact IDs to delete from the subscription. */ + memberContactIds: string; +} diff --git a/src/api/resources/program/client/requests/DeleteLoyaltyProgramRequest.ts b/src/api/resources/program/client/requests/DeleteLoyaltyProgramRequest.ts new file mode 100644 index 0000000..13aaf12 --- /dev/null +++ b/src/api/resources/program/client/requests/DeleteLoyaltyProgramRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface DeleteLoyaltyProgramRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; +} diff --git a/src/api/resources/program/client/requests/GetLoyaltyProgramInfoRequest.ts b/src/api/resources/program/client/requests/GetLoyaltyProgramInfoRequest.ts new file mode 100644 index 0000000..006b647 --- /dev/null +++ b/src/api/resources/program/client/requests/GetLoyaltyProgramInfoRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface GetLoyaltyProgramInfoRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; +} diff --git a/src/api/resources/program/client/requests/GetLpListRequest.ts b/src/api/resources/program/client/requests/GetLpListRequest.ts new file mode 100644 index 0000000..c8f85ed --- /dev/null +++ b/src/api/resources/program/client/requests/GetLpListRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetLpListRequest { + /** Number of documents per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort documents by field */ + sort_field?: Brevo.GetLpListRequestSortField; + /** Sort documents by field */ + sort?: string; +} diff --git a/src/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.ts b/src/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.ts new file mode 100644 index 0000000..1ddb913 --- /dev/null +++ b/src/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface GetParameterSubscriptionInfoRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; + /** The contact ID to filter by. */ + contactId?: string; + /** A list of filter parameters for querying the subscription info. */ + params?: string; + /** The loyalty subscription ID to filter by. */ + loyaltySubscriptionId?: string; +} diff --git a/src/api/resources/program/client/requests/PartiallyUpdateLoyaltyProgramRequest.ts b/src/api/resources/program/client/requests/PartiallyUpdateLoyaltyProgramRequest.ts new file mode 100644 index 0000000..0ee6ebd --- /dev/null +++ b/src/api/resources/program/client/requests/PartiallyUpdateLoyaltyProgramRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface PartiallyUpdateLoyaltyProgramRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; + /** Loyalty Program description */ + description?: string; + /** Loyalty Program meta data */ + meta?: Record; + /** Loyalty Program name */ + name?: string; +} diff --git a/src/api/resources/program/client/requests/PublishLoyaltyProgramRequest.ts b/src/api/resources/program/client/requests/PublishLoyaltyProgramRequest.ts new file mode 100644 index 0000000..052c554 --- /dev/null +++ b/src/api/resources/program/client/requests/PublishLoyaltyProgramRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface PublishLoyaltyProgramRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; +} diff --git a/src/api/resources/program/client/requests/SubscribeMemberToASubscriptionRequest.ts b/src/api/resources/program/client/requests/SubscribeMemberToASubscriptionRequest.ts new file mode 100644 index 0000000..e17d6bb --- /dev/null +++ b/src/api/resources/program/client/requests/SubscribeMemberToASubscriptionRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * memberContactIds: [1] + * } + */ +export interface SubscribeMemberToASubscriptionRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; + /** Required if LoyaltySubscriptionId is not provided, must be greater than 0 */ + contactId?: number; + /** Required if ContactId is not provided, max length 64 */ + loyaltySubscriptionId?: string; + /** Required, each item must be greater than or equal to 1 */ + memberContactIds: number[]; +} diff --git a/src/api/resources/program/client/requests/SubscribeToLoyaltyProgramRequest.ts b/src/api/resources/program/client/requests/SubscribeToLoyaltyProgramRequest.ts new file mode 100644 index 0000000..c359ebf --- /dev/null +++ b/src/api/resources/program/client/requests/SubscribeToLoyaltyProgramRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * contactId: 1 + * } + */ +export interface SubscribeToLoyaltyProgramRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; + /** Required contact ID; must be greater than 0. */ + contactId: number; + /** Optional custom date-time format. */ + creationDate?: string; + /** Optional subscription ID (max length 64). */ + loyaltySubscriptionId?: string; +} diff --git a/src/api/resources/program/client/requests/UpdateLoyaltyProgramRequest.ts b/src/api/resources/program/client/requests/UpdateLoyaltyProgramRequest.ts new file mode 100644 index 0000000..f34a91b --- /dev/null +++ b/src/api/resources/program/client/requests/UpdateLoyaltyProgramRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * name: "name" + * } + */ +export interface UpdateLoyaltyProgramRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; + /** Loyalty Program description */ + description?: string; + /** Loyalty Program meta data */ + meta?: Record; + /** Loyalty Program name */ + name: string; +} diff --git a/src/api/resources/program/client/requests/index.ts b/src/api/resources/program/client/requests/index.ts new file mode 100644 index 0000000..1bac46c --- /dev/null +++ b/src/api/resources/program/client/requests/index.ts @@ -0,0 +1,11 @@ +export type { CreateNewLpRequest } from "./CreateNewLpRequest.js"; +export type { DeleteContactMembersRequest } from "./DeleteContactMembersRequest.js"; +export type { DeleteLoyaltyProgramRequest } from "./DeleteLoyaltyProgramRequest.js"; +export type { GetLoyaltyProgramInfoRequest } from "./GetLoyaltyProgramInfoRequest.js"; +export type { GetLpListRequest } from "./GetLpListRequest.js"; +export type { GetParameterSubscriptionInfoRequest } from "./GetParameterSubscriptionInfoRequest.js"; +export type { PartiallyUpdateLoyaltyProgramRequest } from "./PartiallyUpdateLoyaltyProgramRequest.js"; +export type { PublishLoyaltyProgramRequest } from "./PublishLoyaltyProgramRequest.js"; +export type { SubscribeMemberToASubscriptionRequest } from "./SubscribeMemberToASubscriptionRequest.js"; +export type { SubscribeToLoyaltyProgramRequest } from "./SubscribeToLoyaltyProgramRequest.js"; +export type { UpdateLoyaltyProgramRequest } from "./UpdateLoyaltyProgramRequest.js"; diff --git a/src/api/resources/program/index.ts b/src/api/resources/program/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/program/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/program/types/GetLpListRequestSortField.ts b/src/api/resources/program/types/GetLpListRequestSortField.ts new file mode 100644 index 0000000..9a549b1 --- /dev/null +++ b/src/api/resources/program/types/GetLpListRequestSortField.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLpListRequestSortField = { + Name: "name", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} as const; +export type GetLpListRequestSortField = (typeof GetLpListRequestSortField)[keyof typeof GetLpListRequestSortField]; diff --git a/src/api/resources/program/types/GetLpListResponse.ts b/src/api/resources/program/types/GetLpListResponse.ts new file mode 100644 index 0000000..edbf37f --- /dev/null +++ b/src/api/resources/program/types/GetLpListResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetLpListResponse { + /** Loyalty Program list */ + items?: Brevo.LoyaltyProgram[]; +} diff --git a/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts b/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts new file mode 100644 index 0000000..c31882e --- /dev/null +++ b/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts @@ -0,0 +1,95 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetParameterSubscriptionInfoResponse { + /** Balance details for the subscription. */ + balance?: GetParameterSubscriptionInfoResponse.Balance; + /** List of members associated with the subscription. */ + members?: GetParameterSubscriptionInfoResponse.Members.Item[]; + /** List of rewards associated with the subscription. */ + reward?: GetParameterSubscriptionInfoResponse.Reward.Item[]; + /** List of tier assignments for the subscription. */ + tier?: GetParameterSubscriptionInfoResponse.Tier.Item[]; +} + +export namespace GetParameterSubscriptionInfoResponse { + export interface Balance { + /** List of balance details associated with the contact. */ + balances?: Balance.Balances.Item[]; + /** Unique identifier of the contact. */ + contactId?: number; + /** Unique identifier of the loyalty program. */ + loyaltyProgramId?: string; + } + + export namespace Balance { + export type Balances = Balances.Item[]; + + export namespace Balances { + export interface Item { + /** Unique identifier for the balance definition). */ + balanceDefinitionId?: string; + /** The amount of the balance. */ + value?: number; + } + } + } + + export type Members = Members.Item[]; + + export namespace Members { + export interface Item { + /** Timestamp when the member was created. */ + createdAt?: string; + /** Unique identifier of the member. */ + memberContactId?: number; + /** Timestamp when the member was last updated. */ + updatedAt?: string; + } + } + + export type Reward = Reward.Item[]; + + export namespace Reward { + export interface Item { + /** Reward code assigned to the contact. */ + code?: string; + /** Unique identifier of the contact. */ + contactId?: number; + /** Timestamp when the reward was created. */ + createdAt?: string; + /** Expiration date of the reward. */ + expirationDate?: string; + /** Unique identifier of the reward. */ + id?: string; + /** Unique identifier of the loyalty program. */ + loyaltyProgramId?: string; + /** Additional metadata related to the reward. */ + meta?: Record; + /** Unique identifier of the reward definition. */ + rewardId?: string; + /** Timestamp when the reward was last updated. */ + updatedAt?: string; + } + } + + export type Tier = Tier.Item[]; + + export namespace Tier { + export interface Item { + /** Unique identifier of the contact. */ + contactId?: number; + /** Timestamp when the tier was assigned. */ + createdAt?: string; + /** Unique identifier of the group associated with the tier. */ + groupId?: string; + /** Unique identifier of the loyalty program. */ + loyaltyProgramId?: string; + /** Additional metadata related to the tier. */ + meta?: Record; + /** Unique identifier of the tier. */ + tierId?: string; + /** Timestamp when the tier was last updated */ + updatedAt?: string; + } + } +} diff --git a/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts b/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts new file mode 100644 index 0000000..d37d3f7 --- /dev/null +++ b/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SubscribeMemberToASubscriptionResponse { + /** Timestamp when the subscription member was created. */ + createdAt?: string; + /** List of unique member contact IDs. */ + memberContactIds?: number[]; + /** Unique identifier of the organization. */ + organizationId?: number; + /** Unique identifier of the subscription owner. */ + ownerContactId?: number; + /** Timestamp when the subscription member was last updated. */ + updatedAt?: string; +} diff --git a/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts b/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts new file mode 100644 index 0000000..1226368 --- /dev/null +++ b/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SubscribeToLoyaltyProgramResponse { + /** Unique identifier of the contact. */ + contactId?: number; + /** Timestamp when the subscription was created. */ + createdAt?: string; + /** Unique identifier of the loyalty program. */ + loyaltyProgramId?: string; + /** Unique identifier of the subscription. */ + loyaltySubscriptionId?: string; + /** Unique identifier of the organization. */ + organizationId?: number; + /** Timestamp when the subscription was last updated. */ + updatedAt?: string; + /** Version number of the subscription. */ + versionId?: number; +} diff --git a/src/api/resources/program/types/index.ts b/src/api/resources/program/types/index.ts new file mode 100644 index 0000000..0cec94a --- /dev/null +++ b/src/api/resources/program/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetLpListRequestSortField.js"; +export * from "./GetLpListResponse.js"; +export * from "./GetParameterSubscriptionInfoResponse.js"; +export * from "./SubscribeMemberToASubscriptionResponse.js"; +export * from "./SubscribeToLoyaltyProgramResponse.js"; diff --git a/src/api/resources/reward/client/Client.ts b/src/api/resources/reward/client/Client.ts new file mode 100644 index 0000000..dd836b7 --- /dev/null +++ b/src/api/resources/reward/client/Client.ts @@ -0,0 +1,978 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace RewardClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class RewardClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: RewardClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Get code count + * + * @param {Brevo.GetCodeCountRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.getCodeCount({ + * pid: "pid", + * cpid: "cpid" + * }) + */ + public getCodeCount( + request: Brevo.GetCodeCountRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getCodeCount(request, requestOptions)); + } + + private async __getCodeCount( + request: Brevo.GetCodeCountRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, cpid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/code-pools/${core.url.encodePathParam(cpid)}/codes-count`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCodeCountResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/offer/programs/{pid}/code-pools/{cpid}/codes-count", + ); + } + + /** + * Returns a reward page + * + * @param {Brevo.GetLoyaltyOfferProgramsPidOffersRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.FailedDependencyError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.getRewardPageApi({ + * pid: "pid" + * }) + */ + public getRewardPageApi( + request: Brevo.GetLoyaltyOfferProgramsPidOffersRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getRewardPageApi(request, requestOptions)); + } + + private async __getRewardPageApi( + request: Brevo.GetLoyaltyOfferProgramsPidOffersRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, limit, offset, state, version } = request; + const _queryParams: Record = { + limit, + offset, + state, + version: version != null ? version : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/offers`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetLoyaltyOfferProgramsPidOffersResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 424: + throw new Brevo.FailedDependencyError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/offer/programs/{pid}/offers", + ); + } + + /** + * Creates a new reward in the loyalty program. + * + * @param {Brevo.CreateRewardRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.createReward({ + * pid: "pid", + * name: "name" + * }) + */ + public createReward( + request: Brevo.CreateRewardRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createReward(request, requestOptions)); + } + + private async __createReward( + request: Brevo.CreateRewardRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/offers`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateRewardResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/offer/programs/{pid}/offers", + ); + } + + /** + * Create a voucher and attribute it to a specific membership. + * + * @param {Brevo.CreateVoucherRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.createVoucher({ + * pid: "pid", + * rewardId: "rewardId" + * }) + */ + public createVoucher( + request: Brevo.CreateVoucherRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createVoucher(request, requestOptions)); + } + + private async __createVoucher( + request: Brevo.CreateVoucherRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/rewards/attribute`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateVoucherResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/offer/programs/{pid}/rewards/attribute", + ); + } + + /** + * Creates a request to redeem a voucher. + * + * @param {Brevo.RedeemVoucherRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.PreconditionFailedError} + * @throws {@link Brevo.ExpectationFailedError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.redeemVoucher({ + * pid: "pid" + * }) + */ + public redeemVoucher( + request: Brevo.RedeemVoucherRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__redeemVoucher(request, requestOptions)); + } + + private async __redeemVoucher( + request: Brevo.RedeemVoucherRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/rewards/redeem`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Redeem, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 412: + throw new Brevo.PreconditionFailedError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 417: + throw new Brevo.ExpectationFailedError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/offer/programs/{pid}/rewards/redeem", + ); + } + + /** + * Completes voucher redeem request. + * + * @param {Brevo.CompleteRedeemTransactionRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.PreconditionFailedError} + * @throws {@link Brevo.ExpectationFailedError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.completeRedeemTransaction({ + * pid: "pid", + * tid: "tid" + * }) + */ + public completeRedeemTransaction( + request: Brevo.CompleteRedeemTransactionRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__completeRedeemTransaction(request, requestOptions)); + } + + private async __completeRedeemTransaction( + request: Brevo.CompleteRedeemTransactionRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, tid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/rewards/redeem/${core.url.encodePathParam(tid)}/complete`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Redeem, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 412: + throw new Brevo.PreconditionFailedError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 417: + throw new Brevo.ExpectationFailedError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/offer/programs/{pid}/rewards/redeem/{tid}/complete", + ); + } + + /** + * Revoke attributed vouchers. + * + * @param {Brevo.RevokeVouchersRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.revokeVouchers({ + * pid: "pid" + * }) + */ + public revokeVouchers( + request: Brevo.RevokeVouchersRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__revokeVouchers(request, requestOptions)); + } + + private async __revokeVouchers( + request: Brevo.RevokeVouchersRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, attributedRewardIds } = request; + const _queryParams: Record = { + attributedRewardIds, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/rewards/revoke`, + ), + method: "DELETE", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/offer/programs/{pid}/rewards/revoke", + ); + } + + /** + * Validates a reward. + * + * @param {Brevo.ValidateRewardRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.FailedDependencyError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.validateReward({ + * pid: "pid" + * }) + */ + public validateReward( + request: Brevo.ValidateRewardRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__validateReward(request, requestOptions)); + } + + private async __validateReward( + request: Brevo.ValidateRewardRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/rewards/validate`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ValidateRewardResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 424: + throw new Brevo.FailedDependencyError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/offer/programs/{pid}/rewards/validate", + ); + } + + /** + * Returns reward information. + * + * @param {Brevo.GetLoyaltyOfferProgramsPidRewardsRidRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.FailedDependencyError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.getRewardInformation({ + * pid: "pid", + * rid: "rid" + * }) + */ + public getRewardInformation( + request: Brevo.GetLoyaltyOfferProgramsPidRewardsRidRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getRewardInformation(request, requestOptions)); + } + + private async __getRewardInformation( + request: Brevo.GetLoyaltyOfferProgramsPidRewardsRidRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { pid, rid, version } = request; + const _queryParams: Record = { + version: version != null ? version : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/rewards/${core.url.encodePathParam(rid)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetLoyaltyOfferProgramsPidRewardsRidResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 424: + throw new Brevo.FailedDependencyError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/offer/programs/{pid}/rewards/{rid}", + ); + } + + /** + * Get voucher for a contact + * + * @param {Brevo.GetLoyaltyOfferProgramsPidVouchersRequest} request + * @param {RewardClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.reward.getVoucherForAContact({ + * pid: "pid", + * contactId: 1 + * }) + */ + public getVoucherForAContact( + request: Brevo.GetLoyaltyOfferProgramsPidVouchersRequest, + requestOptions?: RewardClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getVoucherForAContact(request, requestOptions)); + } + + private async __getVoucherForAContact( + request: Brevo.GetLoyaltyOfferProgramsPidVouchersRequest, + requestOptions?: RewardClient.RequestOptions, + ): Promise> { + const { + pid, + limit, + offset, + sort, + sortField, + contactId, + metadata_key_value: metadataKeyValue, + rewardId, + } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + sortField: sortField != null ? sortField : undefined, + contactId, + metadata_key_value: metadataKeyValue, + rewardId, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/offer/programs/${core.url.encodePathParam(pid)}/vouchers`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetLoyaltyOfferProgramsPidVouchersResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/offer/programs/{pid}/vouchers", + ); + } +} diff --git a/src/api/resources/reward/client/index.ts b/src/api/resources/reward/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/reward/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/reward/client/requests/CompleteRedeemTransactionRequest.ts b/src/api/resources/reward/client/requests/CompleteRedeemTransactionRequest.ts new file mode 100644 index 0000000..088b845 --- /dev/null +++ b/src/api/resources/reward/client/requests/CompleteRedeemTransactionRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * tid: "tid" + * } + */ +export interface CompleteRedeemTransactionRequest { + /** Loyalty Program ID */ + pid: string; + /** Redeem transaction ID */ + tid: string; +} diff --git a/src/api/resources/reward/client/requests/CreateRewardRequest.ts b/src/api/resources/reward/client/requests/CreateRewardRequest.ts new file mode 100644 index 0000000..c9f61b9 --- /dev/null +++ b/src/api/resources/reward/client/requests/CreateRewardRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * name: "name" + * } + */ +export interface CreateRewardRequest { + /** Loyalty Program ID */ + pid: string; + /** Internal name of the reward */ + name: string; + /** Public facing description of the reward */ + publicDescription?: string; + /** URL of the public image for the reward */ + publicImage?: string; + /** Public facing name of the reward */ + publicName?: string; +} diff --git a/src/api/resources/reward/client/requests/CreateVoucherRequest.ts b/src/api/resources/reward/client/requests/CreateVoucherRequest.ts new file mode 100644 index 0000000..2ef3851 --- /dev/null +++ b/src/api/resources/reward/client/requests/CreateVoucherRequest.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * rewardId: "rewardId" + * } + */ +export interface CreateVoucherRequest { + /** Loyalty Program ID */ + pid: string; + /** Code generated to attribute reward to a contact */ + code?: string; + /** Contact to attribute the reward */ + contactId?: number; + /** Reward expiration date */ + expirationDate?: string; + /** One of contactId or loyaltySubscriptionId is required */ + loyaltySubscriptionId?: string; + /** Offer meta information (key/value object) */ + meta?: Record; + /** Reward id */ + rewardId: string; + /** Value of the selected reward config */ + value?: number; +} diff --git a/src/api/resources/reward/client/requests/GetCodeCountRequest.ts b/src/api/resources/reward/client/requests/GetCodeCountRequest.ts new file mode 100644 index 0000000..8715e37 --- /dev/null +++ b/src/api/resources/reward/client/requests/GetCodeCountRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * cpid: "cpid" + * } + */ +export interface GetCodeCountRequest { + /** Loyalty Program ID */ + pid: string; + /** Code Pool ID */ + cpid: string; +} diff --git a/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidOffersRequest.ts b/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidOffersRequest.ts new file mode 100644 index 0000000..8389eb6 --- /dev/null +++ b/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidOffersRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface GetLoyaltyOfferProgramsPidOffersRequest { + /** Loyalty Program ID */ + pid: string; + /** Page size */ + limit?: number; + /** Pagination offset */ + offset?: number; + /** State of the reward */ + state?: string; + /** Version */ + version?: Brevo.GetLoyaltyOfferProgramsPidOffersRequestVersion; +} diff --git a/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidRewardsRidRequest.ts b/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidRewardsRidRequest.ts new file mode 100644 index 0000000..65bff0f --- /dev/null +++ b/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidRewardsRidRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid", + * rid: "rid" + * } + */ +export interface GetLoyaltyOfferProgramsPidRewardsRidRequest { + /** Loyalty Program ID */ + pid: string; + /** Reward ID */ + rid: string; + /** Version */ + version?: Brevo.GetLoyaltyOfferProgramsPidRewardsRidRequestVersion; +} diff --git a/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidVouchersRequest.ts b/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidVouchersRequest.ts new file mode 100644 index 0000000..358cf7e --- /dev/null +++ b/src/api/resources/reward/client/requests/GetLoyaltyOfferProgramsPidVouchersRequest.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid", + * contactId: 1 + * } + */ +export interface GetLoyaltyOfferProgramsPidVouchersRequest { + /** Loyalty Program ID */ + pid: string; + /** Page size */ + limit?: number; + /** Pagination offset */ + offset?: number; + /** Sort order */ + sort?: Brevo.GetLoyaltyOfferProgramsPidVouchersRequestSort; + /** Sort field */ + sortField?: Brevo.GetLoyaltyOfferProgramsPidVouchersRequestSortField; + /** Contact ID */ + contactId: number; + /** Metadata value for a Key filter */ + metadata_key_value?: string; + /** Reward ID */ + rewardId?: string; +} diff --git a/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts b/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts new file mode 100644 index 0000000..b2b6e02 --- /dev/null +++ b/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts @@ -0,0 +1,100 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface RedeemVoucherRequest { + /** Loyalty Program ID */ + pid: string; + /** Unique identifier for the attributed reward */ + attributedRewardId?: string; + /** Redemption code for the reward */ + code?: string; + /** Unique identifier for the contact */ + contactId?: number; + /** Identifier for the loyalty subscription */ + loyaltySubscriptionId?: string; + /** Additional metadata associated with the redeem request */ + meta?: Record; + /** Order details for the redemption */ + order?: RedeemVoucherRequest.Order; + /** Unique identifier for the reward */ + rewardId?: string; + /** Time to live in seconds for the redemption request */ + ttl?: number; +} + +export namespace RedeemVoucherRequest { + export interface Order { + /** Total amount of the order */ + amount?: number; + /** Billing information for the order */ + billing?: Order.Billing; + /** Unique identifier for the contact */ + contact_id?: number; + /** List of coupon codes applied to the order */ + coupons?: string[]; + /** Timestamp when the order was created */ + createdAt?: string; + /** Email address associated with the order */ + email?: string; + /** Unique identifier for the order */ + id?: string; + /** Additional identifiers for the order */ + identifiers?: Order.Identifiers; + /** List of products in the order */ + products?: Order.Products.Item[]; + /** Current status of the order */ + status?: string; + /** Identifier for the store where the order was placed */ + storeId?: string; + /** Timestamp when the order was last updated */ + updatedAt?: string; + } + + export namespace Order { + export interface Billing { + /** Address of the user */ + address?: string; + /** City of the user */ + city?: string; + /** Country code of the user */ + countryCode?: string; + /** Payment method opted by the user */ + paymentMethod?: string; + /** Phone number of the user */ + phone?: number; + /** Postal Code of user's location */ + postCode?: number; + /** Region where user resides */ + region?: string; + } + + export interface Identifiers { + /** External identifier for the order */ + ext_id?: string; + /** Identifier for the loyalty subscription */ + loyalty_subscription_id?: string; + } + + export type Products = Products.Item[]; + + export namespace Products { + export interface Item { + /** List of categories the product belongs to */ + category?: string[]; + /** Price of the product */ + price?: number; + /** Unique identifier for the product */ + productId?: string; + /** Quantity of the product */ + quantity?: number; + /** Identifier for the product variant */ + variantId?: string; + } + } + } +} diff --git a/src/api/resources/reward/client/requests/RevokeVouchersRequest.ts b/src/api/resources/reward/client/requests/RevokeVouchersRequest.ts new file mode 100644 index 0000000..4feb53d --- /dev/null +++ b/src/api/resources/reward/client/requests/RevokeVouchersRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface RevokeVouchersRequest { + /** Loyalty Program ID */ + pid: string; + /** Reward Attribution IDs (comma seperated) */ + attributedRewardIds?: string; +} diff --git a/src/api/resources/reward/client/requests/ValidateRewardRequest.ts b/src/api/resources/reward/client/requests/ValidateRewardRequest.ts new file mode 100644 index 0000000..880feb9 --- /dev/null +++ b/src/api/resources/reward/client/requests/ValidateRewardRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface ValidateRewardRequest { + /** Loyalty Program ID */ + pid: string; + /** Unique identifier for the attributed reward */ + attributedRewardId?: string; + /** Validation code for the reward */ + code?: string; + /** Unique identifier for the contact */ + contactId?: number; + /** Identifier for the loyalty subscription */ + loyaltySubscriptionId?: string; + /** Identifier for the point of sale */ + pointOfSellId?: string; + /** Unique identifier for the reward */ + rewardId?: string; +} diff --git a/src/api/resources/reward/client/requests/index.ts b/src/api/resources/reward/client/requests/index.ts new file mode 100644 index 0000000..a0485df --- /dev/null +++ b/src/api/resources/reward/client/requests/index.ts @@ -0,0 +1,10 @@ +export type { CompleteRedeemTransactionRequest } from "./CompleteRedeemTransactionRequest.js"; +export type { CreateRewardRequest } from "./CreateRewardRequest.js"; +export type { CreateVoucherRequest } from "./CreateVoucherRequest.js"; +export type { GetCodeCountRequest } from "./GetCodeCountRequest.js"; +export type { GetLoyaltyOfferProgramsPidOffersRequest } from "./GetLoyaltyOfferProgramsPidOffersRequest.js"; +export type { GetLoyaltyOfferProgramsPidRewardsRidRequest } from "./GetLoyaltyOfferProgramsPidRewardsRidRequest.js"; +export type { GetLoyaltyOfferProgramsPidVouchersRequest } from "./GetLoyaltyOfferProgramsPidVouchersRequest.js"; +export type { RedeemVoucherRequest } from "./RedeemVoucherRequest.js"; +export type { RevokeVouchersRequest } from "./RevokeVouchersRequest.js"; +export type { ValidateRewardRequest } from "./ValidateRewardRequest.js"; diff --git a/src/api/resources/reward/index.ts b/src/api/resources/reward/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/reward/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/reward/types/CreateRewardResponse.ts b/src/api/resources/reward/types/CreateRewardResponse.ts new file mode 100644 index 0000000..e23edf3 --- /dev/null +++ b/src/api/resources/reward/types/CreateRewardResponse.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateRewardResponse { + /** Timestamp when the reward was created */ + createdAt?: string; + /** Unique identifier for the reward */ + id?: string; + /** Id of the loyalty program to which the current reward belongs to */ + loyaltyProgramId?: string; + /** Name of the reward */ + name?: string; + /** Public description for the reward */ + publicDescription?: string; + /** Public Image for the reward */ + publicImage?: string; + /** Public name for the reward */ + publicName?: string; + /** Timestamp for when this reward was last updated. */ + updatedAt?: string; +} diff --git a/src/api/resources/reward/types/CreateVoucherResponse.ts b/src/api/resources/reward/types/CreateVoucherResponse.ts new file mode 100644 index 0000000..cc7dabd --- /dev/null +++ b/src/api/resources/reward/types/CreateVoucherResponse.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateVoucherResponse { + /** Generated code */ + code?: string; + /** Timestamp for when this reward was consumed */ + consumedAt?: string; + /** Id of the contact that attributed the reward */ + contactId?: number; + /** Timestamp for when this reward was created */ + createdAt?: string; + /** Expiration date of the reward */ + expirationDate?: string; + /** Unique identifier */ + id?: string; + /** Loyalty Program Id to which attributed reward belongs */ + loyaltyProgramId?: string; + /** Additional data to define the reward */ + meta?: Record; + /** Unique identifier for the reward */ + rewardId?: string; + /** Timestamp for when this reward was updated */ + updatedAt?: string; + /** Value of the selected reward config */ + value?: number; +} diff --git a/src/api/resources/reward/types/GetCodeCountResponse.ts b/src/api/resources/reward/types/GetCodeCountResponse.ts new file mode 100644 index 0000000..a226524 --- /dev/null +++ b/src/api/resources/reward/types/GetCodeCountResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCodeCountResponse { + /** Number of codes */ + count?: number; +} diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersRequestVersion.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersRequestVersion.ts new file mode 100644 index 0000000..d5056d1 --- /dev/null +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersRequestVersion.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyOfferProgramsPidOffersRequestVersion = { + Active: "active", + Draft: "draft", +} as const; +export type GetLoyaltyOfferProgramsPidOffersRequestVersion = + (typeof GetLoyaltyOfferProgramsPidOffersRequestVersion)[keyof typeof GetLoyaltyOfferProgramsPidOffersRequestVersion]; diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersResponse.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersResponse.ts new file mode 100644 index 0000000..1442ec9 --- /dev/null +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersResponse.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetLoyaltyOfferProgramsPidOffersResponse { + /** Items for the current reward */ + items?: GetLoyaltyOfferProgramsPidOffersResponse.Items.Item[]; + /** Count of the associated parameter in current reward */ + totalCount?: number; +} + +export namespace GetLoyaltyOfferProgramsPidOffersResponse { + export type Items = Items.Item[]; + + export namespace Items { + export interface Item { + /** Timestamp for when this reward was created */ + createdAt?: string; + /** Timestamp for when this reward attribution ended */ + endDate?: string; + /** Unique identifier for the reward */ + id?: string; + /** Loyalty Program to which current reward is associated */ + loyaltyProgramId?: string; + /** Name of the reward */ + name?: string; + /** Public image of the reward */ + publicImage?: string; + /** Timestamp for when this reward attribution started */ + startDate?: string; + /** State of the reward */ + state?: string; + /** Timestamp for when this reward attribution was updated */ + updatedAt?: string; + } + } +} diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidRequestVersion.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidRequestVersion.ts new file mode 100644 index 0000000..b6785cb --- /dev/null +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidRequestVersion.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyOfferProgramsPidRewardsRidRequestVersion = { + Active: "active", + Draft: "draft", +} as const; +export type GetLoyaltyOfferProgramsPidRewardsRidRequestVersion = + (typeof GetLoyaltyOfferProgramsPidRewardsRidRequestVersion)[keyof typeof GetLoyaltyOfferProgramsPidRewardsRidRequestVersion]; diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidResponse.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidResponse.ts new file mode 100644 index 0000000..e822f8d --- /dev/null +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidResponse.ts @@ -0,0 +1,222 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetLoyaltyOfferProgramsPidRewardsRidResponse { + /** Maximum number of times a consumer can be attributed this reward */ + attributionPerConsumer?: number; + /** Unique identifier for the balance definition */ + balanceDefinitionId?: string; + /** Unique code for the reward */ + code?: string; + /** Total number of codes generated */ + codeCount?: number; + /** Unique identifier for the code generator */ + codeGeneratorId?: string; + /** Unique identifier for the code pool */ + codePoolId?: string; + /** Configuration settings for the reward */ + config?: string; + /** Timestamp when the reward was created */ + createdAt?: string; + /** Disabled date of the reward */ + disabledAt?: string; + /** End date of the reward validity */ + endDate?: string; + /** Expiration date of the reward */ + expirationDate?: string; + /** Select startOfPeriod to configure rewards expiry on start of day/week/month/year. Select endOfPeriod to configure reward expiry on end of day/week/month/year, else select noModification */ + expirationModifier?: GetLoyaltyOfferProgramsPidRewardsRidResponse.ExpirationModifier; + /** Unit of time for the rewards's availability (e.g., day/week/month/year). */ + expirationUnit?: string; + /** Number of days/weeks/month/year for reward expiry */ + expirationValue?: number; + /** object */ + generator?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Generator; + /** Unique identifier for the reward */ + id?: string; + /** Attribution / Redeem Limits for the reward */ + limits?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Limits.Item[]; + /** Id of the loyalty program to which the current reward belongs to */ + loyaltyProgramId?: string; + /** Additional data for reward definition */ + meta?: Record; + /** Name of the reward */ + name?: string; + /** Selected products for reward definition */ + products?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Products.Item[]; + /** Public description for the reward */ + publicDescription?: string; + /** Public Image for the reward */ + publicImage?: string; + /** Public name for the reward */ + publicName?: string; + /** Defines the redeem limit for the consumer */ + redeemPerConsumer?: number; + /** Rules defined to redeem a reward */ + redeemRules?: string[]; + /** object */ + rewardConfigs?: GetLoyaltyOfferProgramsPidRewardsRidResponse.RewardConfigs; + /** Rule to define the reward */ + rule?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Rule; + /** Start date of attribution of the reward */ + startDate?: string; + /** Id of the selected balance while redeeming / attributing a reward */ + subtractBalanceDefinitionId?: string; + /** Strategy of the Balance while redeeming / attributing a reward */ + subtractBalanceStrategy?: string; + /** Amount of balance to be selected while redeeming / attributing a reward */ + subtractBalanceValue?: number; + /** Value to indicate to subtract full balance or not */ + subtractTotalBalance?: boolean; + /** Defines the limit to which a consumer can attribute a reward */ + totalAttribution?: number; + /** Defines the limit to which a consumer can redeem a reward */ + totalRedeem?: number; + /** Id of the Rule to be updated for that reward */ + triggerId?: string; + /** Selected unit of the balance */ + unit?: string; + /** Timestamp for when this reward was last updated. */ + updatedAt?: string; + /** Value of metric in selected config for reward definition */ + value?: number; + /** Type of config selected for reward definition */ + valueType?: string; +} + +export namespace GetLoyaltyOfferProgramsPidRewardsRidResponse { + /** Select startOfPeriod to configure rewards expiry on start of day/week/month/year. Select endOfPeriod to configure reward expiry on end of day/week/month/year, else select noModification */ + export const ExpirationModifier = { + StartOfPeriod: "startOfPeriod", + EndOfPeriod: "endOfPeriod", + NoModification: "noModification", + } as const; + export type ExpirationModifier = (typeof ExpirationModifier)[keyof typeof ExpirationModifier]; + + export interface Generator { + /** Timestamp when the reward was created */ + createdAt?: string; + /** Public facing description of the reward */ + description?: string; + /** Unique identifier for the reward */ + id?: string; + /** Name of the reward */ + name?: string; + /** Generated pattern */ + pattern?: string; + /** Timestamp when the reward was created */ + updatedAt?: string; + } + + export type Limits = Limits.Item[]; + + export namespace Limits { + export interface Item { + /** Timestamp when the reward limit was created */ + createdAt?: string; + /** Unit of time for the reward limit's availability (e.g., day/week/month/year). */ + durationUnit?: string; + /** Number of days/weeks/month/year for reward limit */ + durationValue?: number; + /** Value of the limit */ + limitValue?: number; + /** Unique identifier for the reward limit */ + rewardLimitId?: string; + /** Select true to calculate all redeems/attributions from the previous value of selected durationUnit to the current time */ + slidingSchedule?: boolean; + /** Type of reward */ + type?: string; + /** Timestamp when the reward limit was created */ + updatedAt?: string; + } + } + + export type Products = Products.Item[]; + + export namespace Products { + export interface Item { + /** Timestamp when the product was created */ + createdAt?: string; + /** URL of the product image */ + imageRef?: string; + /** Unique identifier for the product */ + productId?: string; + /** string */ + value?: string; + } + } + + export interface RewardConfigs { + /** Attribution config of the reward */ + attribution?: string; + /** Code config of the reward */ + code?: string; + /** Value config of the reward */ + value?: string; + } + + export interface Rule { + /** Selected rule condition */ + condition?: Brevo.RuleConditionResponse; + /** Timestamp when the rule was created */ + createdAt?: string; + /** Description of the rule */ + description?: string; + /** Selected event in the rule */ + event?: Rule.Event; + /** Metric to identify if it's an internal rule or not */ + isInternal?: boolean; + /** Loyalty Program id to which current rule is associated */ + loyaltyProgramId?: string; + /** Loyalty Version id to which current rule is associated */ + loyaltyVersionId?: number; + /** Additional data to define the rule */ + meta?: Record; + /** Rule name */ + name?: string; + /** Results of the rule definition */ + results?: Rule.Results.Item[]; + /** Unique identifier for the rule */ + ruleId?: string; + /** Type of the rule */ + ruleType?: string; + /** Timestamp when the rule was updated */ + updatedAt?: string; + } + + export namespace Rule { + export interface Event { + /** Name of the event */ + name?: string; + /** Source of the event */ + source?: string; + } + + export type Results = Results.Item[]; + + export namespace Results { + export interface Item { + /** Action for the defined rule */ + action?: string; + /** Parameters to define the reward */ + parameters?: Item.Parameters.Item[]; + /** Selected service to define the reward */ + service?: string; + } + + export namespace Item { + export type Parameters = Parameters.Item[]; + + export namespace Parameters { + export interface Item { + /** Name of the rule */ + name?: string; + /** Selected value of the parameter to define the rule */ + value?: Brevo.ValueResponse; + } + } + } + } + } +} diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersRequestSort.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersRequestSort.ts new file mode 100644 index 0000000..c105ee7 --- /dev/null +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyOfferProgramsPidVouchersRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetLoyaltyOfferProgramsPidVouchersRequestSort = + (typeof GetLoyaltyOfferProgramsPidVouchersRequestSort)[keyof typeof GetLoyaltyOfferProgramsPidVouchersRequestSort]; diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersRequestSortField.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersRequestSortField.ts new file mode 100644 index 0000000..195c05b --- /dev/null +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersRequestSortField.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyOfferProgramsPidVouchersRequestSortField = { + UpdatedAt: "updatedAt", + CreatedAt: "createdAt", +} as const; +export type GetLoyaltyOfferProgramsPidVouchersRequestSortField = + (typeof GetLoyaltyOfferProgramsPidVouchersRequestSortField)[keyof typeof GetLoyaltyOfferProgramsPidVouchersRequestSortField]; diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts new file mode 100644 index 0000000..824d73b --- /dev/null +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts @@ -0,0 +1,43 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetLoyaltyOfferProgramsPidVouchersResponse { + /** Contact id associated with the current reward */ + contactId?: number; + /** List of all the rewards for current contact */ + contactRewards?: GetLoyaltyOfferProgramsPidVouchersResponse.ContactRewards.Item[]; + /** Count of the rewards associated with the current contact */ + count?: number; + /** Loyalty Program Id for the contact */ + loyaltyProgramId?: string; + /** Loyalty Subscription Id for the contact */ + loyaltySubscriptionId?: string; +} + +export namespace GetLoyaltyOfferProgramsPidVouchersResponse { + export type ContactRewards = ContactRewards.Item[]; + + export namespace ContactRewards { + export interface Item { + /** Generated code */ + code?: string; + /** Timestamp when the reward limit was consumed */ + consumedAt?: string; + /** Timestamp when the reward limit was created */ + createdAt?: string; + /** Reward expiration date */ + expirationDate?: string; + /** Unique identifier for the contact */ + id?: string; + /** Additional data for the reward */ + meta?: Record; + /** Unique identifier for the reward */ + rewardId?: string; + /** Unit of the balance selected in the reward definition */ + unit?: string; + /** Timestamp when the reward limit was updated */ + updatedAt?: string; + /** Value of the selected reward config */ + value?: number; + } + } +} diff --git a/src/api/resources/reward/types/ValidateRewardResponse.ts b/src/api/resources/reward/types/ValidateRewardResponse.ts new file mode 100644 index 0000000..26100c9 --- /dev/null +++ b/src/api/resources/reward/types/ValidateRewardResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ValidateRewardResponse { + /** Boolean value to authorize a reward or not */ + authorize?: boolean; +} diff --git a/src/api/resources/reward/types/index.ts b/src/api/resources/reward/types/index.ts new file mode 100644 index 0000000..598f7de --- /dev/null +++ b/src/api/resources/reward/types/index.ts @@ -0,0 +1,11 @@ +export * from "./CreateRewardResponse.js"; +export * from "./CreateVoucherResponse.js"; +export * from "./GetCodeCountResponse.js"; +export * from "./GetLoyaltyOfferProgramsPidOffersRequestVersion.js"; +export * from "./GetLoyaltyOfferProgramsPidOffersResponse.js"; +export * from "./GetLoyaltyOfferProgramsPidRewardsRidRequestVersion.js"; +export * from "./GetLoyaltyOfferProgramsPidRewardsRidResponse.js"; +export * from "./GetLoyaltyOfferProgramsPidVouchersRequestSort.js"; +export * from "./GetLoyaltyOfferProgramsPidVouchersRequestSortField.js"; +export * from "./GetLoyaltyOfferProgramsPidVouchersResponse.js"; +export * from "./ValidateRewardResponse.js"; diff --git a/src/api/resources/senders/client/Client.ts b/src/api/resources/senders/client/Client.ts new file mode 100644 index 0000000..4edf96a --- /dev/null +++ b/src/api/resources/senders/client/Client.ts @@ -0,0 +1,673 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace SendersClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class SendersClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: SendersClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Retrieves a list of all email senders from your Brevo account with optional filtering. + * + * **Use this to:** + * - Get all available senders for email campaign setup + * - Find sender details including ID, name, and email address + * - Filter senders by IP address for dedicated IP users + * - Filter senders by domain for domain-specific configurations + * - Monitor sender configuration and status + * + * **Key information returned:** + * - Sender details (ID, name, email address) + * - Sender status and verification information + * - Associated IP addresses and domains (for dedicated IP accounts) + * - Sender configuration settings + * + * **Important considerations:** + * - Standard accounts show empty IP arrays, dedicated IP accounts show IP assignments + * - Filtering by IP only available for accounts with dedicated IPs + * - Domain filtering helps organize senders by business units or brands + * - Sender status indicates if sender is active and ready for campaign use + * - Email verification required before sender can be used in campaigns + * + * @param {Brevo.GetSendersRequest} request + * @param {SendersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.senders.getSenders() + */ + public getSenders( + request: Brevo.GetSendersRequest = {}, + requestOptions?: SendersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSenders(request, requestOptions)); + } + + private async __getSenders( + request: Brevo.GetSendersRequest = {}, + requestOptions?: SendersClient.RequestOptions, + ): Promise> { + const { ip, domain } = request; + const _queryParams: Record = { + ip, + domain, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "senders", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSendersResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/senders"); + } + + /** + * Creates a new email sender in your Brevo account. + * + * **Use this to:** + * - Add new senders for email campaigns + * - Configure sender identity (name and email) + * - Associate dedicated IPs with the sender (for dedicated IP accounts) + * - Set up domain-based sender configurations + * + * **Key information returned:** + * - Created sender ID + * - DKIM and SPF configuration status + * - Success confirmation + * + * **Important considerations:** + * - Verification email sent to specified sender address + * - DKIM and SPF configuration affects deliverability + * - Dedicated IP accounts require IP association during creation + * - IP weights must sum to 100 when specified + * - Sender must be verified before use in campaigns + * + * @param {Brevo.CreateSenderRequest} request + * @param {SendersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.senders.createSender({ + * email: "support@example.com", + * name: "Support Team" + * }) + * + * @example + * await client.senders.createSender({ + * email: "marketing@example.com", + * ips: [{ + * domain: "example.com", + * ip: "203.0.113.100", + * weight: 100 + * }], + * name: "Marketing Team" + * }) + * + * @example + * await client.senders.createSender({ + * email: "newsletter@example.com", + * ips: [{ + * domain: "example.com", + * ip: "203.0.113.100", + * weight: 60 + * }, { + * domain: "news.example.com", + * ip: "203.0.113.101", + * weight: 40 + * }], + * name: "Newsletter" + * }) + */ + public createSender( + request: Brevo.CreateSenderRequest, + requestOptions?: SendersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createSender(request, requestOptions)); + } + + private async __createSender( + request: Brevo.CreateSenderRequest, + requestOptions?: SendersClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "senders", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateSenderResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/senders"); + } + + /** + * Retrieves all dedicated IPs associated with your Brevo account. + * + * Use this to: + * - List all your dedicated IPs + * - Check the status of your dedicated IPs (active/inactive) + * - Find IP addresses and associated domains for configuration purposes + * - Monitor your IP reputation and deliverability + * - Verify available IPs for sender configuration + * + * Key information returned: + * - IP ID and address + * - Associated domain + * - Active status + * - IP configuration details + * + * @param {SendersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.senders.getIps() + */ + public getIps(requestOptions?: SendersClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getIps(requestOptions)); + } + + private async __getIps( + requestOptions?: SendersClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "senders/ips", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetIpsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/senders/ips"); + } + + /** + * Updates an existing email sender's configuration. + * + * Use this to: + * - Modify sender display name or email address + * - Update dedicated IP associations + * - Change sender configuration settings + * - Correct sender information + * + * Key information returned: + * - Success confirmation + * - Updated sender details + * + * @param {Brevo.UpdateSenderRequest} request + * @param {SendersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.senders.updateSender({ + * senderId: 1000000, + * name: "New Support Team" + * }) + * + * @example + * await client.senders.updateSender({ + * senderId: 1000000, + * email: "newsupport@mycompany.com" + * }) + * + * @example + * await client.senders.updateSender({ + * senderId: 1000000, + * email: "marketing@mycompany.com", + * name: "Marketing Team" + * }) + * + * @example + * await client.senders.updateSender({ + * senderId: 1000000, + * email: "marketing@enterprise.com", + * ips: [{ + * domain: "enterprise.com", + * ip: "192.168.1.100", + * weight: 100 + * }], + * name: "Enterprise Marketing" + * }) + * + * @example + * await client.senders.updateSender({ + * senderId: 1000000, + * email: "campaigns@enterprise.com", + * ips: [{ + * domain: "enterprise.com", + * ip: "192.168.1.100", + * weight: 70 + * }, { + * domain: "mail.enterprise.com", + * ip: "192.168.1.101", + * weight: 30 + * }], + * name: "Multi-IP Sender" + * }) + */ + public updateSender( + request: Brevo.UpdateSenderRequest, + requestOptions?: SendersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateSender(request, requestOptions)); + } + + private async __updateSender( + request: Brevo.UpdateSenderRequest, + requestOptions?: SendersClient.RequestOptions, + ): Promise> { + const { senderId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `senders/${core.url.encodePathParam(senderId)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/senders/{senderId}"); + } + + /** + * Deletes an email sender from your Brevo account. + * + * Use this to: + * - Remove senders that are no longer needed + * - Clean up sender configurations + * - Remove duplicate or test senders + * + * Key information returned: + * - Success confirmation message + * + * @param {Brevo.DeleteSenderRequest} request + * @param {SendersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.senders.deleteSender({ + * senderId: 1000000 + * }) + */ + public deleteSender( + request: Brevo.DeleteSenderRequest, + requestOptions?: SendersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteSender(request, requestOptions)); + } + + private async __deleteSender( + request: Brevo.DeleteSenderRequest, + requestOptions?: SendersClient.RequestOptions, + ): Promise> { + const { senderId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `senders/${core.url.encodePathParam(senderId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/senders/{senderId}"); + } + + /** + * Retrieves the dedicated IPs associated with a specific sender. + * + * Use this to: + * - Check IP configuration for a sender + * - Verify dedicated IP associations + * - Get IP details for troubleshooting + * - Monitor sender IP configuration + * + * Key information returned: + * - List of associated dedicated IPs + * - IP addresses and domain configurations + * - IP status and settings + * + * @param {Brevo.GetIpsFromSenderRequest} request + * @param {SendersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.senders.getIpsFromSender({ + * senderId: 1000000 + * }) + */ + public getIpsFromSender( + request: Brevo.GetIpsFromSenderRequest, + requestOptions?: SendersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getIpsFromSender(request, requestOptions)); + } + + private async __getIpsFromSender( + request: Brevo.GetIpsFromSenderRequest, + requestOptions?: SendersClient.RequestOptions, + ): Promise> { + const { senderId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `senders/${core.url.encodePathParam(senderId)}/ips`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetIpsFromSenderResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/senders/{senderId}/ips"); + } + + /** + * Validates a sender using the OTP (One-Time Password) received via email. + * + * Use this to: + * - Complete sender verification process + * - Activate a newly created sender + * - Verify ownership of the sender email address + * - Enable the sender for use in email campaigns + * + * Key information returned: + * - Success confirmation of sender verification + * - Sender activation status + * + * @param {Brevo.ValidateSenderByOtpRequest} request + * @param {SendersClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.senders.validateSenderByOtp({ + * senderId: 1000000, + * otp: 123456 + * }) + * + * @example + * await client.senders.validateSenderByOtp({ + * senderId: 1000000, + * otp: 789012 + * }) + */ + public validateSenderByOtp( + request: Brevo.ValidateSenderByOtpRequest, + requestOptions?: SendersClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__validateSenderByOtp(request, requestOptions)); + } + + private async __validateSenderByOtp( + request: Brevo.ValidateSenderByOtpRequest, + requestOptions?: SendersClient.RequestOptions, + ): Promise> { + const { senderId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `senders/${core.url.encodePathParam(senderId)}/validate`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/senders/{senderId}/validate"); + } +} diff --git a/src/api/resources/senders/client/index.ts b/src/api/resources/senders/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/senders/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/senders/client/requests/CreateSenderRequest.ts b/src/api/resources/senders/client/requests/CreateSenderRequest.ts new file mode 100644 index 0000000..364ae95 --- /dev/null +++ b/src/api/resources/senders/client/requests/CreateSenderRequest.ts @@ -0,0 +1,81 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "support@example.com", + * name: "Support Team" + * } + * + * @example + * { + * email: "marketing@example.com", + * ips: [{ + * domain: "example.com", + * ip: "203.0.113.100", + * weight: 100 + * }], + * name: "Marketing Team" + * } + * + * @example + * { + * email: "newsletter@example.com", + * ips: [{ + * domain: "example.com", + * ip: "203.0.113.100", + * weight: 60 + * }, { + * domain: "news.example.com", + * ip: "203.0.113.101", + * weight: 40 + * }], + * name: "Newsletter" + * } + * + * @example + * { + * email: "support@example.com", + * name: "Support Team" + * } + * + * @example + * { + * email: "support@example.com", + * name: "Support Team" + * } + */ +export interface CreateSenderRequest { + /** + * From email to use for the sender. A verification email will be + * sent to this address. + */ + email: string; + /** + * **Mandatory in case of dedicated IP**. IPs to associate to the + * sender. Not required for standard accounts. + */ + ips?: CreateSenderRequest.Ips.Item[]; + /** From Name to use for the sender */ + name: string; +} + +export namespace CreateSenderRequest { + export type Ips = Ips.Item[]; + + export namespace Ips { + export interface Item { + /** Domain of the IP */ + domain: string; + /** Dedicated IP available in your account */ + ip: string; + /** + * Weight to apply to the IP. Sum of all IP weights must be + * 100. Should be passed for either ALL or NONE of the IPs. + * If it's not passed, the sending will be equally balanced + * on all IPs. + */ + weight?: number; + } + } +} diff --git a/src/api/resources/senders/client/requests/DeleteSenderRequest.ts b/src/api/resources/senders/client/requests/DeleteSenderRequest.ts new file mode 100644 index 0000000..d1344e6 --- /dev/null +++ b/src/api/resources/senders/client/requests/DeleteSenderRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * senderId: 1000000 + * } + */ +export interface DeleteSenderRequest { + /** Id of the sender */ + senderId: number; +} diff --git a/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts b/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts new file mode 100644 index 0000000..c90da79 --- /dev/null +++ b/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * senderId: 1000000 + * } + * + * @example + * { + * senderId: 1000000 + * } + */ +export interface GetIpsFromSenderRequest { + /** Id of the sender */ + senderId: number; +} diff --git a/src/api/resources/senders/client/requests/GetSendersRequest.ts b/src/api/resources/senders/client/requests/GetSendersRequest.ts new file mode 100644 index 0000000..78e6525 --- /dev/null +++ b/src/api/resources/senders/client/requests/GetSendersRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + * + * @example + * {} + */ +export interface GetSendersRequest { + /** Filter your senders for a specific ip. **Available for dedicated IP usage only** */ + ip?: string; + /** Filter your senders for a specific domain */ + domain?: string; +} diff --git a/src/api/resources/senders/client/requests/UpdateSenderRequest.ts b/src/api/resources/senders/client/requests/UpdateSenderRequest.ts new file mode 100644 index 0000000..3460946 --- /dev/null +++ b/src/api/resources/senders/client/requests/UpdateSenderRequest.ts @@ -0,0 +1,83 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * senderId: 1000000, + * name: "New Support Team" + * } + * + * @example + * { + * senderId: 1000000, + * email: "newsupport@mycompany.com" + * } + * + * @example + * { + * senderId: 1000000, + * email: "marketing@mycompany.com", + * name: "Marketing Team" + * } + * + * @example + * { + * senderId: 1000000, + * email: "marketing@enterprise.com", + * ips: [{ + * domain: "enterprise.com", + * ip: "192.168.1.100", + * weight: 100 + * }], + * name: "Enterprise Marketing" + * } + * + * @example + * { + * senderId: 1000000, + * email: "campaigns@enterprise.com", + * ips: [{ + * domain: "enterprise.com", + * ip: "192.168.1.100", + * weight: 70 + * }, { + * domain: "mail.enterprise.com", + * ip: "192.168.1.101", + * weight: 30 + * }], + * name: "Multi-IP Sender" + * } + */ +export interface UpdateSenderRequest { + /** Id of the sender */ + senderId: number; + /** From Email to update the sender */ + email?: string; + /** + * **Only in case of dedicated IP**. IPs to associate to the + * sender. If passed, will replace all the existing IPs. Not required for standard accounts. + */ + ips?: UpdateSenderRequest.Ips.Item[]; + /** From Name to update the sender */ + name?: string; +} + +export namespace UpdateSenderRequest { + export type Ips = Ips.Item[]; + + export namespace Ips { + export interface Item { + /** Domain of the IP */ + domain: string; + /** Dedicated IP available in your account */ + ip: string; + /** + * Weight to apply to the IP. Sum of all IP weights must be + * 100. Should be passed for either ALL or NONE of the IPs. + * If it's not passed, the sending will be equally balanced + * on all IPs. + */ + weight?: number; + } + } +} diff --git a/src/api/resources/senders/client/requests/ValidateSenderByOtpRequest.ts b/src/api/resources/senders/client/requests/ValidateSenderByOtpRequest.ts new file mode 100644 index 0000000..36651fc --- /dev/null +++ b/src/api/resources/senders/client/requests/ValidateSenderByOtpRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * senderId: 1000000, + * otp: 123456 + * } + * + * @example + * { + * senderId: 1000000, + * otp: 789012 + * } + */ +export interface ValidateSenderByOtpRequest { + /** Id of the sender */ + senderId: number; + /** 6 digit OTP received on email */ + otp: number; +} diff --git a/src/api/resources/senders/client/requests/index.ts b/src/api/resources/senders/client/requests/index.ts new file mode 100644 index 0000000..8651598 --- /dev/null +++ b/src/api/resources/senders/client/requests/index.ts @@ -0,0 +1,6 @@ +export type { CreateSenderRequest } from "./CreateSenderRequest.js"; +export type { DeleteSenderRequest } from "./DeleteSenderRequest.js"; +export type { GetIpsFromSenderRequest } from "./GetIpsFromSenderRequest.js"; +export type { GetSendersRequest } from "./GetSendersRequest.js"; +export type { UpdateSenderRequest } from "./UpdateSenderRequest.js"; +export type { ValidateSenderByOtpRequest } from "./ValidateSenderByOtpRequest.js"; diff --git a/src/api/resources/senders/index.ts b/src/api/resources/senders/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/senders/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/senders/types/CreateSenderResponse.ts b/src/api/resources/senders/types/CreateSenderResponse.ts new file mode 100644 index 0000000..3aebcbd --- /dev/null +++ b/src/api/resources/senders/types/CreateSenderResponse.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateSenderResponse { + /** + * Status of DKIM configuration for the sender (true = DKIM not + * well configured, false = DKIM well configured) + */ + dkimError?: boolean; + /** ID of the Sender created */ + id: number; + /** + * Status of SPF configuration for the sender (true = SPF not + * well configured, false = SPF well configured) + */ + spfError?: boolean; +} diff --git a/src/api/resources/senders/types/GetIpsFromSenderResponse.ts b/src/api/resources/senders/types/GetIpsFromSenderResponse.ts new file mode 100644 index 0000000..f1b15ca --- /dev/null +++ b/src/api/resources/senders/types/GetIpsFromSenderResponse.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetIpsFromSenderResponse { + /** + * Dedicated IP(s) linked to a sender. Returns empty array for standard accounts + * without dedicated IPs. + */ + ips: GetIpsFromSenderResponse.Ips.Item[]; +} + +export namespace GetIpsFromSenderResponse { + export type Ips = Ips.Item[]; + + export namespace Ips { + export interface Item { + /** Domain associated to the IP */ + domain: string; + /** ID of the dedicated IP */ + id: number; + /** Dedicated IP address */ + ip: string; + /** Weight of the IP for this sender */ + weight: number; + } + } +} diff --git a/src/api/resources/senders/types/GetIpsResponse.ts b/src/api/resources/senders/types/GetIpsResponse.ts new file mode 100644 index 0000000..4614c77 --- /dev/null +++ b/src/api/resources/senders/types/GetIpsResponse.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetIpsResponse { + /** + * Dedicated IP(s) available on your account. Returns empty array + * for standard accounts without dedicated IPs. + */ + ips: GetIpsResponse.Ips.Item[]; +} + +export namespace GetIpsResponse { + export type Ips = Ips.Item[]; + + export namespace Ips { + export interface Item { + /** Status of the IP (true=active, false=inactive) */ + active: boolean; + /** Domain associated to the IP */ + domain: string; + /** ID of the dedicated IP */ + id: number; + /** Dedicated IP address */ + ip: string; + } + } +} diff --git a/src/api/resources/senders/types/GetSendersResponse.ts b/src/api/resources/senders/types/GetSendersResponse.ts new file mode 100644 index 0000000..0ad9003 --- /dev/null +++ b/src/api/resources/senders/types/GetSendersResponse.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSendersResponse { + /** List of the senders available in your account */ + senders?: GetSendersResponse.Senders.Item[]; +} + +export namespace GetSendersResponse { + export type Senders = Senders.Item[]; + + export namespace Senders { + export interface Item { + /** Status of sender (true=activated, false=deactivated) */ + active: boolean; + /** From Email associated to the sender */ + email: string; + /** Id of the sender */ + id: number; + /** + * List of dedicated IP(s) available in the account. This + * data is displayed only for dedicated IPs. For standard accounts, + * this will be an empty array. + */ + ips: Item.Ips.Item[]; + /** From Name associated to the sender */ + name: string; + } + + export namespace Item { + export type Ips = Ips.Item[]; + + export namespace Ips { + export interface Item { + /** Domain of the IP */ + domain: string; + /** Dedicated IP available in your account */ + ip: string; + /** Weight of the IP for this sender */ + weight: number; + } + } + } + } +} diff --git a/src/api/resources/senders/types/index.ts b/src/api/resources/senders/types/index.ts new file mode 100644 index 0000000..1ca608b --- /dev/null +++ b/src/api/resources/senders/types/index.ts @@ -0,0 +1,4 @@ +export * from "./CreateSenderResponse.js"; +export * from "./GetIpsFromSenderResponse.js"; +export * from "./GetIpsResponse.js"; +export * from "./GetSendersResponse.js"; diff --git a/src/api/resources/smsCampaigns/client/Client.ts b/src/api/resources/smsCampaigns/client/Client.ts new file mode 100644 index 0000000..7bf2355 --- /dev/null +++ b/src/api/resources/smsCampaigns/client/Client.ts @@ -0,0 +1,769 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace SmsCampaignsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class SmsCampaignsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: SmsCampaignsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetSmsCampaignsRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.smsCampaigns.getSmsCampaigns() + */ + public getSmsCampaigns( + request: Brevo.GetSmsCampaignsRequest = {}, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSmsCampaigns(request, requestOptions)); + } + + private async __getSmsCampaigns( + request: Brevo.GetSmsCampaignsRequest = {}, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { status, startDate, endDate, limit, offset, sort } = request; + const _queryParams: Record = { + status: status != null ? status : undefined, + startDate, + endDate, + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smsCampaigns", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSmsCampaignsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smsCampaigns"); + } + + /** + * @param {Brevo.CreateSmsCampaignRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.smsCampaigns.createSmsCampaign({ + * content: "Get a discount by visiting our NY store and saying : Happy Spring!", + * name: "Spring Promo Code", + * sender: "MyShop" + * }) + */ + public createSmsCampaign( + request: Brevo.CreateSmsCampaignRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createSmsCampaign(request, requestOptions)); + } + + private async __createSmsCampaign( + request: Brevo.CreateSmsCampaignRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smsCampaigns", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateSmsCampaignResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/smsCampaigns"); + } + + /** + * @param {Brevo.GetSmsCampaignRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.smsCampaigns.getSmsCampaign({ + * campaignId: 1000000 + * }) + */ + public getSmsCampaign( + request: Brevo.GetSmsCampaignRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSmsCampaign(request, requestOptions)); + } + + private async __getSmsCampaign( + request: Brevo.GetSmsCampaignRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smsCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSmsCampaignResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smsCampaigns/{campaignId}"); + } + + /** + * @param {Brevo.UpdateSmsCampaignRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.smsCampaigns.updateSmsCampaign({ + * campaignId: 1000000 + * }) + */ + public updateSmsCampaign( + request: Brevo.UpdateSmsCampaignRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateSmsCampaign(request, requestOptions)); + } + + private async __updateSmsCampaign( + request: Brevo.UpdateSmsCampaignRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smsCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/smsCampaigns/{campaignId}"); + } + + /** + * @param {Brevo.DeleteSmsCampaignRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.smsCampaigns.deleteSmsCampaign({ + * campaignId: 1000000 + * }) + */ + public deleteSmsCampaign( + request: Brevo.DeleteSmsCampaignRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteSmsCampaign(request, requestOptions)); + } + + private async __deleteSmsCampaign( + request: Brevo.DeleteSmsCampaignRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smsCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/smsCampaigns/{campaignId}"); + } + + /** + * It returns the background process ID which on completion calls the notify URL that you have set in the input. + * + * @param {Brevo.RequestSmsRecipientExportRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.smsCampaigns.requestSmsRecipientExport({ + * campaignId: 1000000, + * recipientsType: "all" + * }) + */ + public requestSmsRecipientExport( + request: Brevo.RequestSmsRecipientExportRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__requestSmsRecipientExport(request, requestOptions)); + } + + private async __requestSmsRecipientExport( + request: Brevo.RequestSmsRecipientExportRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smsCampaigns/${core.url.encodePathParam(campaignId)}/exportRecipients`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.RequestSmsRecipientExportResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/smsCampaigns/{campaignId}/exportRecipients", + ); + } + + /** + * @param {Brevo.SendSmsCampaignNowRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.PaymentRequiredError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.smsCampaigns.sendSmsCampaignNow({ + * campaignId: 1000000 + * }) + */ + public sendSmsCampaignNow( + request: Brevo.SendSmsCampaignNowRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendSmsCampaignNow(request, requestOptions)); + } + + private async __sendSmsCampaignNow( + request: Brevo.SendSmsCampaignNowRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smsCampaigns/${core.url.encodePathParam(campaignId)}/sendNow`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 402: + throw new Brevo.PaymentRequiredError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/smsCampaigns/{campaignId}/sendNow", + ); + } + + /** + * Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. + * + * @param {Brevo.SendSmsReportRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.smsCampaigns.sendSmsReport({ + * campaignId: 1000000, + * body: { + * email: { + * body: "Please find attached the report of our last email campaign.", + * to: ["jim.suehan@example.com"] + * } + * } + * }) + */ + public sendSmsReport( + request: Brevo.SendSmsReportRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendSmsReport(request, requestOptions)); + } + + private async __sendSmsReport( + request: Brevo.SendSmsReportRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smsCampaigns/${core.url.encodePathParam(campaignId)}/sendReport`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/smsCampaigns/{campaignId}/sendReport", + ); + } + + /** + * @param {Brevo.SendTestSmsRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.smsCampaigns.sendTestSms({ + * campaignId: 1000000 + * }) + */ + public sendTestSms( + request: Brevo.SendTestSmsRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendTestSms(request, requestOptions)); + } + + private async __sendTestSms( + request: Brevo.SendTestSmsRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smsCampaigns/${core.url.encodePathParam(campaignId)}/sendTest`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/smsCampaigns/{campaignId}/sendTest", + ); + } + + /** + * @param {Brevo.UpdateSmsCampaignStatusRequest} request + * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.smsCampaigns.updateSmsCampaignStatus({ + * campaignId: 1000000, + * body: {} + * }) + */ + public updateSmsCampaignStatus( + request: Brevo.UpdateSmsCampaignStatusRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateSmsCampaignStatus(request, requestOptions)); + } + + private async __updateSmsCampaignStatus( + request: Brevo.UpdateSmsCampaignStatusRequest, + requestOptions?: SmsCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smsCampaigns/${core.url.encodePathParam(campaignId)}/status`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/smsCampaigns/{campaignId}/status", + ); + } +} diff --git a/src/api/resources/smsCampaigns/client/index.ts b/src/api/resources/smsCampaigns/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/smsCampaigns/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/smsCampaigns/client/requests/CreateSmsCampaignRequest.ts b/src/api/resources/smsCampaigns/client/requests/CreateSmsCampaignRequest.ts new file mode 100644 index 0000000..a9d5af0 --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/CreateSmsCampaignRequest.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * content: "Get a discount by visiting our NY store and saying : Happy Spring!", + * name: "Spring Promo Code", + * sender: "MyShop" + * } + */ +export interface CreateSmsCampaignRequest { + /** Content of the message. The **maximum characters used per SMS is 160**, if used more than that, it will be counted as more than one SMS. */ + content: string; + /** Name of the campaign */ + name: string; + /** A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** */ + organisationPrefix?: string; + recipients?: CreateSmsCampaignRequest.Recipients; + /** UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + scheduledAt?: string; + /** Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** */ + sender: string; + /** Format of the message. It indicates whether the content should be treated as unicode or not. */ + unicodeEnabled?: boolean; + /** Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** */ + unsubscribeInstruction?: string; +} + +export namespace CreateSmsCampaignRequest { + export interface Recipients { + /** List ids which have to be excluded from a campaign */ + exclusionListIds?: number[]; + /** Lists Ids to send the campaign to. **REQUIRED if scheduledAt is not empty** */ + listIds: number[]; + } +} diff --git a/src/api/resources/smsCampaigns/client/requests/DeleteSmsCampaignRequest.ts b/src/api/resources/smsCampaigns/client/requests/DeleteSmsCampaignRequest.ts new file mode 100644 index 0000000..25f3253 --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/DeleteSmsCampaignRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface DeleteSmsCampaignRequest { + /** id of the SMS campaign */ + campaignId: number; +} diff --git a/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignRequest.ts b/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignRequest.ts new file mode 100644 index 0000000..111dd6c --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface GetSmsCampaignRequest { + /** id of the SMS campaign */ + campaignId: number; +} diff --git a/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignsRequest.ts b/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignsRequest.ts new file mode 100644 index 0000000..31e8ff6 --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignsRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetSmsCampaignsRequest { + /** Status of campaign. */ + status?: Brevo.GetSmsCampaignsRequestStatus; + /** **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) */ + endDate?: string; + /** Number limitation for the result returned */ + limit?: number; + /** Beginning point in the list to retrieve from. */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetSmsCampaignsRequestSort; +} diff --git a/src/api/resources/smsCampaigns/client/requests/RequestSmsRecipientExportRequest.ts b/src/api/resources/smsCampaigns/client/requests/RequestSmsRecipientExportRequest.ts new file mode 100644 index 0000000..38ae182 --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/RequestSmsRecipientExportRequest.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000, + * recipientsType: "all" + * } + */ +export interface RequestSmsRecipientExportRequest { + /** id of the campaign */ + campaignId: number; + /** URL that will be called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479 */ + notifyURL?: string; + /** Filter the recipients based on how they interacted with the campaign */ + recipientsType: RequestSmsRecipientExportRequest.RecipientsType; +} + +export namespace RequestSmsRecipientExportRequest { + /** Filter the recipients based on how they interacted with the campaign */ + export const RecipientsType = { + All: "all", + Delivered: "delivered", + Answered: "answered", + SoftBounces: "softBounces", + HardBounces: "hardBounces", + Unsubscribed: "unsubscribed", + } as const; + export type RecipientsType = (typeof RecipientsType)[keyof typeof RecipientsType]; +} diff --git a/src/api/resources/smsCampaigns/client/requests/SendSmsCampaignNowRequest.ts b/src/api/resources/smsCampaigns/client/requests/SendSmsCampaignNowRequest.ts new file mode 100644 index 0000000..daff4af --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/SendSmsCampaignNowRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface SendSmsCampaignNowRequest { + /** id of the campaign */ + campaignId: number; +} diff --git a/src/api/resources/smsCampaigns/client/requests/SendSmsReportRequest.ts b/src/api/resources/smsCampaigns/client/requests/SendSmsReportRequest.ts new file mode 100644 index 0000000..d22d9d2 --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/SendSmsReportRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * campaignId: 1000000, + * body: { + * email: { + * body: "Please find attached the report of our last email campaign.", + * to: ["jim.suehan@example.com"] + * } + * } + * } + */ +export interface SendSmsReportRequest { + /** id of the campaign */ + campaignId: number; + body: Brevo.SendReport; +} diff --git a/src/api/resources/smsCampaigns/client/requests/SendTestSmsRequest.ts b/src/api/resources/smsCampaigns/client/requests/SendTestSmsRequest.ts new file mode 100644 index 0000000..e7e5776 --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/SendTestSmsRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface SendTestSmsRequest { + /** Id of the SMS campaign */ + campaignId: number; + /** Mobile number of the recipient with the country code. This number **must belong to one of your contacts in Brevo account and must not be blacklisted** */ + phoneNumber?: string; +} diff --git a/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignRequest.ts b/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignRequest.ts new file mode 100644 index 0000000..994dedd --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignRequest.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface UpdateSmsCampaignRequest { + /** id of the SMS campaign */ + campaignId: number; + /** Content of the message. The **maximum characters used per SMS is 160**, if used more than that, it will be counted as more than one SMS */ + content?: string; + /** Name of the campaign */ + name?: string; + /** A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** */ + organisationPrefix?: string; + recipients?: UpdateSmsCampaignRequest.Recipients; + /** UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + scheduledAt?: string; + /** Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** */ + sender?: string; + /** Format of the message. It indicates whether the content should be treated as unicode or not. */ + unicodeEnabled?: boolean; + /** Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include **STOP** keyword. This will be added as instructions after the end of message content. **Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.** */ + unsubscribeInstruction?: string; +} + +export namespace UpdateSmsCampaignRequest { + export interface Recipients { + /** List ids which have to be excluded from a campaign */ + exclusionListIds?: number[]; + /** Lists Ids to send the campaign to. **REQUIRED if scheduledAt is not empty** */ + listIds: number[]; + } +} diff --git a/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignStatusRequest.ts b/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignStatusRequest.ts new file mode 100644 index 0000000..2eda88f --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignStatusRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * campaignId: 1000000, + * body: {} + * } + */ +export interface UpdateSmsCampaignStatusRequest { + /** id of the campaign */ + campaignId: number; + body: Brevo.UpdateCampaignStatus; +} diff --git a/src/api/resources/smsCampaigns/client/requests/index.ts b/src/api/resources/smsCampaigns/client/requests/index.ts new file mode 100644 index 0000000..8aefebd --- /dev/null +++ b/src/api/resources/smsCampaigns/client/requests/index.ts @@ -0,0 +1,10 @@ +export type { CreateSmsCampaignRequest } from "./CreateSmsCampaignRequest.js"; +export type { DeleteSmsCampaignRequest } from "./DeleteSmsCampaignRequest.js"; +export type { GetSmsCampaignRequest } from "./GetSmsCampaignRequest.js"; +export type { GetSmsCampaignsRequest } from "./GetSmsCampaignsRequest.js"; +export { RequestSmsRecipientExportRequest } from "./RequestSmsRecipientExportRequest.js"; +export type { SendSmsCampaignNowRequest } from "./SendSmsCampaignNowRequest.js"; +export type { SendSmsReportRequest } from "./SendSmsReportRequest.js"; +export type { SendTestSmsRequest } from "./SendTestSmsRequest.js"; +export type { UpdateSmsCampaignRequest } from "./UpdateSmsCampaignRequest.js"; +export type { UpdateSmsCampaignStatusRequest } from "./UpdateSmsCampaignStatusRequest.js"; diff --git a/src/api/resources/smsCampaigns/index.ts b/src/api/resources/smsCampaigns/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/smsCampaigns/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/smsCampaigns/types/CreateSmsCampaignResponse.ts b/src/api/resources/smsCampaigns/types/CreateSmsCampaignResponse.ts new file mode 100644 index 0000000..b95229e --- /dev/null +++ b/src/api/resources/smsCampaigns/types/CreateSmsCampaignResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateSmsCampaignResponse { + /** ID of the object created */ + id: number; +} diff --git a/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts b/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts new file mode 100644 index 0000000..116a2f9 --- /dev/null +++ b/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetSmsCampaignResponse { + /** Content of the SMS Campaign */ + content: string; + /** Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** ID of the SMS Campaign */ + id: number; + /** UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Name of the SMS Campaign */ + name: string; + /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ + scheduledAt?: string; + /** Sender of the SMS Campaign */ + sender: string; + /** Status of the SMS Campaign */ + status: GetSmsCampaignResponse.Status; + recipients: Brevo.GetCampaignRecipients; + statistics: Brevo.GetSmsCampaignStats; +} + +export namespace GetSmsCampaignResponse { + /** Status of the SMS Campaign */ + export const Status = { + Draft: "draft", + Sent: "sent", + Archive: "archive", + Queued: "queued", + Suspended: "suspended", + InProcess: "inProcess", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; +} diff --git a/src/api/resources/smsCampaigns/types/GetSmsCampaignsRequestSort.ts b/src/api/resources/smsCampaigns/types/GetSmsCampaignsRequestSort.ts new file mode 100644 index 0000000..cc32b74 --- /dev/null +++ b/src/api/resources/smsCampaigns/types/GetSmsCampaignsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetSmsCampaignsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetSmsCampaignsRequestSort = (typeof GetSmsCampaignsRequestSort)[keyof typeof GetSmsCampaignsRequestSort]; diff --git a/src/api/resources/smsCampaigns/types/GetSmsCampaignsRequestStatus.ts b/src/api/resources/smsCampaigns/types/GetSmsCampaignsRequestStatus.ts new file mode 100644 index 0000000..af329d2 --- /dev/null +++ b/src/api/resources/smsCampaigns/types/GetSmsCampaignsRequestStatus.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetSmsCampaignsRequestStatus = { + Suspended: "suspended", + Archive: "archive", + Sent: "sent", + Queued: "queued", + Draft: "draft", + InProcess: "inProcess", +} as const; +export type GetSmsCampaignsRequestStatus = + (typeof GetSmsCampaignsRequestStatus)[keyof typeof GetSmsCampaignsRequestStatus]; diff --git a/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts b/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts new file mode 100644 index 0000000..33c029a --- /dev/null +++ b/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts @@ -0,0 +1,49 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetSmsCampaignsResponse { + campaigns?: GetSmsCampaignsResponse.Campaigns.Item[]; + /** Number of SMS campaigns retrieved */ + count?: number; +} + +export namespace GetSmsCampaignsResponse { + export type Campaigns = Campaigns.Item[]; + + export namespace Campaigns { + export interface Item { + /** Content of the SMS Campaign */ + content: string; + /** Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** ID of the SMS Campaign */ + id: number; + /** UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Name of the SMS Campaign */ + name: string; + /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ + scheduledAt?: string; + /** Sender of the SMS Campaign */ + sender: string; + /** Status of the SMS Campaign */ + status: Item.Status; + recipients: Brevo.GetCampaignRecipients; + statistics: Brevo.GetSmsCampaignStats; + } + + export namespace Item { + /** Status of the SMS Campaign */ + export const Status = { + Draft: "draft", + Sent: "sent", + Archive: "archive", + Queued: "queued", + Suspended: "suspended", + InProcess: "inProcess", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; + } + } +} diff --git a/src/api/resources/smsCampaigns/types/RequestSmsRecipientExportResponse.ts b/src/api/resources/smsCampaigns/types/RequestSmsRecipientExportResponse.ts new file mode 100644 index 0000000..16905a6 --- /dev/null +++ b/src/api/resources/smsCampaigns/types/RequestSmsRecipientExportResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface RequestSmsRecipientExportResponse { + /** Id of the process created */ + processId: number; +} diff --git a/src/api/resources/smsCampaigns/types/index.ts b/src/api/resources/smsCampaigns/types/index.ts new file mode 100644 index 0000000..c98f360 --- /dev/null +++ b/src/api/resources/smsCampaigns/types/index.ts @@ -0,0 +1,6 @@ +export * from "./CreateSmsCampaignResponse.js"; +export * from "./GetSmsCampaignResponse.js"; +export * from "./GetSmsCampaignsRequestSort.js"; +export * from "./GetSmsCampaignsRequestStatus.js"; +export * from "./GetSmsCampaignsResponse.js"; +export * from "./RequestSmsRecipientExportResponse.js"; diff --git a/src/api/resources/smsTemplates/client/Client.ts b/src/api/resources/smsTemplates/client/Client.ts new file mode 100644 index 0000000..b9c2fd2 --- /dev/null +++ b/src/api/resources/smsTemplates/client/Client.ts @@ -0,0 +1,92 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace SmsTemplatesClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class SmsTemplatesClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: SmsTemplatesClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetSmsTemplatesRequest} request + * @param {SmsTemplatesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.smsTemplates.getSmsTemplates() + */ + public getSmsTemplates( + request: Brevo.GetSmsTemplatesRequest = {}, + requestOptions?: SmsTemplatesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSmsTemplates(request, requestOptions)); + } + + private async __getSmsTemplates( + request: Brevo.GetSmsTemplatesRequest = {}, + requestOptions?: SmsTemplatesClient.RequestOptions, + ): Promise> { + const { limit, offset, sort } = request; + const _queryParams: Record = { + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "transactionalSMS/templates", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSmsTemplatesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/transactionalSMS/templates"); + } +} diff --git a/src/api/resources/smsTemplates/client/index.ts b/src/api/resources/smsTemplates/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/smsTemplates/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/smsTemplates/client/requests/GetSmsTemplatesRequest.ts b/src/api/resources/smsTemplates/client/requests/GetSmsTemplatesRequest.ts new file mode 100644 index 0000000..ffd71a4 --- /dev/null +++ b/src/api/resources/smsTemplates/client/requests/GetSmsTemplatesRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetSmsTemplatesRequest { + /** Number of documents returned per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetSmsTemplatesRequestSort; +} diff --git a/src/api/resources/smsTemplates/client/requests/index.ts b/src/api/resources/smsTemplates/client/requests/index.ts new file mode 100644 index 0000000..b13bc1a --- /dev/null +++ b/src/api/resources/smsTemplates/client/requests/index.ts @@ -0,0 +1 @@ +export type { GetSmsTemplatesRequest } from "./GetSmsTemplatesRequest.js"; diff --git a/src/api/resources/smsTemplates/index.ts b/src/api/resources/smsTemplates/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/smsTemplates/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/smsTemplates/types/GetSmsTemplatesRequestSort.ts b/src/api/resources/smsTemplates/types/GetSmsTemplatesRequestSort.ts new file mode 100644 index 0000000..520aa08 --- /dev/null +++ b/src/api/resources/smsTemplates/types/GetSmsTemplatesRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetSmsTemplatesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetSmsTemplatesRequestSort = (typeof GetSmsTemplatesRequestSort)[keyof typeof GetSmsTemplatesRequestSort]; diff --git a/src/api/resources/smsTemplates/types/GetSmsTemplatesResponse.ts b/src/api/resources/smsTemplates/types/GetSmsTemplatesResponse.ts new file mode 100644 index 0000000..7b3e21b --- /dev/null +++ b/src/api/resources/smsTemplates/types/GetSmsTemplatesResponse.ts @@ -0,0 +1,54 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSmsTemplatesResponse { + /** Count of transactional sms templates */ + count?: number; + templates?: GetSmsTemplatesResponse.Templates.Item[]; +} + +export namespace GetSmsTemplatesResponse { + export type Templates = Templates.Item[]; + + export namespace Templates { + export interface Item { + /** ID of the template */ + id?: number; + /** Name of the template */ + name?: string; + /** URL shortening is enabled */ + short_url_enabled?: boolean; + /** message content for the sms */ + message?: string; + /** Manage US compliance */ + compliance?: Item.Compliance; + /** Enable Unicode encryption. */ + encryption?: boolean; + /** Support unicode characters in the sms. */ + unicode_sms?: boolean; + /** file name of the media. */ + media_file?: string; + /** file size in bytes. */ + media_file_size?: string; + /** URL of the image. */ + media_url?: string; + /** Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt?: string; + /** Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + updatedAt?: string; + } + + export namespace Item { + /** + * Manage US compliance + */ + export interface Compliance { + /** US compliance is enabled. */ + compliance_toggle?: boolean; + /** A recognizable prefix will ensure your audience knows who you are. Recommended by the U.S. carriers. */ + organisation_prefix?: string; + /** Instructions to unsubscribe from future communications. Must include STOP keyword. */ + stop_keyword?: string; + } + } + } +} diff --git a/src/api/resources/smsTemplates/types/index.ts b/src/api/resources/smsTemplates/types/index.ts new file mode 100644 index 0000000..a42e2b6 --- /dev/null +++ b/src/api/resources/smsTemplates/types/index.ts @@ -0,0 +1,2 @@ +export * from "./GetSmsTemplatesRequestSort.js"; +export * from "./GetSmsTemplatesResponse.js"; diff --git a/src/api/resources/tasks/client/Client.ts b/src/api/resources/tasks/client/Client.ts new file mode 100644 index 0000000..4e85ecc --- /dev/null +++ b/src/api/resources/tasks/client/Client.ts @@ -0,0 +1,446 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace TasksClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TasksClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TasksClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetCrmTasksRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.tasks.getAllTasks({ + * sortBy: "name" + * }) + */ + public getAllTasks( + request: Brevo.GetCrmTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAllTasks(request, requestOptions)); + } + + private async __getAllTasks( + request: Brevo.GetCrmTasksRequest = {}, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const { + "filter[type]": filterType, + "filter[status]": filterStatus, + "filter[date]": filterDate, + "filter[assignTo]": filterAssignTo, + "filter[contacts]": filterContacts, + "filter[deals]": filterDeals, + "filter[companies]": filterCompanies, + dateFrom, + dateTo, + offset, + limit, + sort, + sortBy, + } = request; + const _queryParams: Record = { + "filter[type]": filterType, + "filter[status]": filterStatus != null ? filterStatus : undefined, + "filter[date]": filterDate != null ? filterDate : undefined, + "filter[assignTo]": filterAssignTo, + "filter[contacts]": filterContacts, + "filter[deals]": filterDeals, + "filter[companies]": filterCompanies, + dateFrom, + dateTo, + offset, + limit, + sort: sort != null ? sort : undefined, + sortBy, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/tasks", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCrmTasksResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/tasks"); + } + + /** + * @param {Brevo.PostCrmTasksRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.tasks.createATask({ + * date: "2021-11-01T17:44:54Z", + * name: "Task: Connect with client_dev", + * taskTypeId: "61a5cd07ca1347c82306ad09" + * }) + */ + public createATask( + request: Brevo.PostCrmTasksRequest, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createATask(request, requestOptions)); + } + + private async __createATask( + request: Brevo.PostCrmTasksRequest, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/tasks", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.PostCrmTasksResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/tasks"); + } + + /** + * @param {Brevo.GetCrmTasksIdRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.tasks.getATask({ + * id: "id" + * }) + */ + public getATask( + request: Brevo.GetCrmTasksIdRequest, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getATask(request, requestOptions)); + } + + private async __getATask( + request: Brevo.GetCrmTasksIdRequest, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/tasks/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Task, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/tasks/{id}"); + } + + /** + * @param {Brevo.DeleteCrmTasksIdRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.tasks.deleteATask({ + * id: "id" + * }) + */ + public deleteATask( + request: Brevo.DeleteCrmTasksIdRequest, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteATask(request, requestOptions)); + } + + private async __deleteATask( + request: Brevo.DeleteCrmTasksIdRequest, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/tasks/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/crm/tasks/{id}"); + } + + /** + * @param {Brevo.PatchCrmTasksIdRequest} request + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.tasks.updateATask({ + * id: "id" + * }) + */ + public updateATask( + request: Brevo.PatchCrmTasksIdRequest, + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateATask(request, requestOptions)); + } + + private async __updateATask( + request: Brevo.PatchCrmTasksIdRequest, + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/tasks/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/crm/tasks/{id}"); + } + + /** + * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.tasks.getAllTaskTypes() + */ + public getAllTaskTypes( + requestOptions?: TasksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAllTaskTypes(requestOptions)); + } + + private async __getAllTaskTypes( + requestOptions?: TasksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "crm/tasktypes", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetCrmTasktypesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/tasktypes"); + } +} diff --git a/src/api/resources/tasks/client/index.ts b/src/api/resources/tasks/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/tasks/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/tasks/client/requests/DeleteCrmTasksIdRequest.ts b/src/api/resources/tasks/client/requests/DeleteCrmTasksIdRequest.ts new file mode 100644 index 0000000..015c356 --- /dev/null +++ b/src/api/resources/tasks/client/requests/DeleteCrmTasksIdRequest.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteCrmTasksIdRequest { + id: string; +} diff --git a/src/api/resources/tasks/client/requests/GetCrmTasksIdRequest.ts b/src/api/resources/tasks/client/requests/GetCrmTasksIdRequest.ts new file mode 100644 index 0000000..abc4106 --- /dev/null +++ b/src/api/resources/tasks/client/requests/GetCrmTasksIdRequest.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface GetCrmTasksIdRequest { + id: string; +} diff --git a/src/api/resources/tasks/client/requests/GetCrmTasksRequest.ts b/src/api/resources/tasks/client/requests/GetCrmTasksRequest.ts new file mode 100644 index 0000000..1a7f6e6 --- /dev/null +++ b/src/api/resources/tasks/client/requests/GetCrmTasksRequest.ts @@ -0,0 +1,38 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * sortBy: "name" + * } + */ +export interface GetCrmTasksRequest { + /** Filter by task type (ID) */ + "filter[type]"?: string; + /** Filter by task status */ + "filter[status]"?: Brevo.GetCrmTasksRequestFilterStatus; + /** Filter by date */ + "filter[date]"?: Brevo.GetCrmTasksRequestFilterDate; + /** Filter by the "assignTo" ID. You can utilize account emails for the "assignTo" attribute. */ + "filter[assignTo]"?: string; + /** Filter by contact ids */ + "filter[contacts]"?: string; + /** Filter by deals ids */ + "filter[deals]"?: string; + /** Filter by companies ids */ + "filter[companies]"?: string; + /** dateFrom to date range filter type (timestamp in milliseconds) */ + dateFrom?: number; + /** dateTo to date range filter type (timestamp in milliseconds) */ + dateTo?: number; + /** Index of the first document of the page */ + offset?: number; + /** Number of documents per page */ + limit?: number; + /** Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed */ + sort?: Brevo.GetCrmTasksRequestSort; + /** The field used to sort field names. */ + sortBy?: string; +} diff --git a/src/api/resources/tasks/client/requests/PatchCrmTasksIdRequest.ts b/src/api/resources/tasks/client/requests/PatchCrmTasksIdRequest.ts new file mode 100644 index 0000000..a4a0744 --- /dev/null +++ b/src/api/resources/tasks/client/requests/PatchCrmTasksIdRequest.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * id: "id" + * } + */ +export interface PatchCrmTasksIdRequest { + id: string; + /** To assign a task to a user you can use either the account email or ID. */ + assignToId?: string; + /** Companies ids for companies a task is linked to */ + companiesIds?: string[]; + /** Contact ids for contacts linked to this task */ + contactsIds?: number[]; + /** Task date/time */ + date?: string; + /** Deal ids for deals a task is linked to */ + dealsIds?: string[]; + /** Task marked as done */ + done?: boolean; + /** Duration of task in milliseconds [1 minute = 60000 ms] */ + duration?: number; + /** Name of task */ + name?: string; + /** Notes added to a task */ + notes?: string; + reminder?: Brevo.TaskReminder; + /** Id for type of task e.g Call / Email / Meeting etc. */ + taskTypeId?: string; +} diff --git a/src/api/resources/tasks/client/requests/PostCrmTasksRequest.ts b/src/api/resources/tasks/client/requests/PostCrmTasksRequest.ts new file mode 100644 index 0000000..407964c --- /dev/null +++ b/src/api/resources/tasks/client/requests/PostCrmTasksRequest.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * date: "2021-11-01T17:44:54Z", + * name: "Task: Connect with client_dev", + * taskTypeId: "61a5cd07ca1347c82306ad09" + * } + */ +export interface PostCrmTasksRequest { + /** To assign a task to a user you can use either the account email or ID. */ + assignToId?: string; + /** Companies ids for companies a task is linked to */ + companiesIds?: string[]; + /** Contact ids for contacts linked to this task */ + contactsIds?: number[]; + /** Task due date and time */ + date: string; + /** Deal ids for deals a task is linked to */ + dealsIds?: string[]; + /** Task marked as done */ + done?: boolean; + /** Duration of task in milliseconds [1 minute = 60000 ms] */ + duration?: number; + /** Name of task */ + name: string; + /** Notes added to a task */ + notes?: string; + reminder?: Brevo.TaskReminder; + /** Id for type of task e.g Call / Email / Meeting etc. */ + taskTypeId: string; +} diff --git a/src/api/resources/tasks/client/requests/index.ts b/src/api/resources/tasks/client/requests/index.ts new file mode 100644 index 0000000..b6c4585 --- /dev/null +++ b/src/api/resources/tasks/client/requests/index.ts @@ -0,0 +1,5 @@ +export type { DeleteCrmTasksIdRequest } from "./DeleteCrmTasksIdRequest.js"; +export type { GetCrmTasksIdRequest } from "./GetCrmTasksIdRequest.js"; +export type { GetCrmTasksRequest } from "./GetCrmTasksRequest.js"; +export type { PatchCrmTasksIdRequest } from "./PatchCrmTasksIdRequest.js"; +export type { PostCrmTasksRequest } from "./PostCrmTasksRequest.js"; diff --git a/src/api/resources/tasks/index.ts b/src/api/resources/tasks/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/tasks/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/tasks/types/GetCrmTasksRequestFilterDate.ts b/src/api/resources/tasks/types/GetCrmTasksRequestFilterDate.ts new file mode 100644 index 0000000..c0d3d19 --- /dev/null +++ b/src/api/resources/tasks/types/GetCrmTasksRequestFilterDate.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCrmTasksRequestFilterDate = { + Overdue: "overdue", + Today: "today", + Tomorrow: "tomorrow", + Week: "week", + Range: "range", +} as const; +export type GetCrmTasksRequestFilterDate = + (typeof GetCrmTasksRequestFilterDate)[keyof typeof GetCrmTasksRequestFilterDate]; diff --git a/src/api/resources/tasks/types/GetCrmTasksRequestFilterStatus.ts b/src/api/resources/tasks/types/GetCrmTasksRequestFilterStatus.ts new file mode 100644 index 0000000..5fd9f0c --- /dev/null +++ b/src/api/resources/tasks/types/GetCrmTasksRequestFilterStatus.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCrmTasksRequestFilterStatus = { + Done: "done", + Undone: "undone", +} as const; +export type GetCrmTasksRequestFilterStatus = + (typeof GetCrmTasksRequestFilterStatus)[keyof typeof GetCrmTasksRequestFilterStatus]; diff --git a/src/api/resources/tasks/types/GetCrmTasksRequestSort.ts b/src/api/resources/tasks/types/GetCrmTasksRequestSort.ts new file mode 100644 index 0000000..a6dc569 --- /dev/null +++ b/src/api/resources/tasks/types/GetCrmTasksRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetCrmTasksRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetCrmTasksRequestSort = (typeof GetCrmTasksRequestSort)[keyof typeof GetCrmTasksRequestSort]; diff --git a/src/api/resources/tasks/types/GetCrmTasksResponse.ts b/src/api/resources/tasks/types/GetCrmTasksResponse.ts new file mode 100644 index 0000000..835857f --- /dev/null +++ b/src/api/resources/tasks/types/GetCrmTasksResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +/** + * List of tasks + */ +export interface GetCrmTasksResponse { + /** List of tasks */ + items?: Brevo.Task[]; +} diff --git a/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts b/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts new file mode 100644 index 0000000..5aa2e7b --- /dev/null +++ b/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Task types details + */ +export interface GetCrmTasktypesResponse { + /** Id of task type */ + id?: string; + /** Title of task type */ + title?: string; +} diff --git a/src/api/resources/tasks/types/PostCrmTasksResponse.ts b/src/api/resources/tasks/types/PostCrmTasksResponse.ts new file mode 100644 index 0000000..0ee13e4 --- /dev/null +++ b/src/api/resources/tasks/types/PostCrmTasksResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Task Details + */ +export interface PostCrmTasksResponse { + /** Unique task id */ + id: string; +} diff --git a/src/api/resources/tasks/types/index.ts b/src/api/resources/tasks/types/index.ts new file mode 100644 index 0000000..cb1bf53 --- /dev/null +++ b/src/api/resources/tasks/types/index.ts @@ -0,0 +1,6 @@ +export * from "./GetCrmTasksRequestFilterDate.js"; +export * from "./GetCrmTasksRequestFilterStatus.js"; +export * from "./GetCrmTasksRequestSort.js"; +export * from "./GetCrmTasksResponse.js"; +export * from "./GetCrmTasktypesResponse.js"; +export * from "./PostCrmTasksResponse.js"; diff --git a/src/api/resources/tier/client/Client.ts b/src/api/resources/tier/client/Client.ts new file mode 100644 index 0000000..6d43dab --- /dev/null +++ b/src/api/resources/tier/client/Client.ts @@ -0,0 +1,945 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace TierClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TierClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TierClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Manually assigns a tier to a specific membership. + * + * @param {Brevo.AddSubscriptionToTierRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.ConflictError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.FailedDependencyError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.addSubscriptionToTier({ + * pid: "pid", + * cid: "cid", + * tid: "tid" + * }) + */ + public addSubscriptionToTier( + request: Brevo.AddSubscriptionToTierRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__addSubscriptionToTier(request, requestOptions)); + } + + private async __addSubscriptionToTier( + request: Brevo.AddSubscriptionToTierRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, cid, tid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/contacts/${core.url.encodePathParam(cid)}/tiers/${core.url.encodePathParam(tid)}`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.AddSubscriptionToTierResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Brevo.ConflictError(_response.error.body as Brevo.ErrorModel, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 424: + throw new Brevo.FailedDependencyError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/tier/programs/{pid}/contacts/{cid}/tiers/{tid}", + ); + } + + /** + * Returns the list of tier groups defined within the loyalty program. + * + * @param {Brevo.GetListOfTierGroupsRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.getListOfTierGroups({ + * pid: "pid" + * }) + */ + public getListOfTierGroups( + request: Brevo.GetListOfTierGroupsRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getListOfTierGroups(request, requestOptions)); + } + + private async __getListOfTierGroups( + request: Brevo.GetListOfTierGroupsRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, version } = request; + const _queryParams: Record = { + version: version != null ? version : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tier-groups`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetListOfTierGroupsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/tier/programs/{pid}/tier-groups", + ); + } + + /** + * Creates a new tier group in a loyalty program. *(The changes will take effect with the next publication of the loyalty program)* + * + * @param {Brevo.CreateTierGroupRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.ConflictError} + * @throws {@link Brevo.UnprocessableEntityError} + * + * @example + * await client.tier.createTierGroup({ + * pid: "pid", + * name: "name" + * }) + */ + public createTierGroup( + request: Brevo.CreateTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createTierGroup(request, requestOptions)); + } + + private async __createTierGroup( + request: Brevo.CreateTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tier-groups`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.TierGroup, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Brevo.ConflictError(_response.error.body as Brevo.ErrorModel, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/tier/programs/{pid}/tier-groups", + ); + } + + /** + * Returns tier group information. + * + * @param {Brevo.GetTierGroupRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.getTierGroup({ + * pid: "pid", + * gid: "gid" + * }) + */ + public getTierGroup( + request: Brevo.GetTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTierGroup(request, requestOptions)); + } + + private async __getTierGroup( + request: Brevo.GetTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, gid, version } = request; + const _queryParams: Record = { + version: version != null ? version : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tier-groups/${core.url.encodePathParam(gid)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.TierGroup, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/tier/programs/{pid}/tier-groups/{gid}", + ); + } + + /** + * Updates a tier group from a loyalty program. *(The changes will take effect with the next publication of the loyalty program)* + * + * @param {Brevo.UpdateTierGroupRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.updateTierGroup({ + * pid: "pid", + * gid: "gid", + * downgradeStrategy: "real_time", + * name: "name", + * tierOrder: ["tierOrder"], + * upgradeStrategy: "real_time" + * }) + */ + public updateTierGroup( + request: Brevo.UpdateTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateTierGroup(request, requestOptions)); + } + + private async __updateTierGroup( + request: Brevo.UpdateTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, gid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tier-groups/${core.url.encodePathParam(gid)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.TierGroup, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/loyalty/tier/programs/{pid}/tier-groups/{gid}", + ); + } + + /** + * Deletes a tier group from a loyalty program. *(The changes will take effect with the next publication of the loyalty program)* + * + * @param {Brevo.DeleteTierGroupRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.ConflictError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.deleteTierGroup({ + * pid: "pid", + * gid: "gid" + * }) + */ + public deleteTierGroup( + request: Brevo.DeleteTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteTierGroup(request, requestOptions)); + } + + private async __deleteTierGroup( + request: Brevo.DeleteTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, gid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tier-groups/${core.url.encodePathParam(gid)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as string, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 409: + throw new Brevo.ConflictError(_response.error.body as Brevo.ErrorModel, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/tier/programs/{pid}/tier-groups/{gid}", + ); + } + + /** + * Creates a new tier in a loyalty program tier group. *(The changes will take effect with the next publication of the loyalty program)* + * + * @param {Brevo.CreateTierForTierGroupRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.createTierForTierGroup({ + * pid: "pid", + * gid: "gid", + * accessConditions: [{}], + * name: "name" + * }) + */ + public createTierForTierGroup( + request: Brevo.CreateTierForTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createTierForTierGroup(request, requestOptions)); + } + + private async __createTierForTierGroup( + request: Brevo.CreateTierForTierGroupRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, gid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tier-groups/${core.url.encodePathParam(gid)}/tiers`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Tier, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/loyalty/tier/programs/{pid}/tier-groups/{gid}/tiers", + ); + } + + /** + * Returns the list of tiers defined within the loyalty program. + * + * @param {Brevo.GetLoyaltyProgramTierRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.getLoyaltyProgramTier({ + * pid: "pid" + * }) + */ + public getLoyaltyProgramTier( + request: Brevo.GetLoyaltyProgramTierRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getLoyaltyProgramTier(request, requestOptions)); + } + + private async __getLoyaltyProgramTier( + request: Brevo.GetLoyaltyProgramTierRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, version } = request; + const _queryParams: Record = { + version: version != null ? version : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tiers`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetLoyaltyProgramTierResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/loyalty/tier/programs/{pid}/tiers", + ); + } + + /** + * Modifies an existing tier for the specified tier group *(The changes will take effect with the next publication of the loyalty program)* + * + * @param {Brevo.UpdateTierRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.updateTier({ + * pid: "pid", + * tid: "tid", + * accessConditions: [{}], + * name: "name", + * tierRewards: [{}] + * }) + */ + public updateTier( + request: Brevo.UpdateTierRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateTier(request, requestOptions)); + } + + private async __updateTier( + request: Brevo.UpdateTierRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, tid, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tiers/${core.url.encodePathParam(tid)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.Tier, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/loyalty/tier/programs/{pid}/tiers/{tid}", + ); + } + + /** + * Deletes a tier from a loyalty program tier group. *(The changes will take effect with the next publication of the loyalty program)* + * + * @param {Brevo.DeleteTierRequest} request + * @param {TierClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.tier.deleteTier({ + * pid: "pid", + * tid: "tid" + * }) + */ + public deleteTier( + request: Brevo.DeleteTierRequest, + requestOptions?: TierClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteTier(request, requestOptions)); + } + + private async __deleteTier( + request: Brevo.DeleteTierRequest, + requestOptions?: TierClient.RequestOptions, + ): Promise> { + const { pid, tid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/tier/programs/${core.url.encodePathParam(pid)}/tiers/${core.url.encodePathParam(tid)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as string, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/tier/programs/{pid}/tiers/{tid}", + ); + } +} diff --git a/src/api/resources/tier/client/index.ts b/src/api/resources/tier/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/tier/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/tier/client/requests/AddSubscriptionToTierRequest.ts b/src/api/resources/tier/client/requests/AddSubscriptionToTierRequest.ts new file mode 100644 index 0000000..400f349 --- /dev/null +++ b/src/api/resources/tier/client/requests/AddSubscriptionToTierRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * cid: "cid", + * tid: "tid" + * } + */ +export interface AddSubscriptionToTierRequest { + /** Loyalty Program ID */ + pid: string; + /** Contact ID */ + cid: string; + /** Tier ID */ + tid: string; +} diff --git a/src/api/resources/tier/client/requests/CreateTierForTierGroupRequest.ts b/src/api/resources/tier/client/requests/CreateTierForTierGroupRequest.ts new file mode 100644 index 0000000..5f700ca --- /dev/null +++ b/src/api/resources/tier/client/requests/CreateTierForTierGroupRequest.ts @@ -0,0 +1,45 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * gid: "gid", + * accessConditions: [{}], + * name: "name" + * } + */ +export interface CreateTierForTierGroupRequest { + /** Loyalty Program ID */ + pid: string; + /** Tier group ID */ + gid: string; + accessConditions: CreateTierForTierGroupRequest.AccessConditions.Item[]; + /** Image of the tier */ + imageRef?: string; + /** Name of the tier to be created */ + name: string; + tierRewards?: CreateTierForTierGroupRequest.TierRewards.Item[]; +} + +export namespace CreateTierForTierGroupRequest { + export type AccessConditions = AccessConditions.Item[]; + + export namespace AccessConditions { + export interface Item { + /** Balance definition identifier for accessing the tier */ + balanceDefinitionId?: string; + /** Minimum value required to access the tier */ + minimumValue?: number; + } + } + + export type TierRewards = TierRewards.Item[]; + + export namespace TierRewards { + export interface Item { + /** Reward unique identifier */ + rewardId?: string; + } + } +} diff --git a/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts b/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts new file mode 100644 index 0000000..844e4bc --- /dev/null +++ b/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts @@ -0,0 +1,38 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * name: "name" + * } + */ +export interface CreateTierGroupRequest { + /** Loyalty Program ID */ + pid: string; + /** Select real_time to downgrade tier on real time balance updates. Select membership_anniversary to downgrade tier on subscription anniversary. Select tier_anniversary to downgrade tier on tier anniversary. */ + downgradeStrategy?: CreateTierGroupRequest.DowngradeStrategy; + /** Name of the tier group */ + name: string; + /** Order of the tiers in the group in ascending order */ + tierOrder?: string[]; + /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ + upgradeStrategy?: CreateTierGroupRequest.UpgradeStrategy; +} + +export namespace CreateTierGroupRequest { + /** Select real_time to downgrade tier on real time balance updates. Select membership_anniversary to downgrade tier on subscription anniversary. Select tier_anniversary to downgrade tier on tier anniversary. */ + export const DowngradeStrategy = { + RealTime: "real_time", + MembershipAnniversary: "membership_anniversary", + TierAnniversary: "tier_anniversary", + } as const; + export type DowngradeStrategy = (typeof DowngradeStrategy)[keyof typeof DowngradeStrategy]; + /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ + export const UpgradeStrategy = { + RealTime: "real_time", + MembershipAnniversary: "membership_anniversary", + TierAnniversary: "tier_anniversary", + } as const; + export type UpgradeStrategy = (typeof UpgradeStrategy)[keyof typeof UpgradeStrategy]; +} diff --git a/src/api/resources/tier/client/requests/DeleteTierGroupRequest.ts b/src/api/resources/tier/client/requests/DeleteTierGroupRequest.ts new file mode 100644 index 0000000..6607171 --- /dev/null +++ b/src/api/resources/tier/client/requests/DeleteTierGroupRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * gid: "gid" + * } + */ +export interface DeleteTierGroupRequest { + /** Loyalty Program ID */ + pid: string; + /** Tier group ID */ + gid: string; +} diff --git a/src/api/resources/tier/client/requests/DeleteTierRequest.ts b/src/api/resources/tier/client/requests/DeleteTierRequest.ts new file mode 100644 index 0000000..268cdc4 --- /dev/null +++ b/src/api/resources/tier/client/requests/DeleteTierRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * tid: "tid" + * } + */ +export interface DeleteTierRequest { + /** Loyalty Program ID */ + pid: string; + /** Tier ID */ + tid: string; +} diff --git a/src/api/resources/tier/client/requests/GetListOfTierGroupsRequest.ts b/src/api/resources/tier/client/requests/GetListOfTierGroupsRequest.ts new file mode 100644 index 0000000..e8538c8 --- /dev/null +++ b/src/api/resources/tier/client/requests/GetListOfTierGroupsRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface GetListOfTierGroupsRequest { + /** Loyalty Program ID */ + pid: string; + /** Select 'active' to retrieve list of all tier groups which are live for clients. Select draft to retrieve list of all non deleted tier groups. */ + version?: Brevo.GetListOfTierGroupsRequestVersion; +} diff --git a/src/api/resources/tier/client/requests/GetLoyaltyProgramTierRequest.ts b/src/api/resources/tier/client/requests/GetLoyaltyProgramTierRequest.ts new file mode 100644 index 0000000..7b08d92 --- /dev/null +++ b/src/api/resources/tier/client/requests/GetLoyaltyProgramTierRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid" + * } + */ +export interface GetLoyaltyProgramTierRequest { + /** Loyalty Program ID */ + pid: string; + /** Select 'active' to retrieve list of all tiers which are live for clients. Select draft to retrieve list of all non deleted tiers. */ + version?: Brevo.GetLoyaltyProgramTierRequestVersion; +} diff --git a/src/api/resources/tier/client/requests/GetTierGroupRequest.ts b/src/api/resources/tier/client/requests/GetTierGroupRequest.ts new file mode 100644 index 0000000..a6b5faf --- /dev/null +++ b/src/api/resources/tier/client/requests/GetTierGroupRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * pid: "pid", + * gid: "gid" + * } + */ +export interface GetTierGroupRequest { + /** Loyalty Program ID */ + pid: string; + /** Tier group ID */ + gid: string; + /** Select active to retrieve active version of tier group. Select draft to retrieve latest changes in tier group. */ + version?: Brevo.GetTierGroupRequestVersion; +} diff --git a/src/api/resources/tier/client/requests/UpdateTierGroupRequest.ts b/src/api/resources/tier/client/requests/UpdateTierGroupRequest.ts new file mode 100644 index 0000000..db20de7 --- /dev/null +++ b/src/api/resources/tier/client/requests/UpdateTierGroupRequest.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * gid: "gid", + * downgradeStrategy: "real_time", + * name: "name", + * tierOrder: ["tierOrder"], + * upgradeStrategy: "real_time" + * } + */ +export interface UpdateTierGroupRequest { + /** Loyalty Program ID */ + pid: string; + /** Tier group ID */ + gid: string; + /** Select real_time to downgrade tier on real time balance updates. Select membership_anniversary to downgrade tier on subscription anniversary. Select tier_anniversary to downgrade tier on tier anniversary. */ + downgradeStrategy: UpdateTierGroupRequest.DowngradeStrategy; + /** Name of the tier group */ + name: string; + /** Order of the tiers in the group in ascending order */ + tierOrder: string[]; + /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ + upgradeStrategy: UpdateTierGroupRequest.UpgradeStrategy; +} + +export namespace UpdateTierGroupRequest { + /** Select real_time to downgrade tier on real time balance updates. Select membership_anniversary to downgrade tier on subscription anniversary. Select tier_anniversary to downgrade tier on tier anniversary. */ + export const DowngradeStrategy = { + RealTime: "real_time", + MembershipAnniversary: "membership_anniversary", + TierAnniversary: "tier_anniversary", + } as const; + export type DowngradeStrategy = (typeof DowngradeStrategy)[keyof typeof DowngradeStrategy]; + /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ + export const UpgradeStrategy = { + RealTime: "real_time", + MembershipAnniversary: "membership_anniversary", + TierAnniversary: "tier_anniversary", + } as const; + export type UpgradeStrategy = (typeof UpgradeStrategy)[keyof typeof UpgradeStrategy]; +} diff --git a/src/api/resources/tier/client/requests/UpdateTierRequest.ts b/src/api/resources/tier/client/requests/UpdateTierRequest.ts new file mode 100644 index 0000000..0f33b96 --- /dev/null +++ b/src/api/resources/tier/client/requests/UpdateTierRequest.ts @@ -0,0 +1,46 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * tid: "tid", + * accessConditions: [{}], + * name: "name", + * tierRewards: [{}] + * } + */ +export interface UpdateTierRequest { + /** Loyalty Program ID */ + pid: string; + /** Tier ID */ + tid: string; + accessConditions: UpdateTierRequest.AccessConditions.Item[]; + /** Image of the tier */ + imageRef?: string; + /** Name of the tier to be created */ + name: string; + tierRewards: UpdateTierRequest.TierRewards.Item[]; +} + +export namespace UpdateTierRequest { + export type AccessConditions = AccessConditions.Item[]; + + export namespace AccessConditions { + export interface Item { + /** Balance definition identifier for accessing the tier */ + balanceDefinitionId?: string; + /** Minimum value required to access the tier */ + minimumValue?: number; + } + } + + export type TierRewards = TierRewards.Item[]; + + export namespace TierRewards { + export interface Item { + /** Reward unique identifier */ + rewardId?: string; + } + } +} diff --git a/src/api/resources/tier/client/requests/index.ts b/src/api/resources/tier/client/requests/index.ts new file mode 100644 index 0000000..6a580cb --- /dev/null +++ b/src/api/resources/tier/client/requests/index.ts @@ -0,0 +1,10 @@ +export type { AddSubscriptionToTierRequest } from "./AddSubscriptionToTierRequest.js"; +export type { CreateTierForTierGroupRequest } from "./CreateTierForTierGroupRequest.js"; +export { CreateTierGroupRequest } from "./CreateTierGroupRequest.js"; +export type { DeleteTierGroupRequest } from "./DeleteTierGroupRequest.js"; +export type { DeleteTierRequest } from "./DeleteTierRequest.js"; +export type { GetListOfTierGroupsRequest } from "./GetListOfTierGroupsRequest.js"; +export type { GetLoyaltyProgramTierRequest } from "./GetLoyaltyProgramTierRequest.js"; +export type { GetTierGroupRequest } from "./GetTierGroupRequest.js"; +export { UpdateTierGroupRequest } from "./UpdateTierGroupRequest.js"; +export type { UpdateTierRequest } from "./UpdateTierRequest.js"; diff --git a/src/api/resources/tier/index.ts b/src/api/resources/tier/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/tier/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/tier/types/AddSubscriptionToTierResponse.ts b/src/api/resources/tier/types/AddSubscriptionToTierResponse.ts new file mode 100644 index 0000000..9dfdfa2 --- /dev/null +++ b/src/api/resources/tier/types/AddSubscriptionToTierResponse.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AddSubscriptionToTierResponse { + /** Contact to which the tier is assigned */ + contactId?: number; + createdAt?: string; + /** Group Id to which the tier is associated */ + groupId?: string; + /** Unique identifier for the assigned tier */ + id?: string; + /** Associated loyalty program Id */ + loyaltyProgramId?: string; + /** object */ + meta?: Record; + updatedAt?: string; +} diff --git a/src/api/resources/tier/types/GetListOfTierGroupsRequestVersion.ts b/src/api/resources/tier/types/GetListOfTierGroupsRequestVersion.ts new file mode 100644 index 0000000..50e8720 --- /dev/null +++ b/src/api/resources/tier/types/GetListOfTierGroupsRequestVersion.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetListOfTierGroupsRequestVersion = { + Active: "active", + Draft: "draft", +} as const; +export type GetListOfTierGroupsRequestVersion = + (typeof GetListOfTierGroupsRequestVersion)[keyof typeof GetListOfTierGroupsRequestVersion]; diff --git a/src/api/resources/tier/types/GetListOfTierGroupsResponse.ts b/src/api/resources/tier/types/GetListOfTierGroupsResponse.ts new file mode 100644 index 0000000..36f325e --- /dev/null +++ b/src/api/resources/tier/types/GetListOfTierGroupsResponse.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetListOfTierGroupsResponse { + items?: Brevo.TierGroup[]; +} diff --git a/src/api/resources/tier/types/GetLoyaltyProgramTierRequestVersion.ts b/src/api/resources/tier/types/GetLoyaltyProgramTierRequestVersion.ts new file mode 100644 index 0000000..0080f33 --- /dev/null +++ b/src/api/resources/tier/types/GetLoyaltyProgramTierRequestVersion.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyProgramTierRequestVersion = { + Active: "active", + Draft: "draft", +} as const; +export type GetLoyaltyProgramTierRequestVersion = + (typeof GetLoyaltyProgramTierRequestVersion)[keyof typeof GetLoyaltyProgramTierRequestVersion]; diff --git a/src/api/resources/tier/types/GetLoyaltyProgramTierResponse.ts b/src/api/resources/tier/types/GetLoyaltyProgramTierResponse.ts new file mode 100644 index 0000000..d3e5605 --- /dev/null +++ b/src/api/resources/tier/types/GetLoyaltyProgramTierResponse.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetLoyaltyProgramTierResponse { + items?: Brevo.Tier[]; +} diff --git a/src/api/resources/tier/types/GetTierGroupRequestVersion.ts b/src/api/resources/tier/types/GetTierGroupRequestVersion.ts new file mode 100644 index 0000000..3adb29a --- /dev/null +++ b/src/api/resources/tier/types/GetTierGroupRequestVersion.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetTierGroupRequestVersion = { + Active: "active", + Draft: "draft", +} as const; +export type GetTierGroupRequestVersion = (typeof GetTierGroupRequestVersion)[keyof typeof GetTierGroupRequestVersion]; diff --git a/src/api/resources/tier/types/index.ts b/src/api/resources/tier/types/index.ts new file mode 100644 index 0000000..686177e --- /dev/null +++ b/src/api/resources/tier/types/index.ts @@ -0,0 +1,6 @@ +export * from "./AddSubscriptionToTierResponse.js"; +export * from "./GetListOfTierGroupsRequestVersion.js"; +export * from "./GetListOfTierGroupsResponse.js"; +export * from "./GetLoyaltyProgramTierRequestVersion.js"; +export * from "./GetLoyaltyProgramTierResponse.js"; +export * from "./GetTierGroupRequestVersion.js"; diff --git a/src/api/resources/transactionalEmails/client/Client.ts b/src/api/resources/transactionalEmails/client/Client.ts new file mode 100644 index 0000000..45e8cb4 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/Client.ts @@ -0,0 +1,1622 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace TransactionalEmailsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TransactionalEmailsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TransactionalEmailsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetTransacBlockedContactsRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.getTransacBlockedContacts() + */ + public getTransacBlockedContacts( + request: Brevo.GetTransacBlockedContactsRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransacBlockedContacts(request, requestOptions)); + } + + private async __getTransacBlockedContacts( + request: Brevo.GetTransacBlockedContactsRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { startDate, endDate, limit, offset, senders, sort } = request; + const _queryParams: Record = { + startDate, + endDate, + limit, + offset, + senders, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/blockedContacts", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetTransacBlockedContactsResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/blockedContacts"); + } + + /** + * @param {Brevo.DeleteSmtpBlockedContactsEmailRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.unblockOrResubscribeATransactionalContact({ + * email: "email" + * }) + */ + public unblockOrResubscribeATransactionalContact( + request: Brevo.DeleteSmtpBlockedContactsEmailRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__unblockOrResubscribeATransactionalContact(request, requestOptions), + ); + } + + private async __unblockOrResubscribeATransactionalContact( + request: Brevo.DeleteSmtpBlockedContactsEmailRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { email } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/blockedContacts/${core.url.encodePathParam(email)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/smtp/blockedContacts/{email}", + ); + } + + /** + * Get the list of blocked domains + * + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transactionalEmails.getBlockedDomains() + */ + public getBlockedDomains( + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getBlockedDomains(requestOptions)); + } + + private async __getBlockedDomains( + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/blockedDomains", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetBlockedDomainsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/blockedDomains"); + } + + /** + * Blocks a new domain in order to avoid messages being sent to the same + * + * @param {Brevo.BlockNewDomainRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.blockNewDomain({ + * domain: "example.com" + * }) + */ + public blockNewDomain( + request: Brevo.BlockNewDomainRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__blockNewDomain(request, requestOptions)); + } + + private async __blockNewDomain( + request: Brevo.BlockNewDomainRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/blockedDomains", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/smtp/blockedDomains"); + } + + /** + * Unblocks an existing domain from the list of blocked domains + * + * @param {Brevo.DeleteBlockedDomainRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.deleteBlockedDomain({ + * domain: "domain" + * }) + */ + public deleteBlockedDomain( + request: Brevo.DeleteBlockedDomainRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteBlockedDomain(request, requestOptions)); + } + + private async __deleteBlockedDomain( + request: Brevo.DeleteBlockedDomainRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { domain } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/blockedDomains/${core.url.encodePathParam(domain)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/smtp/blockedDomains/{domain}", + ); + } + + /** + * Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) + * + * @param {Brevo.DeleteHardbouncesRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.deleteHardbounces() + */ + public deleteHardbounces( + request: Brevo.DeleteHardbouncesRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteHardbounces(request, requestOptions)); + } + + private async __deleteHardbounces( + request: Brevo.DeleteHardbouncesRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/deleteHardbounces", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/smtp/deleteHardbounces"); + } + + /** + * @param {Brevo.SendTransacEmailRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.sendTransacEmail({ + * htmlContent: "

Hello,

This is my first transactional email sent from Brevo.

", + * sender: { + * email: "hello@brevo.com", + * name: "Alex from Brevo" + * }, + * subject: "Hello from Brevo!", + * to: [{ + * email: "johndoe@example.com", + * name: "John Doe" + * }] + * }) + * + * @example + * await client.transactionalEmails.sendTransacEmail({ + * htmlContent: "Your delivery is expected {{params.estimatedArrival}}.Your tracking code: {{params.trackingCode}}

", + * params: { + * "trackingCode": "JD01460000300002350000", + * "estimatedArrival": "Tomorrow" + * }, + * sender: { + * email: "hello@brevo.com", + * name: "Alex from Brevo" + * }, + * subject: "Hello from Brevo!", + * to: [{ + * email: "johndoe@example.com", + * name: "John Doe" + * }] + * }) + */ + public sendTransacEmail( + request: Brevo.SendTransacEmailRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendTransacEmail(request, requestOptions)); + } + + private async __sendTransacEmail( + request: Brevo.SendTransacEmailRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/email", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.SendTransacEmailResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/smtp/email"); + } + + /** + * Delete scheduled batch of emails by batchId or single scheduled email by messageId + * + * @param {Brevo.DeleteScheduledEmailByIdRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.deleteScheduledEmailById({ + * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627" + * }) + */ + public deleteScheduledEmailById( + request: Brevo.DeleteScheduledEmailByIdRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteScheduledEmailById(request, requestOptions)); + } + + private async __deleteScheduledEmailById( + request: Brevo.DeleteScheduledEmailByIdRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { identifier } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/email/${core.url.encodePathParam(identifier)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/smtp/email/{identifier}"); + } + + /** + * Fetch scheduled batch of emails by batchId or single scheduled email by messageId (Can retrieve data upto 30 days old) + * + * @param {Brevo.GetScheduledEmailByIdRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.getScheduledEmailById({ + * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", + * startDate: "2022-02-02", + * endDate: "2022-03-02" + * }) + */ + public getScheduledEmailById( + request: Brevo.GetScheduledEmailByIdRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getScheduledEmailById(request, requestOptions)); + } + + private async __getScheduledEmailById( + request: Brevo.GetScheduledEmailByIdRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { identifier, startDate, endDate, sort, status, limit, offset } = request; + const _queryParams: Record = { + startDate: startDate != null ? startDate : undefined, + endDate: endDate != null ? endDate : undefined, + sort: sort != null ? sort : undefined, + status: status != null ? status : undefined, + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/emailStatus/${core.url.encodePathParam(identifier)}`, + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetScheduledEmailByIdResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/smtp/emailStatus/{identifier}", + ); + } + + /** + * This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. + * + * @param {Brevo.GetTransacEmailsListRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.getTransacEmailsList() + */ + public getTransacEmailsList( + request: Brevo.GetTransacEmailsListRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransacEmailsList(request, requestOptions)); + } + + private async __getTransacEmailsList( + request: Brevo.GetTransacEmailsListRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { email, templateId, messageId, startDate, endDate, sort, limit, offset } = request; + const _queryParams: Record = { + email, + templateId, + messageId, + startDate, + endDate, + sort: sort != null ? sort : undefined, + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/emails", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetTransacEmailsListResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/emails"); + } + + /** + * + * You can get the uuid using either of the following methods: + * + * Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response. + * + * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. + * + * + * @param {Brevo.GetTransacEmailContentRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transactionalEmails.getTransacEmailContent({ + * uuid: "uuid" + * }) + */ + public getTransacEmailContent( + request: Brevo.GetTransacEmailContentRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransacEmailContent(request, requestOptions)); + } + + private async __getTransacEmailContent( + request: Brevo.GetTransacEmailContentRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { uuid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/emails/${core.url.encodePathParam(uuid)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetTransacEmailContentResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/emails/{uuid}"); + } + + /** + * @param {Brevo.DeleteSmtpLogIdentifierRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.deleteAnSmtpTransactionalLog({ + * identifier: "identifier" + * }) + */ + public deleteAnSmtpTransactionalLog( + request: Brevo.DeleteSmtpLogIdentifierRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteAnSmtpTransactionalLog(request, requestOptions)); + } + + private async __deleteAnSmtpTransactionalLog( + request: Brevo.DeleteSmtpLogIdentifierRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { identifier } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/log/${core.url.encodePathParam(identifier)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/smtp/log/{identifier}"); + } + + /** + * This endpoint will show the aggregated stats for past 90 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + * + * @param {Brevo.GetAggregatedSmtpReportRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.getAggregatedSmtpReport() + */ + public getAggregatedSmtpReport( + request: Brevo.GetAggregatedSmtpReportRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getAggregatedSmtpReport(request, requestOptions)); + } + + private async __getAggregatedSmtpReport( + request: Brevo.GetAggregatedSmtpReportRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { startDate, endDate, days, tag } = request; + const _queryParams: Record = { + startDate, + endDate, + days, + tag, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/statistics/aggregatedReport", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetAggregatedSmtpReportResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/smtp/statistics/aggregatedReport", + ); + } + + /** + * This endpoint will show the aggregated stats for past 30 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 90 days + * + * @param {Brevo.GetEmailEventReportRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.getEmailEventReport() + */ + public getEmailEventReport( + request: Brevo.GetEmailEventReportRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getEmailEventReport(request, requestOptions)); + } + + private async __getEmailEventReport( + request: Brevo.GetEmailEventReportRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { limit, offset, startDate, endDate, days, email, event, tags, messageId, templateId, sort } = request; + const _queryParams: Record = { + limit, + offset, + startDate, + endDate, + days, + email, + event: event != null ? event : undefined, + tags, + messageId, + templateId, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/statistics/events", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetEmailEventReportResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/statistics/events"); + } + + /** + * @param {Brevo.GetSmtpReportRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.getSmtpReport() + */ + public getSmtpReport( + request: Brevo.GetSmtpReportRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSmtpReport(request, requestOptions)); + } + + private async __getSmtpReport( + request: Brevo.GetSmtpReportRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { limit, offset, startDate, endDate, days, tag, sort } = request; + const _queryParams: Record = { + limit, + offset, + startDate, + endDate, + days, + tag, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/statistics/reports", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSmtpReportResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/statistics/reports"); + } + + /** + * @param {unknown} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.postPreviewSmtpEmailTemplates({ + * "key": "value" + * }) + */ + public postPreviewSmtpEmailTemplates( + request?: unknown, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__postPreviewSmtpEmailTemplates(request, requestOptions)); + } + + private async __postPreviewSmtpEmailTemplates( + request?: unknown, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/template/preview", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.PostPreviewSmtpEmailTemplatesResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/smtp/template/preview"); + } + + /** + * @param {Brevo.GetSmtpTemplatesRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.getSmtpTemplates() + */ + public getSmtpTemplates( + request: Brevo.GetSmtpTemplatesRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSmtpTemplates(request, requestOptions)); + } + + private async __getSmtpTemplates( + request: Brevo.GetSmtpTemplatesRequest = {}, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { templateStatus, limit, offset, sort } = request; + const _queryParams: Record = { + templateStatus, + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/templates", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSmtpTemplatesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/templates"); + } + + /** + * @param {Brevo.CreateSmtpTemplateRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalEmails.createSmtpTemplate({ + * sender: {}, + * subject: "Thanks for your purchase !", + * templateName: "Order Confirmation - EN" + * }) + */ + public createSmtpTemplate( + request: Brevo.CreateSmtpTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createSmtpTemplate(request, requestOptions)); + } + + private async __createSmtpTemplate( + request: Brevo.CreateSmtpTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "smtp/templates", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateSmtpTemplateResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/smtp/templates"); + } + + /** + * @param {Brevo.GetSmtpTemplateRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.getSmtpTemplate({ + * templateId: 1000000 + * }) + */ + public getSmtpTemplate( + request: Brevo.GetSmtpTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSmtpTemplate(request, requestOptions)); + } + + private async __getSmtpTemplate( + request: Brevo.GetSmtpTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { templateId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/templates/${core.url.encodePathParam(templateId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSmtpTemplateOverview, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/templates/{templateId}"); + } + + /** + * @param {Brevo.UpdateSmtpTemplateRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.updateSmtpTemplate({ + * templateId: 1000000 + * }) + */ + public updateSmtpTemplate( + request: Brevo.UpdateSmtpTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateSmtpTemplate(request, requestOptions)); + } + + private async __updateSmtpTemplate( + request: Brevo.UpdateSmtpTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { templateId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/templates/${core.url.encodePathParam(templateId)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/smtp/templates/{templateId}"); + } + + /** + * @param {Brevo.DeleteSmtpTemplateRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.deleteSmtpTemplate({ + * templateId: 1000000 + * }) + */ + public deleteSmtpTemplate( + request: Brevo.DeleteSmtpTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteSmtpTemplate(request, requestOptions)); + } + + private async __deleteSmtpTemplate( + request: Brevo.DeleteSmtpTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { templateId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/templates/${core.url.encodePathParam(templateId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/smtp/templates/{templateId}", + ); + } + + /** + * @param {Brevo.SendTestTemplateRequest} request + * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.transactionalEmails.sendTestTemplate({ + * templateId: 1000000, + * body: {} + * }) + */ + public sendTestTemplate( + request: Brevo.SendTestTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendTestTemplate(request, requestOptions)); + } + + private async __sendTestTemplate( + request: Brevo.SendTestTemplateRequest, + requestOptions?: TransactionalEmailsClient.RequestOptions, + ): Promise> { + const { templateId, body: _body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `smtp/templates/${core.url.encodePathParam(templateId)}/sendTest`, + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/smtp/templates/{templateId}/sendTest", + ); + } +} diff --git a/src/api/resources/transactionalEmails/client/index.ts b/src/api/resources/transactionalEmails/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/transactionalEmails/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/transactionalEmails/client/requests/BlockNewDomainRequest.ts b/src/api/resources/transactionalEmails/client/requests/BlockNewDomainRequest.ts new file mode 100644 index 0000000..32c9fa2 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/BlockNewDomainRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * domain: "example.com" + * } + */ +export interface BlockNewDomainRequest { + /** name of the domain to be blocked */ + domain: string; +} diff --git a/src/api/resources/transactionalEmails/client/requests/CreateSmtpTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/CreateSmtpTemplateRequest.ts new file mode 100644 index 0000000..f76e126 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/CreateSmtpTemplateRequest.ts @@ -0,0 +1,46 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * sender: {}, + * subject: "Thanks for your purchase !", + * templateName: "Order Confirmation - EN" + * } + */ +export interface CreateSmtpTemplateRequest { + /** Absolute url of the attachment (**no local file**). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps' */ + attachmentUrl?: string; + /** Body of the message (HTML version). The field must have more than 10 characters. **REQUIRED if htmlUrl is empty** */ + htmlContent?: string; + /** Url which contents the body of the email message. REQUIRED if htmlContent is empty */ + htmlUrl?: string; + /** Status of template. isActive = true means template is active and isActive = false means template is inactive */ + isActive?: boolean; + /** Email on which campaign recipients will be able to reply to */ + replyTo?: string; + /** Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** */ + sender: CreateSmtpTemplateRequest.Sender; + /** Subject of the template */ + subject: string; + /** Tag of the template */ + tag?: string; + /** Name of the template */ + templateName: string; + /** To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization */ + toField?: string; +} + +export namespace CreateSmtpTemplateRequest { + /** + * Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** + */ + export interface Sender { + /** Email of the sender */ + email?: string; + /** Select the sender for the template on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. */ + id?: number; + /** Name of the sender. **If not passed, will be set to default** */ + name?: string; + } +} diff --git a/src/api/resources/transactionalEmails/client/requests/DeleteBlockedDomainRequest.ts b/src/api/resources/transactionalEmails/client/requests/DeleteBlockedDomainRequest.ts new file mode 100644 index 0000000..e1efe33 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/DeleteBlockedDomainRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * domain: "domain" + * } + */ +export interface DeleteBlockedDomainRequest { + /** The name of the domain to be deleted */ + domain: string; +} diff --git a/src/api/resources/transactionalEmails/client/requests/DeleteHardbouncesRequest.ts b/src/api/resources/transactionalEmails/client/requests/DeleteHardbouncesRequest.ts new file mode 100644 index 0000000..facf3fd --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/DeleteHardbouncesRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface DeleteHardbouncesRequest { + /** Target a specific email address */ + contactEmail?: string; + /** Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate */ + endDate?: string; + /** Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate */ + startDate?: string; +} diff --git a/src/api/resources/transactionalEmails/client/requests/DeleteScheduledEmailByIdRequest.ts b/src/api/resources/transactionalEmails/client/requests/DeleteScheduledEmailByIdRequest.ts new file mode 100644 index 0000000..8d943ea --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/DeleteScheduledEmailByIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627" + * } + */ +export interface DeleteScheduledEmailByIdRequest { + /** The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. */ + identifier: string; +} diff --git a/src/api/resources/transactionalEmails/client/requests/DeleteSmtpBlockedContactsEmailRequest.ts b/src/api/resources/transactionalEmails/client/requests/DeleteSmtpBlockedContactsEmailRequest.ts new file mode 100644 index 0000000..51ed113 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/DeleteSmtpBlockedContactsEmailRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "email" + * } + */ +export interface DeleteSmtpBlockedContactsEmailRequest { + /** contact email (urlencoded) to unblock. */ + email: string; +} diff --git a/src/api/resources/transactionalEmails/client/requests/DeleteSmtpLogIdentifierRequest.ts b/src/api/resources/transactionalEmails/client/requests/DeleteSmtpLogIdentifierRequest.ts new file mode 100644 index 0000000..2b0e9d8 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/DeleteSmtpLogIdentifierRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * identifier: "identifier" + * } + */ +export interface DeleteSmtpLogIdentifierRequest { + /** MessageId of the transactional log(s) to delete */ + identifier: string; +} diff --git a/src/api/resources/transactionalEmails/client/requests/DeleteSmtpTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/DeleteSmtpTemplateRequest.ts new file mode 100644 index 0000000..39661d9 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/DeleteSmtpTemplateRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * templateId: 1000000 + * } + */ +export interface DeleteSmtpTemplateRequest { + /** id of the template */ + templateId: number; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetAggregatedSmtpReportRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetAggregatedSmtpReportRequest.ts new file mode 100644 index 0000000..a2871dd --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetAggregatedSmtpReportRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetAggregatedSmtpReportRequest { + /** **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate */ + endDate?: string; + /** Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ */ + days?: number; + /** Tag of the emails */ + tag?: string; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetEmailEventReportRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetEmailEventReportRequest.ts new file mode 100644 index 0000000..7da330b --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetEmailEventReportRequest.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetEmailEventReportRequest { + /** Number limitation for the result returned */ + limit?: number; + /** Beginning point in the list to retrieve from. */ + offset?: number; + /** **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate */ + endDate?: string; + /** Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ */ + days?: number; + /** Filter the report for a specific email addresses */ + email?: string; + /** Filter the report for a specific event type */ + event?: Brevo.GetEmailEventReportRequestEvent; + /** Filter the report for tags (serialized and urlencoded array) */ + tags?: string; + /** Filter on a specific message id */ + messageId?: string; + /** Filter on a specific template id */ + templateId?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetEmailEventReportRequestSort; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts new file mode 100644 index 0000000..235c13c --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", + * startDate: "2022-02-02", + * endDate: "2022-03-02" + * } + * + * @example + * { + * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", + * startDate: "2022-02-02", + * endDate: "2022-03-02" + * } + */ +export interface GetScheduledEmailByIdRequest { + /** The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. */ + identifier: string; + /** Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. */ + startDate?: string; + /** Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. */ + endDate?: string; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed. Not valid when identifier is `messageId`. */ + sort?: Brevo.GetScheduledEmailByIdRequestSort; + /** Filter the records by `status` of the scheduled email batch or message. Not valid when identifier is `messageId`. */ + status?: Brevo.GetScheduledEmailByIdRequestStatus; + /** Number of documents returned per page. Not valid when identifier is `messageId`. */ + limit?: number; + /** Index of the first document on the page. Not valid when identifier is `messageId`. */ + offset?: number; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetSmtpReportRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetSmtpReportRequest.ts new file mode 100644 index 0000000..f2fd0b2 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetSmtpReportRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetSmtpReportRequest { + /** Number of documents returned per page */ + limit?: number; + /** Index of the first document on the page */ + offset?: number; + /** **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD) */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) */ + endDate?: string; + /** Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ */ + days?: number; + /** Tag of the emails */ + tag?: string; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetSmtpReportRequestSort; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplateRequest.ts new file mode 100644 index 0000000..b674209 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplateRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * templateId: 1000000 + * } + */ +export interface GetSmtpTemplateRequest { + /** id of the template */ + templateId: number; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplatesRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplatesRequest.ts new file mode 100644 index 0000000..368e057 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplatesRequest.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetSmtpTemplatesRequest { + /** Filter on the status of the template. Active = true, inactive = false */ + templateStatus?: boolean; + /** Number of documents returned per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetSmtpTemplatesRequestSort; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetTransacBlockedContactsRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetTransacBlockedContactsRequest.ts new file mode 100644 index 0000000..1e63448 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetTransacBlockedContactsRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetTransacBlockedContactsRequest { + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts */ + endDate?: string; + /** Number of documents returned per page */ + limit?: number; + /** Index of the first document on the page */ + offset?: number; + /** Comma separated list of emails of the senders from which contacts are blocked or unsubscribed */ + senders?: string | string[]; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetTransacBlockedContactsRequestSort; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetTransacEmailContentRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetTransacEmailContentRequest.ts new file mode 100644 index 0000000..055dc4c --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetTransacEmailContentRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * uuid: "uuid" + * } + */ +export interface GetTransacEmailContentRequest { + /** Unique id of the transactional email that has been sent to a particular contact */ + uuid: string; +} diff --git a/src/api/resources/transactionalEmails/client/requests/GetTransacEmailsListRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetTransacEmailsListRequest.ts new file mode 100644 index 0000000..700a98b --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/GetTransacEmailsListRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetTransacEmailsListRequest { + /** **Mandatory if templateId and messageId are not passed in query filters.** Email address to which transactional email has been sent. */ + email?: string; + /** **Mandatory if email and messageId are not passed in query filters.** Id of the template that was used to compose transactional email. */ + templateId?: number; + /** **Mandatory if templateId and email are not passed in query filters.** Message ID of the transactional email sent. */ + messageId?: string; + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) from which you want to fetch the list. **Maximum time period that can be selected is one month**. */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) till which you want to fetch the list. **Maximum time period that can be selected is one month.** */ + endDate?: string; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetTransacEmailsListRequestSort; + /** Number of documents returned per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; +} diff --git a/src/api/resources/transactionalEmails/client/requests/SendTestTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/SendTestTemplateRequest.ts new file mode 100644 index 0000000..748c101 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/SendTestTemplateRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * templateId: 1000000, + * body: {} + * } + */ +export interface SendTestTemplateRequest { + /** Id of the template */ + templateId: number; + body: Brevo.SendTestEmail; +} diff --git a/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts b/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts new file mode 100644 index 0000000..915aafa --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts @@ -0,0 +1,207 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * htmlContent: "

Hello,

This is my first transactional email sent from Brevo.

", + * sender: { + * email: "hello@brevo.com", + * name: "Alex from Brevo" + * }, + * subject: "Hello from Brevo!", + * to: [{ + * email: "johndoe@example.com", + * name: "John Doe" + * }] + * } + * + * @example + * { + * htmlContent: "Your delivery is expected {{params.estimatedArrival}}.Your tracking code: {{params.trackingCode}}

", + * params: { + * "trackingCode": "JD01460000300002350000", + * "estimatedArrival": "Tomorrow" + * }, + * sender: { + * email: "hello@brevo.com", + * name: "Alex from Brevo" + * }, + * subject: "Hello from Brevo!", + * to: [{ + * email: "johndoe@example.com", + * name: "John Doe" + * }] + * } + */ +export interface SendTransacEmailRequest { + /** Array of attachment objects. Each attachment must include either an absolute URL (no local file paths) or base64-encoded content, along with the attachment filename. The `name` field is required when `content` is provided. Supported file extensions: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass, xlsm. When `templateId` is specified: if the template uses the New Template Language format, both `url` and `content` attachment types are supported; if the template uses the Old Template Language format, the `attachment` parameter is ignored. */ + attachment?: SendTransacEmailRequest.Attachment.Item[]; + /** UUIDv4 identifier for the scheduled batch of transactional emails. If omitted, a valid UUIDv4 batch identifier is automatically generated. */ + batchId?: string; + /** Array of BCC recipient objects. Each object contains an email address and an optional name. */ + bcc?: SendTransacEmailRequest.Bcc.Item[]; + /** Array of CC recipient objects. Each object contains an email address and an optional name. */ + cc?: SendTransacEmailRequest.Cc.Item[]; + /** Custom email headers (non-standard headers) to include in the email. The `sender.ip` header can be set to specify the IP address used for sending transactional emails (dedicated IP users only). Header names must use Title-Case-Format (words separated by hyphens with the first letter of each word capitalized). Headers not in this format are automatically converted. Standard email headers are not supported. Example: `{"sender.ip":"1.2.3.4", "X-Mailin-custom":"some_custom_value", "Idempotency-Key":"abc-123"}` */ + headers?: Record; + /** HTML body content of the email. Required when `templateId` is not provided. Ignored when `templateId` is provided. */ + htmlContent?: string; + /** Array of message version objects for sending customized email variants. The `templateId` can be customized per version only if a global `templateId` is provided. The `htmlContent` and `textContent` can be customized per version only if at least one of these is present in the global parameters. Global parameters such as `to` (required), `bcc`, `cc`, `replyTo`, and `subject` can be customized per version. Maximum total recipients per API request is 2000. Maximum recipients per message version is 99. Individual `params` objects must not exceed 100 KB. Cumulative `params` across all versions must not exceed 1000 KB. See https://developers.brevo.com/docs/batch-send-transactional-emails for detailed usage instructions. */ + messageVersions?: SendTransacEmailRequest.MessageVersions.Item[]; + /** Key-value pairs for template variable substitution. Only applicable when the template uses the New Template Language format. */ + params?: Record; + /** Reply-to email address (required) and optional display name. Recipients will use this address when replying to the email. */ + replyTo?: SendTransacEmailRequest.ReplyTo; + /** UTC date-time when the email should be sent (format: YYYY-MM-DDTHH:mm:ss.SSSZ). Include timezone information in the date-time value. Scheduled emails may be delayed by up to 5 minutes. */ + scheduledAt?: string; + /** Sender information. Required when `templateId` is not provided. Specify either an email address (with optional name) or a sender ID. The `name` field is ignored when `id` is provided. */ + sender?: SendTransacEmailRequest.Sender; + /** Email subject line. Required when `templateId` is not provided. */ + subject?: string; + /** Array of tags for categorizing and filtering emails */ + tags?: string[]; + /** Template identifier */ + templateId?: number; + /** Plain text body content of the email. Ignored when `templateId` is provided. */ + textContent?: string; + /** Array of recipient objects. Each object contains an email address and an optional display name. Required when `messageVersions` is not provided. Ignored when `messageVersions` is provided. Example: `[{"name":"Jimmy", "email":"jimmy@example.com"}, {"name":"Joe", "email":"joe@example.com"}]` */ + to?: SendTransacEmailRequest.To.Item[]; +} + +export namespace SendTransacEmailRequest { + export type Attachment = Attachment.Item[]; + + export namespace Attachment { + export interface Item { + /** Base64-encoded attachment data */ + content?: string; + /** Attachment filename. Required when `content` is provided. */ + name?: string; + /** Absolute URL of the attachment. Local file paths are not supported. */ + url?: string; + } + } + + export type Bcc = Bcc.Item[]; + + export namespace Bcc { + export interface Item { + /** BCC recipient email address */ + email: string; + /** Display name of the BCC recipient. Maximum length is 70 characters. */ + name?: string; + } + } + + export type Cc = Cc.Item[]; + + export namespace Cc { + export interface Item { + /** CC recipient email address */ + email: string; + /** Display name of the CC recipient. Maximum length is 70 characters. */ + name?: string; + } + } + + export type MessageVersions = MessageVersions.Item[]; + + export namespace MessageVersions { + export interface Item { + /** Array of BCC recipient objects. Each object contains an email address and an optional name. */ + bcc?: Item.Bcc.Item[]; + /** Array of CC recipient objects. Each object contains an email address and an optional name. */ + cc?: Item.Cc.Item[]; + /** HTML body content of the email. Required when `templateId` is not provided. Ignored when `templateId` is provided. */ + htmlContent?: string; + /** Key-value pairs for template variable substitution. Only applicable when the template uses the New Template Language format. */ + params?: Record; + /** Reply-to email address (required) and optional display name. Recipients will use this address when replying to the email. */ + replyTo?: Item.ReplyTo; + /** Email subject line for this message version */ + subject?: string; + /** Plain text body content of the email. Ignored when `templateId` is provided. */ + textContent?: string; + /** Array of recipient objects. Each object contains an email address and an optional display name. */ + to: Item.To.Item[]; + } + + export namespace Item { + export type Bcc = Bcc.Item[]; + + export namespace Bcc { + export interface Item { + /** BCC recipient email address */ + email: string; + /** Display name of the BCC recipient. Maximum length is 70 characters. */ + name?: string; + } + } + + export type Cc = Cc.Item[]; + + export namespace Cc { + export interface Item { + /** CC recipient email address */ + email: string; + /** Display name of the CC recipient. Maximum length is 70 characters. */ + name?: string; + } + } + + /** + * Reply-to email address (required) and optional display name. Recipients will use this address when replying to the email. + */ + export interface ReplyTo { + /** Email address in reply to */ + email: string; + /** Display name for the reply-to address. Maximum length is 70 characters. */ + name?: string; + } + + export type To = To.Item[]; + + export namespace To { + export interface Item { + /** Email address of the recipient */ + email: string; + /** Display name of the recipient. Maximum length is 70 characters. */ + name?: string; + } + } + } + } + + /** + * Reply-to email address (required) and optional display name. Recipients will use this address when replying to the email. + */ + export interface ReplyTo { + /** Email address in reply to */ + email: string; + /** Display name for the reply-to address. Maximum length is 70 characters. */ + name?: string; + } + + /** + * Sender information. Required when `templateId` is not provided. Specify either an email address (with optional name) or a sender ID. The `name` field is ignored when `id` is provided. + */ + export interface Sender { + /** Sender email address. Required when `id` is not provided. */ + email?: string; + /** Sender identifier. Required when `email` is not provided. Use this field to select a sender with a specific IP pool (dedicated IP users only). */ + id?: number; + /** Display name of the sender. Maximum length is 70 characters. Only applicable when `email` is provided. */ + name?: string; + } + + export type To = To.Item[]; + + export namespace To { + export interface Item { + /** Email address of the recipient */ + email: string; + /** Display name of the recipient. Maximum length is 70 characters. */ + name?: string; + } + } +} diff --git a/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts new file mode 100644 index 0000000..a91899a --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts @@ -0,0 +1,46 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * templateId: 1000000 + * } + */ +export interface UpdateSmtpTemplateRequest { + /** id of the template */ + templateId: number; + /** Absolute url of the attachment (**no local file**). Extensions allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps */ + attachmentUrl?: string; + /** **Required if htmlUrl is empty**. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) */ + htmlContent?: string; + /** **Required if htmlContent is empty**. URL to the body of the email (HTML) */ + htmlUrl?: string; + /** Status of the template. isActive = false means template is inactive, isActive = true means template is active */ + isActive?: boolean; + /** Email on which campaign recipients will be able to reply to */ + replyTo?: string; + /** Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** */ + sender?: UpdateSmtpTemplateRequest.Sender; + /** Subject of the email */ + subject?: string; + /** Tag of the template */ + tag?: string; + /** Name of the template */ + templateName?: string; + /** To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization */ + toField?: string; +} + +export namespace UpdateSmtpTemplateRequest { + /** + * Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** + */ + export interface Sender { + /** Email of the sender */ + email?: string; + /** Select the sender for the template on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. */ + id?: number; + /** Name of the sender */ + name?: string; + } +} diff --git a/src/api/resources/transactionalEmails/client/requests/index.ts b/src/api/resources/transactionalEmails/client/requests/index.ts new file mode 100644 index 0000000..3b3f1e6 --- /dev/null +++ b/src/api/resources/transactionalEmails/client/requests/index.ts @@ -0,0 +1,20 @@ +export type { BlockNewDomainRequest } from "./BlockNewDomainRequest.js"; +export type { CreateSmtpTemplateRequest } from "./CreateSmtpTemplateRequest.js"; +export type { DeleteBlockedDomainRequest } from "./DeleteBlockedDomainRequest.js"; +export type { DeleteHardbouncesRequest } from "./DeleteHardbouncesRequest.js"; +export type { DeleteScheduledEmailByIdRequest } from "./DeleteScheduledEmailByIdRequest.js"; +export type { DeleteSmtpBlockedContactsEmailRequest } from "./DeleteSmtpBlockedContactsEmailRequest.js"; +export type { DeleteSmtpLogIdentifierRequest } from "./DeleteSmtpLogIdentifierRequest.js"; +export type { DeleteSmtpTemplateRequest } from "./DeleteSmtpTemplateRequest.js"; +export type { GetAggregatedSmtpReportRequest } from "./GetAggregatedSmtpReportRequest.js"; +export type { GetEmailEventReportRequest } from "./GetEmailEventReportRequest.js"; +export type { GetScheduledEmailByIdRequest } from "./GetScheduledEmailByIdRequest.js"; +export type { GetSmtpReportRequest } from "./GetSmtpReportRequest.js"; +export type { GetSmtpTemplateRequest } from "./GetSmtpTemplateRequest.js"; +export type { GetSmtpTemplatesRequest } from "./GetSmtpTemplatesRequest.js"; +export type { GetTransacBlockedContactsRequest } from "./GetTransacBlockedContactsRequest.js"; +export type { GetTransacEmailContentRequest } from "./GetTransacEmailContentRequest.js"; +export type { GetTransacEmailsListRequest } from "./GetTransacEmailsListRequest.js"; +export type { SendTestTemplateRequest } from "./SendTestTemplateRequest.js"; +export type { SendTransacEmailRequest } from "./SendTransacEmailRequest.js"; +export type { UpdateSmtpTemplateRequest } from "./UpdateSmtpTemplateRequest.js"; diff --git a/src/api/resources/transactionalEmails/index.ts b/src/api/resources/transactionalEmails/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/transactionalEmails/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/transactionalEmails/types/CreateSmtpTemplateResponse.ts b/src/api/resources/transactionalEmails/types/CreateSmtpTemplateResponse.ts new file mode 100644 index 0000000..871956c --- /dev/null +++ b/src/api/resources/transactionalEmails/types/CreateSmtpTemplateResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateSmtpTemplateResponse { + /** ID of the object created */ + id: number; +} diff --git a/src/api/resources/transactionalEmails/types/GetAggregatedSmtpReportResponse.ts b/src/api/resources/transactionalEmails/types/GetAggregatedSmtpReportResponse.ts new file mode 100644 index 0000000..66581ca --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetAggregatedSmtpReportResponse.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetAggregatedSmtpReportResponse { + /** Number of blocked contact emails for the timeframe */ + blocked?: number; + /** Number of clicks for the timeframe */ + clicks?: number; + /** Number of delivered emails for the timeframe */ + delivered?: number; + /** Number of hardbounces for the timeframe */ + hardBounces?: number; + /** Number of invalid emails for the timeframe */ + invalid?: number; + /** Number of openings for the timeframe */ + opens?: number; + /** Time frame of the report */ + range?: string; + /** Number of requests for the timeframe */ + requests?: number; + /** Number of softbounces for the timeframe */ + softBounces?: number; + /** Number of complaint (spam report) for the timeframe */ + spamReports?: number; + /** Number of unique clicks for the timeframe */ + uniqueClicks?: number; + /** Number of unique openings for the timeframe */ + uniqueOpens?: number; + /** Number of unsubscribed emails for the timeframe */ + unsubscribed?: number; +} diff --git a/src/api/resources/transactionalEmails/types/GetBlockedDomainsResponse.ts b/src/api/resources/transactionalEmails/types/GetBlockedDomainsResponse.ts new file mode 100644 index 0000000..3e7661e --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetBlockedDomainsResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetBlockedDomainsResponse { + /** List of all blocked domains */ + domains: string[]; +} diff --git a/src/api/resources/transactionalEmails/types/GetEmailEventReportRequestEvent.ts b/src/api/resources/transactionalEmails/types/GetEmailEventReportRequestEvent.ts new file mode 100644 index 0000000..3807eda --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetEmailEventReportRequestEvent.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEmailEventReportRequestEvent = { + Bounces: "bounces", + HardBounces: "hardBounces", + SoftBounces: "softBounces", + Delivered: "delivered", + Spam: "spam", + Requests: "requests", + Opened: "opened", + Clicks: "clicks", + Invalid: "invalid", + Deferred: "deferred", + Blocked: "blocked", + Unsubscribed: "unsubscribed", + Error: "error", + LoadedByProxy: "loadedByProxy", +} as const; +export type GetEmailEventReportRequestEvent = + (typeof GetEmailEventReportRequestEvent)[keyof typeof GetEmailEventReportRequestEvent]; diff --git a/src/api/resources/transactionalEmails/types/GetEmailEventReportRequestSort.ts b/src/api/resources/transactionalEmails/types/GetEmailEventReportRequestSort.ts new file mode 100644 index 0000000..13ce5ff --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetEmailEventReportRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetEmailEventReportRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetEmailEventReportRequestSort = + (typeof GetEmailEventReportRequestSort)[keyof typeof GetEmailEventReportRequestSort]; diff --git a/src/api/resources/transactionalEmails/types/GetEmailEventReportResponse.ts b/src/api/resources/transactionalEmails/types/GetEmailEventReportResponse.ts new file mode 100644 index 0000000..cc0b6c5 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetEmailEventReportResponse.ts @@ -0,0 +1,57 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetEmailEventReportResponse { + events?: GetEmailEventReportResponse.Events.Item[]; +} + +export namespace GetEmailEventReportResponse { + export type Events = Events.Item[]; + + export namespace Events { + export interface Item { + /** UTC date-time on which the event has been generated */ + date: string; + /** Email address which generates the event */ + email: string; + /** Event which occurred */ + event: Item.Event; + /** Sender email from which the emails are sent */ + from?: string; + /** IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) */ + ip?: string; + /** The link which is sent to the user (only available if the event is requests or opened or clicks) */ + link?: string; + /** Message ID which generated the event */ + messageId: string; + /** Reason of bounce (only available if the event is hardbounce or softbounce) */ + reason?: string; + /** Subject of the event */ + subject?: string; + /** Tag of the email which generated the event */ + tag?: string; + /** ID of the template (only available if the email is template based) */ + templateId?: number; + } + + export namespace Item { + /** Event which occurred */ + export const Event = { + Bounces: "bounces", + HardBounces: "hardBounces", + SoftBounces: "softBounces", + Delivered: "delivered", + Spam: "spam", + Requests: "requests", + Opened: "opened", + Clicks: "clicks", + Invalid: "invalid", + Deferred: "deferred", + Blocked: "blocked", + Unsubscribed: "unsubscribed", + Error: "error", + LoadedByProxy: "loadedByProxy", + } as const; + export type Event = (typeof Event)[keyof typeof Event]; + } + } +} diff --git a/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdRequestSort.ts b/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdRequestSort.ts new file mode 100644 index 0000000..c0ae6e9 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetScheduledEmailByIdRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetScheduledEmailByIdRequestSort = + (typeof GetScheduledEmailByIdRequestSort)[keyof typeof GetScheduledEmailByIdRequestSort]; diff --git a/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdRequestStatus.ts b/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdRequestStatus.ts new file mode 100644 index 0000000..e3332c0 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdRequestStatus.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetScheduledEmailByIdRequestStatus = { + Processed: "processed", + InProgress: "inProgress", + Queued: "queued", +} as const; +export type GetScheduledEmailByIdRequestStatus = + (typeof GetScheduledEmailByIdRequestStatus)[keyof typeof GetScheduledEmailByIdRequestStatus]; diff --git a/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdResponse.ts b/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdResponse.ts new file mode 100644 index 0000000..a157524 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetScheduledEmailByIdResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +export type GetScheduledEmailByIdResponse = + | { + batches?: + | { + createdAt: string; + scheduledAt: string; + status: "inProgress" | "queued" | "processed" | "error"; + }[] + | undefined; + count?: number | undefined; + } + | { + createdAt: string; + scheduledAt: string; + status: "inProgress" | "queued" | "processed" | "error"; + }; diff --git a/src/api/resources/transactionalEmails/types/GetSmtpReportRequestSort.ts b/src/api/resources/transactionalEmails/types/GetSmtpReportRequestSort.ts new file mode 100644 index 0000000..855077a --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetSmtpReportRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetSmtpReportRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetSmtpReportRequestSort = (typeof GetSmtpReportRequestSort)[keyof typeof GetSmtpReportRequestSort]; diff --git a/src/api/resources/transactionalEmails/types/GetSmtpReportResponse.ts b/src/api/resources/transactionalEmails/types/GetSmtpReportResponse.ts new file mode 100644 index 0000000..3dad4ce --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetSmtpReportResponse.ts @@ -0,0 +1,40 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSmtpReportResponse { + reports?: GetSmtpReportResponse.Reports.Item[]; +} + +export namespace GetSmtpReportResponse { + export type Reports = Reports.Item[]; + + export namespace Reports { + export interface Item { + /** Number of blocked emails for the date */ + blocked: number; + /** Number of clicks for the date */ + clicks: number; + /** Date of the statistics */ + date: string; + /** Number of delivered emails for the date */ + delivered: number; + /** Number of hardbounces for the date */ + hardBounces: number; + /** Number of invalid emails for the date */ + invalid: number; + /** Number of openings for the date */ + opens: number; + /** Number of requests for the date */ + requests: number; + /** Number of softbounces for the date */ + softBounces: number; + /** Number of complaints (spam reports) for the date */ + spamReports: number; + /** Number of unique clicks for the date */ + uniqueClicks: number; + /** Number of unique openings for the date */ + uniqueOpens: number; + /** Number of unsubscribed emails for the date */ + unsubscribed: number; + } + } +} diff --git a/src/api/resources/transactionalEmails/types/GetSmtpTemplatesRequestSort.ts b/src/api/resources/transactionalEmails/types/GetSmtpTemplatesRequestSort.ts new file mode 100644 index 0000000..7cc5acb --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetSmtpTemplatesRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetSmtpTemplatesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetSmtpTemplatesRequestSort = + (typeof GetSmtpTemplatesRequestSort)[keyof typeof GetSmtpTemplatesRequestSort]; diff --git a/src/api/resources/transactionalEmails/types/GetSmtpTemplatesResponse.ts b/src/api/resources/transactionalEmails/types/GetSmtpTemplatesResponse.ts new file mode 100644 index 0000000..232e4b8 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetSmtpTemplatesResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetSmtpTemplatesResponse { + /** Count of transactional email templates */ + count?: number; + templates?: Brevo.GetSmtpTemplateOverview[]; +} diff --git a/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsRequestSort.ts b/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsRequestSort.ts new file mode 100644 index 0000000..7bdfb1c --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetTransacBlockedContactsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetTransacBlockedContactsRequestSort = + (typeof GetTransacBlockedContactsRequestSort)[keyof typeof GetTransacBlockedContactsRequestSort]; diff --git a/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.ts b/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.ts new file mode 100644 index 0000000..e8491d6 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.ts @@ -0,0 +1,49 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetTransacBlockedContactsResponse { + contacts?: GetTransacBlockedContactsResponse.Contacts.Item[]; + /** Count of blocked or unsubscribed contact */ + count?: number; +} + +export namespace GetTransacBlockedContactsResponse { + export type Contacts = Contacts.Item[]; + + export namespace Contacts { + export interface Item { + /** Date when the contact was blocked or unsubscribed on */ + blockedAt: string; + /** Email address of the blocked or unsubscribed contact */ + email: string; + /** Reason for blocking / unsubscribing */ + reason: Item.Reason; + /** Sender email address of the blocked or unsubscribed contact */ + senderEmail: string; + } + + export namespace Item { + /** + * Reason for blocking / unsubscribing + */ + export interface Reason { + /** Reason code for blocking / unsubscribing (This code is safe for comparison) */ + code?: Reason.Code; + /** Reason for blocking / unsubscribing (This string is not safe for comparison) */ + message?: string; + } + + export namespace Reason { + /** Reason code for blocking / unsubscribing (This code is safe for comparison) */ + export const Code = { + UnsubscribedViaMa: "unsubscribedViaMA", + UnsubscribedViaEmail: "unsubscribedViaEmail", + AdminBlocked: "adminBlocked", + UnsubscribedViaApi: "unsubscribedViaApi", + HardBounce: "hardBounce", + ContactFlaggedAsSpam: "contactFlaggedAsSpam", + } as const; + export type Code = (typeof Code)[keyof typeof Code]; + } + } + } +} diff --git a/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts b/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts new file mode 100644 index 0000000..2dd44a8 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetTransacEmailContentResponse { + /** Count of the attachments that were sent in the email */ + attachmentCount: number; + /** Actual content of the transactional email that has been sent */ + body: string; + /** Date on which transactional email was sent */ + date: string; + /** Email address to which transactional email has been sent */ + email: string; + /** Series of events which occurred on the transactional email */ + events: GetTransacEmailContentResponse.Events.Item[]; + /** Subject of the sent email */ + subject: string; + /** Id of the template */ + templateId?: number; +} + +export namespace GetTransacEmailContentResponse { + export type Events = Events.Item[]; + + export namespace Events { + export interface Item { + /** Name of the event that occurred on the sent email */ + name: string; + /** Time at which the event occurred */ + time: string; + } + } +} diff --git a/src/api/resources/transactionalEmails/types/GetTransacEmailsListRequestSort.ts b/src/api/resources/transactionalEmails/types/GetTransacEmailsListRequestSort.ts new file mode 100644 index 0000000..7f38ee5 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetTransacEmailsListRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetTransacEmailsListRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetTransacEmailsListRequestSort = + (typeof GetTransacEmailsListRequestSort)[keyof typeof GetTransacEmailsListRequestSort]; diff --git a/src/api/resources/transactionalEmails/types/GetTransacEmailsListResponse.ts b/src/api/resources/transactionalEmails/types/GetTransacEmailsListResponse.ts new file mode 100644 index 0000000..cde220b --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetTransacEmailsListResponse.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetTransacEmailsListResponse { + /** Total number of transactional emails available on your account according to the passed filter */ + count?: number; + transactionalEmails?: GetTransacEmailsListResponse.TransactionalEmails.Item[]; +} + +export namespace GetTransacEmailsListResponse { + export type TransactionalEmails = TransactionalEmails.Item[]; + + export namespace TransactionalEmails { + export interface Item { + /** Date on which transactional email was sent */ + date: string; + /** Email address to which transactional email has been sent */ + email: string; + /** Email address of the sender from which the email was sent */ + from?: string; + /** Message Id of the sent email */ + messageId: string; + /** Subject of the sent email */ + subject: string; + /** Tags used for your email */ + tags?: string[]; + /** Id of the template */ + templateId?: number; + /** Unique id of the email sent to a particular contact */ + uuid: string; + } + } +} diff --git a/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesResponse.ts b/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesResponse.ts new file mode 100644 index 0000000..9c6f68d --- /dev/null +++ b/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesResponse.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostPreviewSmtpEmailTemplatesResponse { + /** Sender email address */ + fromEmail?: string; + /** Sender Name */ + fromName?: string; + /** Html content of the template */ + html?: string; + /** Preview text of the template */ + previewText?: string; + /** subject of the template */ + subject?: string; + usedFeedNames?: string[]; +} diff --git a/src/api/resources/transactionalEmails/types/SendTransacEmailResponse.ts b/src/api/resources/transactionalEmails/types/SendTransacEmailResponse.ts new file mode 100644 index 0000000..62fcb65 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/SendTransacEmailResponse.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SendTransacEmailResponse { + /** Message ID of the transactional email sent */ + messageId?: string; + messageIds?: string[]; +} diff --git a/src/api/resources/transactionalEmails/types/index.ts b/src/api/resources/transactionalEmails/types/index.ts new file mode 100644 index 0000000..cc5fc42 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/index.ts @@ -0,0 +1,20 @@ +export * from "./CreateSmtpTemplateResponse.js"; +export * from "./GetAggregatedSmtpReportResponse.js"; +export * from "./GetBlockedDomainsResponse.js"; +export * from "./GetEmailEventReportRequestEvent.js"; +export * from "./GetEmailEventReportRequestSort.js"; +export * from "./GetEmailEventReportResponse.js"; +export * from "./GetScheduledEmailByIdRequestSort.js"; +export * from "./GetScheduledEmailByIdRequestStatus.js"; +export * from "./GetScheduledEmailByIdResponse.js"; +export * from "./GetSmtpReportRequestSort.js"; +export * from "./GetSmtpReportResponse.js"; +export * from "./GetSmtpTemplatesRequestSort.js"; +export * from "./GetSmtpTemplatesResponse.js"; +export * from "./GetTransacBlockedContactsRequestSort.js"; +export * from "./GetTransacBlockedContactsResponse.js"; +export * from "./GetTransacEmailContentResponse.js"; +export * from "./GetTransacEmailsListRequestSort.js"; +export * from "./GetTransacEmailsListResponse.js"; +export * from "./PostPreviewSmtpEmailTemplatesResponse.js"; +export * from "./SendTransacEmailResponse.js"; diff --git a/src/api/resources/transactionalSms/client/Client.ts b/src/api/resources/transactionalSms/client/Client.ts new file mode 100644 index 0000000..e945006 --- /dev/null +++ b/src/api/resources/transactionalSms/client/Client.ts @@ -0,0 +1,410 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace TransactionalSmsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TransactionalSmsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TransactionalSmsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * + * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. + * + * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. + * + * + * + * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. + * + * + * @param {Brevo.SendTransacSms} request + * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalSms.sendAsyncTransactionalSms({ + * recipient: "33689965433", + * sender: "MyShop" + * }) + */ + public sendAsyncTransactionalSms( + request: Brevo.SendTransacSms, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendAsyncTransactionalSms(request, requestOptions)); + } + + private async __sendAsyncTransactionalSms( + request: Brevo.SendTransacSms, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "transactionalSMS/send", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.SendAsyncTransactionalSmsResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/transactionalSMS/send"); + } + + /** + * @param {Brevo.SendTransacSms} request + * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.PaymentRequiredError} + * + * @example + * await client.transactionalSms.sendTransacSms({ + * recipient: "33689965433", + * sender: "MyShop" + * }) + */ + public sendTransacSms( + request: Brevo.SendTransacSms, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendTransacSms(request, requestOptions)); + } + + private async __sendTransacSms( + request: Brevo.SendTransacSms, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "transactionalSMS/sms", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.SendTransacSmsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 402: + throw new Brevo.PaymentRequiredError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/transactionalSMS/sms"); + } + + /** + * @param {Brevo.GetTransacAggregatedSmsReportRequest} request + * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalSms.getTransacAggregatedSmsReport() + */ + public getTransacAggregatedSmsReport( + request: Brevo.GetTransacAggregatedSmsReportRequest = {}, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransacAggregatedSmsReport(request, requestOptions)); + } + + private async __getTransacAggregatedSmsReport( + request: Brevo.GetTransacAggregatedSmsReportRequest = {}, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): Promise> { + const { startDate, endDate, days, tag } = request; + const _queryParams: Record = { + startDate, + endDate, + days, + tag, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "transactionalSMS/statistics/aggregatedReport", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.GetTransacAggregatedSmsReportResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/transactionalSMS/statistics/aggregatedReport", + ); + } + + /** + * @param {Brevo.GetSmsEventsRequest} request + * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalSms.getSmsEvents() + */ + public getSmsEvents( + request: Brevo.GetSmsEventsRequest = {}, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getSmsEvents(request, requestOptions)); + } + + private async __getSmsEvents( + request: Brevo.GetSmsEventsRequest = {}, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): Promise> { + const { limit, startDate, endDate, offset, days, phoneNumber, event, tags, sort } = request; + const _queryParams: Record = { + limit, + startDate, + endDate, + offset, + days, + phoneNumber, + event: event != null ? event : undefined, + tags, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "transactionalSMS/statistics/events", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetSmsEventsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/transactionalSMS/statistics/events", + ); + } + + /** + * @param {Brevo.GetTransacSmsReportRequest} request + * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalSms.getTransacSmsReport() + */ + public getTransacSmsReport( + request: Brevo.GetTransacSmsReportRequest = {}, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransacSmsReport(request, requestOptions)); + } + + private async __getTransacSmsReport( + request: Brevo.GetTransacSmsReportRequest = {}, + requestOptions?: TransactionalSmsClient.RequestOptions, + ): Promise> { + const { startDate, endDate, days, tag, sort } = request; + const _queryParams: Record = { + startDate, + endDate, + days, + tag, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "transactionalSMS/statistics/reports", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetTransacSmsReportResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/transactionalSMS/statistics/reports", + ); + } +} diff --git a/src/api/resources/transactionalSms/client/index.ts b/src/api/resources/transactionalSms/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/transactionalSms/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/transactionalSms/client/requests/GetSmsEventsRequest.ts b/src/api/resources/transactionalSms/client/requests/GetSmsEventsRequest.ts new file mode 100644 index 0000000..370ee48 --- /dev/null +++ b/src/api/resources/transactionalSms/client/requests/GetSmsEventsRequest.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetSmsEventsRequest { + /** Number of documents per page */ + limit?: number; + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report */ + endDate?: string; + /** Index of the first document of the page */ + offset?: number; + /** Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** */ + days?: number; + /** Filter the report for a specific phone number */ + phoneNumber?: string; + /** Filter the report for specific events */ + event?: Brevo.GetSmsEventsRequestEvent; + /** Filter the report for specific tags passed as a serialized urlencoded array */ + tags?: string; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetSmsEventsRequestSort; +} diff --git a/src/api/resources/transactionalSms/client/requests/GetTransacAggregatedSmsReportRequest.ts b/src/api/resources/transactionalSms/client/requests/GetTransacAggregatedSmsReportRequest.ts new file mode 100644 index 0000000..3844a57 --- /dev/null +++ b/src/api/resources/transactionalSms/client/requests/GetTransacAggregatedSmsReportRequest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetTransacAggregatedSmsReportRequest { + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report */ + endDate?: string; + /** Number of days in the past including today (positive integer). **Not compatible with startDate and endDate** */ + days?: number; + /** Filter on a tag */ + tag?: string; +} diff --git a/src/api/resources/transactionalSms/client/requests/GetTransacSmsReportRequest.ts b/src/api/resources/transactionalSms/client/requests/GetTransacSmsReportRequest.ts new file mode 100644 index 0000000..44e9752 --- /dev/null +++ b/src/api/resources/transactionalSms/client/requests/GetTransacSmsReportRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetTransacSmsReportRequest { + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the report */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the report */ + endDate?: string; + /** Number of days in the past including today (positive integer). **Not compatible with 'startDate' and 'endDate'** */ + days?: number; + /** Filter on a tag */ + tag?: string; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetTransacSmsReportRequestSort; +} diff --git a/src/api/resources/transactionalSms/client/requests/index.ts b/src/api/resources/transactionalSms/client/requests/index.ts new file mode 100644 index 0000000..a05395e --- /dev/null +++ b/src/api/resources/transactionalSms/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { GetSmsEventsRequest } from "./GetSmsEventsRequest.js"; +export type { GetTransacAggregatedSmsReportRequest } from "./GetTransacAggregatedSmsReportRequest.js"; +export type { GetTransacSmsReportRequest } from "./GetTransacSmsReportRequest.js"; diff --git a/src/api/resources/transactionalSms/index.ts b/src/api/resources/transactionalSms/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/transactionalSms/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/transactionalSms/types/GetSmsEventsRequestEvent.ts b/src/api/resources/transactionalSms/types/GetSmsEventsRequestEvent.ts new file mode 100644 index 0000000..f5f8ab3 --- /dev/null +++ b/src/api/resources/transactionalSms/types/GetSmsEventsRequestEvent.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetSmsEventsRequestEvent = { + Bounces: "bounces", + HardBounces: "hardBounces", + SoftBounces: "softBounces", + Delivered: "delivered", + Sent: "sent", + Accepted: "accepted", + Unsubscription: "unsubscription", + Replies: "replies", + Blocked: "blocked", + Rejected: "rejected", + Skipped: "skipped", +} as const; +export type GetSmsEventsRequestEvent = (typeof GetSmsEventsRequestEvent)[keyof typeof GetSmsEventsRequestEvent]; diff --git a/src/api/resources/transactionalSms/types/GetSmsEventsRequestSort.ts b/src/api/resources/transactionalSms/types/GetSmsEventsRequestSort.ts new file mode 100644 index 0000000..6670ca5 --- /dev/null +++ b/src/api/resources/transactionalSms/types/GetSmsEventsRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetSmsEventsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetSmsEventsRequestSort = (typeof GetSmsEventsRequestSort)[keyof typeof GetSmsEventsRequestSort]; diff --git a/src/api/resources/transactionalSms/types/GetSmsEventsResponse.ts b/src/api/resources/transactionalSms/types/GetSmsEventsResponse.ts new file mode 100644 index 0000000..79298c3 --- /dev/null +++ b/src/api/resources/transactionalSms/types/GetSmsEventsResponse.ts @@ -0,0 +1,45 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSmsEventsResponse { + events?: GetSmsEventsResponse.Events.Item[]; +} + +export namespace GetSmsEventsResponse { + export type Events = Events.Item[]; + + export namespace Events { + export interface Item { + /** UTC date-time on which the event has been generated */ + date?: string; + /** Event which occurred */ + event?: Item.Event; + /** Message ID which generated the event */ + messageId?: string; + /** Phone number which has generated the event */ + phoneNumber?: string; + /** Reason of bounce (only available if the event is hardbounce or softbounce) */ + reason?: string; + reply?: string; + /** Tag of the SMS which generated the event */ + tag?: string; + } + + export namespace Item { + /** Event which occurred */ + export const Event = { + Bounces: "bounces", + HardBounces: "hardBounces", + SoftBounces: "softBounces", + Delivered: "delivered", + Sent: "sent", + Accepted: "accepted", + Unsubscription: "unsubscription", + Replies: "replies", + Blocked: "blocked", + Rejected: "rejected", + Skipped: "skipped", + } as const; + export type Event = (typeof Event)[keyof typeof Event]; + } + } +} diff --git a/src/api/resources/transactionalSms/types/GetTransacAggregatedSmsReportResponse.ts b/src/api/resources/transactionalSms/types/GetTransacAggregatedSmsReportResponse.ts new file mode 100644 index 0000000..875abfb --- /dev/null +++ b/src/api/resources/transactionalSms/types/GetTransacAggregatedSmsReportResponse.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetTransacAggregatedSmsReportResponse { + /** Number of accepted SMS for the timeframe */ + accepted?: number; + /** Number of blocked contact for the timeframe */ + blocked?: number; + /** Number of delivered SMS for the timeframe */ + delivered?: number; + /** Number of hardbounces for the timeframe */ + hardBounces?: number; + /** Time frame of the report */ + range?: string; + /** Number of rejected SMS for the timeframe */ + rejected?: number; + /** Number of answered SMS for the timeframe */ + replied?: number; + /** Number of requests for the timeframe */ + requests?: number; + /** Number of skipped SMS for the timeframe */ + skipped?: number; + /** Number of softbounces for the timeframe */ + softBounces?: number; + /** Number of unsubscription for the timeframe */ + unsubscribed?: number; +} diff --git a/src/api/resources/transactionalSms/types/GetTransacSmsReportRequestSort.ts b/src/api/resources/transactionalSms/types/GetTransacSmsReportRequestSort.ts new file mode 100644 index 0000000..1c805d3 --- /dev/null +++ b/src/api/resources/transactionalSms/types/GetTransacSmsReportRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetTransacSmsReportRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetTransacSmsReportRequestSort = + (typeof GetTransacSmsReportRequestSort)[keyof typeof GetTransacSmsReportRequestSort]; diff --git a/src/api/resources/transactionalSms/types/GetTransacSmsReportResponse.ts b/src/api/resources/transactionalSms/types/GetTransacSmsReportResponse.ts new file mode 100644 index 0000000..d5b1197 --- /dev/null +++ b/src/api/resources/transactionalSms/types/GetTransacSmsReportResponse.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetTransacSmsReportResponse { + reports?: GetTransacSmsReportResponse.Reports.Item[]; +} + +export namespace GetTransacSmsReportResponse { + export type Reports = Reports.Item[]; + + export namespace Reports { + export interface Item { + /** Number of accepted SMS for the date */ + accepted?: number; + /** Number of blocked contact for the date */ + blocked?: number; + /** Date for which statistics are retrieved */ + date?: string; + /** Number of delivered SMS for the date */ + delivered?: number; + /** Number of hardbounces for the date */ + hardBounces?: number; + /** Number of rejected SMS for the date */ + rejected?: number; + /** Number of answered SMS for the date */ + replied?: number; + /** Number of requests for the date */ + requests?: number; + /** Number of skipped SMS for the date */ + skipped?: number; + /** Number of softbounces for the date */ + softBounces?: number; + /** Number of unsubscription for the date */ + unsubscribed?: number; + } + } +} diff --git a/src/api/resources/transactionalSms/types/SendAsyncTransactionalSmsResponse.ts b/src/api/resources/transactionalSms/types/SendAsyncTransactionalSmsResponse.ts new file mode 100644 index 0000000..c4d7dcd --- /dev/null +++ b/src/api/resources/transactionalSms/types/SendAsyncTransactionalSmsResponse.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SendAsyncTransactionalSmsResponse { + messageId: number; +} diff --git a/src/api/resources/transactionalSms/types/SendTransacSmsResponse.ts b/src/api/resources/transactionalSms/types/SendTransacSmsResponse.ts new file mode 100644 index 0000000..add3c35 --- /dev/null +++ b/src/api/resources/transactionalSms/types/SendTransacSmsResponse.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SendTransacSmsResponse { + messageId: number; + reference: string; + /** Remaining SMS credits of the user */ + remainingCredits?: number; + /** Count of SMS's to send multiple text messages */ + smsCount?: number; + /** SMS credits used per text message */ + usedCredits?: number; +} diff --git a/src/api/resources/transactionalSms/types/index.ts b/src/api/resources/transactionalSms/types/index.ts new file mode 100644 index 0000000..ac436fd --- /dev/null +++ b/src/api/resources/transactionalSms/types/index.ts @@ -0,0 +1,8 @@ +export * from "./GetSmsEventsRequestEvent.js"; +export * from "./GetSmsEventsRequestSort.js"; +export * from "./GetSmsEventsResponse.js"; +export * from "./GetTransacAggregatedSmsReportResponse.js"; +export * from "./GetTransacSmsReportRequestSort.js"; +export * from "./GetTransacSmsReportResponse.js"; +export * from "./SendAsyncTransactionalSmsResponse.js"; +export * from "./SendTransacSmsResponse.js"; diff --git a/src/api/resources/transactionalWhatsApp/client/Client.ts b/src/api/resources/transactionalWhatsApp/client/Client.ts new file mode 100644 index 0000000..f50da6e --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/client/Client.ts @@ -0,0 +1,171 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace TransactionalWhatsAppClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class TransactionalWhatsAppClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: TransactionalWhatsAppClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) + * + * @param {Brevo.SendWhatsappMessageRequest} request + * @param {TransactionalWhatsAppClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalWhatsApp.sendWhatsappMessage({ + * contactNumbers: ["contactNumbers"], + * senderNumber: "senderNumber", + * templateId: 123 + * }) + */ + public sendWhatsappMessage( + request: Brevo.SendWhatsappMessageRequest, + requestOptions?: TransactionalWhatsAppClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendWhatsappMessage(request, requestOptions)); + } + + private async __sendWhatsappMessage( + request: Brevo.SendWhatsappMessageRequest, + requestOptions?: TransactionalWhatsAppClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "whatsapp/sendMessage", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.SendWhatsappMessageResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/whatsapp/sendMessage"); + } + + /** + * This endpoint will show the unaggregated statistics for WhatsApp activity (30 days by default if `startDate` and `endDate` or `days` is not passed. The date range can not exceed 90 days) + * + * @param {Brevo.GetWhatsappEventReportRequest} request + * @param {TransactionalWhatsAppClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.transactionalWhatsApp.getWhatsappEventReport() + */ + public getWhatsappEventReport( + request: Brevo.GetWhatsappEventReportRequest = {}, + requestOptions?: TransactionalWhatsAppClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getWhatsappEventReport(request, requestOptions)); + } + + private async __getWhatsappEventReport( + request: Brevo.GetWhatsappEventReportRequest = {}, + requestOptions?: TransactionalWhatsAppClient.RequestOptions, + ): Promise> { + const { limit, offset, startDate, endDate, days, contactNumber, event, sort } = request; + const _queryParams: Record = { + limit, + offset, + startDate, + endDate, + days, + contactNumber, + event: event != null ? event : undefined, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "whatsapp/statistics/events", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetWhatsappEventReportResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/whatsapp/statistics/events"); + } +} diff --git a/src/api/resources/transactionalWhatsApp/client/index.ts b/src/api/resources/transactionalWhatsApp/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/transactionalWhatsApp/client/requests/GetWhatsappEventReportRequest.ts b/src/api/resources/transactionalWhatsApp/client/requests/GetWhatsappEventReportRequest.ts new file mode 100644 index 0000000..a81eb4c --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/client/requests/GetWhatsappEventReportRequest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetWhatsappEventReportRequest { + /** Number limitation for the result returned */ + limit?: number; + /** Beginning point in the list to retrieve from */ + offset?: number; + /** **Mandatory if endDate is used.** Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate */ + startDate?: string; + /** **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate */ + endDate?: string; + /** Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ */ + days?: number; + /** Filter results for specific contact (WhatsApp Number with country code. Example, 85264318721) */ + contactNumber?: string; + /** Filter the report for a specific event type */ + event?: Brevo.GetWhatsappEventReportRequestEvent; + /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetWhatsappEventReportRequestSort; +} diff --git a/src/api/resources/transactionalWhatsApp/client/requests/index.ts b/src/api/resources/transactionalWhatsApp/client/requests/index.ts new file mode 100644 index 0000000..8ec86a6 --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/client/requests/index.ts @@ -0,0 +1 @@ +export type { GetWhatsappEventReportRequest } from "./GetWhatsappEventReportRequest.js"; diff --git a/src/api/resources/transactionalWhatsApp/index.ts b/src/api/resources/transactionalWhatsApp/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportRequestEvent.ts b/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportRequestEvent.ts new file mode 100644 index 0000000..fd38013 --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportRequestEvent.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetWhatsappEventReportRequestEvent = { + Sent: "sent", + Delivered: "delivered", + Read: "read", + Error: "error", + Unsubscribe: "unsubscribe", + Reply: "reply", + SoftBounce: "soft-bounce", +} as const; +export type GetWhatsappEventReportRequestEvent = + (typeof GetWhatsappEventReportRequestEvent)[keyof typeof GetWhatsappEventReportRequestEvent]; diff --git a/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportRequestSort.ts b/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportRequestSort.ts new file mode 100644 index 0000000..93eaa03 --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetWhatsappEventReportRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetWhatsappEventReportRequestSort = + (typeof GetWhatsappEventReportRequestSort)[keyof typeof GetWhatsappEventReportRequestSort]; diff --git a/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportResponse.ts b/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportResponse.ts new file mode 100644 index 0000000..85412fd --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportResponse.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetWhatsappEventReportResponse { + events?: GetWhatsappEventReportResponse.Events.Item[]; +} + +export namespace GetWhatsappEventReportResponse { + export type Events = Events.Item[]; + + export namespace Events { + export interface Item { + /** Text of the reply (will be there only in case of `reply` event with text) */ + body?: string; + /** WhatsApp Number with country code. Example, 85264318721 */ + contactNumber: string; + /** UTC date-time on which the event has been generated */ + date: string; + /** Event which occurred */ + event: Item.Event; + /** Url of the media reply (will be there only in case of `reply` event with media) */ + mediaUrl?: string; + /** Message ID which generated the event */ + messageId: string; + /** Reason for the event (will be there in case of `error` and `soft-bounce` events) */ + reason?: string; + /** WhatsApp Number with country code. Example, 85264318721 */ + senderNumber: string; + } + + export namespace Item { + /** Event which occurred */ + export const Event = { + Sent: "sent", + Delivered: "delivered", + Read: "read", + Error: "error", + Unsubscribe: "unsubscribe", + Reply: "reply", + SoftBounce: "soft-bounce", + } as const; + export type Event = (typeof Event)[keyof typeof Event]; + } + } +} diff --git a/src/api/resources/transactionalWhatsApp/types/SendWhatsappMessageRequest.ts b/src/api/resources/transactionalWhatsApp/types/SendWhatsappMessageRequest.ts new file mode 100644 index 0000000..6ba70f8 --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/types/SendWhatsappMessageRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +export type SendWhatsappMessageRequest = + | { + contactNumbers: string[]; + params?: Record | undefined; + senderNumber: string; + templateId: number; + } + | { + contactNumbers: string[]; + senderNumber: string; + text: string; + }; diff --git a/src/api/resources/transactionalWhatsApp/types/SendWhatsappMessageResponse.ts b/src/api/resources/transactionalWhatsApp/types/SendWhatsappMessageResponse.ts new file mode 100644 index 0000000..164000e --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/types/SendWhatsappMessageResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SendWhatsappMessageResponse { + /** messageId of sent message */ + messageId: string; +} diff --git a/src/api/resources/transactionalWhatsApp/types/index.ts b/src/api/resources/transactionalWhatsApp/types/index.ts new file mode 100644 index 0000000..946d337 --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/types/index.ts @@ -0,0 +1,5 @@ +export * from "./GetWhatsappEventReportRequestEvent.js"; +export * from "./GetWhatsappEventReportRequestSort.js"; +export * from "./GetWhatsappEventReportResponse.js"; +export * from "./SendWhatsappMessageRequest.js"; +export * from "./SendWhatsappMessageResponse.js"; diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts new file mode 100644 index 0000000..dcc94ed --- /dev/null +++ b/src/api/resources/user/client/Client.ts @@ -0,0 +1,585 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace UserClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class UserClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: UserClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.user.getInvitedUsersList() + */ + public getInvitedUsersList( + requestOptions?: UserClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getInvitedUsersList(requestOptions)); + } + + private async __getInvitedUsersList( + requestOptions?: UserClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "organization/invited/users", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetInvitedUsersListResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/organization/invited/users"); + } + + /** + * @param {Brevo.PutRevokeUserPermissionRequest} request + * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.user.putRevokeUserPermission({ + * email: "email" + * }) + */ + public putRevokeUserPermission( + request: Brevo.PutRevokeUserPermissionRequest, + requestOptions?: UserClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__putRevokeUserPermission(request, requestOptions)); + } + + private async __putRevokeUserPermission( + request: Brevo.PutRevokeUserPermissionRequest, + requestOptions?: UserClient.RequestOptions, + ): Promise> { + const { email } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `organization/user/invitation/revoke/${core.url.encodePathParam(email)}`, + ), + method: "PUT", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.PutRevokeUserPermissionResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/organization/user/invitation/revoke/{email}", + ); + } + + /** + * `Feature` - A Feature represents a specific functionality like Email + * campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, + * determine which feature you want to manage access to. You must specify the + * feature accurately to avoid errors. `Permission` - A Permission defines the + * level of access or control a user has over a specific feature. While + * inviting user, decide on the permission level required for the selected + * feature. Make sure the chosen permission is related to the selected feature. + * Features and their respective permissions are as below: - `email_campaigns`: + * - "create_edit_delete" + * - "send_schedule_suspend" + * - `sms_campaigns`: + * - "create_edit_delete" + * - "send_schedule_suspend" + * - `contacts`: + * - "view" + * - "create_edit_delete" + * - "import" + * - "export" + * - "list_and_attributes" + * - "forms" + * - `templates`: + * - "create_edit_delete" + * - "activate_deactivate" + * - `workflows`: + * - "create_edit_delete" + * - "activate_deactivate_pause" + * - "settings" + * - `landing_pages`: + * - "all" + * - `transactional_emails`: + * - "settings" + * - "logs" + * - `smtp_api`: + * - "smtp" + * - "api_keys" + * - "authorized_ips" + * - `user_management`: + * - "all" + * - `sales_platform`: + * - "create_edit_deals" + * - "delete_deals" + * - "manage_others_deals_tasks" + * - "reports" + * - "settings" + * - `phone`: + * - "all" + * - `conversations`: + * - "access" + * - "assign" + * - "configure" + * - `senders_domains_dedicated_ips`: + * - "senders_management" + * - "domains_management" + * - "dedicated_ips_management" + * - `push_notifications`: + * - "view" + * - "create_edit_delete" + * - "send" + * - "settings" + * - `companies`: + * - "manage_owned_companies" + * - "manage_other_companies" + * - "settings" + * **Note**: - If `all_features_access: false` then only privileges are + * required otherwise if `true` then it's assumed that all permissions will be + * there for the invited user. - The availability of feature and its permission + * depends on your current plan. Please select the features and permissions + * accordingly. + * + * @param {Brevo.Inviteuser} request + * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.user.inviteuser({ + * all_features_access: true, + * email: "inviteuser@example.com", + * privileges: [{}] + * }) + */ + public inviteuser( + request: Brevo.Inviteuser, + requestOptions?: UserClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__inviteuser(request, requestOptions)); + } + + private async __inviteuser( + request: Brevo.Inviteuser, + requestOptions?: UserClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "organization/user/invitation/send", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.InviteuserResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/organization/user/invitation/send", + ); + } + + /** + * @param {Brevo.PutresendcancelinvitationRequest} request + * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.ForbiddenError} + * + * @example + * await client.user.putresendcancelinvitation({ + * action: "resend", + * email: "email" + * }) + */ + public putresendcancelinvitation( + request: Brevo.PutresendcancelinvitationRequest, + requestOptions?: UserClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__putresendcancelinvitation(request, requestOptions)); + } + + private async __putresendcancelinvitation( + request: Brevo.PutresendcancelinvitationRequest, + requestOptions?: UserClient.RequestOptions, + ): Promise> { + const { action, email } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `organization/user/invitation/${core.url.encodePathParam(action)}/${core.url.encodePathParam(email)}`, + ), + method: "PUT", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Brevo.PutresendcancelinvitationResponse, + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/organization/user/invitation/{action}/{email}", + ); + } + + /** + * `Feature` - A Feature represents a specific functionality like Email + * campaign, Deals, Calls, Automations, etc. on Brevo. While inviting a user, + * determine which feature you want to manage access to. You must specify the + * feature accurately to avoid errors. `Permission` - A Permission defines the + * level of access or control a user has over a specific feature. While + * inviting user, decide on the permission level required for the selected + * feature. Make sure the chosen permission is related to the selected feature. + * Features and their respective permissions are as below: - `email_campaigns`: + * - "create_edit_delete" + * - "send_schedule_suspend" + * - `sms_campaigns`: + * - "create_edit_delete" + * - "send_schedule_suspend" + * - `contacts`: + * - "view" + * - "create_edit_delete" + * - "import" + * - "export" + * - "list_and_attributes" + * - "forms" + * - `templates`: + * - "create_edit_delete" + * - "activate_deactivate" + * - `workflows`: + * - "create_edit_delete" + * - "activate_deactivate_pause" + * - "settings" + * - `landing_pages`: + * - "all" + * - `transactional_emails`: + * - "settings" + * - "logs" + * - `smtp_api`: + * - "smtp" + * - "api_keys" + * - "authorized_ips" + * - `user_management`: + * - "all" + * - `sales_platform`: + * - "create_edit_deals" + * - "delete_deals" + * - "manage_others_deals_tasks" + * - "reports" + * - "settings" + * - `phone`: + * - "all" + * - `conversations`: + * - "access" + * - "assign" + * - "configure" + * - `senders_domains_dedicated_ips`: + * - "senders_management" + * - "domains_management" + * - "dedicated_ips_management" + * - `push_notifications`: + * - "view" + * - "create_edit_delete" + * - "send" + * - "settings" + * - `companies`: + * - "manage_owned_companies" + * - "manage_other_companies" + * - "settings" + * **Note**: - The privileges array remains the same as in the send invitation; + * the user simply needs to provide the permissions that need to be updated. - + * The availability of feature and its permission depends on your current plan. + * Please select the features and permissions accordingly. + * + * @param {Brevo.Inviteuser} request + * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.user.editUserPermission({ + * all_features_access: true, + * email: "inviteuser@example.com", + * privileges: [{}] + * }) + */ + public editUserPermission( + request: Brevo.Inviteuser, + requestOptions?: UserClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__editUserPermission(request, requestOptions)); + } + + private async __editUserPermission( + request: Brevo.Inviteuser, + requestOptions?: UserClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "organization/user/update/permissions", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.EditUserPermissionResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/organization/user/update/permissions", + ); + } + + /** + * @param {Brevo.GetUserPermissionRequest} request + * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.user.getUserPermission({ + * email: "email" + * }) + */ + public getUserPermission( + request: Brevo.GetUserPermissionRequest, + requestOptions?: UserClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getUserPermission(request, requestOptions)); + } + + private async __getUserPermission( + request: Brevo.GetUserPermissionRequest, + requestOptions?: UserClient.RequestOptions, + ): Promise> { + const { email } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `organization/user/${core.url.encodePathParam(email)}/permissions`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetUserPermissionResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/organization/user/{email}/permissions", + ); + } +} diff --git a/src/api/resources/user/client/index.ts b/src/api/resources/user/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/user/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/user/client/requests/GetUserPermissionRequest.ts b/src/api/resources/user/client/requests/GetUserPermissionRequest.ts new file mode 100644 index 0000000..712ee20 --- /dev/null +++ b/src/api/resources/user/client/requests/GetUserPermissionRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "email" + * } + */ +export interface GetUserPermissionRequest { + /** Email of the invited user. */ + email: string; +} diff --git a/src/api/resources/user/client/requests/PutRevokeUserPermissionRequest.ts b/src/api/resources/user/client/requests/PutRevokeUserPermissionRequest.ts new file mode 100644 index 0000000..044d4b5 --- /dev/null +++ b/src/api/resources/user/client/requests/PutRevokeUserPermissionRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * email: "email" + * } + */ +export interface PutRevokeUserPermissionRequest { + /** Email of the invited user. */ + email: string; +} diff --git a/src/api/resources/user/client/requests/PutresendcancelinvitationRequest.ts b/src/api/resources/user/client/requests/PutresendcancelinvitationRequest.ts new file mode 100644 index 0000000..d484ec2 --- /dev/null +++ b/src/api/resources/user/client/requests/PutresendcancelinvitationRequest.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * { + * action: "resend", + * email: "email" + * } + */ +export interface PutresendcancelinvitationRequest { + /** action */ + action: Brevo.PutresendcancelinvitationRequestAction; + /** Email of the invited user. */ + email: string; +} diff --git a/src/api/resources/user/client/requests/index.ts b/src/api/resources/user/client/requests/index.ts new file mode 100644 index 0000000..03480df --- /dev/null +++ b/src/api/resources/user/client/requests/index.ts @@ -0,0 +1,3 @@ +export type { GetUserPermissionRequest } from "./GetUserPermissionRequest.js"; +export type { PutRevokeUserPermissionRequest } from "./PutRevokeUserPermissionRequest.js"; +export type { PutresendcancelinvitationRequest } from "./PutresendcancelinvitationRequest.js"; diff --git a/src/api/resources/user/index.ts b/src/api/resources/user/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/user/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/user/types/EditUserPermissionResponse.ts b/src/api/resources/user/types/EditUserPermissionResponse.ts new file mode 100644 index 0000000..1d903fb --- /dev/null +++ b/src/api/resources/user/types/EditUserPermissionResponse.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface EditUserPermissionResponse { + /** Credit note */ + credit_notes?: string[]; + /** Invoice id */ + invoice_id?: string; + /** Status of the API operation. */ + status: string; +} diff --git a/src/api/resources/user/types/GetInvitedUsersListResponse.ts b/src/api/resources/user/types/GetInvitedUsersListResponse.ts new file mode 100644 index 0000000..6eeac0b --- /dev/null +++ b/src/api/resources/user/types/GetInvitedUsersListResponse.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetInvitedUsersListResponse { + /** Get invited users list */ + users?: GetInvitedUsersListResponse.Users.Item[]; +} + +export namespace GetInvitedUsersListResponse { + export type Users = Users.Item[]; + + export namespace Users { + export interface Item { + /** Email address of the user. */ + email: string; + /** Feature accessiblity given to the user. */ + feature_access: Item.FeatureAccess; + /** Flag for indicating is user owner of the organization. */ + is_owner: string; + /** Status of the invited user. */ + status: string; + } + + export namespace Item { + /** + * Feature accessiblity given to the user. + */ + export interface FeatureAccess { + /** Conversations features accessiblity. */ + conversations?: string; + /** CRM features accessiblity. */ + crm?: string; + /** Marketing features accessiblity. */ + marketing?: string; + } + } + } +} diff --git a/src/api/resources/user/types/GetUserPermissionResponse.ts b/src/api/resources/user/types/GetUserPermissionResponse.ts new file mode 100644 index 0000000..e5743b8 --- /dev/null +++ b/src/api/resources/user/types/GetUserPermissionResponse.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Check user permission + */ +export interface GetUserPermissionResponse { + /** Email address of the user. */ + email: string; + /** Granular feature permissions given to the user. */ + privileges: GetUserPermissionResponse.Privileges.Item[]; + /** Status of the invited user. */ + status: string; +} + +export namespace GetUserPermissionResponse { + export type Privileges = Privileges.Item[]; + + export namespace Privileges { + export interface Item { + feature: string; + permissions: string[]; + } + } +} diff --git a/src/api/resources/user/types/InviteuserResponse.ts b/src/api/resources/user/types/InviteuserResponse.ts new file mode 100644 index 0000000..6826386 --- /dev/null +++ b/src/api/resources/user/types/InviteuserResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface InviteuserResponse { + /** Invoice id */ + invoice_id?: string; + /** Status of the API operation. */ + status: string; +} diff --git a/src/api/resources/user/types/PutRevokeUserPermissionResponse.ts b/src/api/resources/user/types/PutRevokeUserPermissionResponse.ts new file mode 100644 index 0000000..186c476 --- /dev/null +++ b/src/api/resources/user/types/PutRevokeUserPermissionResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PutRevokeUserPermissionResponse { + /** Credit note */ + credit_notes?: string[]; + /** Status of the API operation. */ + status: string; +} diff --git a/src/api/resources/user/types/PutresendcancelinvitationRequestAction.ts b/src/api/resources/user/types/PutresendcancelinvitationRequestAction.ts new file mode 100644 index 0000000..6357ec1 --- /dev/null +++ b/src/api/resources/user/types/PutresendcancelinvitationRequestAction.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const PutresendcancelinvitationRequestAction = { + Resend: "resend", + Cancel: "cancel", +} as const; +export type PutresendcancelinvitationRequestAction = + (typeof PutresendcancelinvitationRequestAction)[keyof typeof PutresendcancelinvitationRequestAction]; diff --git a/src/api/resources/user/types/PutresendcancelinvitationResponse.ts b/src/api/resources/user/types/PutresendcancelinvitationResponse.ts new file mode 100644 index 0000000..2c2b746 --- /dev/null +++ b/src/api/resources/user/types/PutresendcancelinvitationResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PutresendcancelinvitationResponse { + /** Credit note */ + credit_notes?: string[]; + /** Status of the API operation. */ + status: string; +} diff --git a/src/api/resources/user/types/index.ts b/src/api/resources/user/types/index.ts new file mode 100644 index 0000000..ff745ee --- /dev/null +++ b/src/api/resources/user/types/index.ts @@ -0,0 +1,7 @@ +export * from "./EditUserPermissionResponse.js"; +export * from "./GetInvitedUsersListResponse.js"; +export * from "./GetUserPermissionResponse.js"; +export * from "./InviteuserResponse.js"; +export * from "./PutRevokeUserPermissionResponse.js"; +export * from "./PutresendcancelinvitationRequestAction.js"; +export * from "./PutresendcancelinvitationResponse.js"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts new file mode 100644 index 0000000..b995b0b --- /dev/null +++ b/src/api/resources/webhooks/client/Client.ts @@ -0,0 +1,520 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace WebhooksClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class WebhooksClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: WebhooksClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * Retrieves all webhooks from your Brevo account with filtering and sorting options. + * + * Use this to: + * - Monitor webhook configurations and event handling + * - List webhooks by type (transactional, marketing, inbound) + * - Review webhook endpoints and authentication + * - Track webhook creation and modification history + * - Audit webhook event subscriptions + * + * Key information returned: + * - Complete webhook details and configuration + * - Event types and channel subscriptions + * - Authentication and security settings + * - Webhook URLs and custom headers + * - Creation and modification timestamps + * + * @param {Brevo.GetWebhooksRequest} request + * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.webhooks.getWebhooks() + */ + public getWebhooks( + request: Brevo.GetWebhooksRequest = {}, + requestOptions?: WebhooksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getWebhooks(request, requestOptions)); + } + + private async __getWebhooks( + request: Brevo.GetWebhooksRequest = {}, + requestOptions?: WebhooksClient.RequestOptions, + ): Promise> { + const { type: type_, sort } = request; + const _queryParams: Record = { + type: type_ != null ? type_ : undefined, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "webhooks", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetWebhooksResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/webhooks"); + } + + /** + * Creates a new webhook to receive real-time notifications for specified events. + * + * Use this to: + * - Set up event notifications for transactional or marketing emails + * - Configure webhook endpoints for campaign tracking + * - Enable real-time monitoring of email delivery status + * - Subscribe to contact list changes and updates + * - Implement custom event handling and automation + * + * Key information returned: + * - Created webhook ID and configuration + * - Success confirmation and setup details + * + * @param {Brevo.CreateWebhookRequest} request + * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.webhooks.createWebhook({ + * events: ["sent"], + * url: "http://requestb.in/173lyyx1" + * }) + */ + public createWebhook( + request: Brevo.CreateWebhookRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createWebhook(request, requestOptions)); + } + + private async __createWebhook( + request: Brevo.CreateWebhookRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "webhooks", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateWebhookResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/webhooks"); + } + + /** + * + * To have it activated please send us a request and we will activate it for your account. + * + * + * Exports webhook event history to CSV format for analysis and reporting. + * + * Use this to: + * - Generate comprehensive webhook event reports + * - Analyze webhook delivery patterns and success rates + * - Export event data for external analysis tools + * - Create historical reports for compliance and auditing + * - Track webhook performance and reliability metrics + * + * Key information returned: + * - Process ID for tracking export completion + * - CSV file will be delivered to specified webhook URL + * + * @param {Brevo.ExportWebhooksHistoryRequest} request + * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.webhooks.exportWebhooksHistory({ + * event: "invalid_parameter", + * notifyURL: "https://brevo.com", + * type: "transactional" + * }) + */ + public exportWebhooksHistory( + request: Brevo.ExportWebhooksHistoryRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__exportWebhooksHistory(request, requestOptions)); + } + + private async __exportWebhooksHistory( + request: Brevo.ExportWebhooksHistoryRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "webhooks/export", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.ExportWebhooksHistoryResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/webhooks/export"); + } + + /** + * Retrieves detailed information about a specific webhook configuration. + * + * Use this to: + * - Get complete webhook configuration and settings + * - Check webhook event subscriptions and triggers + * - Review authentication and security settings + * - Verify webhook URL and custom headers + * - Access webhook creation and modification history + * + * Key information returned: + * - Complete webhook details and configuration + * - Event types and channel subscriptions + * - Authentication credentials and methods + * - Custom headers and request settings + * - Webhook status and activity information + * + * @param {Brevo.GetWebhookRequest} request + * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.webhooks.getWebhook({ + * webhookId: 1000000 + * }) + */ + public getWebhook( + request: Brevo.GetWebhookRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getWebhook(request, requestOptions)); + } + + private async __getWebhook( + request: Brevo.GetWebhookRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): Promise> { + const { webhookId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `webhooks/${core.url.encodePathParam(webhookId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetWebhook, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/webhooks/{webhookId}"); + } + + /** + * Updates an existing webhook configuration and event subscriptions. + * + * Use this to: + * - Modify webhook event subscriptions and triggers + * - Update webhook URL and endpoint configuration + * - Change authentication settings and credentials + * - Adjust custom headers and request parameters + * - Enable or disable specific webhook events + * + * Key information returned: + * - Success confirmation of webhook updates + * + * @param {Brevo.UpdateWebhookRequest} request + * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.webhooks.updateWebhook({ + * webhookId: 1000000 + * }) + */ + public updateWebhook( + request: Brevo.UpdateWebhookRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateWebhook(request, requestOptions)); + } + + private async __updateWebhook( + request: Brevo.UpdateWebhookRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): Promise> { + const { webhookId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `webhooks/${core.url.encodePathParam(webhookId)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/webhooks/{webhookId}"); + } + + /** + * Permanently deletes a webhook and stops all event notifications. + * + * Use this to: + * - Remove unused or obsolete webhook configurations + * - Clean up webhook endpoints and subscriptions + * - Stop event notifications to specific URLs + * - Maintain organized webhook management + * + * Key information returned: + * - Success confirmation of webhook deletion + * + * @param {Brevo.DeleteWebhookRequest} request + * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.webhooks.deleteWebhook({ + * webhookId: 1000000 + * }) + */ + public deleteWebhook( + request: Brevo.DeleteWebhookRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteWebhook(request, requestOptions)); + } + + private async __deleteWebhook( + request: Brevo.DeleteWebhookRequest, + requestOptions?: WebhooksClient.RequestOptions, + ): Promise> { + const { webhookId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `webhooks/${core.url.encodePathParam(webhookId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/webhooks/{webhookId}"); + } +} diff --git a/src/api/resources/webhooks/client/index.ts b/src/api/resources/webhooks/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/webhooks/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts new file mode 100644 index 0000000..c8a8d69 --- /dev/null +++ b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts @@ -0,0 +1,110 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * events: ["sent"], + * url: "http://requestb.in/173lyyx1" + * } + */ +export interface CreateWebhookRequest { + /** Add authentication on webhook url */ + auth?: CreateWebhookRequest.Auth; + /** To send batched webhooks */ + batched?: boolean; + /** channel of webhook */ + channel?: CreateWebhookRequest.Channel; + /** Description of the webhook */ + description?: string; + /** + * Inbound domain of webhook, required in case of event type + * `inbound` + */ + domain?: string; + /** + * - Events triggering the webhook. Possible values for + * **Transactional** type webhook: #### `sent` OR `request`, + * `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, + * `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and + * `unsubscribed` - Possible values for **Marketing** type webhook: + * #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, + * `unsubscribed`, `listAddition` & `delivered` - Possible values + * for **Inbound** type webhook: #### `inboundEmailProcessed` - + * Possible values for type **Transactional** and channel **SMS** + * #### + * `accepted`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`, + * `subscribe`,`sent`,`blacklisted`,`skip` - Possible values for + * type **Marketing** channel **SMS** #### + * `sent`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`, + * `subscribe`,`skip` + */ + events: CreateWebhookRequest.Events.Item[]; + /** Custom headers to be send with webhooks */ + headers?: CreateWebhookRequest.Headers.Item[]; + /** Type of the webhook */ + type?: CreateWebhookRequest.Type; + /** URL of the webhook */ + url: string; +} + +export namespace CreateWebhookRequest { + /** + * Add authentication on webhook url + */ + export interface Auth { + /** Webhook authentication token */ + token?: string; + /** Type of authentication */ + type?: string; + } + + /** channel of webhook */ + export const Channel = { + Sms: "sms", + Email: "email", + } as const; + export type Channel = (typeof Channel)[keyof typeof Channel]; + export type Events = Events.Item[]; + + export namespace Events { + export const Item = { + Sent: "sent", + HardBounce: "hardBounce", + SoftBounce: "softBounce", + Blocked: "blocked", + Spam: "spam", + Delivered: "delivered", + Request: "request", + Click: "click", + Invalid: "invalid", + Deferred: "deferred", + Opened: "opened", + UniqueOpened: "uniqueOpened", + Unsubscribed: "unsubscribed", + ListAddition: "listAddition", + ContactUpdated: "contactUpdated", + ContactDeleted: "contactDeleted", + InboundEmailProcessed: "inboundEmailProcessed", + } as const; + export type Item = (typeof Item)[keyof typeof Item]; + } + + export type Headers = Headers.Item[]; + + export namespace Headers { + export interface Item { + /** Header key name */ + key?: string; + /** Header value */ + value?: string; + } + } + + /** Type of the webhook */ + export const Type = { + Transactional: "transactional", + Marketing: "marketing", + Inbound: "inbound", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; +} diff --git a/src/api/resources/webhooks/client/requests/DeleteWebhookRequest.ts b/src/api/resources/webhooks/client/requests/DeleteWebhookRequest.ts new file mode 100644 index 0000000..c668527 --- /dev/null +++ b/src/api/resources/webhooks/client/requests/DeleteWebhookRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * webhookId: 1000000 + * } + */ +export interface DeleteWebhookRequest { + /** Id of the webhook */ + webhookId: number; +} diff --git a/src/api/resources/webhooks/client/requests/ExportWebhooksHistoryRequest.ts b/src/api/resources/webhooks/client/requests/ExportWebhooksHistoryRequest.ts new file mode 100644 index 0000000..354c438 --- /dev/null +++ b/src/api/resources/webhooks/client/requests/ExportWebhooksHistoryRequest.ts @@ -0,0 +1,74 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * event: "invalid_parameter", + * notifyURL: "https://brevo.com", + * type: "transactional" + * } + */ +export interface ExportWebhooksHistoryRequest { + /** + * Number of days in the past including today (positive + * integer). _Not compatible with 'startDate' and 'endDate'_ + */ + days?: number; + /** Filter the history for a specific email */ + email?: string; + /** + * Mandatory if startDate is used. Ending date of the report + * (YYYY-MM-DD). Must be greater than equal to startDate + */ + endDate?: string; + /** Filter the history for a specific event type */ + event: ExportWebhooksHistoryRequest.Event; + /** + * Filter the history for a specific message id. Applicable + * only for transactional webhooks. + */ + messageId?: number; + /** Webhook URL to receive CSV file link */ + notifyURL: string; + /** Sorting order of records (asc or desc) */ + sort?: string; + /** + * Mandatory if endDate is used. Starting date of the history + * (YYYY-MM-DD). Must be lower than equal to endDate + */ + startDate?: string; + /** Filter the history based on webhook type */ + type: ExportWebhooksHistoryRequest.Type; + /** Filter the history for a specific webhook id */ + webhookId?: number; +} + +export namespace ExportWebhooksHistoryRequest { + /** Filter the history for a specific event type */ + export const Event = { + InvalidParameter: "invalid_parameter", + MissingParameter: "missing_parameter", + HardBounce: "hardBounce", + SoftBounce: "softBounce", + Delivered: "delivered", + Spam: "spam", + Request: "request", + Opened: "opened", + Click: "click", + Invalid: "invalid", + Deferred: "deferred", + Blocked: "blocked", + Unsubscribed: "unsubscribed", + Error: "error", + UniqueOpened: "uniqueOpened", + LoadedByProxy: "loadedByProxy", + AllEvents: "allEvents", + } as const; + export type Event = (typeof Event)[keyof typeof Event]; + /** Filter the history based on webhook type */ + export const Type = { + Transactional: "transactional", + Marketing: "marketing", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; +} diff --git a/src/api/resources/webhooks/client/requests/GetWebhookRequest.ts b/src/api/resources/webhooks/client/requests/GetWebhookRequest.ts new file mode 100644 index 0000000..382f4f8 --- /dev/null +++ b/src/api/resources/webhooks/client/requests/GetWebhookRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * webhookId: 1000000 + * } + */ +export interface GetWebhookRequest { + /** Id of the webhook */ + webhookId: number; +} diff --git a/src/api/resources/webhooks/client/requests/GetWebhooksRequest.ts b/src/api/resources/webhooks/client/requests/GetWebhooksRequest.ts new file mode 100644 index 0000000..aaf6fb1 --- /dev/null +++ b/src/api/resources/webhooks/client/requests/GetWebhooksRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetWebhooksRequest { + /** Filter on webhook type */ + type?: Brevo.GetWebhooksRequestType; + /** Sort the results in the ascending/descending order of webhook creation */ + sort?: Brevo.GetWebhooksRequestSort; +} diff --git a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts new file mode 100644 index 0000000..126cd01 --- /dev/null +++ b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts @@ -0,0 +1,83 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * webhookId: 1000000 + * } + */ +export interface UpdateWebhookRequest { + /** Id of the webhook */ + webhookId: number; + /** Add authentication on webhook url */ + auth?: UpdateWebhookRequest.Auth; + /** To send batched webhooks */ + batched?: boolean; + /** Description of the webhook */ + description?: string; + /** Inbound domain of webhook, used in case of event type `inbound` */ + domain?: string; + /** + * - Events triggering the webhook. Possible values for + * **Transactional** type webhook: #### `sent` OR `request`, + * `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, + * `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and + * `unsubscribed` - Possible values for **Marketing** type webhook: + * #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, + * `unsubscribed`, `listAddition` & `delivered` - Possible values + * for **Inbound** type webhook: #### `inboundEmailProcessed` + */ + events?: UpdateWebhookRequest.Events.Item[]; + /** Custom headers to be send with webhooks */ + headers?: UpdateWebhookRequest.Headers.Item[]; + /** URL of the webhook */ + url?: string; +} + +export namespace UpdateWebhookRequest { + /** + * Add authentication on webhook url + */ + export interface Auth { + /** Webhook authentication token */ + token?: string; + /** Type of authentication */ + type?: string; + } + + export type Events = Events.Item[]; + + export namespace Events { + export const Item = { + Sent: "sent", + HardBounce: "hardBounce", + SoftBounce: "softBounce", + Blocked: "blocked", + Spam: "spam", + Delivered: "delivered", + Request: "request", + Click: "click", + Invalid: "invalid", + Deferred: "deferred", + Opened: "opened", + UniqueOpened: "uniqueOpened", + Unsubscribed: "unsubscribed", + ListAddition: "listAddition", + ContactUpdated: "contactUpdated", + ContactDeleted: "contactDeleted", + InboundEmailProcessed: "inboundEmailProcessed", + } as const; + export type Item = (typeof Item)[keyof typeof Item]; + } + + export type Headers = Headers.Item[]; + + export namespace Headers { + export interface Item { + /** Header key name */ + key?: string; + /** Header value */ + value?: string; + } + } +} diff --git a/src/api/resources/webhooks/client/requests/index.ts b/src/api/resources/webhooks/client/requests/index.ts new file mode 100644 index 0000000..b68a1af --- /dev/null +++ b/src/api/resources/webhooks/client/requests/index.ts @@ -0,0 +1,6 @@ +export { CreateWebhookRequest } from "./CreateWebhookRequest.js"; +export type { DeleteWebhookRequest } from "./DeleteWebhookRequest.js"; +export { ExportWebhooksHistoryRequest } from "./ExportWebhooksHistoryRequest.js"; +export type { GetWebhookRequest } from "./GetWebhookRequest.js"; +export type { GetWebhooksRequest } from "./GetWebhooksRequest.js"; +export { UpdateWebhookRequest } from "./UpdateWebhookRequest.js"; diff --git a/src/api/resources/webhooks/index.ts b/src/api/resources/webhooks/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/webhooks/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/webhooks/types/CreateWebhookResponse.ts b/src/api/resources/webhooks/types/CreateWebhookResponse.ts new file mode 100644 index 0000000..4630ba6 --- /dev/null +++ b/src/api/resources/webhooks/types/CreateWebhookResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateWebhookResponse { + /** ID of the object created */ + id: number; +} diff --git a/src/api/resources/webhooks/types/ExportWebhooksHistoryResponse.ts b/src/api/resources/webhooks/types/ExportWebhooksHistoryResponse.ts new file mode 100644 index 0000000..17d8c71 --- /dev/null +++ b/src/api/resources/webhooks/types/ExportWebhooksHistoryResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ExportWebhooksHistoryResponse { + /** Id of the process created */ + processId: number; +} diff --git a/src/api/resources/webhooks/types/GetWebhooksRequestSort.ts b/src/api/resources/webhooks/types/GetWebhooksRequestSort.ts new file mode 100644 index 0000000..5aa3757 --- /dev/null +++ b/src/api/resources/webhooks/types/GetWebhooksRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetWebhooksRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetWebhooksRequestSort = (typeof GetWebhooksRequestSort)[keyof typeof GetWebhooksRequestSort]; diff --git a/src/api/resources/webhooks/types/GetWebhooksRequestType.ts b/src/api/resources/webhooks/types/GetWebhooksRequestType.ts new file mode 100644 index 0000000..d70292b --- /dev/null +++ b/src/api/resources/webhooks/types/GetWebhooksRequestType.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetWebhooksRequestType = { + Marketing: "marketing", + Transactional: "transactional", + Inbound: "inbound", +} as const; +export type GetWebhooksRequestType = (typeof GetWebhooksRequestType)[keyof typeof GetWebhooksRequestType]; diff --git a/src/api/resources/webhooks/types/GetWebhooksResponse.ts b/src/api/resources/webhooks/types/GetWebhooksResponse.ts new file mode 100644 index 0000000..ce20c10 --- /dev/null +++ b/src/api/resources/webhooks/types/GetWebhooksResponse.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetWebhooksResponse { + webhooks: Brevo.GetWebhook[]; +} diff --git a/src/api/resources/webhooks/types/index.ts b/src/api/resources/webhooks/types/index.ts new file mode 100644 index 0000000..fb876da --- /dev/null +++ b/src/api/resources/webhooks/types/index.ts @@ -0,0 +1,5 @@ +export * from "./CreateWebhookResponse.js"; +export * from "./ExportWebhooksHistoryResponse.js"; +export * from "./GetWebhooksRequestSort.js"; +export * from "./GetWebhooksRequestType.js"; +export * from "./GetWebhooksResponse.js"; diff --git a/src/api/resources/whatsAppCampaigns/client/Client.ts b/src/api/resources/whatsAppCampaigns/client/Client.ts new file mode 100644 index 0000000..b9becb7 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/Client.ts @@ -0,0 +1,710 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as Brevo from "../../../index.js"; + +export declare namespace WhatsAppCampaignsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class WhatsAppCampaignsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: WhatsAppCampaignsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Brevo.GetWhatsAppCampaignsRequest} request + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.whatsAppCampaigns.getWhatsAppCampaigns() + */ + public getWhatsAppCampaigns( + request: Brevo.GetWhatsAppCampaignsRequest = {}, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getWhatsAppCampaigns(request, requestOptions)); + } + + private async __getWhatsAppCampaigns( + request: Brevo.GetWhatsAppCampaignsRequest = {}, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const { startDate, endDate, limit, offset, sort } = request; + const _queryParams: Record = { + startDate, + endDate, + limit, + offset, + sort: sort != null ? sort : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "whatsappCampaigns", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetWhatsAppCampaignsResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/whatsappCampaigns"); + } + + /** + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * + * + * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. + * + * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) + * + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) + * + * + * @param {Brevo.CreateWhatsAppCampaignRequest} request + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.whatsAppCampaigns.createWhatsAppCampaign({ + * name: "Test Campaign", + * recipients: {}, + * scheduledAt: "2017-06-01T12:30:00+02:00", + * templateId: 19 + * }) + */ + public createWhatsAppCampaign( + request: Brevo.CreateWhatsAppCampaignRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createWhatsAppCampaign(request, requestOptions)); + } + + private async __createWhatsAppCampaign( + request: Brevo.CreateWhatsAppCampaignRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "whatsappCampaigns", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateWhatsAppCampaignResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/whatsappCampaigns"); + } + + /** + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.whatsAppCampaigns.getWhatsAppConfig() + */ + public getWhatsAppConfig( + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getWhatsAppConfig(requestOptions)); + } + + private async __getWhatsAppConfig( + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "whatsappCampaigns/config", + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetWhatsAppConfigResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/whatsappCampaigns/config"); + } + + /** + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * + * @param {Brevo.CreateWhatsAppTemplateRequest} request + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.whatsAppCampaigns.createWhatsAppTemplate({ + * bodyText: "making it look like readable English", + * category: "MARKETING", + * language: "en", + * name: "Test template" + * }) + */ + public createWhatsAppTemplate( + request: Brevo.CreateWhatsAppTemplateRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createWhatsAppTemplate(request, requestOptions)); + } + + private async __createWhatsAppTemplate( + request: Brevo.CreateWhatsAppTemplateRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "whatsappCampaigns/template", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.CreateWhatsAppTemplateResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/whatsappCampaigns/template"); + } + + /** + * @param {Brevo.GetWhatsAppTemplatesRequest} request + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.whatsAppCampaigns.getWhatsAppTemplates() + */ + public getWhatsAppTemplates( + request: Brevo.GetWhatsAppTemplatesRequest = {}, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getWhatsAppTemplates(request, requestOptions)); + } + + private async __getWhatsAppTemplates( + request: Brevo.GetWhatsAppTemplatesRequest = {}, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const { startDate, endDate, limit, offset, sort, source } = request; + const _queryParams: Record = { + startDate, + endDate, + limit, + offset, + sort: sort != null ? sort : undefined, + source: source != null ? source : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "whatsappCampaigns/template-list", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetWhatsAppTemplatesResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/whatsappCampaigns/template-list", + ); + } + + /** + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * + * @param {Brevo.SendWhatsAppTemplateApprovalRequest} request + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.whatsAppCampaigns.sendWhatsAppTemplateApproval({ + * templateId: 1000000 + * }) + */ + public sendWhatsAppTemplateApproval( + request: Brevo.SendWhatsAppTemplateApprovalRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__sendWhatsAppTemplateApproval(request, requestOptions)); + } + + private async __sendWhatsAppTemplateApproval( + request: Brevo.SendWhatsAppTemplateApprovalRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const { templateId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `whatsappCampaigns/template/approval/${core.url.encodePathParam(templateId)}`, + ), + method: "POST", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/whatsappCampaigns/template/approval/{templateId}", + ); + } + + /** + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * + * @param {Brevo.GetWhatsAppCampaignRequest} request + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.whatsAppCampaigns.getWhatsAppCampaign({ + * campaignId: 1000000 + * }) + */ + public getWhatsAppCampaign( + request: Brevo.GetWhatsAppCampaignRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getWhatsAppCampaign(request, requestOptions)); + } + + private async __getWhatsAppCampaign( + request: Brevo.GetWhatsAppCampaignRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `whatsappCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetWhatsAppCampaignResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/whatsappCampaigns/{campaignId}", + ); + } + + /** + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * + * + * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. + * + * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) + * + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) + * + * + * @param {Brevo.UpdateWhatsAppCampaignRequest} request + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * + * @example + * await client.whatsAppCampaigns.updateWhatsAppCampaign({ + * campaignId: 1000000 + * }) + */ + public updateWhatsAppCampaign( + request: Brevo.UpdateWhatsAppCampaignRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateWhatsAppCampaign(request, requestOptions)); + } + + private async __updateWhatsAppCampaign( + request: Brevo.UpdateWhatsAppCampaignRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `whatsappCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/whatsappCampaigns/{campaignId}", + ); + } + + /** + * @param {Brevo.DeleteWhatsAppCampaignRequest} request + * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.whatsAppCampaigns.deleteWhatsAppCampaign({ + * campaignId: 1000000 + * }) + */ + public deleteWhatsAppCampaign( + request: Brevo.DeleteWhatsAppCampaignRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteWhatsAppCampaign(request, requestOptions)); + } + + private async __deleteWhatsAppCampaign( + request: Brevo.DeleteWhatsAppCampaignRequest, + requestOptions?: WhatsAppCampaignsClient.RequestOptions, + ): Promise> { + const { campaignId } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `whatsappCampaigns/${core.url.encodePathParam(campaignId)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/whatsappCampaigns/{campaignId}", + ); + } +} diff --git a/src/api/resources/whatsAppCampaigns/client/index.ts b/src/api/resources/whatsAppCampaigns/client/index.ts new file mode 100644 index 0000000..195f9aa --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppCampaignRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppCampaignRequest.ts new file mode 100644 index 0000000..7ce0d47 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppCampaignRequest.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * name: "Test Campaign", + * recipients: {}, + * scheduledAt: "2017-06-01T12:30:00+02:00", + * templateId: 19 + * } + */ +export interface CreateWhatsAppCampaignRequest { + /** Name of the WhatsApp campaign creation */ + name: string; + /** Segment ids and List ids to include/exclude from campaign */ + recipients: CreateWhatsAppCampaignRequest.Recipients; + /** Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** */ + scheduledAt: string; + /** Id of the WhatsApp template in **approved** state */ + templateId: number; +} + +export namespace CreateWhatsAppCampaignRequest { + /** + * Segment ids and List ids to include/exclude from campaign + */ + export interface Recipients { + /** List ids to exclude from the campaign */ + excludedListIds?: number[]; + /** **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to */ + listIds?: number[]; + /** **Mandatory if listIds are not used**. Segment ids to send the campaign to. */ + segments?: number[]; + } +} diff --git a/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppTemplateRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppTemplateRequest.ts new file mode 100644 index 0000000..d11fb09 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppTemplateRequest.ts @@ -0,0 +1,45 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * bodyText: "making it look like readable English", + * category: "MARKETING", + * language: "en", + * name: "Test template" + * } + */ +export interface CreateWhatsAppTemplateRequest { + /** Body of the template. **Maximum allowed characters are 1024** */ + bodyText: string; + /** Category of the template */ + category: CreateWhatsAppTemplateRequest.Category; + /** Text content of the header in the template. **Maximum allowed characters are 45** **Use this field to add text content in template header and if mediaUrl is empty** */ + headerText?: string; + /** + * Language of the template. For Example : + * **en** for English + */ + language: string; + /** Absolute url of the media file **(no local file)** for the header. **Use this field in you want to add media in Template header and headerText is empty** Allowed extensions for media files are: #### jpeg | png | mp4 | pdf */ + mediaUrl?: string; + /** Name of the template */ + name: string; + /** source of the template */ + source?: CreateWhatsAppTemplateRequest.Source; +} + +export namespace CreateWhatsAppTemplateRequest { + /** Category of the template */ + export const Category = { + Marketing: "MARKETING", + Utility: "UTILITY", + } as const; + export type Category = (typeof Category)[keyof typeof Category]; + /** source of the template */ + export const Source = { + Automation: "Automation", + Conversations: "Conversations", + } as const; + export type Source = (typeof Source)[keyof typeof Source]; +} diff --git a/src/api/resources/whatsAppCampaigns/client/requests/DeleteWhatsAppCampaignRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/DeleteWhatsAppCampaignRequest.ts new file mode 100644 index 0000000..077a8fe --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/DeleteWhatsAppCampaignRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface DeleteWhatsAppCampaignRequest { + /** id of the campaign */ + campaignId: number; +} diff --git a/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppCampaignRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppCampaignRequest.ts new file mode 100644 index 0000000..03105ad --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppCampaignRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface GetWhatsAppCampaignRequest { + /** Id of the campaign */ + campaignId: number; +} diff --git a/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppCampaignsRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppCampaignsRequest.ts new file mode 100644 index 0000000..19962cb --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppCampaignsRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetWhatsAppCampaignsRequest { + /** **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** */ + startDate?: string; + /** **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the WhatsApp campaigns created. **Prefer to pass your timezone in date-time format for accurate result** */ + endDate?: string; + /** Number of documents per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetWhatsAppCampaignsRequestSort; +} diff --git a/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppTemplatesRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppTemplatesRequest.ts new file mode 100644 index 0000000..95924fe --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/GetWhatsAppTemplatesRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface GetWhatsAppTemplatesRequest { + /** **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** */ + startDate?: string; + /** **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the templates created. **Prefer to pass your timezone in date-time format for accurate result** */ + endDate?: string; + /** Number of documents per page */ + limit?: number; + /** Index of the first document in the page */ + offset?: number; + /** Sort the results in the ascending/descending order of record modification. Default order is **descending** if `sort` is not passed */ + sort?: Brevo.GetWhatsAppTemplatesRequestSort; + /** source of the template */ + source?: Brevo.GetWhatsAppTemplatesRequestSource; +} diff --git a/src/api/resources/whatsAppCampaigns/client/requests/SendWhatsAppTemplateApprovalRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/SendWhatsAppTemplateApprovalRequest.ts new file mode 100644 index 0000000..380244b --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/SendWhatsAppTemplateApprovalRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * templateId: 1000000 + * } + */ +export interface SendWhatsAppTemplateApprovalRequest { + /** id of the template */ + templateId: number; +} diff --git a/src/api/resources/whatsAppCampaigns/client/requests/UpdateWhatsAppCampaignRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/UpdateWhatsAppCampaignRequest.ts new file mode 100644 index 0000000..a332848 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/UpdateWhatsAppCampaignRequest.ts @@ -0,0 +1,41 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * campaignId: 1000000 + * } + */ +export interface UpdateWhatsAppCampaignRequest { + /** id of the campaign */ + campaignId: number; + /** Name of the campaign */ + campaignName?: string; + /** Status of the campaign */ + campaignStatus?: UpdateWhatsAppCampaignRequest.CampaignStatus; + /** Segment ids and List ids to include/exclude from campaign */ + recipients?: UpdateWhatsAppCampaignRequest.Recipients; + /** Reschedule the sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of campaign. **Prefer to pass your timezone in date-time format for accurate result.For example: **2017-06-01T12:30:00+02:00** Use this field to update the scheduledAt of any existing draft or scheduled WhatsApp campaign. */ + rescheduleFor?: string; +} + +export namespace UpdateWhatsAppCampaignRequest { + /** Status of the campaign */ + export const CampaignStatus = { + Scheduled: "scheduled", + Suspended: "suspended", + } as const; + export type CampaignStatus = (typeof CampaignStatus)[keyof typeof CampaignStatus]; + + /** + * Segment ids and List ids to include/exclude from campaign + */ + export interface Recipients { + /** List ids to exclude from the campaign */ + excludedListIds?: number[]; + /** **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to */ + listIds?: number[]; + /** **Mandatory if listIds are not used**. Segment ids to send the campaign to. */ + segments?: number[]; + } +} diff --git a/src/api/resources/whatsAppCampaigns/client/requests/index.ts b/src/api/resources/whatsAppCampaigns/client/requests/index.ts new file mode 100644 index 0000000..384ef54 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/client/requests/index.ts @@ -0,0 +1,8 @@ +export type { CreateWhatsAppCampaignRequest } from "./CreateWhatsAppCampaignRequest.js"; +export { CreateWhatsAppTemplateRequest } from "./CreateWhatsAppTemplateRequest.js"; +export type { DeleteWhatsAppCampaignRequest } from "./DeleteWhatsAppCampaignRequest.js"; +export type { GetWhatsAppCampaignRequest } from "./GetWhatsAppCampaignRequest.js"; +export type { GetWhatsAppCampaignsRequest } from "./GetWhatsAppCampaignsRequest.js"; +export type { GetWhatsAppTemplatesRequest } from "./GetWhatsAppTemplatesRequest.js"; +export type { SendWhatsAppTemplateApprovalRequest } from "./SendWhatsAppTemplateApprovalRequest.js"; +export { UpdateWhatsAppCampaignRequest } from "./UpdateWhatsAppCampaignRequest.js"; diff --git a/src/api/resources/whatsAppCampaigns/index.ts b/src/api/resources/whatsAppCampaigns/index.ts new file mode 100644 index 0000000..d9adb1a --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/whatsAppCampaigns/types/CreateWhatsAppCampaignResponse.ts b/src/api/resources/whatsAppCampaigns/types/CreateWhatsAppCampaignResponse.ts new file mode 100644 index 0000000..3c7ac72 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/CreateWhatsAppCampaignResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateWhatsAppCampaignResponse { + /** ID of the object created */ + id: number; +} diff --git a/src/api/resources/whatsAppCampaigns/types/CreateWhatsAppTemplateResponse.ts b/src/api/resources/whatsAppCampaigns/types/CreateWhatsAppTemplateResponse.ts new file mode 100644 index 0000000..5da9b0f --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/CreateWhatsAppTemplateResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateWhatsAppTemplateResponse { + /** ID of the object created */ + id: number; +} diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts new file mode 100644 index 0000000..7b4f1f1 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts @@ -0,0 +1,69 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetWhatsAppCampaignResponse { + /** Name of the WhatsApp Campaign */ + campaignName: string; + /** Status of the WhatsApp Campaign */ + campaignStatus: GetWhatsAppCampaignResponse.CampaignStatus; + /** Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** ID of the WhatsApp Campaign */ + id: number; + /** UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ + scheduledAt?: string; + /** Sender of the WhatsApp Campaign */ + senderNumber: string; + stats?: Brevo.WhatsappCampStats; + template: GetWhatsAppCampaignResponse.Template; +} + +export namespace GetWhatsAppCampaignResponse { + /** Status of the WhatsApp Campaign */ + export const CampaignStatus = { + Draft: "draft", + Scheduled: "scheduled", + Pending: "pending", + Approved: "approved", + Running: "running", + Suspended: "suspended", + Rejected: "rejected", + Sent: "sent", + } as const; + export type CampaignStatus = (typeof CampaignStatus)[keyof typeof CampaignStatus]; + + export interface Template { + /** array of variables item variables */ + body_variables?: Brevo.VariablesItems[]; + button_type?: string; + /** description of the template */ + category?: string; + /** array of component item objects */ + components?: Template.Components.Item[]; + contains_button?: boolean; + display_header?: boolean; + /** type of header */ + header_type?: string; + /** array of variables item object */ + header_variables?: Brevo.VariablesItems[]; + hide_footer?: boolean; + /** language of the template */ + language?: string; + /** name of the template */ + name?: string; + } + + export namespace Template { + export type Components = Components.Item[]; + + export namespace Components { + export interface Item { + text?: string; + type?: string; + } + } + } +} diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsRequestSort.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsRequestSort.ts new file mode 100644 index 0000000..b7432ad --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetWhatsAppCampaignsRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetWhatsAppCampaignsRequestSort = + (typeof GetWhatsAppCampaignsRequestSort)[keyof typeof GetWhatsAppCampaignsRequestSort]; diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsResponse.ts new file mode 100644 index 0000000..f0e75ff --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsResponse.ts @@ -0,0 +1,54 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../../../index.js"; + +export interface GetWhatsAppCampaignsResponse { + campaigns?: GetWhatsAppCampaignsResponse.Campaigns.Item[]; + /** Number of WhatsApp campaigns retrieved */ + count?: number; +} + +export namespace GetWhatsAppCampaignsResponse { + export type Campaigns = Campaigns.Item[]; + + export namespace Campaigns { + export interface Item { + /** Name of the WhatsApp Campaign */ + campaignName: string; + /** Status of the Whatsapp Campaign */ + campaignStatus: Item.CampaignStatus; + /** Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Error Reason associated with the WhatsApp campaign sending */ + errorReason?: string; + /** ID of the WhatsApp Campaign */ + id: number; + /** Count of invalidated contacts */ + invalidatedContacts?: number; + /** UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Read percentage of the the whatsapp campaign created */ + readPercentage?: number; + /** UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ + scheduledAt: string; + stats?: Brevo.WhatsappCampStats; + /** Id of the WhatsApp template */ + templateId: string; + } + + export namespace Item { + /** Status of the Whatsapp Campaign */ + export const CampaignStatus = { + Draft: "draft", + Scheduled: "scheduled", + Pending: "pending", + Approved: "approved", + Running: "running", + Suspended: "suspended", + Rejected: "rejected", + Sent: "sent", + } as const; + export type CampaignStatus = (typeof CampaignStatus)[keyof typeof CampaignStatus]; + } + } +} diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppConfigResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppConfigResponse.ts new file mode 100644 index 0000000..41b0ce2 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppConfigResponse.ts @@ -0,0 +1,41 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetWhatsAppConfigResponse { + /** Verification status information of the Business account */ + businessStatus?: string; + /** Status of the name associated with WhatsApp Phone number */ + phoneNumberNameStatus?: GetWhatsAppConfigResponse.PhoneNumberNameStatus; + /** Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** */ + phoneNumberQuality?: GetWhatsAppConfigResponse.PhoneNumberQuality; + /** Sending limit of the WhatsApp account */ + sendingLimit?: string; + /** Id of the WhatsApp business account */ + whatsappBusinessAccountId?: string; + /** Status information related to WhatsApp Api account */ + whatsappBusinessAccountStatus?: GetWhatsAppConfigResponse.WhatsappBusinessAccountStatus; +} + +export namespace GetWhatsAppConfigResponse { + /** Status of the name associated with WhatsApp Phone number */ + export const PhoneNumberNameStatus = { + Approved: "APPROVED", + Pending: "PENDING", + Rejected: "REJECTED", + } as const; + export type PhoneNumberNameStatus = (typeof PhoneNumberNameStatus)[keyof typeof PhoneNumberNameStatus]; + /** Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** */ + export const PhoneNumberQuality = { + Green: "GREEN", + Yellow: "YELLOW", + Red: "RED", + } as const; + export type PhoneNumberQuality = (typeof PhoneNumberQuality)[keyof typeof PhoneNumberQuality]; + /** Status information related to WhatsApp Api account */ + export const WhatsappBusinessAccountStatus = { + Approved: "APPROVED", + Pending: "PENDING", + Rejected: "REJECTED", + } as const; + export type WhatsappBusinessAccountStatus = + (typeof WhatsappBusinessAccountStatus)[keyof typeof WhatsappBusinessAccountStatus]; +} diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesRequestSort.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesRequestSort.ts new file mode 100644 index 0000000..54cb89a --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetWhatsAppTemplatesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetWhatsAppTemplatesRequestSort = + (typeof GetWhatsAppTemplatesRequestSort)[keyof typeof GetWhatsAppTemplatesRequestSort]; diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesRequestSource.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesRequestSource.ts new file mode 100644 index 0000000..9db3227 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesRequestSource.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetWhatsAppTemplatesRequestSource = { + Automation: "Automation", + Conversations: "Conversations", +} as const; +export type GetWhatsAppTemplatesRequestSource = + (typeof GetWhatsAppTemplatesRequestSource)[keyof typeof GetWhatsAppTemplatesRequestSource]; diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts new file mode 100644 index 0000000..3142bc9 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetWhatsAppTemplatesResponse { + /** Number of whatsApp templates retrieved */ + count?: number; + templates?: GetWhatsAppTemplatesResponse.Templates.Item[]; +} + +export namespace GetWhatsAppTemplatesResponse { + export type Templates = Templates.Item[]; + + export namespace Templates { + export interface Item { + /** category of the template */ + category: string; + /** Creation UTC date-time of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Error reason in the template creation */ + errorReason?: string; + /** ID of the whatsApp template */ + id: number; + /** Language in which template exists */ + language: string; + /** UTC date-time of last modification of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Name of the whatsApp template */ + name: string; + /** Status of the whatsApp template */ + status: string; + } + } +} diff --git a/src/api/resources/whatsAppCampaigns/types/index.ts b/src/api/resources/whatsAppCampaigns/types/index.ts new file mode 100644 index 0000000..ac0a08b --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/types/index.ts @@ -0,0 +1,9 @@ +export * from "./CreateWhatsAppCampaignResponse.js"; +export * from "./CreateWhatsAppTemplateResponse.js"; +export * from "./GetWhatsAppCampaignResponse.js"; +export * from "./GetWhatsAppCampaignsRequestSort.js"; +export * from "./GetWhatsAppCampaignsResponse.js"; +export * from "./GetWhatsAppConfigResponse.js"; +export * from "./GetWhatsAppTemplatesRequestSort.js"; +export * from "./GetWhatsAppTemplatesRequestSource.js"; +export * from "./GetWhatsAppTemplatesResponse.js"; diff --git a/src/api/types/AbTestVersionClicks.ts b/src/api/types/AbTestVersionClicks.ts new file mode 100644 index 0000000..9e932f3 --- /dev/null +++ b/src/api/types/AbTestVersionClicks.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../index.js"; + +/** + * Information on clicked links for a particular version + */ +export type AbTestVersionClicks = Brevo.AbTestVersionClicksItem[]; diff --git a/src/api/types/AbTestVersionClicksItem.ts b/src/api/types/AbTestVersionClicksItem.ts new file mode 100644 index 0000000..9c2e08d --- /dev/null +++ b/src/api/types/AbTestVersionClicksItem.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AbTestVersionClicksItem { + /** Percentage of clicks of link with respect to total clicks */ + clickRate: string; + /** Number of times a link is clicked */ + clicksCount: number; + /** URL of the link */ + link: string; +} diff --git a/src/api/types/AbTestVersionStats.ts b/src/api/types/AbTestVersionStats.ts new file mode 100644 index 0000000..412bd89 --- /dev/null +++ b/src/api/types/AbTestVersionStats.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Percentage of a particular event for both versions + */ +export interface AbTestVersionStats { + /** percentage of an event for version A */ + "Version A": string; + /** percentage of an event for version B */ + "Version B": string; +} diff --git a/src/api/types/BadRequestErrorBody.ts b/src/api/types/BadRequestErrorBody.ts new file mode 100644 index 0000000..640bb89 --- /dev/null +++ b/src/api/types/BadRequestErrorBody.ts @@ -0,0 +1,51 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface BadRequestErrorBody { + /** Error code displayed in case of a failure */ + code: BadRequestErrorBody.Code; + /** Readable message associated to the failure */ + message: string; +} + +export namespace BadRequestErrorBody { + /** Error code displayed in case of a failure */ + export const Code = { + InvalidParameter: "invalid_parameter", + MissingParameter: "missing_parameter", + OutOfRange: "out_of_range", + CampaignProcessing: "campaign_processing", + CampaignSent: "campaign_sent", + DocumentNotFound: "document_not_found", + NotEnoughCredits: "not_enough_credits", + PermissionDenied: "permission_denied", + DuplicateParameter: "duplicate_parameter", + DuplicateRequest: "duplicate_request", + MethodNotAllowed: "method_not_allowed", + Unauthorized: "unauthorized", + AccountUnderValidation: "account_under_validation", + NotAcceptable: "not_acceptable", + BadRequest: "bad_request", + UnprocessableEntity: "unprocessable_entity", + DomainDoesNotExist: "Domain does not exist", + ContactEmailNotFound: "Contact email not found", + AttributeNotFound: "Attribute not found", + CategoryIdNotFound: "Category id not found", + InvalidParametersPassed: "Invalid parameters passed", + RecordSForIdentifierNotFound: "Record(s) for identifier not found", + ReturnedWhenQueryParamsAreInvalid: "Returned when query params are invalid", + ReturnedWhenInvalidDataPosted: "Returned when invalid data posted", + FeedNotFound: "Feed not found", + CampaignIdNotFound: "Campaign ID not found", + ApiKeyNotFound: "api-key not found", + DmarcPolicyRequiresDomainAuthentication: "DMARC policy requires domain authentication", + DnsRecordsNotProperlyConfigured: "DNS records not properly configured", + InvalidOtpCodeProvided: "Invalid OTP code provided", + OtpCodeHasExpired: "OTP code has expired", + DomainAlreadyExistsInYourAccount: "Domain already exists in your account", + TheSumOfAllIpWeightsMustEqual100: "The sum of all IP weights must equal 100", + AuthenticationFailed: "Authentication failed", + InsufficientCredits: "Insufficient credits", + RequestAlreadyProcessed: "Request already processed", + } as const; + export type Code = (typeof Code)[keyof typeof Code]; +} diff --git a/src/api/types/BalanceDefinition.ts b/src/api/types/BalanceDefinition.ts new file mode 100644 index 0000000..2bb26b4 --- /dev/null +++ b/src/api/types/BalanceDefinition.ts @@ -0,0 +1,55 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface BalanceDefinition { + /** startOfPeriod depicts the balancy expiry on start of day/week/month/year. endOfPeriod depicts the balancy expiry on end of day/week/month/year */ + balanceAvailabilityDurationModifier?: BalanceDefinition.BalanceAvailabilityDurationModifier; + /** Unit of time for the balance's availability (e.g., day/week/month/year). */ + balanceAvailabilityDurationUnit?: string; + /** Number of days/weeks/month/year for balance expiry */ + balanceAvailabilityDurationValue?: number; + /** Date when the balance expires and can no longer be used, in dd/mm format. The balance will be expired when this date appears next in the calendar and only one of balanceExpirationDate or balance availability fields can be used. */ + balanceExpirationDate?: string; + /** Partial enables partial credit of balance if maximum balance limit is reaching. Strict enables rejection of transaction if it will breach the max credit amount limit. */ + balanceOptionAmountOvertakingStrategy?: string; + /** Rounding strategy for credit transactions. */ + balanceOptionCreditRounding?: string; + /** Rounding strategy for debit transactions. */ + balanceOptionDebitRounding?: string; + /** Timestamp of balance definition creation. */ + createdAt?: string; + /** Timestamp of balance definition deletion (nullable). */ + deletedAt?: string; + /** Short description of the balance definition. */ + description?: string; + /** Unique identifier for the balance definition. */ + id?: string; + /** Optional image reference URL. */ + imageRef?: string; + /** Maximum allowable balance. */ + maxAmount?: number; + /** Max credit allowed per operation. */ + maxCreditAmountLimit?: number; + /** Max debit allowed per operation. */ + maxDebitAmountLimit?: number; + /** Additional metadata for the balance definition. */ + meta?: Record; + /** Minimum allowable balance. */ + minAmount?: number; + /** Name of the balance definition. */ + name?: string; + /** Unit of balance (e.g., points, currency). */ + unit?: string; + /** Timestamp of the last update. */ + updatedAt?: string; +} + +export namespace BalanceDefinition { + /** startOfPeriod depicts the balancy expiry on start of day/week/month/year. endOfPeriod depicts the balancy expiry on end of day/week/month/year */ + export const BalanceAvailabilityDurationModifier = { + StartOfPeriod: "startOfPeriod", + EndOfPeriod: "endOfPeriod", + NoModification: "noModification", + } as const; + export type BalanceAvailabilityDurationModifier = + (typeof BalanceAvailabilityDurationModifier)[keyof typeof BalanceAvailabilityDurationModifier]; +} diff --git a/src/api/types/BalanceLimit.ts b/src/api/types/BalanceLimit.ts new file mode 100644 index 0000000..2945963 --- /dev/null +++ b/src/api/types/BalanceLimit.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface BalanceLimit { + /** balance definition ID */ + balanceDefinitionId?: string; + /** Defines the type of constraint (e.g., transaction-based or amount-based). */ + constraintType?: string; + /** Timestamp of when the balance limit was created. */ + createdAt: string; + /** Time unit for the balance limit (day, week, month, year). */ + durationUnit?: string; + /** Number of time units the balance limit applies to. */ + durationValue?: number; + /** Unique identifier for the balance limit. */ + id?: string; + /** Indicates if the limit resets periodically based on a sliding schedule. */ + slidingSchedule?: boolean; + /** Specifies whether the limit applies to credit or debit transactions. */ + transactionType?: string; + /** Timestamp of the last update to the balance limit. */ + updatedAt: string; + /** The maximum allowed value for the defined constraint. */ + value?: number; +} diff --git a/src/api/types/Cart.ts b/src/api/types/Cart.ts new file mode 100644 index 0000000..5f7a122 --- /dev/null +++ b/src/api/types/Cart.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Specify the payment currency and amount. + */ +export interface Cart { + /** Currency code for the payment amount. */ + currency: "EUR"; + /** Payment amount, in cents. e.g. if you want to request €12.00, then the amount in cents is 1200. */ + specificAmount: number; +} diff --git a/src/api/types/Company.ts b/src/api/types/Company.ts new file mode 100644 index 0000000..920e101 --- /dev/null +++ b/src/api/types/Company.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Company Details + */ +export interface Company { + /** Company attributes with values */ + attributes?: Record; + /** Unique company id */ + id?: string; + /** Contact ids for contacts linked to this company */ + linkedContactsIds?: number[]; + /** Deals ids for companies linked to this company */ + linkedDealsIds?: string[]; +} diff --git a/src/api/types/Configuration.ts b/src/api/types/Configuration.ts new file mode 100644 index 0000000..d909c35 --- /dev/null +++ b/src/api/types/Configuration.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Optional. Redirect contact to a custom success page once payment is successful. If empty the default Brevo page will be displayed once a payment is validated + */ +export interface Configuration { + /** Absolute URL of the custom success page. */ + customSuccessUrl: string; +} diff --git a/src/api/types/ContactErrorModel.ts b/src/api/types/ContactErrorModel.ts new file mode 100644 index 0000000..920119c --- /dev/null +++ b/src/api/types/ContactErrorModel.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ContactErrorModel { + /** Error code displayed in case of a failure */ + code: ContactErrorModel.Code; + /** Readable message associated to the failure */ + message: string; + /** Additional information about the error */ + metadata?: Record; +} + +export namespace ContactErrorModel { + /** Error code displayed in case of a failure */ + export const Code = { + InvalidParameter: "invalid_parameter", + MissingParameter: "missing_parameter", + DocumentNotFound: "document_not_found", + AccountInProcess: "account_in_process", + DuplicateParameter: "duplicate_parameter", + MethodNotAllowed: "method_not_allowed", + OutOfRange: "out_of_range", + } as const; + export type Code = (typeof Code)[keyof typeof Code]; +} diff --git a/src/api/types/ConversationsMessage.ts b/src/api/types/ConversationsMessage.ts new file mode 100644 index 0000000..7dbd1d2 --- /dev/null +++ b/src/api/types/ConversationsMessage.ts @@ -0,0 +1,166 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * a Conversations message + */ +export interface ConversationsMessage { + /** ID of the agent on whose behalf the message was sent (only in messages sent by an agent). */ + agentId?: string; + /** Agent’s name as displayed to the visitor. Only in the messages sent by an agent. */ + agentName?: string; + /** Only set if the agent has uploaded a profile picture. */ + agentUserpic?: string; + /** An array of file attachments. */ + attachments?: ConversationsMessage.Attachments.Item[]; + /** An array containing details of the blind carbon copy (BCC) recipients (applicable only to messages in email threads). */ + bcc?: ConversationsMessage.Bcc.Item[]; + /** An array containing details of the carbon copy (CC) recipients (applicable only to messages in email threads). */ + cc?: ConversationsMessage.Cc.Item[]; + /** Timestamp in milliseconds. */ + createdAt?: number; + file?: ConversationsMessage.File_; + /** Status of the message forwarding to the source. */ + forwardedToSourceStatus?: ConversationsMessage.ForwardedToSourceStatus; + /** An object containing details about the email sender (applicable only to messages in email threads). */ + from?: ConversationsMessage.From; + /** The HTML content of the message. */ + html?: string; + /** Message ID. It can be used for further manipulations with the message. */ + id?: string; + /** Integration details. */ + integrations?: Record; + /** `true` for automated messages generated by an AI bot. */ + isBot?: boolean; + /** `true` for missed and offline messages. */ + isMissed?: boolean; + /** `true` for unread agent’s messages in finished chats. */ + isMissedByVisitor?: boolean; + /** `true` for pushed messages */ + isPushed?: boolean; + /** `true` for automatic messages from “Targeted chats & triggers” and API (https://developers.brevo.com/docs/javascript-api-reference#sendautomessage) */ + isTrigger?: boolean; + /** Unescaped HTML content of the message (may include unsafe HTML). */ + rawUnsafeHtml?: string; + /** In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop. */ + receivedFrom?: string; + /** An object containing details of the reply-to email address (applicable only to messages in email threads). */ + replyTo?: ConversationsMessage.ReplyTo; + /** The ID of the message assigned by the integration source. */ + sourceMessageId?: string; + /** The subject line of the email message (only for messages sent to email threads). */ + subject?: string; + /** Message text or name of the attached file */ + text?: string; + /** An array containing details of the recipients (applicable only to messages in email threads). */ + to?: ConversationsMessage.To.Item[]; + /** `"agent"` for agents’ messages, `"visitor"` for visitors’ messages. */ + type?: ConversationsMessage.Type; + /** visitor’s ID */ + visitorId?: string; +} + +export namespace ConversationsMessage { + export type Attachments = Attachments.Item[]; + + export namespace Attachments { + export interface Item { + /** The name of the file. */ + fileName?: string; + /** The ID of the inline file. */ + inlineId?: string; + /** `true` for images. */ + isImage?: boolean; + /** `true` for inline files. */ + isInline?: string; + /** The size of the file in bytes. */ + size?: number; + /** The URL of the file. */ + url?: string; + } + } + + export type Bcc = Bcc.Item[]; + + export namespace Bcc { + export interface Item { + email?: string; + name?: string; + } + } + + export type Cc = Cc.Item[]; + + export namespace Cc { + export interface Item { + email?: string; + name?: string; + } + } + + export interface File_ { + /** Name of the file */ + filename?: string; + /** image info is passed in case the file is an image */ + imageInfo?: File_.ImageInfo; + /** Whether the file is an image */ + isImage?: boolean; + /** Size in bytes */ + size?: number; + /** URL of the file */ + url?: string; + } + + export namespace File_ { + /** + * image info is passed in case the file is an image + */ + export interface ImageInfo { + /** height of the image */ + height?: number; + /** URL of the preview */ + previewUrl?: string; + /** Width of the image */ + width?: number; + } + } + + /** + * Status of the message forwarding to the source. + */ + export interface ForwardedToSourceStatus { + error?: string; + isSuccess?: boolean; + } + + /** + * An object containing details about the email sender (applicable only to messages in email threads). + */ + export interface From { + email?: string; + name?: string; + } + + /** + * An object containing details of the reply-to email address (applicable only to messages in email threads). + */ + export interface ReplyTo { + email?: string; + name?: string; + } + + export type To = To.Item[]; + + export namespace To { + export interface Item { + email?: string; + name?: string; + } + } + + /** `"agent"` for agents’ messages, `"visitor"` for visitors’ messages. */ + export const Type = { + Agent: "agent", + Visitor: "visitor", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; +} diff --git a/src/api/types/ConversionSourceMetrics.ts b/src/api/types/ConversionSourceMetrics.ts new file mode 100644 index 0000000..12ff801 --- /dev/null +++ b/src/api/types/ConversionSourceMetrics.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ConversionSourceMetrics { + averageBasket: number; + conversionSource: ConversionSourceMetrics.ConversionSource; + id: number; + ordersCount: number; + revenue: number; +} + +export namespace ConversionSourceMetrics { + export const ConversionSource = { + EmailCampaign: "email_campaign", + SmsCampaign: "sms_campaign", + AutomationWorkflowEmail: "automation_workflow_email", + AutomationWorkflowSms: "automation_workflow_sms", + } as const; + export type ConversionSource = (typeof ConversionSource)[keyof typeof ConversionSource]; +} diff --git a/src/api/types/CreateUpdateFolder.ts b/src/api/types/CreateUpdateFolder.ts new file mode 100644 index 0000000..47c1340 --- /dev/null +++ b/src/api/types/CreateUpdateFolder.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateUpdateFolder { + /** Name of the folder */ + name?: string; +} diff --git a/src/api/types/Deal.ts b/src/api/types/Deal.ts new file mode 100644 index 0000000..1370a94 --- /dev/null +++ b/src/api/types/Deal.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Deal Details + */ +export interface Deal { + /** Deal attributes with values */ + attributes?: Record; + /** Unique deal id */ + id?: string; + /** Companies ids for companies linked to this deal */ + linkedCompaniesIds?: string[]; + /** Contact ids for contacts linked to this deal */ + linkedContactsIds?: number[]; +} diff --git a/src/api/types/ErrorModel.ts b/src/api/types/ErrorModel.ts new file mode 100644 index 0000000..0319619 --- /dev/null +++ b/src/api/types/ErrorModel.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ErrorModel { + /** Error code displayed in case of a failure */ + code?: string; + /** Readable message associated to the failure */ + message: string; +} diff --git a/src/api/types/FileData.ts b/src/api/types/FileData.ts new file mode 100644 index 0000000..e8ae0a0 --- /dev/null +++ b/src/api/types/FileData.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * File data that is uploaded + */ +export interface FileData { + /** Account id of user which created the file */ + authorId?: string; + /** Company id linked to a file */ + companyId?: string; + /** Contact id of contact on which file is uploaded */ + contactId?: number; + /** File created date/time */ + createdAt?: string; + /** Deal id linked to a file */ + dealId?: string; + /** Name of uploaded file */ + name?: string; + /** Size of file in bytes */ + size?: number; +} diff --git a/src/api/types/ForbiddenErrorBody.ts b/src/api/types/ForbiddenErrorBody.ts new file mode 100644 index 0000000..d35452d --- /dev/null +++ b/src/api/types/ForbiddenErrorBody.ts @@ -0,0 +1,51 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface ForbiddenErrorBody { + /** Error code displayed in case of a failure */ + code: ForbiddenErrorBody.Code; + /** Readable message associated to the failure */ + message: string; +} + +export namespace ForbiddenErrorBody { + /** Error code displayed in case of a failure */ + export const Code = { + InvalidParameter: "invalid_parameter", + MissingParameter: "missing_parameter", + OutOfRange: "out_of_range", + CampaignProcessing: "campaign_processing", + CampaignSent: "campaign_sent", + DocumentNotFound: "document_not_found", + NotEnoughCredits: "not_enough_credits", + PermissionDenied: "permission_denied", + DuplicateParameter: "duplicate_parameter", + DuplicateRequest: "duplicate_request", + MethodNotAllowed: "method_not_allowed", + Unauthorized: "unauthorized", + AccountUnderValidation: "account_under_validation", + NotAcceptable: "not_acceptable", + BadRequest: "bad_request", + UnprocessableEntity: "unprocessable_entity", + DomainDoesNotExist: "Domain does not exist", + ContactEmailNotFound: "Contact email not found", + AttributeNotFound: "Attribute not found", + CategoryIdNotFound: "Category id not found", + InvalidParametersPassed: "Invalid parameters passed", + RecordSForIdentifierNotFound: "Record(s) for identifier not found", + ReturnedWhenQueryParamsAreInvalid: "Returned when query params are invalid", + ReturnedWhenInvalidDataPosted: "Returned when invalid data posted", + FeedNotFound: "Feed not found", + CampaignIdNotFound: "Campaign ID not found", + ApiKeyNotFound: "api-key not found", + DmarcPolicyRequiresDomainAuthentication: "DMARC policy requires domain authentication", + DnsRecordsNotProperlyConfigured: "DNS records not properly configured", + InvalidOtpCodeProvided: "Invalid OTP code provided", + OtpCodeHasExpired: "OTP code has expired", + DomainAlreadyExistsInYourAccount: "Domain already exists in your account", + TheSumOfAllIpWeightsMustEqual100: "The sum of all IP weights must equal 100", + AuthenticationFailed: "Authentication failed", + InsufficientCredits: "Insufficient credits", + RequestAlreadyProcessed: "Request already processed", + } as const; + export type Code = (typeof Code)[keyof typeof Code]; +} diff --git a/src/api/types/GetCampaignRecipients.ts b/src/api/types/GetCampaignRecipients.ts new file mode 100644 index 0000000..975fe8e --- /dev/null +++ b/src/api/types/GetCampaignRecipients.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCampaignRecipients { + exclusionLists: number[]; + lists: number[]; +} diff --git a/src/api/types/GetCampaignStats.ts b/src/api/types/GetCampaignStats.ts new file mode 100644 index 0000000..f0f6085 --- /dev/null +++ b/src/api/types/GetCampaignStats.ts @@ -0,0 +1,40 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCampaignStats { + /** Numbers of times your email has been opened automatically through Apple MPP. */ + appleMppOpens: number; + /** Number of total clicks for the campaign */ + clickers: number; + /** Number of complaints (Spam reports) for the campaign */ + complaints: number; + /** Number of deferred emails for the campaign */ + deferred?: number; + /** Number of delivered emails for the campaign */ + delivered: number; + /** Rate of recipients without any privacy protection option enabled in their email client_dev, applied to all delivered emails */ + estimatedViews?: number; + /** Number of harbounce for the campaign */ + hardBounces: number; + /** List Id of email campaign (only in case of get email campaign(s)(not for global stats)) */ + listId?: number; + /** Percentage of recipients who open the email out of your total number of recipients. Depending on your Campaign settings, they may include Apple MPP opens. */ + opensRate: number; + /** Total number of non-delivered campaigns for a particular campaign id. */ + returnBounce?: number; + /** Number of sent emails for the campaign */ + sent: number; + /** Number of softbounce for the campaign */ + softBounces: number; + /** Recipients without any privacy protection option enabled in their email client_dev */ + trackableViews: number; + /** Rate of recipients without any privacy protection option enabled in their email client_dev */ + trackableViewsRate?: number; + /** Number of unique clicks for the campaign */ + uniqueClicks: number; + /** Number of unique openings for the campaign */ + uniqueViews: number; + /** Number of unsubscription for the campaign */ + unsubscriptions: number; + /** Number of openings for the campaign */ + viewed: number; +} diff --git a/src/api/types/GetCategoryDetails.ts b/src/api/types/GetCategoryDetails.ts new file mode 100644 index 0000000..d474b06 --- /dev/null +++ b/src/api/types/GetCategoryDetails.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCategoryDetails { + /** Creation UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Category ID for which you requested the details */ + id: string; + /** category deleted from the shop's database */ + isDeleted: boolean; + /** Last modification UTC date-time of the category (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Name of the category for which you requested the details */ + name: string; + /** URL to the category */ + url?: string; +} diff --git a/src/api/types/GetContactDetails.ts b/src/api/types/GetContactDetails.ts new file mode 100644 index 0000000..45374d9 --- /dev/null +++ b/src/api/types/GetContactDetails.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetContactDetails { + /** Set of attributes of the contact */ + attributes: GetContactDetails.Attributes; + /** Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Email address of the contact for which you requested the details */ + email?: string; + /** Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) */ + emailBlacklisted: boolean; + /** ID of the contact for which you requested the details */ + id: number; + listIds: number[]; + listUnsubscribed?: number[]; + /** Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) */ + smsBlacklisted: boolean; +} + +export namespace GetContactDetails { + /** + * Set of attributes of the contact + */ + export type Attributes = {}; +} diff --git a/src/api/types/GetContacts.ts b/src/api/types/GetContacts.ts new file mode 100644 index 0000000..4d8e960 --- /dev/null +++ b/src/api/types/GetContacts.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../index.js"; + +export interface GetContacts { + contacts: Brevo.GetContactDetails[]; + /** Number of contacts */ + count: number; +} diff --git a/src/api/types/GetCouponCollection.ts b/src/api/types/GetCouponCollection.ts new file mode 100644 index 0000000..2f23b13 --- /dev/null +++ b/src/api/types/GetCouponCollection.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetCouponCollection { + /** Datetime on which the collection was created. */ + createdAt: string; + /** The default coupon of the collection. */ + defaultCoupon: string; + /** Expiration date for the coupon collection in RFC3339 format. */ + expirationDate?: string; + /** The id of the collection. */ + id: string; + /** The name of the collection. */ + name: string; + /** Number of coupons that have not been sent yet. */ + remainingCoupons: number; + /** If present, an email notification is going to be sent when the total number of available coupons falls below the defined threshold. */ + remainingCouponsAlert?: number; + /** If present, an email notification is going to be sent the defined amount of days before to the expiration date. */ + remainingDaysAlert?: number; + /** Total number of coupons in the collection. */ + totalCoupons: number; +} diff --git a/src/api/types/GetDeviceBrowserStats.ts b/src/api/types/GetDeviceBrowserStats.ts new file mode 100644 index 0000000..c9d2447 --- /dev/null +++ b/src/api/types/GetDeviceBrowserStats.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetDeviceBrowserStats { + /** Number of total clicks for the campaign using the particular browser */ + clickers: number; + /** Number of unique clicks for the campaign using the particular browser */ + uniqueClicks: number; + /** Number of unique openings for the campaign using the particular browser */ + uniqueViews: number; + /** Number of openings for the campaign using the particular browser */ + viewed: number; +} diff --git a/src/api/types/GetExtendedCampaignOverview.ts b/src/api/types/GetExtendedCampaignOverview.ts new file mode 100644 index 0000000..48b784e --- /dev/null +++ b/src/api/types/GetExtendedCampaignOverview.ts @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetExtendedCampaignOverview { + /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ + abTesting?: boolean; + /** ID of the campaign */ + id: number; + /** Name of the campaign */ + name: string; + /** Preview text or preheader of the email campaign */ + previewText?: string; + /** UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + scheduledAt?: string; + /** It is true if you have chosen to send your campaign at best time, otherwise it is false */ + sendAtBestTime?: boolean; + /** The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` */ + splitRule?: number; + /** Status of the campaign */ + status: GetExtendedCampaignOverview.Status; + /** Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` */ + subject?: string; + /** Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ + subjectA?: string; + /** Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ + subjectB?: string; + /** Type of campaign */ + type: GetExtendedCampaignOverview.Type; + /** Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` */ + winnerCriteria?: string; + /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ + winnerDelay?: number; + /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Footer of the campaign */ + footer: string; + /** Header of the campaign */ + header: string; + /** HTML content of the campaign */ + htmlContent: string; + /** Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. */ + inlineImageActivation?: boolean; + /** Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign */ + mirrorActive?: boolean; + /** UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times */ + recurring?: boolean; + /** Email defined as the "Reply to" of the campaign */ + replyTo: string; + /** Total number of non-delivered campaigns for a particular campaign id. */ + returnBounce?: number; + sender: GetExtendedCampaignOverview.Sender; + /** Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' */ + sentDate?: string; + /** Link to share the campaign on social medias */ + shareLink?: string; + /** Tag of the campaign */ + tag?: string; + /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ + testSent: boolean; + /** Customisation of the "to" field of the campaign */ + toField?: string; + /** utm parameter associated with campaign */ + utmCampaignValue?: string; + /** utm id active */ + utmIDActive?: boolean; + utmMedium?: string; + /** source of utm */ + utmSource?: string; +} + +export namespace GetExtendedCampaignOverview { + /** Status of the campaign */ + export const Status = { + Draft: "draft", + Sent: "sent", + Archive: "archive", + Queued: "queued", + Suspended: "suspended", + InProcess: "in_process", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; + /** Type of campaign */ + export const Type = { + Classic: "classic", + Trigger: "trigger", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; + + export interface Sender { + /** Sender email of the campaign */ + email?: string; + /** Sender id of the campaign */ + id?: number; + /** Sender name of the campaign */ + name?: string; + } +} diff --git a/src/api/types/GetExtendedCampaignStats.ts b/src/api/types/GetExtendedCampaignStats.ts new file mode 100644 index 0000000..5e135a4 --- /dev/null +++ b/src/api/types/GetExtendedCampaignStats.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../index.js"; + +export interface GetExtendedCampaignStats { + /** List-wise statistics of the campaign. */ + campaignStats: Brevo.GetCampaignStats[]; + /** Overall statistics of the campaign */ + globalStats: Brevo.GetCampaignStats; + /** Statistics about the number of clicks for the links */ + linksStats: GetExtendedCampaignStats.LinksStats; + /** Number of clicks on mirror link */ + mirrorClick: number; + /** Number of remaning emails to send */ + remaining: number; + statsByBrowser: Record; + statsByDevice: GetExtendedCampaignStats.StatsByDevice; + statsByDomain: Record; +} + +export namespace GetExtendedCampaignStats { + /** + * Statistics about the number of clicks for the links + */ + export type LinksStats = {}; + + export interface StatsByDevice { + /** Statistics of the campaign on the basis of desktop devices */ + desktop?: Record; + /** Statistics of the campaign on the basis of mobile devices */ + mobile?: Record; + /** Statistics of the campaign on the basis of tablet devices */ + tablet?: Record; + /** Statistics of the campaign on the basis of unknown devices */ + unknown?: Record; + } +} diff --git a/src/api/types/GetFolder.ts b/src/api/types/GetFolder.ts new file mode 100644 index 0000000..343f981 --- /dev/null +++ b/src/api/types/GetFolder.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetFolder { + /** ID of the folder */ + id: number; + /** Name of the folder */ + name: string; + /** Number of blacklisted contacts in the folder */ + totalBlacklisted: number; + /** Number of contacts in the folder */ + totalSubscribers: number; + /** Number of unique contacts in the folder */ + uniqueSubscribers: number; +} diff --git a/src/api/types/GetList.ts b/src/api/types/GetList.ts new file mode 100644 index 0000000..ced44a2 --- /dev/null +++ b/src/api/types/GetList.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetList { + /** ID of the list */ + id: number; + /** Name of the list */ + name: string; + /** Number of blacklisted contacts in the list */ + totalBlacklisted: number; + /** Number of contacts in the list */ + totalSubscribers: number; + /** Number of unique contacts in the list */ + uniqueSubscribers: number; +} diff --git a/src/api/types/GetProductDetails.ts b/src/api/types/GetProductDetails.ts new file mode 100644 index 0000000..5422f0b --- /dev/null +++ b/src/api/types/GetProductDetails.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetProductDetails { + /** Category ID-s of the product */ + categories?: string[]; + /** Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Product ID for which you requested the details */ + id: string; + /** Absolute URL to the cover image of the product */ + imageUrl?: string; + /** Product get deleted from the shop's database but not from Brevo */ + isDeleted?: boolean; + /** Meta data of product such as description, vendor, producer, stock level, etc. */ + metaInfo?: Record; + /** Last modification UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Name of the product for which you requested the details */ + name: string; + /** Parent product id of the product */ + parentId?: string; + /** Price of the product */ + price?: number; + /** S3 url of original image */ + s3Original?: string; + /** S3 thumbnail url of original image in 120x120 dimension for analytics section */ + s3ThumbAnalytics: string; + /** S3 thumbnail url of original image in 600x400 dimension for editor section */ + s3ThumbEditor: string; + /** Product identifier from the shop */ + sku?: string; + /** Current stock value of the product from the shop's database */ + stock?: number; + /** URL to the product */ + url?: string; +} diff --git a/src/api/types/GetSmsCampaignOverview.ts b/src/api/types/GetSmsCampaignOverview.ts new file mode 100644 index 0000000..735abf8 --- /dev/null +++ b/src/api/types/GetSmsCampaignOverview.ts @@ -0,0 +1,33 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSmsCampaignOverview { + /** Content of the SMS Campaign */ + content: string; + /** Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** ID of the SMS Campaign */ + id: number; + /** UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Name of the SMS Campaign */ + name: string; + /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ + scheduledAt?: string; + /** Sender of the SMS Campaign */ + sender: string; + /** Status of the SMS Campaign */ + status: GetSmsCampaignOverview.Status; +} + +export namespace GetSmsCampaignOverview { + /** Status of the SMS Campaign */ + export const Status = { + Draft: "draft", + Sent: "sent", + Archive: "archive", + Queued: "queued", + Suspended: "suspended", + InProcess: "inProcess", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; +} diff --git a/src/api/types/GetSmsCampaignStats.ts b/src/api/types/GetSmsCampaignStats.ts new file mode 100644 index 0000000..bc6c737 --- /dev/null +++ b/src/api/types/GetSmsCampaignStats.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSmsCampaignStats { + /** Number of replies to the SMS */ + answered: number; + /** Number of delivered SMS */ + delivered: number; + /** Number of hardbounced SMS */ + hardBounces: number; + /** Number of processing SMS */ + processing: number; + /** Number of sent SMS */ + sent: number; + /** Number of softbounced SMS */ + softBounces: number; + /** Number of unsubscription SMS */ + unsubscriptions: number; +} diff --git a/src/api/types/GetSmtpTemplateOverview.ts b/src/api/types/GetSmtpTemplateOverview.ts new file mode 100644 index 0000000..2d21df8 --- /dev/null +++ b/src/api/types/GetSmtpTemplateOverview.ts @@ -0,0 +1,40 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSmtpTemplateOverview { + /** Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. */ + doiTemplate?: boolean; + /** HTML content of the template */ + htmlContent: string; + /** ID of the template */ + id: number; + /** Status of template (true=active, false=inactive) */ + isActive: boolean; + /** Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Name of the template */ + name: string; + /** Email defined as the "Reply to" for the template */ + replyTo: string; + sender: GetSmtpTemplateOverview.Sender; + /** Subject of the template */ + subject: string; + /** Tag of the template */ + tag: string; + /** Status of test sending for the template (true=test email has been sent, false=test email has not been sent) */ + testSent: boolean; + /** Customisation of the "to" field for the template */ + toField: string; +} + +export namespace GetSmtpTemplateOverview { + export interface Sender { + /** From email for the template */ + email?: string; + /** Sender id of the template */ + id?: string; + /** From email for the template */ + name?: string; + } +} diff --git a/src/api/types/GetSsoToken.ts b/src/api/types/GetSsoToken.ts new file mode 100644 index 0000000..7775fbf --- /dev/null +++ b/src/api/types/GetSsoToken.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetSsoToken { + /** Session token, it will remain valid for 15 days. */ + token: string; +} diff --git a/src/api/types/GetWebhook.ts b/src/api/types/GetWebhook.ts new file mode 100644 index 0000000..d4f2778 --- /dev/null +++ b/src/api/types/GetWebhook.ts @@ -0,0 +1,42 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetWebhook { + /** Authentication header to be send with the webhook requests */ + auth?: Record; + /** + * Batching configuration of the webhook, we send batched webhooks if its + * true + */ + batched?: boolean; + /** channel of webhook */ + channel?: GetWebhook.Channel; + /** Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + createdAt: string; + /** Description of the webhook */ + description: string; + events: string[]; + headers?: Record[]; + /** ID of the webhook */ + id: number; + /** Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + modifiedAt: string; + /** Type of webhook (marketing or transactional) */ + type: GetWebhook.Type; + /** URL of the webhook */ + url: string; +} + +export namespace GetWebhook { + /** channel of webhook */ + export const Channel = { + Sms: "sms", + Email: "email", + } as const; + export type Channel = (typeof Channel)[keyof typeof Channel]; + /** Type of webhook (marketing or transactional) */ + export const Type = { + Marketing: "marketing", + Transactional: "transactional", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; +} diff --git a/src/api/types/Inviteuser.ts b/src/api/types/Inviteuser.ts new file mode 100644 index 0000000..074363d --- /dev/null +++ b/src/api/types/Inviteuser.ts @@ -0,0 +1,84 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface Inviteuser { + /** All access to the features */ + all_features_access: boolean; + /** Email address for the organization */ + email: string; + privileges: Inviteuser.Privileges.Item[]; +} + +export namespace Inviteuser { + export type Privileges = Privileges.Item[]; + + export namespace Privileges { + /** + * Privileges given to the user + */ + export interface Item { + /** Feature name */ + feature?: Item.Feature; + /** Permissions for a given feature */ + permissions?: Item.Permissions.Item[]; + } + + export namespace Item { + /** Feature name */ + export const Feature = { + EmailCampaigns: "email_campaigns", + SmsCampaigns: "sms_campaigns", + Contacts: "contacts", + Templates: "templates", + Workflows: "workflows", + LandingPages: "landing_pages", + TransactionalEmails: "transactional_emails", + SmtpApi: "smtp_api", + UserManagement: "user_management", + SalesPlatform: "sales_platform", + Phone: "phone", + Conversations: "conversations", + SendersDomainsDedicatedIps: "senders_domains_dedicated_ips", + PushNotifications: "push_notifications", + Companies: "companies", + } as const; + export type Feature = (typeof Feature)[keyof typeof Feature]; + export type Permissions = Permissions.Item[]; + + export namespace Permissions { + export const Item = { + CreateEditDelete: "create_edit_delete", + SendScheduleSuspend: "send_schedule_suspend", + View: "view", + Import: "import", + Export: "export", + ListAndAttributes: "list_and_attributes", + Forms: "forms", + ActivateDeactivate: "activate_deactivate", + ActivateDeactivatePause: "activate_deactivate_pause", + Settings: "settings", + SchedulePause: "schedule_pause", + All: "all", + Logs: "logs", + Access: "access", + Assign: "assign", + Configure: "configure", + CreateEditDeals: "create_edit_deals", + DeleteDeals: "delete_deals", + ManageOthersDealsTasks: "manage_others_deals_tasks", + ManageOwnedCompanies: "manage_owned_companies", + ManageOthersCompanies: "manage_others_companies", + Reports: "reports", + SendersManagement: "senders_management", + DomainsManagement: "domains_management", + DedicatedIpsManagement: "dedicated_ips_management", + Send: "send", + Smtp: "smtp", + ApiKeys: "api_keys", + AuthorizedIps: "authorized_ips", + None: "none", + } as const; + export type Item = (typeof Item)[keyof typeof Item]; + } + } + } +} diff --git a/src/api/types/LoyaltyProgram.ts b/src/api/types/LoyaltyProgram.ts new file mode 100644 index 0000000..2ca6bd4 --- /dev/null +++ b/src/api/types/LoyaltyProgram.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface LoyaltyProgram { + /** Loyalty Program code count */ + codeCount?: number; + /** Loyalty Program creation date */ + createdAt?: string; + /** Loyalty Program description */ + description?: string; + /** string */ + documentId?: string; + /** Loyalty Program ID */ + id?: string; + /** Loyalty Program meta data */ + meta?: Record; + /** Loyalty Program name */ + name?: string; + /** string */ + pattern?: string; + /** Loyalty Program state */ + state?: LoyaltyProgram.State; + /** Loyalty Program subscription generator ID */ + subscriptionGeneratorId?: string; + /** Loyalty Program subscription pool ID */ + subscriptionPoolId?: string; + /** Loyalty Program last modification date */ + updatedAt?: string; +} + +export namespace LoyaltyProgram { + /** Loyalty Program state */ + export const State = { + Inactive: "inactive", + Active: "active", + } as const; + export type State = (typeof State)[keyof typeof State]; +} diff --git a/src/api/types/NodeResponse.ts b/src/api/types/NodeResponse.ts new file mode 100644 index 0000000..fe37393 --- /dev/null +++ b/src/api/types/NodeResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../index.js"; + +export interface NodeResponse { + /** array[object] */ + args?: Brevo.NodeResponse[]; + /** Array values for rule definition */ + array?: Brevo.NodeResponse[]; + /** Boolean values for rule definition */ + boolean?: boolean; + /** Description for rule definition */ + description?: string; + /** Float values for rule definition */ + float?: number; + /** int64 */ + int?: number; + /** Operator selected for rule definition */ + op?: string; + /** Boolean values for rule definition */ + string?: string; +} diff --git a/src/api/types/NotFoundErrorBody.ts b/src/api/types/NotFoundErrorBody.ts new file mode 100644 index 0000000..c0294fc --- /dev/null +++ b/src/api/types/NotFoundErrorBody.ts @@ -0,0 +1,51 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface NotFoundErrorBody { + /** Error code displayed in case of a failure */ + code: NotFoundErrorBody.Code; + /** Readable message associated to the failure */ + message: string; +} + +export namespace NotFoundErrorBody { + /** Error code displayed in case of a failure */ + export const Code = { + InvalidParameter: "invalid_parameter", + MissingParameter: "missing_parameter", + OutOfRange: "out_of_range", + CampaignProcessing: "campaign_processing", + CampaignSent: "campaign_sent", + DocumentNotFound: "document_not_found", + NotEnoughCredits: "not_enough_credits", + PermissionDenied: "permission_denied", + DuplicateParameter: "duplicate_parameter", + DuplicateRequest: "duplicate_request", + MethodNotAllowed: "method_not_allowed", + Unauthorized: "unauthorized", + AccountUnderValidation: "account_under_validation", + NotAcceptable: "not_acceptable", + BadRequest: "bad_request", + UnprocessableEntity: "unprocessable_entity", + DomainDoesNotExist: "Domain does not exist", + ContactEmailNotFound: "Contact email not found", + AttributeNotFound: "Attribute not found", + CategoryIdNotFound: "Category id not found", + InvalidParametersPassed: "Invalid parameters passed", + RecordSForIdentifierNotFound: "Record(s) for identifier not found", + ReturnedWhenQueryParamsAreInvalid: "Returned when query params are invalid", + ReturnedWhenInvalidDataPosted: "Returned when invalid data posted", + FeedNotFound: "Feed not found", + CampaignIdNotFound: "Campaign ID not found", + ApiKeyNotFound: "api-key not found", + DmarcPolicyRequiresDomainAuthentication: "DMARC policy requires domain authentication", + DnsRecordsNotProperlyConfigured: "DNS records not properly configured", + InvalidOtpCodeProvided: "Invalid OTP code provided", + OtpCodeHasExpired: "OTP code has expired", + DomainAlreadyExistsInYourAccount: "Domain already exists in your account", + TheSumOfAllIpWeightsMustEqual100: "The sum of all IP weights must equal 100", + AuthenticationFailed: "Authentication failed", + InsufficientCredits: "Insufficient credits", + RequestAlreadyProcessed: "Request already processed", + } as const; + export type Code = (typeof Code)[keyof typeof Code]; +} diff --git a/src/api/types/Note.ts b/src/api/types/Note.ts new file mode 100644 index 0000000..540f61f --- /dev/null +++ b/src/api/types/Note.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Note Details + */ +export interface Note { + /** Account details of user which created the note */ + authorId?: Record; + /** Contact ids linked to a note */ + contactIds?: number[]; + /** Note created date/time */ + createdAt?: string; + /** Deal ids linked to a note */ + dealIds?: string[]; + /** Unique note Id */ + id?: string; + /** Text content of a note */ + text: string; + /** Note updated date/time */ + updatedAt?: string; +} diff --git a/src/api/types/NoteData.ts b/src/api/types/NoteData.ts new file mode 100644 index 0000000..cfdb12a --- /dev/null +++ b/src/api/types/NoteData.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Note data to be saved + */ +export interface NoteData { + /** Company Ids linked to a note */ + companyIds?: string[]; + /** Contact Ids linked to a note */ + contactIds?: number[]; + /** Deal Ids linked to a note */ + dealIds?: string[]; + /** Text content of a note */ + text: string; +} diff --git a/src/api/types/Notification.ts b/src/api/types/Notification.ts new file mode 100644 index 0000000..75d1449 --- /dev/null +++ b/src/api/types/Notification.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Optional. Use this object if you want to let Brevo send an email to the contact, with the payment request URL. If empty, no notifications (message and reminders) will be sent. + */ +export interface Notification { + /** Channel used to send the notifications. */ + channel: "email"; + /** Use this field if you want to give more context to your contact about the payment request. */ + text: string; +} diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts new file mode 100644 index 0000000..181324e --- /dev/null +++ b/src/api/types/Order.ts @@ -0,0 +1,85 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface Order { + /** Total amount of the order, including all shipping expenses, tax and the price of items. */ + amount: number; + /** Billing details of an order. */ + billing?: Order.Billing; + /** Coupons applied to the order. Stored case insensitive. */ + coupons?: string[]; + /** Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created. */ + createdAt: string; + /** Unique ID of the order. */ + id: string; + /** Identifies the contact associated with the order. */ + identifiers?: Order.Identifiers; + /** Meta data of order to store additional detal such as custom message, customer type, source. */ + metaInfo?: Record; + products: Order.Products.Item[]; + /** State of the order. */ + status: string; + /** ID of store where the order is placed */ + storeId?: string; + /** Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated. */ + updatedAt: string; +} + +export namespace Order { + /** + * Billing details of an order. + */ + export interface Billing { + /** Full billing address. */ + address?: string; + /** Exact city of the address. */ + city?: string; + /** Billing country name. */ + country?: string; + /** Billing country 2-letter ISO code. */ + countryCode?: string; + /** How the visitor will pay for the item(s), e.g. paypal, check, etc. */ + paymentMethod?: string; + /** Billing phone number. */ + phone?: string; + /** Postcode for delivery and billing. */ + postCode?: string; + /** Exact region (state/province) for delivery and billing. */ + region?: string; + } + + /** + * Identifies the contact associated with the order. + */ + export interface Identifiers { + /** Email of the contact associated with the order */ + email_id?: string; + /** ext_id associated with the order */ + ext_id?: string; + /** loyalty_subscription_id associated with the order */ + loyalty_subscription_id?: string; + /** Phone number of the contact associated with the order */ + phone_id?: string; + } + + export namespace MetaInfo { + export type Value = string | number | boolean; + } + + export type Products = Products.Item[]; + + export namespace Products { + /** + * Details for the Products in an order. + */ + export interface Item { + /** The price of a unit of product */ + price: number; + /** ID of the product. */ + productId: string; + /** How many pieces of the product the visitor has added to the cart. */ + quantity: number; + /** Product ID of the red color shirts. */ + variantId?: string; + } + } +} diff --git a/src/api/types/Pipeline.ts b/src/api/types/Pipeline.ts new file mode 100644 index 0000000..0528af0 --- /dev/null +++ b/src/api/types/Pipeline.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * List of stages + */ +export interface Pipeline { + /** Pipeline id */ + pipeline?: string; + /** Pipeline Name */ + pipeline_name?: string; + /** List of stages */ + stages?: Pipeline.Stages.Item[]; +} + +export namespace Pipeline { + export type Stages = Stages.Item[]; + + export namespace Stages { + /** + * List of stages + */ + export interface Item { + /** Stage id */ + id?: string; + /** Stage name */ + name?: string; + } + } +} diff --git a/src/api/types/Pipelines.ts b/src/api/types/Pipelines.ts new file mode 100644 index 0000000..49462dd --- /dev/null +++ b/src/api/types/Pipelines.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../index.js"; + +/** + * List of pipeline + */ +export type Pipelines = Brevo.Pipeline[]; diff --git a/src/api/types/PostContactInfo.ts b/src/api/types/PostContactInfo.ts new file mode 100644 index 0000000..5359429 --- /dev/null +++ b/src/api/types/PostContactInfo.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostContactInfo { + contacts: PostContactInfo.Contacts; +} + +export namespace PostContactInfo { + export interface Contacts { + failure?: Contacts.Failure; + /** Id of the process created to remove contacts from list when user opts for "all" option. */ + processId?: number; + success?: Contacts.Success; + /** Displays the count of total number of contacts removed from list when user opts for "all" option. */ + total?: number; + } + + export namespace Contacts { + export type Failure = string[] | number[]; + export type Success = string[] | number[]; + } +} diff --git a/src/api/types/PostSendFailed.ts b/src/api/types/PostSendFailed.ts new file mode 100644 index 0000000..c9c2e35 --- /dev/null +++ b/src/api/types/PostSendFailed.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PostSendFailed { + blackListedEmails?: string[]; + /** Response code */ + code: string; + /** Response message */ + message: string; + unexistingEmails?: string[]; + withoutListEmails?: string[]; +} diff --git a/src/api/types/Redeem.ts b/src/api/types/Redeem.ts new file mode 100644 index 0000000..90914e5 --- /dev/null +++ b/src/api/types/Redeem.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface Redeem { + /** Timestamp when the redemption was cancelled */ + cancelledAt?: string; + /** Timestamp when the redemption was completed */ + completedAt?: string; + /** Unique identifier for the contact */ + contactId?: number; + /** Timestamp when the redemption was created */ + createdAt?: string; + /** Unique identifier for the debit transaction */ + debitTransactionId?: string; + /** Timestamp when the redemption expires */ + expiresAt?: string; + /** Unique identifier for the redemption */ + id?: string; + /** Unique identifier for the loyalty program */ + loyaltyProgramId?: string; + /** Additional metadata associated with the redemption */ + meta?: Record; + /** Reason for rejection if the redemption was rejected */ + rejectReason?: string; + /** Timestamp when the redemption was rejected */ + rejectedAt?: string; + /** Unique identifier for the reward attribution */ + rewardAttributionId?: string; + /** Current status of the redemption */ + status?: string; + /** Timestamp when the redemption was last updated */ + updatedAt?: string; +} diff --git a/src/api/types/RuleConditionResponse.ts b/src/api/types/RuleConditionResponse.ts new file mode 100644 index 0000000..d371650 --- /dev/null +++ b/src/api/types/RuleConditionResponse.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../index.js"; + +export interface RuleConditionResponse { + /** Metric to indicate AND between rules */ + and?: Brevo.RuleConditionResponse[]; + /** Condition of the rule */ + lhs?: Brevo.ValueResponse; + /** Selected operator for the rule */ + op?: string; + /** Metric to indicate OR between rules */ + or?: Brevo.RuleConditionResponse[]; + /** Action of the rule */ + rhs?: Brevo.ValueResponse; +} diff --git a/src/api/types/SendReport.ts b/src/api/types/SendReport.ts new file mode 100644 index 0000000..27df3d2 --- /dev/null +++ b/src/api/types/SendReport.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SendReport { + /** Custom attributes for the report email. */ + email: SendReport.Email; + /** Language of email content for campaign report sending. */ + language?: SendReport.Language; +} + +export namespace SendReport { + /** + * Custom attributes for the report email. + */ + export interface Email { + /** Custom text message to be presented in the report email. */ + body: string; + /** Email addresses of the recipients */ + to: string[]; + } + + /** Language of email content for campaign report sending. */ + export const Language = { + Fr: "fr", + Es: "es", + Pt: "pt", + It: "it", + De: "de", + En: "en", + } as const; + export type Language = (typeof Language)[keyof typeof Language]; +} diff --git a/src/api/types/SendTestEmail.ts b/src/api/types/SendTestEmail.ts new file mode 100644 index 0000000..192467d --- /dev/null +++ b/src/api/types/SendTestEmail.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SendTestEmail { + /** List of the email addresses of the recipients whom you wish to send the test mail. _If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day_. */ + emailTo?: string[]; +} diff --git a/src/api/types/SendTransacSms.ts b/src/api/types/SendTransacSms.ts new file mode 100644 index 0000000..7c1f51e --- /dev/null +++ b/src/api/types/SendTransacSms.ts @@ -0,0 +1,42 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface SendTransacSms { + /** A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** */ + organisationPrefix?: string; + /** Mobile number to send SMS with the country code */ + recipient: string; + /** Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** */ + sender: string; + /** Tag of the message */ + tag?: SendTransacSms.Tag; + /** Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. */ + type?: SendTransacSms.Type; + /** Format of the message. It indicates whether the content should be treated as unicode or not. */ + unicodeEnabled?: boolean; + /** Webhook to call for each event triggered by the message (delivered etc.) */ + webUrl?: string; +} + +export namespace SendTransacSms { + /** + * Tag of the message + */ + export interface Tag { + /** A tag can be a string or an array of strings. */ + field?: Tag.Field; + } + + export namespace Tag { + /** + * A tag can be a string or an array of strings. + */ + export type Field = string | string[]; + } + + /** Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. */ + export const Type = { + Transactional: "transactional", + Marketing: "marketing", + } as const; + export type Type = (typeof Type)[keyof typeof Type]; +} diff --git a/src/api/types/Task.ts b/src/api/types/Task.ts new file mode 100644 index 0000000..d3418dc --- /dev/null +++ b/src/api/types/Task.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Task Details + */ +export interface Task { + /** Companies ids for companies a task is linked to */ + companiesIds?: string[]; + /** Contact ids for contacts linked to this task */ + contactsIds?: number[]; + /** Deal ids for deals a task is linked to */ + dealsIds?: string[]; + /** Unique task id */ + id?: string; + /** Name of task */ + name: string; + /** Id for type of task e.g Call / Email / Meeting etc. */ + taskTypeId: string; +} diff --git a/src/api/types/TaskReminder.ts b/src/api/types/TaskReminder.ts new file mode 100644 index 0000000..78c7d0d --- /dev/null +++ b/src/api/types/TaskReminder.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Task reminder date/time for a task + */ +export interface TaskReminder { + /** Type of task reminder e.g email, push */ + types: TaskReminder.Types.Item[]; + /** Unit of time before reminder is to be sent */ + unit: TaskReminder.Unit; + /** Value of time unit before reminder is to be sent */ + value: number; +} + +export namespace TaskReminder { + export type Types = Types.Item[]; + + export namespace Types { + export const Item = { + Email: "email", + Push: "push", + } as const; + export type Item = (typeof Item)[keyof typeof Item]; + } + + /** Unit of time before reminder is to be sent */ + export const Unit = { + Minutes: "minutes", + Hours: "hours", + Weeks: "weeks", + Days: "days", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; +} diff --git a/src/api/types/Tier.ts b/src/api/types/Tier.ts new file mode 100644 index 0000000..f121ffa --- /dev/null +++ b/src/api/types/Tier.ts @@ -0,0 +1,46 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface Tier { + /** Conditions required to access this tier */ + accessConditions?: Tier.AccessConditions.Item[]; + createdAt?: string; + /** Associated group Id */ + groupId?: string; + /** Tier image reference */ + imageRef?: string; + /** Associated loyalty program Id */ + loyaltyProgramId?: string; + /** Tier name */ + name?: string; + /** Tier id */ + tierId?: string; + /** Rewards associated with this tier */ + tierRewards?: Tier.TierRewards.Item[]; + updatedAt?: string; +} + +export namespace Tier { + export type AccessConditions = AccessConditions.Item[]; + + export namespace AccessConditions { + export interface Item { + /** Balance definition identifier */ + balanceDefinitionId?: string; + createdAt?: string; + /** Minimum value required to access this tier */ + minimumValue?: number; + updatedAt?: string; + } + } + + export type TierRewards = TierRewards.Item[]; + + export namespace TierRewards { + export interface Item { + createdAt?: string; + /** Reward to be attributed on tier assignment */ + rewardId?: string; + updatedAt?: string; + } + } +} diff --git a/src/api/types/TierGroup.ts b/src/api/types/TierGroup.ts new file mode 100644 index 0000000..1c8f7f1 --- /dev/null +++ b/src/api/types/TierGroup.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface TierGroup { + /** Timestamp when the tier group was created */ + createdAt?: string; + /** Select real_time to downgrade tier on real time balance updates. Select membership_anniversary to downgrade tier on subscription anniversary. Select tier_anniversary to downgrade tier on tier anniversary. */ + downgradeStrategy?: TierGroup.DowngradeStrategy; + /** Tier group unique identifier */ + id?: string; + /** Associated loyalty program Id */ + loyaltyProgramId?: string; + /** Tier group name */ + name?: string; + /** Order of the tiers in the group in ascending order */ + tierOrder?: string[]; + /** Timestamp when the tier group was last updated */ + updatedAt?: string; + /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ + upgradeStrategy?: TierGroup.UpgradeStrategy; +} + +export namespace TierGroup { + /** Select real_time to downgrade tier on real time balance updates. Select membership_anniversary to downgrade tier on subscription anniversary. Select tier_anniversary to downgrade tier on tier anniversary. */ + export const DowngradeStrategy = { + RealTime: "real_time", + MembershipAnniversary: "membership_anniversary", + TierAnniversary: "tier_anniversary", + } as const; + export type DowngradeStrategy = (typeof DowngradeStrategy)[keyof typeof DowngradeStrategy]; + /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ + export const UpgradeStrategy = { + RealTime: "real_time", + MembershipAnniversary: "membership_anniversary", + TierAnniversary: "tier_anniversary", + } as const; + export type UpgradeStrategy = (typeof UpgradeStrategy)[keyof typeof UpgradeStrategy]; +} diff --git a/src/api/types/Transaction.ts b/src/api/types/Transaction.ts new file mode 100644 index 0000000..dc0d9d4 --- /dev/null +++ b/src/api/types/Transaction.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Represents a transaction involving a balance, including status and timestamps. + */ +export interface Transaction { + /** The transaction amount. */ + amount?: number; + /** Unique identifier (UUID) of the associated balance definition. */ + balanceDefinitionId?: string; + /** Timestamp when the transaction was canceled (nullable). */ + cancelledAt?: string; + /** Timestamp when the transaction was completed (nullable). */ + completedAt?: string; + /** Unique identifier of the contact associated with the transaction. */ + contactId?: number; + /** Timestamp when the transaction was created. */ + createdAt?: string; + /** Optional timestamp indicating when the transaction event occurred. */ + eventTime?: string; + /** Expiry date of the transaction (nullable). */ + expirationDate?: string; + /** Unique identifier (UUID) of the transaction. */ + id?: string; + /** Unique identifier (UUID) of the associated loyalty program. */ + loyaltyProgramId?: string; + /** Optional metadata associated with the transaction. */ + meta?: Record; + /** Reason for rejection if the transaction was declined (nullable). */ + rejectReason?: string; + /** Timestamp when the transaction was rejected (nullable). */ + rejectedAt?: string; + /** The current status of the transaction (e.g., pending, completed, rejected). */ + status?: string; + /** Timestamp when the transaction was last updated. */ + updatedAt?: string; +} diff --git a/src/api/types/UnauthorizedErrorBody.ts b/src/api/types/UnauthorizedErrorBody.ts new file mode 100644 index 0000000..9a55ffb --- /dev/null +++ b/src/api/types/UnauthorizedErrorBody.ts @@ -0,0 +1,51 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface UnauthorizedErrorBody { + /** Error code displayed in case of a failure */ + code: UnauthorizedErrorBody.Code; + /** Readable message associated to the failure */ + message: string; +} + +export namespace UnauthorizedErrorBody { + /** Error code displayed in case of a failure */ + export const Code = { + InvalidParameter: "invalid_parameter", + MissingParameter: "missing_parameter", + OutOfRange: "out_of_range", + CampaignProcessing: "campaign_processing", + CampaignSent: "campaign_sent", + DocumentNotFound: "document_not_found", + NotEnoughCredits: "not_enough_credits", + PermissionDenied: "permission_denied", + DuplicateParameter: "duplicate_parameter", + DuplicateRequest: "duplicate_request", + MethodNotAllowed: "method_not_allowed", + Unauthorized: "unauthorized", + AccountUnderValidation: "account_under_validation", + NotAcceptable: "not_acceptable", + BadRequest: "bad_request", + UnprocessableEntity: "unprocessable_entity", + DomainDoesNotExist: "Domain does not exist", + ContactEmailNotFound: "Contact email not found", + AttributeNotFound: "Attribute not found", + CategoryIdNotFound: "Category id not found", + InvalidParametersPassed: "Invalid parameters passed", + RecordSForIdentifierNotFound: "Record(s) for identifier not found", + ReturnedWhenQueryParamsAreInvalid: "Returned when query params are invalid", + ReturnedWhenInvalidDataPosted: "Returned when invalid data posted", + FeedNotFound: "Feed not found", + CampaignIdNotFound: "Campaign ID not found", + ApiKeyNotFound: "api-key not found", + DmarcPolicyRequiresDomainAuthentication: "DMARC policy requires domain authentication", + DnsRecordsNotProperlyConfigured: "DNS records not properly configured", + InvalidOtpCodeProvided: "Invalid OTP code provided", + OtpCodeHasExpired: "OTP code has expired", + DomainAlreadyExistsInYourAccount: "Domain already exists in your account", + TheSumOfAllIpWeightsMustEqual100: "The sum of all IP weights must equal 100", + AuthenticationFailed: "Authentication failed", + InsufficientCredits: "Insufficient credits", + RequestAlreadyProcessed: "Request already processed", + } as const; + export type Code = (typeof Code)[keyof typeof Code]; +} diff --git a/src/api/types/UpdateCampaignStatus.ts b/src/api/types/UpdateCampaignStatus.ts new file mode 100644 index 0000000..13718d9 --- /dev/null +++ b/src/api/types/UpdateCampaignStatus.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Status of the campaign + */ +export interface UpdateCampaignStatus { + /** Note:- **replicateTemplate** status will be available **only for template type campaigns.** */ + status?: UpdateCampaignStatus.Status; +} + +export namespace UpdateCampaignStatus { + /** Note:- **replicateTemplate** status will be available **only for template type campaigns.** */ + export const Status = { + Suspended: "suspended", + Archive: "archive", + Darchive: "darchive", + Sent: "sent", + Queued: "queued", + Replicate: "replicate", + ReplicateTemplate: "replicateTemplate", + Draft: "draft", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; +} diff --git a/src/api/types/ValueResponse.ts b/src/api/types/ValueResponse.ts new file mode 100644 index 0000000..8e4b851 --- /dev/null +++ b/src/api/types/ValueResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Brevo from "../index.js"; + +export interface ValueResponse { + /** Array values to define the rule */ + array?: Brevo.ValueResponse[]; + /** Boolean values for rule definition */ + boolean?: boolean; + /** string */ + contactProperty?: string; + /** Selected date for rule definition */ + date?: string; + /** Selected event property for rule definition */ + eventProperty?: string; + /** Created expression for rule definition */ + expression?: Brevo.NodeResponse; + /** Boolean values for rule definition */ + number?: number; + /** String values for rule definition */ + string?: string; +} diff --git a/src/api/types/VariablesItems.ts b/src/api/types/VariablesItems.ts new file mode 100644 index 0000000..7ebe304 --- /dev/null +++ b/src/api/types/VariablesItems.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface VariablesItems { + datatype?: string; + default?: string; + name?: string; +} diff --git a/src/api/types/WhatsappCampStats.ts b/src/api/types/WhatsappCampStats.ts new file mode 100644 index 0000000..45fc0ef --- /dev/null +++ b/src/api/types/WhatsappCampStats.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface WhatsappCampStats { + delivered: number; + notSent: number; + read: number; + sent: number; + unsubscribe: number; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts new file mode 100644 index 0000000..28b4c8d --- /dev/null +++ b/src/api/types/index.ts @@ -0,0 +1,61 @@ +export * from "./AbTestVersionClicks.js"; +export * from "./AbTestVersionClicksItem.js"; +export * from "./AbTestVersionStats.js"; +export * from "./BadRequestErrorBody.js"; +export * from "./BalanceDefinition.js"; +export * from "./BalanceLimit.js"; +export * from "./Cart.js"; +export * from "./Company.js"; +export * from "./Configuration.js"; +export * from "./ContactErrorModel.js"; +export * from "./ConversationsMessage.js"; +export * from "./ConversionSourceMetrics.js"; +export * from "./CreateUpdateFolder.js"; +export * from "./Deal.js"; +export * from "./ErrorModel.js"; +export * from "./FileData.js"; +export * from "./ForbiddenErrorBody.js"; +export * from "./GetCampaignRecipients.js"; +export * from "./GetCampaignStats.js"; +export * from "./GetCategoryDetails.js"; +export * from "./GetContactDetails.js"; +export * from "./GetContacts.js"; +export * from "./GetCouponCollection.js"; +export * from "./GetDeviceBrowserStats.js"; +export * from "./GetExtendedCampaignOverview.js"; +export * from "./GetExtendedCampaignStats.js"; +export * from "./GetFolder.js"; +export * from "./GetList.js"; +export * from "./GetProductDetails.js"; +export * from "./GetSmsCampaignOverview.js"; +export * from "./GetSmsCampaignStats.js"; +export * from "./GetSmtpTemplateOverview.js"; +export * from "./GetSsoToken.js"; +export * from "./GetWebhook.js"; +export * from "./Inviteuser.js"; +export * from "./LoyaltyProgram.js"; +export * from "./NodeResponse.js"; +export * from "./Note.js"; +export * from "./NoteData.js"; +export * from "./NotFoundErrorBody.js"; +export * from "./Notification.js"; +export * from "./Order.js"; +export * from "./Pipeline.js"; +export * from "./Pipelines.js"; +export * from "./PostContactInfo.js"; +export * from "./PostSendFailed.js"; +export * from "./Redeem.js"; +export * from "./RuleConditionResponse.js"; +export * from "./SendReport.js"; +export * from "./SendTestEmail.js"; +export * from "./SendTransacSms.js"; +export * from "./Task.js"; +export * from "./TaskReminder.js"; +export * from "./Tier.js"; +export * from "./TierGroup.js"; +export * from "./Transaction.js"; +export * from "./UnauthorizedErrorBody.js"; +export * from "./UpdateCampaignStatus.js"; +export * from "./ValueResponse.js"; +export * from "./VariablesItems.js"; +export * from "./WhatsappCampStats.js"; diff --git a/src/auth/HeaderAuthProvider.ts b/src/auth/HeaderAuthProvider.ts new file mode 100644 index 0000000..cee3715 --- /dev/null +++ b/src/auth/HeaderAuthProvider.ts @@ -0,0 +1,48 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as core from "../core/index.js"; +import * as errors from "../errors/index.js"; + +const PARAM_KEY = "apiKey" as const; +const HEADER_NAME = "api-key" as const; + +export class HeaderAuthProvider implements core.AuthProvider { + private readonly options: HeaderAuthProvider.Options; + + constructor(options: HeaderAuthProvider.Options) { + this.options = options; + } + + public static canCreate(options: Partial): boolean { + return options?.[PARAM_KEY] != null; + } + + public async getAuthRequest({ + endpointMetadata, + }: { + endpointMetadata?: core.EndpointMetadata; + } = {}): Promise { + const headerValue = await core.Supplier.get(this.options[PARAM_KEY]); + if (headerValue == null) { + throw new errors.BrevoError({ + message: HeaderAuthProvider.AUTH_CONFIG_ERROR_MESSAGE, + }); + } + + return { + headers: { [HEADER_NAME]: headerValue }, + }; + } +} + +export namespace HeaderAuthProvider { + export const AUTH_SCHEME = "api-key" as const; + export const AUTH_CONFIG_ERROR_MESSAGE: string = + `Please provide '${PARAM_KEY}' when initializing the client` as const; + export type Options = AuthOptions; + export type AuthOptions = { [PARAM_KEY]: core.Supplier }; + + export function createInstance(options: Options): core.AuthProvider { + return new HeaderAuthProvider(options); + } +} diff --git a/src/auth/index.ts b/src/auth/index.ts new file mode 100644 index 0000000..c3485ef --- /dev/null +++ b/src/auth/index.ts @@ -0,0 +1 @@ +export { HeaderAuthProvider } from "./HeaderAuthProvider.js"; diff --git a/src/core/auth/AuthProvider.ts b/src/core/auth/AuthProvider.ts new file mode 100644 index 0000000..895a50f --- /dev/null +++ b/src/core/auth/AuthProvider.ts @@ -0,0 +1,6 @@ +import type { EndpointMetadata } from "../fetcher/EndpointMetadata.js"; +import type { AuthRequest } from "./AuthRequest.js"; + +export interface AuthProvider { + getAuthRequest(arg?: { endpointMetadata?: EndpointMetadata }): Promise; +} diff --git a/src/core/auth/AuthRequest.ts b/src/core/auth/AuthRequest.ts new file mode 100644 index 0000000..f6218b4 --- /dev/null +++ b/src/core/auth/AuthRequest.ts @@ -0,0 +1,9 @@ +/** + * Request parameters for authentication requests. + */ +export interface AuthRequest { + /** + * The headers to be included in the request. + */ + headers: Record; +} diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts new file mode 100644 index 0000000..a642359 --- /dev/null +++ b/src/core/auth/BasicAuth.ts @@ -0,0 +1,32 @@ +import { base64Decode, base64Encode } from "../base64.js"; + +export interface BasicAuth { + username: string; + password: string; +} + +const BASIC_AUTH_HEADER_PREFIX = /^Basic /i; + +export const BasicAuth = { + toAuthorizationHeader: (basicAuth: BasicAuth | undefined): string | undefined => { + if (basicAuth == null) { + return undefined; + } + const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`); + return `Basic ${token}`; + }, + fromAuthorizationHeader: (header: string): BasicAuth => { + const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, ""); + const decoded = base64Decode(credentials); + const [username, ...passwordParts] = decoded.split(":"); + const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined; + + if (username == null || password == null) { + throw new Error("Invalid basic auth"); + } + return { + username, + password, + }; + }, +}; diff --git a/src/core/auth/BearerToken.ts b/src/core/auth/BearerToken.ts new file mode 100644 index 0000000..c44a06c --- /dev/null +++ b/src/core/auth/BearerToken.ts @@ -0,0 +1,20 @@ +export type BearerToken = string; + +const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i; + +function toAuthorizationHeader(token: string | undefined): string | undefined { + if (token == null) { + return undefined; + } + return `Bearer ${token}`; +} + +export const BearerToken: { + toAuthorizationHeader: typeof toAuthorizationHeader; + fromAuthorizationHeader: (header: string) => BearerToken; +} = { + toAuthorizationHeader: toAuthorizationHeader, + fromAuthorizationHeader: (header: string): BearerToken => { + return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim() as BearerToken; + }, +}; diff --git a/src/core/auth/NoOpAuthProvider.ts b/src/core/auth/NoOpAuthProvider.ts new file mode 100644 index 0000000..5b7acfd --- /dev/null +++ b/src/core/auth/NoOpAuthProvider.ts @@ -0,0 +1,8 @@ +import type { AuthProvider } from "./AuthProvider.js"; +import type { AuthRequest } from "./AuthRequest.js"; + +export class NoOpAuthProvider implements AuthProvider { + public getAuthRequest(): Promise { + return Promise.resolve({ headers: {} }); + } +} diff --git a/src/core/auth/index.ts b/src/core/auth/index.ts new file mode 100644 index 0000000..2215b22 --- /dev/null +++ b/src/core/auth/index.ts @@ -0,0 +1,5 @@ +export type { AuthProvider } from "./AuthProvider.js"; +export type { AuthRequest } from "./AuthRequest.js"; +export { BasicAuth } from "./BasicAuth.js"; +export { BearerToken } from "./BearerToken.js"; +export { NoOpAuthProvider } from "./NoOpAuthProvider.js"; diff --git a/src/core/base64.ts b/src/core/base64.ts new file mode 100644 index 0000000..448a0db --- /dev/null +++ b/src/core/base64.ts @@ -0,0 +1,27 @@ +function base64ToBytes(base64: string): Uint8Array { + const binString = atob(base64); + return Uint8Array.from(binString, (m) => m.codePointAt(0)!); +} + +function bytesToBase64(bytes: Uint8Array): string { + const binString = String.fromCodePoint(...bytes); + return btoa(binString); +} + +export function base64Encode(input: string): string { + if (typeof Buffer !== "undefined") { + return Buffer.from(input, "utf8").toString("base64"); + } + + const bytes = new TextEncoder().encode(input); + return bytesToBase64(bytes); +} + +export function base64Decode(input: string): string { + if (typeof Buffer !== "undefined") { + return Buffer.from(input, "base64").toString("utf8"); + } + + const bytes = base64ToBytes(input); + return new TextDecoder().decode(bytes); +} diff --git a/src/core/exports.ts b/src/core/exports.ts new file mode 100644 index 0000000..358d1fb --- /dev/null +++ b/src/core/exports.ts @@ -0,0 +1,2 @@ +export * from "./file/exports.js"; +export * from "./logging/exports.js"; diff --git a/src/core/fetcher/APIResponse.ts b/src/core/fetcher/APIResponse.ts new file mode 100644 index 0000000..97ab83c --- /dev/null +++ b/src/core/fetcher/APIResponse.ts @@ -0,0 +1,23 @@ +import type { RawResponse } from "./RawResponse.js"; + +/** + * The response of an API call. + * It is a successful response or a failed response. + */ +export type APIResponse = SuccessfulResponse | FailedResponse; + +export interface SuccessfulResponse { + ok: true; + body: T; + /** + * @deprecated Use `rawResponse` instead + */ + headers?: Record; + rawResponse: RawResponse; +} + +export interface FailedResponse { + ok: false; + error: T; + rawResponse: RawResponse; +} diff --git a/src/core/fetcher/BinaryResponse.ts b/src/core/fetcher/BinaryResponse.ts new file mode 100644 index 0000000..bca7f4c --- /dev/null +++ b/src/core/fetcher/BinaryResponse.ts @@ -0,0 +1,34 @@ +export type BinaryResponse = { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ + bodyUsed: Response["bodyUsed"]; + /** + * Returns a ReadableStream of the response body. + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) + */ + stream: () => Response["body"]; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */ + arrayBuffer: () => ReturnType; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ + blob: () => ReturnType; + /** + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) + * Some versions of the Fetch API may not support this method. + */ + bytes?(): ReturnType; +}; + +export function getBinaryResponse(response: Response): BinaryResponse { + const binaryResponse: BinaryResponse = { + get bodyUsed() { + return response.bodyUsed; + }, + stream: () => response.body, + arrayBuffer: response.arrayBuffer.bind(response), + blob: response.blob.bind(response), + }; + if ("bytes" in response && typeof response.bytes === "function") { + binaryResponse.bytes = response.bytes.bind(response); + } + + return binaryResponse; +} diff --git a/src/core/fetcher/EndpointMetadata.ts b/src/core/fetcher/EndpointMetadata.ts new file mode 100644 index 0000000..998d68f --- /dev/null +++ b/src/core/fetcher/EndpointMetadata.ts @@ -0,0 +1,13 @@ +export type SecuritySchemeKey = string; +/** + * A collection of security schemes, where the key is the name of the security scheme and the value is the list of scopes required for that scheme. + * All schemes in the collection must be satisfied for authentication to be successful. + */ +export type SecuritySchemeCollection = Record; +export type AuthScope = string; +export type EndpointMetadata = { + /** + * An array of security scheme collections. Each collection represents an alternative way to authenticate. + */ + security?: SecuritySchemeCollection[]; +}; diff --git a/src/core/fetcher/EndpointSupplier.ts b/src/core/fetcher/EndpointSupplier.ts new file mode 100644 index 0000000..aad81f0 --- /dev/null +++ b/src/core/fetcher/EndpointSupplier.ts @@ -0,0 +1,14 @@ +import type { EndpointMetadata } from "./EndpointMetadata.js"; +import type { Supplier } from "./Supplier.js"; + +type EndpointSupplierFn = (arg: { endpointMetadata?: EndpointMetadata }) => T | Promise; +export type EndpointSupplier = Supplier | EndpointSupplierFn; +export const EndpointSupplier = { + get: async (supplier: EndpointSupplier, arg: { endpointMetadata?: EndpointMetadata }): Promise => { + if (typeof supplier === "function") { + return (supplier as EndpointSupplierFn)(arg); + } else { + return supplier; + } + }, +}; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts new file mode 100644 index 0000000..45cae32 --- /dev/null +++ b/src/core/fetcher/Fetcher.ts @@ -0,0 +1,391 @@ +import { toJson } from "../json.js"; +import { createLogger, type LogConfig, type Logger } from "../logging/logger.js"; +import type { APIResponse } from "./APIResponse.js"; +import { createRequestUrl } from "./createRequestUrl.js"; +import type { EndpointMetadata } from "./EndpointMetadata.js"; +import { EndpointSupplier } from "./EndpointSupplier.js"; +import { getErrorResponseBody } from "./getErrorResponseBody.js"; +import { getFetchFn } from "./getFetchFn.js"; +import { getRequestBody } from "./getRequestBody.js"; +import { getResponseBody } from "./getResponseBody.js"; +import { Headers } from "./Headers.js"; +import { makeRequest } from "./makeRequest.js"; +import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.js"; +import { requestWithRetries } from "./requestWithRetries.js"; + +export type FetchFunction = (args: Fetcher.Args) => Promise>; + +export declare namespace Fetcher { + export interface Args { + url: string; + method: string; + contentType?: string; + headers?: Record; + queryParameters?: Record; + body?: unknown; + timeoutMs?: number; + maxRetries?: number; + withCredentials?: boolean; + abortSignal?: AbortSignal; + requestType?: "json" | "file" | "bytes" | "form" | "other"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response"; + duplex?: "half"; + endpointMetadata?: EndpointMetadata; + fetchFn?: typeof fetch; + logging?: LogConfig | Logger; + } + + export type Error = FailedStatusCodeError | NonJsonError | BodyIsNullError | TimeoutError | UnknownError; + + export interface FailedStatusCodeError { + reason: "status-code"; + statusCode: number; + body: unknown; + } + + export interface NonJsonError { + reason: "non-json"; + statusCode: number; + rawBody: string; + } + + export interface BodyIsNullError { + reason: "body-is-null"; + statusCode: number; + } + + export interface TimeoutError { + reason: "timeout"; + } + + export interface UnknownError { + reason: "unknown"; + errorMessage: string; + } +} + +const SENSITIVE_HEADERS = new Set([ + "authorization", + "www-authenticate", + "x-api-key", + "api-key", + "apikey", + "x-api-token", + "x-auth-token", + "auth-token", + "cookie", + "set-cookie", + "proxy-authorization", + "proxy-authenticate", + "x-csrf-token", + "x-xsrf-token", + "x-session-token", + "x-access-token", +]); + +function redactHeaders(headers: Headers | Record): Record { + const filtered: Record = {}; + for (const [key, value] of headers instanceof Headers ? headers.entries() : Object.entries(headers)) { + if (SENSITIVE_HEADERS.has(key.toLowerCase())) { + filtered[key] = "[REDACTED]"; + } else { + filtered[key] = value; + } + } + return filtered; +} + +const SENSITIVE_QUERY_PARAMS = new Set([ + "api_key", + "api-key", + "apikey", + "token", + "access_token", + "access-token", + "auth_token", + "auth-token", + "password", + "passwd", + "secret", + "api_secret", + "api-secret", + "apisecret", + "key", + "session", + "session_id", + "session-id", +]); + +function redactQueryParameters(queryParameters?: Record): Record | undefined { + if (queryParameters == null) { + return queryParameters; + } + const redacted: Record = {}; + for (const [key, value] of Object.entries(queryParameters)) { + if (SENSITIVE_QUERY_PARAMS.has(key.toLowerCase())) { + redacted[key] = "[REDACTED]"; + } else { + redacted[key] = value; + } + } + return redacted; +} + +function redactUrl(url: string): string { + const protocolIndex = url.indexOf("://"); + if (protocolIndex === -1) return url; + + const afterProtocol = protocolIndex + 3; + + // Find the first delimiter that marks the end of the authority section + const pathStart = url.indexOf("/", afterProtocol); + let queryStart = url.indexOf("?", afterProtocol); + let fragmentStart = url.indexOf("#", afterProtocol); + + const firstDelimiter = Math.min( + pathStart === -1 ? url.length : pathStart, + queryStart === -1 ? url.length : queryStart, + fragmentStart === -1 ? url.length : fragmentStart, + ); + + // Find the LAST @ before the delimiter (handles multiple @ in credentials) + let atIndex = -1; + for (let i = afterProtocol; i < firstDelimiter; i++) { + if (url[i] === "@") { + atIndex = i; + } + } + + if (atIndex !== -1) { + url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`; + } + + // Recalculate queryStart since url might have changed + queryStart = url.indexOf("?"); + if (queryStart === -1) return url; + + fragmentStart = url.indexOf("#", queryStart); + const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length; + const queryString = url.slice(queryStart + 1, queryEnd); + + if (queryString.length === 0) return url; + + // FAST PATH: Quick check if any sensitive keywords present + // Using indexOf is faster than regex for simple substring matching + const lower = queryString.toLowerCase(); + const hasSensitive = + lower.includes("token") || + lower.includes("key") || + lower.includes("password") || + lower.includes("passwd") || + lower.includes("secret") || + lower.includes("session") || + lower.includes("auth"); + + if (!hasSensitive) { + return url; + } + + // SLOW PATH: Parse and redact + const redactedParams: string[] = []; + const params = queryString.split("&"); + + for (const param of params) { + const equalIndex = param.indexOf("="); + if (equalIndex === -1) { + redactedParams.push(param); + continue; + } + + const key = param.slice(0, equalIndex); + let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()); + + if (!shouldRedact && key.includes("%")) { + try { + const decodedKey = decodeURIComponent(key); + shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase()); + } catch {} + } + + redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param); + } + + return url.slice(0, queryStart + 1) + redactedParams.join("&") + url.slice(queryEnd); +} + +async function getHeaders(args: Fetcher.Args): Promise { + const newHeaders: Headers = new Headers(); + + newHeaders.set( + "Accept", + args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : "*/*", + ); + if (args.body !== undefined && args.contentType != null) { + newHeaders.set("Content-Type", args.contentType); + } + + if (args.headers == null) { + return newHeaders; + } + + for (const [key, value] of Object.entries(args.headers)) { + const result = await EndpointSupplier.get(value, { endpointMetadata: args.endpointMetadata ?? {} }); + if (typeof result === "string") { + newHeaders.set(key, result); + continue; + } + if (result == null) { + continue; + } + newHeaders.set(key, `${result}`); + } + return newHeaders; +} + +export async function fetcherImpl(args: Fetcher.Args): Promise> { + const url = createRequestUrl(args.url, args.queryParameters); + const requestBody: BodyInit | undefined = await getRequestBody({ + body: args.body, + type: args.requestType ?? "other", + }); + const fetchFn = args.fetchFn ?? (await getFetchFn()); + const headers = await getHeaders(args); + const logger = createLogger(args.logging); + + if (logger.isDebug()) { + const metadata = { + method: args.method, + url: redactUrl(url), + headers: redactHeaders(headers), + queryParameters: redactQueryParameters(args.queryParameters), + hasBody: requestBody != null, + }; + logger.debug("Making HTTP request", metadata); + } + + try { + const response = await requestWithRetries( + async () => + makeRequest( + fetchFn, + url, + args.method, + headers, + requestBody, + args.timeoutMs, + args.abortSignal, + args.withCredentials, + args.duplex, + ), + args.maxRetries, + ); + + if (response.status >= 200 && response.status < 400) { + if (logger.isDebug()) { + const metadata = { + method: args.method, + url: redactUrl(url), + statusCode: response.status, + responseHeaders: redactHeaders(response.headers), + }; + logger.debug("HTTP request succeeded", metadata); + } + const body = await getResponseBody(response, args.responseType); + return { + ok: true, + body: body as R, + headers: response.headers, + rawResponse: toRawResponse(response), + }; + } else { + if (logger.isError()) { + const metadata = { + method: args.method, + url: redactUrl(url), + statusCode: response.status, + responseHeaders: redactHeaders(Object.fromEntries(response.headers.entries())), + }; + logger.error("HTTP request failed with error status", metadata); + } + return { + ok: false, + error: { + reason: "status-code", + statusCode: response.status, + body: await getErrorResponseBody(response), + }, + rawResponse: toRawResponse(response), + }; + } + } catch (error) { + if (args.abortSignal?.aborted) { + if (logger.isError()) { + const metadata = { + method: args.method, + url: redactUrl(url), + }; + logger.error("HTTP request was aborted", metadata); + } + return { + ok: false, + error: { + reason: "unknown", + errorMessage: "The user aborted a request", + }, + rawResponse: abortRawResponse, + }; + } else if (error instanceof Error && error.name === "AbortError") { + if (logger.isError()) { + const metadata = { + method: args.method, + url: redactUrl(url), + timeoutMs: args.timeoutMs, + }; + logger.error("HTTP request timed out", metadata); + } + return { + ok: false, + error: { + reason: "timeout", + }, + rawResponse: abortRawResponse, + }; + } else if (error instanceof Error) { + if (logger.isError()) { + const metadata = { + method: args.method, + url: redactUrl(url), + errorMessage: error.message, + }; + logger.error("HTTP request failed with error", metadata); + } + return { + ok: false, + error: { + reason: "unknown", + errorMessage: error.message, + }, + rawResponse: unknownRawResponse, + }; + } + + if (logger.isError()) { + const metadata = { + method: args.method, + url: redactUrl(url), + error: toJson(error), + }; + logger.error("HTTP request failed with unknown error", metadata); + } + return { + ok: false, + error: { + reason: "unknown", + errorMessage: toJson(error), + }, + rawResponse: unknownRawResponse, + }; + } +} + +export const fetcher: FetchFunction = fetcherImpl; diff --git a/src/core/fetcher/Headers.ts b/src/core/fetcher/Headers.ts new file mode 100644 index 0000000..af841aa --- /dev/null +++ b/src/core/fetcher/Headers.ts @@ -0,0 +1,93 @@ +let Headers: typeof globalThis.Headers; + +if (typeof globalThis.Headers !== "undefined") { + Headers = globalThis.Headers; +} else { + Headers = class Headers implements Headers { + private headers: Map; + + constructor(init?: HeadersInit) { + this.headers = new Map(); + + if (init) { + if (init instanceof Headers) { + init.forEach((value, key) => this.append(key, value)); + } else if (Array.isArray(init)) { + for (const [key, value] of init) { + if (typeof key === "string" && typeof value === "string") { + this.append(key, value); + } else { + throw new TypeError("Each header entry must be a [string, string] tuple"); + } + } + } else { + for (const [key, value] of Object.entries(init)) { + if (typeof value === "string") { + this.append(key, value); + } else { + throw new TypeError("Header values must be strings"); + } + } + } + } + } + + append(name: string, value: string): void { + const key = name.toLowerCase(); + const existing = this.headers.get(key) || []; + this.headers.set(key, [...existing, value]); + } + + delete(name: string): void { + const key = name.toLowerCase(); + this.headers.delete(key); + } + + get(name: string): string | null { + const key = name.toLowerCase(); + const values = this.headers.get(key); + return values ? values.join(", ") : null; + } + + has(name: string): boolean { + const key = name.toLowerCase(); + return this.headers.has(key); + } + + set(name: string, value: string): void { + const key = name.toLowerCase(); + this.headers.set(key, [value]); + } + + forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: unknown): void { + const boundCallback = thisArg ? callbackfn.bind(thisArg) : callbackfn; + this.headers.forEach((values, key) => boundCallback(values.join(", "), key, this)); + } + + getSetCookie(): string[] { + return this.headers.get("set-cookie") || []; + } + + *entries(): HeadersIterator<[string, string]> { + for (const [key, values] of this.headers.entries()) { + yield [key, values.join(", ")]; + } + } + + *keys(): HeadersIterator { + yield* this.headers.keys(); + } + + *values(): HeadersIterator { + for (const values of this.headers.values()) { + yield values.join(", "); + } + } + + [Symbol.iterator](): HeadersIterator<[string, string]> { + return this.entries(); + } + }; +} + +export { Headers }; diff --git a/src/core/fetcher/HttpResponsePromise.ts b/src/core/fetcher/HttpResponsePromise.ts new file mode 100644 index 0000000..692ca7d --- /dev/null +++ b/src/core/fetcher/HttpResponsePromise.ts @@ -0,0 +1,116 @@ +import type { WithRawResponse } from "./RawResponse.js"; + +/** + * A promise that returns the parsed response and lets you retrieve the raw response too. + */ +export class HttpResponsePromise extends Promise { + private innerPromise: Promise>; + private unwrappedPromise: Promise | undefined; + + private constructor(promise: Promise>) { + // Initialize with a no-op to avoid premature parsing + super((resolve) => { + resolve(undefined as unknown as T); + }); + this.innerPromise = promise; + } + + /** + * Creates an `HttpResponsePromise` from a function that returns a promise. + * + * @param fn - A function that returns a promise resolving to a `WithRawResponse` object. + * @param args - Arguments to pass to the function. + * @returns An `HttpResponsePromise` instance. + */ + public static fromFunction Promise>, T>( + fn: F, + ...args: Parameters + ): HttpResponsePromise { + return new HttpResponsePromise(fn(...args)); + } + + /** + * Creates a function that returns an `HttpResponsePromise` from a function that returns a promise. + * + * @param fn - A function that returns a promise resolving to a `WithRawResponse` object. + * @returns A function that returns an `HttpResponsePromise` instance. + */ + public static interceptFunction< + F extends (...args: never[]) => Promise>, + T = Awaited>["data"], + >(fn: F): (...args: Parameters) => HttpResponsePromise { + return (...args: Parameters): HttpResponsePromise => { + return HttpResponsePromise.fromPromise(fn(...args)); + }; + } + + /** + * Creates an `HttpResponsePromise` from an existing promise. + * + * @param promise - A promise resolving to a `WithRawResponse` object. + * @returns An `HttpResponsePromise` instance. + */ + public static fromPromise(promise: Promise>): HttpResponsePromise { + return new HttpResponsePromise(promise); + } + + /** + * Creates an `HttpResponsePromise` from an executor function. + * + * @param executor - A function that takes resolve and reject callbacks to create a promise. + * @returns An `HttpResponsePromise` instance. + */ + public static fromExecutor( + executor: (resolve: (value: WithRawResponse) => void, reject: (reason?: unknown) => void) => void, + ): HttpResponsePromise { + const promise = new Promise>(executor); + return new HttpResponsePromise(promise); + } + + /** + * Creates an `HttpResponsePromise` from a resolved result. + * + * @param result - A `WithRawResponse` object to resolve immediately. + * @returns An `HttpResponsePromise` instance. + */ + public static fromResult(result: WithRawResponse): HttpResponsePromise { + const promise = Promise.resolve(result); + return new HttpResponsePromise(promise); + } + + private unwrap(): Promise { + if (!this.unwrappedPromise) { + this.unwrappedPromise = this.innerPromise.then(({ data }) => data); + } + return this.unwrappedPromise; + } + + /** @inheritdoc */ + public override then( + onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null, + ): Promise { + return this.unwrap().then(onfulfilled, onrejected); + } + + /** @inheritdoc */ + public override catch( + onrejected?: ((reason: unknown) => TResult | PromiseLike) | null, + ): Promise { + return this.unwrap().catch(onrejected); + } + + /** @inheritdoc */ + public override finally(onfinally?: (() => void) | null): Promise { + return this.unwrap().finally(onfinally); + } + + /** + * Retrieves the data and raw response. + * + * @returns A promise resolving to a `WithRawResponse` object. + */ + public async withRawResponse(): Promise> { + return await this.innerPromise; + } +} diff --git a/src/core/fetcher/RawResponse.ts b/src/core/fetcher/RawResponse.ts new file mode 100644 index 0000000..37fb44e --- /dev/null +++ b/src/core/fetcher/RawResponse.ts @@ -0,0 +1,61 @@ +import { Headers } from "./Headers.js"; + +/** + * The raw response from the fetch call excluding the body. + */ +export type RawResponse = Omit< + { + [K in keyof Response as Response[K] extends Function ? never : K]: Response[K]; // strips out functions + }, + "ok" | "body" | "bodyUsed" +>; // strips out body and bodyUsed + +/** + * A raw response indicating that the request was aborted. + */ +export const abortRawResponse: RawResponse = { + headers: new Headers(), + redirected: false, + status: 499, + statusText: "Client Closed Request", + type: "error", + url: "", +} as const; + +/** + * A raw response indicating an unknown error. + */ +export const unknownRawResponse: RawResponse = { + headers: new Headers(), + redirected: false, + status: 0, + statusText: "Unknown Error", + type: "error", + url: "", +} as const; + +/** + * Converts a `RawResponse` object into a `RawResponse` by extracting its properties, + * excluding the `body` and `bodyUsed` fields. + * + * @param response - The `RawResponse` object to convert. + * @returns A `RawResponse` object containing the extracted properties of the input response. + */ +export function toRawResponse(response: Response): RawResponse { + return { + headers: response.headers, + redirected: response.redirected, + status: response.status, + statusText: response.statusText, + type: response.type, + url: response.url, + }; +} + +/** + * Creates a `RawResponse` from a standard `Response` object. + */ +export interface WithRawResponse { + readonly data: T; + readonly rawResponse: RawResponse; +} diff --git a/src/core/fetcher/Supplier.ts b/src/core/fetcher/Supplier.ts new file mode 100644 index 0000000..867c931 --- /dev/null +++ b/src/core/fetcher/Supplier.ts @@ -0,0 +1,11 @@ +export type Supplier = T | Promise | (() => T | Promise); + +export const Supplier = { + get: async (supplier: Supplier): Promise => { + if (typeof supplier === "function") { + return (supplier as () => T)(); + } else { + return supplier; + } + }, +}; diff --git a/src/core/fetcher/createRequestUrl.ts b/src/core/fetcher/createRequestUrl.ts new file mode 100644 index 0000000..88e1326 --- /dev/null +++ b/src/core/fetcher/createRequestUrl.ts @@ -0,0 +1,6 @@ +import { toQueryString } from "../url/qs.js"; + +export function createRequestUrl(baseUrl: string, queryParameters?: Record): string { + const queryString = toQueryString(queryParameters, { arrayFormat: "repeat" }); + return queryString ? `${baseUrl}?${queryString}` : baseUrl; +} diff --git a/src/core/fetcher/getErrorResponseBody.ts b/src/core/fetcher/getErrorResponseBody.ts new file mode 100644 index 0000000..7cf4e62 --- /dev/null +++ b/src/core/fetcher/getErrorResponseBody.ts @@ -0,0 +1,33 @@ +import { fromJson } from "../json.js"; +import { getResponseBody } from "./getResponseBody.js"; + +export async function getErrorResponseBody(response: Response): Promise { + let contentType = response.headers.get("Content-Type")?.toLowerCase(); + if (contentType == null || contentType.length === 0) { + return getResponseBody(response); + } + + if (contentType.indexOf(";") !== -1) { + contentType = contentType.split(";")[0]?.trim() ?? ""; + } + switch (contentType) { + case "application/hal+json": + case "application/json": + case "application/ld+json": + case "application/problem+json": + case "application/vnd.api+json": + case "text/json": { + const text = await response.text(); + return text.length > 0 ? fromJson(text) : undefined; + } + default: + if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) { + const text = await response.text(); + return text.length > 0 ? fromJson(text) : undefined; + } + + // Fallback to plain text if content type is not recognized + // Even if no body is present, the response will be an empty string + return await response.text(); + } +} diff --git a/src/core/fetcher/getFetchFn.ts b/src/core/fetcher/getFetchFn.ts new file mode 100644 index 0000000..9f845b9 --- /dev/null +++ b/src/core/fetcher/getFetchFn.ts @@ -0,0 +1,3 @@ +export async function getFetchFn(): Promise { + return fetch; +} diff --git a/src/core/fetcher/getHeader.ts b/src/core/fetcher/getHeader.ts new file mode 100644 index 0000000..50f922b --- /dev/null +++ b/src/core/fetcher/getHeader.ts @@ -0,0 +1,8 @@ +export function getHeader(headers: Record, header: string): string | undefined { + for (const [headerKey, headerValue] of Object.entries(headers)) { + if (headerKey.toLowerCase() === header.toLowerCase()) { + return headerValue; + } + } + return undefined; +} diff --git a/src/core/fetcher/getRequestBody.ts b/src/core/fetcher/getRequestBody.ts new file mode 100644 index 0000000..91d9d81 --- /dev/null +++ b/src/core/fetcher/getRequestBody.ts @@ -0,0 +1,20 @@ +import { toJson } from "../json.js"; +import { toQueryString } from "../url/qs.js"; + +export declare namespace GetRequestBody { + interface Args { + body: unknown; + type: "json" | "file" | "bytes" | "form" | "other"; + } +} + +export async function getRequestBody({ body, type }: GetRequestBody.Args): Promise { + if (type === "form") { + return toQueryString(body, { arrayFormat: "repeat", encode: true }); + } + if (type.includes("json")) { + return toJson(body); + } else { + return body as BodyInit; + } +} diff --git a/src/core/fetcher/getResponseBody.ts b/src/core/fetcher/getResponseBody.ts new file mode 100644 index 0000000..708d557 --- /dev/null +++ b/src/core/fetcher/getResponseBody.ts @@ -0,0 +1,58 @@ +import { fromJson } from "../json.js"; +import { getBinaryResponse } from "./BinaryResponse.js"; + +export async function getResponseBody(response: Response, responseType?: string): Promise { + switch (responseType) { + case "binary-response": + return getBinaryResponse(response); + case "blob": + return await response.blob(); + case "arrayBuffer": + return await response.arrayBuffer(); + case "sse": + if (response.body == null) { + return { + ok: false, + error: { + reason: "body-is-null", + statusCode: response.status, + }, + }; + } + return response.body; + case "streaming": + if (response.body == null) { + return { + ok: false, + error: { + reason: "body-is-null", + statusCode: response.status, + }, + }; + } + + return response.body; + + case "text": + return await response.text(); + } + + // if responseType is "json" or not specified, try to parse as JSON + const text = await response.text(); + if (text.length > 0) { + try { + const responseBody = fromJson(text); + return responseBody; + } catch (_err) { + return { + ok: false, + error: { + reason: "non-json", + statusCode: response.status, + rawBody: text, + }, + }; + } + } + return undefined; +} diff --git a/src/core/fetcher/index.ts b/src/core/fetcher/index.ts new file mode 100644 index 0000000..c3bc6da --- /dev/null +++ b/src/core/fetcher/index.ts @@ -0,0 +1,11 @@ +export type { APIResponse } from "./APIResponse.js"; +export type { BinaryResponse } from "./BinaryResponse.js"; +export type { EndpointMetadata } from "./EndpointMetadata.js"; +export { EndpointSupplier } from "./EndpointSupplier.js"; +export type { Fetcher, FetchFunction } from "./Fetcher.js"; +export { fetcher } from "./Fetcher.js"; +export { getHeader } from "./getHeader.js"; +export { HttpResponsePromise } from "./HttpResponsePromise.js"; +export type { RawResponse, WithRawResponse } from "./RawResponse.js"; +export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.js"; +export { Supplier } from "./Supplier.js"; diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts new file mode 100644 index 0000000..921565e --- /dev/null +++ b/src/core/fetcher/makeRequest.ts @@ -0,0 +1,42 @@ +import { anySignal, getTimeoutSignal } from "./signals.js"; + +export const makeRequest = async ( + fetchFn: (url: string, init: RequestInit) => Promise, + url: string, + method: string, + headers: Headers | Record, + requestBody: BodyInit | undefined, + timeoutMs?: number, + abortSignal?: AbortSignal, + withCredentials?: boolean, + duplex?: "half", +): Promise => { + const signals: AbortSignal[] = []; + + let timeoutAbortId: ReturnType | undefined; + if (timeoutMs != null) { + const { signal, abortId } = getTimeoutSignal(timeoutMs); + timeoutAbortId = abortId; + signals.push(signal); + } + + if (abortSignal != null) { + signals.push(abortSignal); + } + const newSignals = anySignal(signals); + const response = await fetchFn(url, { + method: method, + headers, + body: requestBody, + signal: newSignals, + credentials: withCredentials ? "include" : undefined, + // @ts-ignore + duplex, + }); + + if (timeoutAbortId != null) { + clearTimeout(timeoutAbortId); + } + + return response; +}; diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts new file mode 100644 index 0000000..1f68968 --- /dev/null +++ b/src/core/fetcher/requestWithRetries.ts @@ -0,0 +1,64 @@ +const INITIAL_RETRY_DELAY = 1000; // in milliseconds +const MAX_RETRY_DELAY = 60000; // in milliseconds +const DEFAULT_MAX_RETRIES = 2; +const JITTER_FACTOR = 0.2; // 20% random jitter + +function addPositiveJitter(delay: number): number { + const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; + return delay * jitterMultiplier; +} + +function addSymmetricJitter(delay: number): number { + const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR; + return delay * jitterMultiplier; +} + +function getRetryDelayFromHeaders(response: Response, retryAttempt: number): number { + const retryAfter = response.headers.get("Retry-After"); + if (retryAfter) { + const retryAfterSeconds = parseInt(retryAfter, 10); + if (!Number.isNaN(retryAfterSeconds) && retryAfterSeconds > 0) { + return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY); + } + + const retryAfterDate = new Date(retryAfter); + if (!Number.isNaN(retryAfterDate.getTime())) { + const delay = retryAfterDate.getTime() - Date.now(); + if (delay > 0) { + return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); + } + } + } + + const rateLimitReset = response.headers.get("X-RateLimit-Reset"); + if (rateLimitReset) { + const resetTime = parseInt(rateLimitReset, 10); + if (!Number.isNaN(resetTime)) { + const delay = resetTime * 1000 - Date.now(); + if (delay > 0) { + return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); + } + } + } + + return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * 2 ** retryAttempt, MAX_RETRY_DELAY)); +} + +export async function requestWithRetries( + requestFn: () => Promise, + maxRetries: number = DEFAULT_MAX_RETRIES, +): Promise { + let response: Response = await requestFn(); + + for (let i = 0; i < maxRetries; ++i) { + if ([408, 429].includes(response.status) || response.status >= 500) { + const delay = getRetryDelayFromHeaders(response, i); + + await new Promise((resolve) => setTimeout(resolve, delay)); + response = await requestFn(); + } else { + break; + } + } + return response!; +} diff --git a/src/core/fetcher/signals.ts b/src/core/fetcher/signals.ts new file mode 100644 index 0000000..7bd3757 --- /dev/null +++ b/src/core/fetcher/signals.ts @@ -0,0 +1,26 @@ +const TIMEOUT = "timeout"; + +export function getTimeoutSignal(timeoutMs: number): { signal: AbortSignal; abortId: ReturnType } { + const controller = new AbortController(); + const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs); + return { signal: controller.signal, abortId }; +} + +export function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal { + const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args) as AbortSignal[]; + + const controller = new AbortController(); + + for (const signal of signals) { + if (signal.aborted) { + controller.abort((signal as any)?.reason); + break; + } + + signal.addEventListener("abort", () => controller.abort((signal as any)?.reason), { + signal: controller.signal, + }); + } + + return controller.signal; +} diff --git a/src/core/file/exports.ts b/src/core/file/exports.ts new file mode 100644 index 0000000..3b0b396 --- /dev/null +++ b/src/core/file/exports.ts @@ -0,0 +1 @@ +export type { Uploadable } from "./types.js"; diff --git a/src/core/file/file.ts b/src/core/file/file.ts new file mode 100644 index 0000000..0bacc48 --- /dev/null +++ b/src/core/file/file.ts @@ -0,0 +1,217 @@ +import type { Uploadable } from "./types.js"; + +export async function toBinaryUploadRequest( + file: Uploadable, +): Promise<{ body: Uploadable.FileLike; headers?: Record }> { + const { data, filename, contentLength, contentType } = await getFileWithMetadata(file); + const request = { + body: data, + headers: {} as Record, + }; + if (filename) { + request.headers["Content-Disposition"] = `attachment; filename="${filename}"`; + } + if (contentType) { + request.headers["Content-Type"] = contentType; + } + if (contentLength != null) { + request.headers["Content-Length"] = contentLength.toString(); + } + return request; +} + +export async function toMultipartDataPart( + file: Uploadable, +): Promise<{ data: Uploadable.FileLike; filename?: string; contentType?: string }> { + const { data, filename, contentType } = await getFileWithMetadata(file, { + noSniffFileSize: true, + }); + return { + data, + filename, + contentType, + }; +} + +async function getFileWithMetadata( + file: Uploadable, + { noSniffFileSize }: { noSniffFileSize?: boolean } = {}, +): Promise { + if (isFileLike(file)) { + return getFileWithMetadata( + { + data: file, + }, + { noSniffFileSize }, + ); + } + + if ("path" in file) { + const fs = await import("fs"); + if (!fs || !fs.createReadStream) { + throw new Error("File path uploads are not supported in this environment."); + } + const data = fs.createReadStream(file.path); + const contentLength = + file.contentLength ?? (noSniffFileSize === true ? undefined : await tryGetFileSizeFromPath(file.path)); + const filename = file.filename ?? getNameFromPath(file.path); + return { + data, + filename, + contentType: file.contentType, + contentLength, + }; + } + if ("data" in file) { + const data = file.data; + const contentLength = + file.contentLength ?? + (await tryGetContentLengthFromFileLike(data, { + noSniffFileSize, + })); + const filename = file.filename ?? tryGetNameFromFileLike(data); + return { + data, + filename, + contentType: file.contentType ?? tryGetContentTypeFromFileLike(data), + contentLength, + }; + } + + throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`); +} + +function isFileLike(value: unknown): value is Uploadable.FileLike { + return ( + isBuffer(value) || + isArrayBufferView(value) || + isArrayBuffer(value) || + isUint8Array(value) || + isBlob(value) || + isFile(value) || + isStreamLike(value) || + isReadableStream(value) + ); +} + +async function tryGetFileSizeFromPath(path: string): Promise { + try { + const fs = await import("fs"); + if (!fs || !fs.promises || !fs.promises.stat) { + return undefined; + } + const fileStat = await fs.promises.stat(path); + return fileStat.size; + } catch (_fallbackError) { + return undefined; + } +} + +function tryGetNameFromFileLike(data: Uploadable.FileLike): string | undefined { + if (isNamedValue(data)) { + return data.name; + } + if (isPathedValue(data)) { + return getNameFromPath(data.path.toString()); + } + return undefined; +} + +async function tryGetContentLengthFromFileLike( + data: Uploadable.FileLike, + { noSniffFileSize }: { noSniffFileSize?: boolean } = {}, +): Promise { + if (isBuffer(data)) { + return data.length; + } + if (isArrayBufferView(data)) { + return data.byteLength; + } + if (isArrayBuffer(data)) { + return data.byteLength; + } + if (isBlob(data)) { + return data.size; + } + if (isFile(data)) { + return data.size; + } + if (noSniffFileSize === true) { + return undefined; + } + if (isPathedValue(data)) { + return await tryGetFileSizeFromPath(data.path.toString()); + } + return undefined; +} + +function tryGetContentTypeFromFileLike(data: Uploadable.FileLike): string | undefined { + if (isBlob(data)) { + return data.type; + } + if (isFile(data)) { + return data.type; + } + + return undefined; +} + +function getNameFromPath(path: string): string | undefined { + const lastForwardSlash = path.lastIndexOf("/"); + const lastBackSlash = path.lastIndexOf("\\"); + const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash); + return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path; +} + +type NamedValue = { + name: string; +} & unknown; + +type PathedValue = { + path: string | { toString(): string }; +} & unknown; + +type StreamLike = { + read?: () => unknown; + pipe?: (dest: unknown) => unknown; +} & unknown; + +function isNamedValue(value: unknown): value is NamedValue { + return typeof value === "object" && value != null && "name" in value; +} + +function isPathedValue(value: unknown): value is PathedValue { + return typeof value === "object" && value != null && "path" in value; +} + +function isStreamLike(value: unknown): value is StreamLike { + return typeof value === "object" && value != null && ("read" in value || "pipe" in value); +} + +function isReadableStream(value: unknown): value is ReadableStream { + return typeof value === "object" && value != null && "getReader" in value; +} + +function isBuffer(value: unknown): value is Buffer { + return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value); +} + +function isArrayBufferView(value: unknown): value is ArrayBufferView { + return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value); +} + +function isArrayBuffer(value: unknown): value is ArrayBuffer { + return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer; +} + +function isUint8Array(value: unknown): value is Uint8Array { + return typeof Uint8Array !== "undefined" && value instanceof Uint8Array; +} + +function isBlob(value: unknown): value is Blob { + return typeof Blob !== "undefined" && value instanceof Blob; +} + +function isFile(value: unknown): value is File { + return typeof File !== "undefined" && value instanceof File; +} diff --git a/src/core/file/index.ts b/src/core/file/index.ts new file mode 100644 index 0000000..fc16dd5 --- /dev/null +++ b/src/core/file/index.ts @@ -0,0 +1,2 @@ +export * from "./file.js"; +export * from "./types.js"; diff --git a/src/core/file/types.ts b/src/core/file/types.ts new file mode 100644 index 0000000..531b692 --- /dev/null +++ b/src/core/file/types.ts @@ -0,0 +1,81 @@ +/** + * A file that can be uploaded. Can be a file-like object (stream, buffer, blob, etc.), + * a path to a file, or an object with a file-like object and metadata. + */ +export type Uploadable = Uploadable.FileLike | Uploadable.FromPath | Uploadable.WithMetadata; + +export namespace Uploadable { + /** + * Various file-like objects that can be used to upload a file. + */ + export type FileLike = + | ArrayBuffer + | ArrayBufferLike + | ArrayBufferView + | Uint8Array + | import("buffer").Buffer + | import("buffer").Blob + | import("buffer").File + | import("stream").Readable + | import("stream/web").ReadableStream + | globalThis.Blob + | globalThis.File + | ReadableStream; + + /** + * A file path with optional metadata, used for uploading a file from the file system. + */ + export type FromPath = { + /** The path to the file to upload */ + path: string; + /** + * Optional override for the file name (defaults to basename of path). + * This is used to set the `Content-Disposition` header in upload requests. + */ + filename?: string; + /** + * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain'). + * This is used to set the `Content-Type` header in upload requests. + */ + contentType?: string; + /** + * Optional file size in bytes. + * If not provided, the file size will be determined from the file system. + * The content length is used to set the `Content-Length` header in upload requests. + */ + contentLength?: number; + }; + + /** + * A file-like object with metadata, used for uploading files. + */ + export type WithMetadata = { + /** The file data */ + data: FileLike; + /** + * Optional override for the file name (defaults to basename of path). + * This is used to set the `Content-Disposition` header in upload requests. + */ + filename?: string; + /** + * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain'). + * This is used to set the `Content-Type` header in upload requests. + * + * If not provided, the content type may be determined from the data itself. + * * If the data is a `File`, `Blob`, or similar, the content type will be determined from the file itself, if the type is set. + * * Any other data type will not have a content type set, and the upload request will use `Content-Type: application/octet-stream` instead. + */ + contentType?: string; + /** + * Optional file size in bytes. + * The content length is used to set the `Content-Length` header in upload requests. + * If the content length is not provided and cannot be determined, the upload request will not include the `Content-Length` header, but will use `Transfer-Encoding: chunked` instead. + * + * If not provided, the file size will be determined depending on the data type. + * * If the data is of type `fs.ReadStream` (`createReadStream`), the size will be determined from the file system. + * * If the data is a `Buffer`, `ArrayBuffer`, `Uint8Array`, `Blob`, `File`, or similar, the size will be determined from the data itself. + * * If the data is a `Readable` or `ReadableStream`, the size will not be determined. + */ + contentLength?: number; + }; +} diff --git a/src/core/form-data-utils/FormDataWrapper.ts b/src/core/form-data-utils/FormDataWrapper.ts new file mode 100644 index 0000000..bea0cf8 --- /dev/null +++ b/src/core/form-data-utils/FormDataWrapper.ts @@ -0,0 +1,140 @@ +import { toMultipartDataPart, type Uploadable } from "../../core/file/index.js"; +import { toJson } from "../../core/json.js"; +import { RUNTIME } from "../runtime/index.js"; + +interface FormDataRequest { + body: Body; + headers: Record; + duplex?: "half"; +} + +export async function newFormData(): Promise { + return new FormDataWrapper(); +} + +export class FormDataWrapper { + private fd: FormData = new FormData(); + + public async setup(): Promise { + // noop + } + + public append(key: string, value: unknown): void { + this.fd.append(key, String(value)); + } + + public async appendFile(key: string, value: Uploadable): Promise { + const { data, filename, contentType } = await toMultipartDataPart(value); + const blob = await convertToBlob(data, contentType); + if (filename) { + this.fd.append(key, blob, filename); + } else { + this.fd.append(key, blob); + } + } + + public getRequest(): FormDataRequest { + return { + body: this.fd, + headers: {}, + duplex: "half" as const, + }; + } +} + +type StreamLike = { + read?: () => unknown; + pipe?: (dest: unknown) => unknown; +} & unknown; + +function isStreamLike(value: unknown): value is StreamLike { + return typeof value === "object" && value != null && ("read" in value || "pipe" in value); +} + +function isReadableStream(value: unknown): value is ReadableStream { + return typeof value === "object" && value != null && "getReader" in value; +} + +function isBuffer(value: unknown): value is Buffer { + return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value); +} + +function isArrayBufferView(value: unknown): value is ArrayBufferView { + return ArrayBuffer.isView(value); +} + +async function streamToBuffer(stream: unknown): Promise { + if (RUNTIME.type === "node") { + const { Readable } = await import("stream"); + + if (stream instanceof Readable) { + const chunks: Buffer[] = []; + for await (const chunk of stream) { + chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)); + } + return Buffer.concat(chunks); + } + } + + if (isReadableStream(stream)) { + const reader = stream.getReader(); + const chunks: Uint8Array[] = []; + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + chunks.push(value); + } + } finally { + reader.releaseLock(); + } + + const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0); + const result = new Uint8Array(totalLength); + let offset = 0; + for (const chunk of chunks) { + result.set(chunk, offset); + offset += chunk.length; + } + + return Buffer.from(result); + } + + throw new Error( + `Unsupported stream type: ${typeof stream}. Expected Node.js Readable stream or Web ReadableStream.`, + ); +} + +async function convertToBlob(value: unknown, contentType?: string): Promise { + if (isStreamLike(value) || isReadableStream(value)) { + const buffer = await streamToBuffer(value); + return new Blob([buffer], { type: contentType }); + } + + if (value instanceof Blob) { + return value; + } + + if (isBuffer(value)) { + return new Blob([value], { type: contentType }); + } + + if (value instanceof ArrayBuffer) { + return new Blob([value], { type: contentType }); + } + + if (isArrayBufferView(value)) { + return new Blob([value], { type: contentType }); + } + + if (typeof value === "string") { + return new Blob([value], { type: contentType }); + } + + if (typeof value === "object" && value !== null) { + return new Blob([toJson(value)], { type: contentType ?? "application/json" }); + } + + return new Blob([String(value)], { type: contentType }); +} diff --git a/src/core/form-data-utils/encodeAsFormParameter.ts b/src/core/form-data-utils/encodeAsFormParameter.ts new file mode 100644 index 0000000..cfc6741 --- /dev/null +++ b/src/core/form-data-utils/encodeAsFormParameter.ts @@ -0,0 +1,12 @@ +import { toQueryString } from "../url/qs.js"; + +export function encodeAsFormParameter(value: unknown): Record { + const stringified = toQueryString(value, { encode: false }); + + const keyValuePairs = stringified.split("&").map((pair) => { + const [key, value] = pair.split("="); + return [key, value] as const; + }); + + return Object.fromEntries(keyValuePairs); +} diff --git a/src/core/form-data-utils/index.ts b/src/core/form-data-utils/index.ts new file mode 100644 index 0000000..1188f80 --- /dev/null +++ b/src/core/form-data-utils/index.ts @@ -0,0 +1,2 @@ +export { encodeAsFormParameter } from "./encodeAsFormParameter.js"; +export * from "./FormDataWrapper.js"; diff --git a/src/core/headers.ts b/src/core/headers.ts new file mode 100644 index 0000000..be45c45 --- /dev/null +++ b/src/core/headers.ts @@ -0,0 +1,33 @@ +export function mergeHeaders(...headersArray: (Record | null | undefined)[]): Record { + const result: Record = {}; + + for (const [key, value] of headersArray + .filter((headers) => headers != null) + .flatMap((headers) => Object.entries(headers))) { + const insensitiveKey = key.toLowerCase(); + if (value != null) { + result[insensitiveKey] = value; + } else if (insensitiveKey in result) { + delete result[insensitiveKey]; + } + } + + return result; +} + +export function mergeOnlyDefinedHeaders( + ...headersArray: (Record | null | undefined)[] +): Record { + const result: Record = {}; + + for (const [key, value] of headersArray + .filter((headers) => headers != null) + .flatMap((headers) => Object.entries(headers))) { + const insensitiveKey = key.toLowerCase(); + if (value != null) { + result[insensitiveKey] = value; + } + } + + return result; +} diff --git a/src/core/index.ts b/src/core/index.ts new file mode 100644 index 0000000..4e377ed --- /dev/null +++ b/src/core/index.ts @@ -0,0 +1,8 @@ +export * from "./auth/index.js"; +export * from "./base64.js"; +export * from "./fetcher/index.js"; +export * as file from "./file/index.js"; +export * from "./form-data-utils/index.js"; +export * as logging from "./logging/index.js"; +export * from "./runtime/index.js"; +export * as url from "./url/index.js"; diff --git a/src/core/json.ts b/src/core/json.ts new file mode 100644 index 0000000..c052f32 --- /dev/null +++ b/src/core/json.ts @@ -0,0 +1,27 @@ +/** + * Serialize a value to JSON + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + * @returns JSON string + */ +export const toJson = ( + value: unknown, + replacer?: (this: unknown, key: string, value: unknown) => unknown, + space?: string | number, +): string => { + return JSON.stringify(value, replacer, space); +}; + +/** + * Parse JSON string to object, array, or other type + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is. + * @returns Parsed object, array, or other type + */ +export function fromJson( + text: string, + reviver?: (this: unknown, key: string, value: unknown) => unknown, +): T { + return JSON.parse(text, reviver); +} diff --git a/src/core/logging/exports.ts b/src/core/logging/exports.ts new file mode 100644 index 0000000..88f6c00 --- /dev/null +++ b/src/core/logging/exports.ts @@ -0,0 +1,19 @@ +import * as logger from "./logger.js"; + +export namespace logging { + /** + * Configuration for logger instances. + */ + export type LogConfig = logger.LogConfig; + export type LogLevel = logger.LogLevel; + export const LogLevel: typeof logger.LogLevel = logger.LogLevel; + export type ILogger = logger.ILogger; + /** + * Console logger implementation that outputs to the console. + */ + export type ConsoleLogger = logger.ConsoleLogger; + /** + * Console logger implementation that outputs to the console. + */ + export const ConsoleLogger: typeof logger.ConsoleLogger = logger.ConsoleLogger; +} diff --git a/src/core/logging/index.ts b/src/core/logging/index.ts new file mode 100644 index 0000000..d81cc32 --- /dev/null +++ b/src/core/logging/index.ts @@ -0,0 +1 @@ +export * from "./logger.js"; diff --git a/src/core/logging/logger.ts b/src/core/logging/logger.ts new file mode 100644 index 0000000..a3f3673 --- /dev/null +++ b/src/core/logging/logger.ts @@ -0,0 +1,203 @@ +export const LogLevel = { + Debug: "debug", + Info: "info", + Warn: "warn", + Error: "error", +} as const; +export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel]; +const logLevelMap: Record = { + [LogLevel.Debug]: 1, + [LogLevel.Info]: 2, + [LogLevel.Warn]: 3, + [LogLevel.Error]: 4, +}; + +export interface ILogger { + /** + * Logs a debug message. + * @param message - The message to log + * @param args - Additional arguments to log + */ + debug(message: string, ...args: unknown[]): void; + /** + * Logs an info message. + * @param message - The message to log + * @param args - Additional arguments to log + */ + info(message: string, ...args: unknown[]): void; + /** + * Logs a warning message. + * @param message - The message to log + * @param args - Additional arguments to log + */ + warn(message: string, ...args: unknown[]): void; + /** + * Logs an error message. + * @param message - The message to log + * @param args - Additional arguments to log + */ + error(message: string, ...args: unknown[]): void; +} + +/** + * Configuration for logger initialization. + */ +export interface LogConfig { + /** + * Minimum log level to output. + * @default LogLevel.Info + */ + level?: LogLevel; + /** + * Logger implementation to use. + * @default new ConsoleLogger() + */ + logger?: ILogger; + /** + * Whether logging should be silenced. + * @default true + */ + silent?: boolean; +} + +/** + * Default console-based logger implementation. + */ +export class ConsoleLogger implements ILogger { + debug(message: string, ...args: unknown[]): void { + console.debug(message, ...args); + } + info(message: string, ...args: unknown[]): void { + console.info(message, ...args); + } + warn(message: string, ...args: unknown[]): void { + console.warn(message, ...args); + } + error(message: string, ...args: unknown[]): void { + console.error(message, ...args); + } +} + +/** + * Logger class that provides level-based logging functionality. + */ +export class Logger { + private readonly level: number; + private readonly logger: ILogger; + private readonly silent: boolean; + + /** + * Creates a new logger instance. + * @param config - Logger configuration + */ + constructor(config: Required) { + this.level = logLevelMap[config.level]; + this.logger = config.logger; + this.silent = config.silent; + } + + /** + * Checks if a log level should be output based on configuration. + * @param level - The log level to check + * @returns True if the level should be logged + */ + public shouldLog(level: LogLevel): boolean { + return !this.silent && this.level <= logLevelMap[level]; + } + + /** + * Checks if debug logging is enabled. + * @returns True if debug logs should be output + */ + public isDebug(): boolean { + return this.shouldLog(LogLevel.Debug); + } + + /** + * Logs a debug message if debug logging is enabled. + * @param message - The message to log + * @param args - Additional arguments to log + */ + public debug(message: string, ...args: unknown[]): void { + if (this.isDebug()) { + this.logger.debug(message, ...args); + } + } + + /** + * Checks if info logging is enabled. + * @returns True if info logs should be output + */ + public isInfo(): boolean { + return this.shouldLog(LogLevel.Info); + } + + /** + * Logs an info message if info logging is enabled. + * @param message - The message to log + * @param args - Additional arguments to log + */ + public info(message: string, ...args: unknown[]): void { + if (this.isInfo()) { + this.logger.info(message, ...args); + } + } + + /** + * Checks if warning logging is enabled. + * @returns True if warning logs should be output + */ + public isWarn(): boolean { + return this.shouldLog(LogLevel.Warn); + } + + /** + * Logs a warning message if warning logging is enabled. + * @param message - The message to log + * @param args - Additional arguments to log + */ + public warn(message: string, ...args: unknown[]): void { + if (this.isWarn()) { + this.logger.warn(message, ...args); + } + } + + /** + * Checks if error logging is enabled. + * @returns True if error logs should be output + */ + public isError(): boolean { + return this.shouldLog(LogLevel.Error); + } + + /** + * Logs an error message if error logging is enabled. + * @param message - The message to log + * @param args - Additional arguments to log + */ + public error(message: string, ...args: unknown[]): void { + if (this.isError()) { + this.logger.error(message, ...args); + } + } +} + +export function createLogger(config?: LogConfig | Logger): Logger { + if (config == null) { + return defaultLogger; + } + if (config instanceof Logger) { + return config; + } + config = config ?? {}; + config.level ??= LogLevel.Info; + config.logger ??= new ConsoleLogger(); + config.silent ??= true; + return new Logger(config as Required); +} + +const defaultLogger: Logger = new Logger({ + level: LogLevel.Info, + logger: new ConsoleLogger(), + silent: true, +}); diff --git a/src/core/runtime/index.ts b/src/core/runtime/index.ts new file mode 100644 index 0000000..cfab23f --- /dev/null +++ b/src/core/runtime/index.ts @@ -0,0 +1 @@ +export { RUNTIME } from "./runtime.js"; diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts new file mode 100644 index 0000000..56ebbb8 --- /dev/null +++ b/src/core/runtime/runtime.ts @@ -0,0 +1,134 @@ +interface DenoGlobal { + version: { + deno: string; + }; +} + +interface BunGlobal { + version: string; +} + +declare const Deno: DenoGlobal | undefined; +declare const Bun: BunGlobal | undefined; +declare const EdgeRuntime: string | undefined; +declare const self: typeof globalThis.self & { + importScripts?: unknown; +}; + +/** + * A constant that indicates which environment and version the SDK is running in. + */ +export const RUNTIME: Runtime = evaluateRuntime(); + +export interface Runtime { + type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime"; + version?: string; + parsedVersion?: number; +} + +function evaluateRuntime(): Runtime { + /** + * A constant that indicates whether the environment the code is running is a Web Browser. + */ + const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + if (isBrowser) { + return { + type: "browser", + version: window.navigator.userAgent, + }; + } + + /** + * A constant that indicates whether the environment the code is running is Cloudflare. + * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent + */ + const isCloudflare = typeof globalThis !== "undefined" && globalThis?.navigator?.userAgent === "Cloudflare-Workers"; + if (isCloudflare) { + return { + type: "workerd", + }; + } + + /** + * A constant that indicates whether the environment the code is running is Edge Runtime. + * https://vercel.com/docs/functions/runtimes/edge-runtime#check-if-you're-running-on-the-edge-runtime + */ + const isEdgeRuntime = typeof EdgeRuntime === "string"; + if (isEdgeRuntime) { + return { + type: "edge-runtime", + }; + } + + /** + * A constant that indicates whether the environment the code is running is a Web Worker. + */ + const isWebWorker = + typeof self === "object" && + typeof self?.importScripts === "function" && + (self.constructor?.name === "DedicatedWorkerGlobalScope" || + self.constructor?.name === "ServiceWorkerGlobalScope" || + self.constructor?.name === "SharedWorkerGlobalScope"); + if (isWebWorker) { + return { + type: "web-worker", + }; + } + + /** + * A constant that indicates whether the environment the code is running is Deno. + * FYI Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions + */ + const isDeno = + typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined"; + if (isDeno) { + return { + type: "deno", + version: Deno.version.deno, + }; + } + + /** + * A constant that indicates whether the environment the code is running is Bun.sh. + */ + const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; + if (isBun) { + return { + type: "bun", + version: Bun.version, + }; + } + + /** + * A constant that indicates whether the environment the code is running is in React-Native. + * This check should come before Node.js detection since React Native may have a process polyfill. + * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js + */ + const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; + if (isReactNative) { + return { + type: "react-native", + }; + } + + /** + * A constant that indicates whether the environment the code is running is Node.JS. + */ + const isNode = + typeof process !== "undefined" && + "version" in process && + !!process.version && + "versions" in process && + !!process.versions?.node; + if (isNode) { + return { + type: "node", + version: process.versions.node, + parsedVersion: Number(process.versions.node.split(".")[0]), + }; + } + + return { + type: "unknown", + }; +} diff --git a/src/core/url/encodePathParam.ts b/src/core/url/encodePathParam.ts new file mode 100644 index 0000000..19b9012 --- /dev/null +++ b/src/core/url/encodePathParam.ts @@ -0,0 +1,18 @@ +export function encodePathParam(param: unknown): string { + if (param === null) { + return "null"; + } + const typeofParam = typeof param; + switch (typeofParam) { + case "undefined": + return "undefined"; + case "string": + case "number": + case "boolean": + break; + default: + param = String(param); + break; + } + return encodeURIComponent(param as string | number | boolean); +} diff --git a/src/core/url/index.ts b/src/core/url/index.ts new file mode 100644 index 0000000..f2e0fa2 --- /dev/null +++ b/src/core/url/index.ts @@ -0,0 +1,3 @@ +export { encodePathParam } from "./encodePathParam.js"; +export { join } from "./join.js"; +export { toQueryString } from "./qs.js"; diff --git a/src/core/url/join.ts b/src/core/url/join.ts new file mode 100644 index 0000000..7ca7dae --- /dev/null +++ b/src/core/url/join.ts @@ -0,0 +1,79 @@ +export function join(base: string, ...segments: string[]): string { + if (!base) { + return ""; + } + + if (segments.length === 0) { + return base; + } + + if (base.includes("://")) { + let url: URL; + try { + url = new URL(base); + } catch { + return joinPath(base, ...segments); + } + + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); + + for (const segment of segments) { + const cleanSegment = trimSlashes(segment); + if (cleanSegment) { + url.pathname = joinPathSegments(url.pathname, cleanSegment); + } + } + + if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) { + url.pathname += "/"; + } + + return url.toString(); + } + + return joinPath(base, ...segments); +} + +function joinPath(base: string, ...segments: string[]): string { + if (segments.length === 0) { + return base; + } + + let result = base; + + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); + + for (const segment of segments) { + const cleanSegment = trimSlashes(segment); + if (cleanSegment) { + result = joinPathSegments(result, cleanSegment); + } + } + + if (shouldPreserveTrailingSlash && !result.endsWith("/")) { + result += "/"; + } + + return result; +} + +function joinPathSegments(left: string, right: string): string { + if (left.endsWith("/")) { + return left + right; + } + return `${left}/${right}`; +} + +function trimSlashes(str: string): string { + if (!str) return str; + + let start = 0; + let end = str.length; + + if (str.startsWith("/")) start = 1; + if (str.endsWith("/")) end = str.length - 1; + + return start === 0 && end === str.length ? str : str.slice(start, end); +} diff --git a/src/core/url/qs.ts b/src/core/url/qs.ts new file mode 100644 index 0000000..13e89be --- /dev/null +++ b/src/core/url/qs.ts @@ -0,0 +1,74 @@ +interface QueryStringOptions { + arrayFormat?: "indices" | "repeat"; + encode?: boolean; +} + +const defaultQsOptions: Required = { + arrayFormat: "indices", + encode: true, +} as const; + +function encodeValue(value: unknown, shouldEncode: boolean): string { + if (value === undefined) { + return ""; + } + if (value === null) { + return ""; + } + const stringValue = String(value); + return shouldEncode ? encodeURIComponent(stringValue) : stringValue; +} + +function stringifyObject(obj: Record, prefix = "", options: Required): string[] { + const parts: string[] = []; + + for (const [key, value] of Object.entries(obj)) { + const fullKey = prefix ? `${prefix}[${key}]` : key; + + if (value === undefined) { + continue; + } + + if (Array.isArray(value)) { + if (value.length === 0) { + continue; + } + for (let i = 0; i < value.length; i++) { + const item = value[i]; + if (item === undefined) { + continue; + } + if (typeof item === "object" && !Array.isArray(item) && item !== null) { + const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + parts.push(...stringifyObject(item as Record, arrayKey, options)); + } else { + const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; + parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } + } + } else if (typeof value === "object" && value !== null) { + if (Object.keys(value as Record).length === 0) { + continue; + } + parts.push(...stringifyObject(value as Record, fullKey, options)); + } else { + const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; + parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`); + } + } + + return parts; +} + +export function toQueryString(obj: unknown, options?: QueryStringOptions): string { + if (obj == null || typeof obj !== "object") { + return ""; + } + + const parts = stringifyObject(obj as Record, "", { + ...defaultQsOptions, + ...options, + }); + return parts.join("&"); +} diff --git a/src/environments.ts b/src/environments.ts new file mode 100644 index 0000000..474d606 --- /dev/null +++ b/src/environments.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const BrevoEnvironment = { + Default: "https://api.brevo.com/v3", +} as const; + +export type BrevoEnvironment = typeof BrevoEnvironment.Default; diff --git a/src/errors/BrevoError.ts b/src/errors/BrevoError.ts new file mode 100644 index 0000000..4bb111e --- /dev/null +++ b/src/errors/BrevoError.ts @@ -0,0 +1,58 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../core/index.js"; +import { toJson } from "../core/json.js"; + +export class BrevoError extends Error { + public readonly statusCode?: number; + public readonly body?: unknown; + public readonly rawResponse?: core.RawResponse; + + constructor({ + message, + statusCode, + body, + rawResponse, + }: { + message?: string; + statusCode?: number; + body?: unknown; + rawResponse?: core.RawResponse; + }) { + super(buildMessage({ message, statusCode, body })); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + this.statusCode = statusCode; + this.body = body; + this.rawResponse = rawResponse; + } +} + +function buildMessage({ + message, + statusCode, + body, +}: { + message: string | undefined; + statusCode: number | undefined; + body: unknown | undefined; +}): string { + const lines: string[] = []; + if (message != null) { + lines.push(message); + } + + if (statusCode != null) { + lines.push(`Status code: ${statusCode.toString()}`); + } + + if (body != null) { + lines.push(`Body: ${toJson(body, undefined, 2)}`); + } + + return lines.join("\n"); +} diff --git a/src/errors/BrevoTimeoutError.ts b/src/errors/BrevoTimeoutError.ts new file mode 100644 index 0000000..2d0bd60 --- /dev/null +++ b/src/errors/BrevoTimeoutError.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +export class BrevoTimeoutError extends Error { + constructor(message: string) { + super(message); + Object.setPrototypeOf(this, new.target.prototype); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = this.constructor.name; + } +} diff --git a/src/errors/handleNonStatusCodeError.ts b/src/errors/handleNonStatusCodeError.ts new file mode 100644 index 0000000..0e66b34 --- /dev/null +++ b/src/errors/handleNonStatusCodeError.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as core from "../core/index.js"; +import * as errors from "./index.js"; + +export function handleNonStatusCodeError( + error: core.Fetcher.Error, + rawResponse: core.RawResponse, + method: string, + path: string, +): never { + switch (error.reason) { + case "non-json": + throw new errors.BrevoError({ + statusCode: error.statusCode, + body: error.rawBody, + rawResponse: rawResponse, + }); + case "body-is-null": + throw new errors.BrevoError({ + statusCode: error.statusCode, + rawResponse: rawResponse, + }); + case "timeout": + throw new errors.BrevoTimeoutError(`Timeout exceeded when calling ${method} ${path}.`); + case "unknown": + throw new errors.BrevoError({ + message: error.errorMessage, + rawResponse: rawResponse, + }); + default: + throw new errors.BrevoError({ + message: "Unknown error", + rawResponse: rawResponse, + }); + } +} diff --git a/src/errors/index.ts b/src/errors/index.ts new file mode 100644 index 0000000..b4f12a7 --- /dev/null +++ b/src/errors/index.ts @@ -0,0 +1,2 @@ +export { BrevoError } from "./BrevoError.js"; +export { BrevoTimeoutError } from "./BrevoTimeoutError.js"; diff --git a/src/exports.ts b/src/exports.ts new file mode 100644 index 0000000..7b70ee1 --- /dev/null +++ b/src/exports.ts @@ -0,0 +1 @@ +export * from "./core/exports.js"; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..886c22d --- /dev/null +++ b/src/index.ts @@ -0,0 +1,6 @@ +export * as Brevo from "./api/index.js"; +export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js"; +export { BrevoClient } from "./Client.js"; +export { BrevoEnvironment } from "./environments.js"; +export { BrevoError, BrevoTimeoutError } from "./errors/index.js"; +export * from "./exports.js"; diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 0000000..fd96a7b --- /dev/null +++ b/src/version.ts @@ -0,0 +1 @@ +export const SDK_VERSION = "0.0.52"; diff --git a/tests/custom.test.ts b/tests/custom.test.ts new file mode 100644 index 0000000..7f5e031 --- /dev/null +++ b/tests/custom.test.ts @@ -0,0 +1,13 @@ +/** + * This is a custom test file, if you wish to add more tests + * to your SDK. + * Be sure to mark this file in `.fernignore`. + * + * If you include example requests/responses in your fern definition, + * you will have tests automatically generated for you. + */ +describe("test", () => { + it("default", () => { + expect(true).toBe(true); + }); +}); diff --git a/tests/mock-server/MockServer.ts b/tests/mock-server/MockServer.ts new file mode 100644 index 0000000..9548721 --- /dev/null +++ b/tests/mock-server/MockServer.ts @@ -0,0 +1,29 @@ +import type { RequestHandlerOptions } from "msw"; +import type { SetupServer } from "msw/node"; + +import { mockEndpointBuilder } from "./mockEndpointBuilder"; + +export interface MockServerOptions { + baseUrl: string; + server: SetupServer; +} + +export class MockServer { + private readonly server: SetupServer; + public readonly baseUrl: string; + + constructor({ baseUrl, server }: MockServerOptions) { + this.baseUrl = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl; + this.server = server; + } + + public mockEndpoint(options?: RequestHandlerOptions): ReturnType { + const builder = mockEndpointBuilder({ + once: options?.once ?? true, + onBuild: (handler) => { + this.server.use(handler); + }, + }).baseUrl(this.baseUrl); + return builder; + } +} diff --git a/tests/mock-server/MockServerPool.ts b/tests/mock-server/MockServerPool.ts new file mode 100644 index 0000000..e1a90f7 --- /dev/null +++ b/tests/mock-server/MockServerPool.ts @@ -0,0 +1,106 @@ +import { setupServer } from "msw/node"; + +import { fromJson, toJson } from "../../src/core/json"; +import { MockServer } from "./MockServer"; +import { randomBaseUrl } from "./randomBaseUrl"; + +const mswServer = setupServer(); +interface MockServerOptions { + baseUrl?: string; +} + +async function formatHttpRequest(request: Request, id?: string): Promise { + try { + const clone = request.clone(); + const headers = [...clone.headers.entries()].map(([k, v]) => `${k}: ${v}`).join("\n"); + + let body = ""; + try { + const contentType = clone.headers.get("content-type"); + if (contentType?.includes("application/json")) { + body = toJson(fromJson(await clone.text()), undefined, 2); + } else if (clone.body) { + body = await clone.text(); + } + } catch (_e) { + body = "(unable to parse body)"; + } + + const title = id ? `### Request ${id} ###\n` : ""; + const firstLine = `${title}${request.method} ${request.url.toString()} HTTP/1.1`; + + return `\n${firstLine}\n${headers}\n\n${body || "(no body)"}\n`; + } catch (e) { + return `Error formatting request: ${e}`; + } +} + +async function formatHttpResponse(response: Response, id?: string): Promise { + try { + const clone = response.clone(); + const headers = [...clone.headers.entries()].map(([k, v]) => `${k}: ${v}`).join("\n"); + + let body = ""; + try { + const contentType = clone.headers.get("content-type"); + if (contentType?.includes("application/json")) { + body = toJson(fromJson(await clone.text()), undefined, 2); + } else if (clone.body) { + body = await clone.text(); + } + } catch (_e) { + body = "(unable to parse body)"; + } + + const title = id ? `### Response for ${id} ###\n` : ""; + const firstLine = `${title}HTTP/1.1 ${response.status} ${response.statusText}`; + + return `\n${firstLine}\n${headers}\n\n${body || "(no body)"}\n`; + } catch (e) { + return `Error formatting response: ${e}`; + } +} + +class MockServerPool { + private servers: MockServer[] = []; + + public createServer(options?: Partial): MockServer { + const baseUrl = options?.baseUrl || randomBaseUrl(); + const server = new MockServer({ baseUrl, server: mswServer }); + this.servers.push(server); + return server; + } + + public getServers(): MockServer[] { + return [...this.servers]; + } + + public listen(): void { + const onUnhandledRequest = process.env.LOG_LEVEL === "debug" ? "warn" : "bypass"; + mswServer.listen({ onUnhandledRequest }); + + if (process.env.LOG_LEVEL === "debug") { + mswServer.events.on("request:start", async ({ request, requestId }) => { + const formattedRequest = await formatHttpRequest(request, requestId); + console.debug(`request:start\n${formattedRequest}`); + }); + + mswServer.events.on("request:unhandled", async ({ request, requestId }) => { + const formattedRequest = await formatHttpRequest(request, requestId); + console.debug(`request:unhandled\n${formattedRequest}`); + }); + + mswServer.events.on("response:mocked", async ({ request, response, requestId }) => { + const formattedResponse = await formatHttpResponse(response, requestId); + console.debug(`response:mocked\n${formattedResponse}`); + }); + } + } + + public close(): void { + this.servers = []; + mswServer.close(); + } +} + +export const mockServerPool = new MockServerPool(); diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts new file mode 100644 index 0000000..78985e7 --- /dev/null +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -0,0 +1,227 @@ +import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponseResolver, http } from "msw"; + +import { url } from "../../src/core"; +import { toJson } from "../../src/core/json"; +import { withFormUrlEncoded } from "./withFormUrlEncoded"; +import { withHeaders } from "./withHeaders"; +import { type WithJsonOptions, withJson } from "./withJson"; + +type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head"; + +interface MethodStage { + baseUrl(baseUrl: string): MethodStage; + all(path: string): RequestHeadersStage; + get(path: string): RequestHeadersStage; + post(path: string): RequestHeadersStage; + put(path: string): RequestHeadersStage; + delete(path: string): RequestHeadersStage; + patch(path: string): RequestHeadersStage; + options(path: string): RequestHeadersStage; + head(path: string): RequestHeadersStage; +} + +interface RequestHeadersStage extends RequestBodyStage, ResponseStage { + header(name: string, value: string): RequestHeadersStage; + headers(headers: Record): RequestBodyStage; +} + +interface RequestBodyStage extends ResponseStage { + jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage; + formUrlEncodedBody(body: unknown): ResponseStage; +} + +interface ResponseStage { + respondWith(): ResponseStatusStage; +} +interface ResponseStatusStage { + statusCode(statusCode: number): ResponseHeaderStage; +} + +interface ResponseHeaderStage extends ResponseBodyStage, BuildStage { + header(name: string, value: string): ResponseHeaderStage; + headers(headers: Record): ResponseHeaderStage; +} + +interface ResponseBodyStage { + jsonBody(body: unknown): BuildStage; +} + +interface BuildStage { + build(): HttpHandler; +} + +export interface HttpHandlerBuilderOptions { + onBuild?: (handler: HttpHandler) => void; + once?: boolean; +} + +class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodyStage, ResponseStage { + private method: HttpMethod = "get"; + private _baseUrl: string = ""; + private path: string = "/"; + private readonly predicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[] = []; + private readonly handlerOptions?: HttpHandlerBuilderOptions; + + constructor(options?: HttpHandlerBuilderOptions) { + this.handlerOptions = options; + } + + baseUrl(baseUrl: string): MethodStage { + this._baseUrl = baseUrl; + return this; + } + + all(path: string): RequestHeadersStage { + this.method = "all"; + this.path = path; + return this; + } + + get(path: string): RequestHeadersStage { + this.method = "get"; + this.path = path; + return this; + } + + post(path: string): RequestHeadersStage { + this.method = "post"; + this.path = path; + return this; + } + + put(path: string): RequestHeadersStage { + this.method = "put"; + this.path = path; + return this; + } + + delete(path: string): RequestHeadersStage { + this.method = "delete"; + this.path = path; + return this; + } + + patch(path: string): RequestHeadersStage { + this.method = "patch"; + this.path = path; + return this; + } + + options(path: string): RequestHeadersStage { + this.method = "options"; + this.path = path; + return this; + } + + head(path: string): RequestHeadersStage { + this.method = "head"; + this.path = path; + return this; + } + + header(name: string, value: string): RequestHeadersStage { + this.predicates.push((resolver) => withHeaders({ [name]: value }, resolver)); + return this; + } + + headers(headers: Record): RequestBodyStage { + this.predicates.push((resolver) => withHeaders(headers, resolver)); + return this; + } + + jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage { + if (body === undefined) { + throw new Error("Undefined is not valid JSON. Do not call jsonBody if you want an empty body."); + } + this.predicates.push((resolver) => withJson(body, resolver, options)); + return this; + } + + formUrlEncodedBody(body: unknown): ResponseStage { + if (body === undefined) { + throw new Error( + "Undefined is not valid for form-urlencoded. Do not call formUrlEncodedBody if you want an empty body.", + ); + } + this.predicates.push((resolver) => withFormUrlEncoded(body, resolver)); + return this; + } + + respondWith(): ResponseStatusStage { + return new ResponseBuilder(this.method, this.buildUrl(), this.predicates, this.handlerOptions); + } + + private buildUrl(): string { + return url.join(this._baseUrl, this.path); + } +} + +class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, ResponseBodyStage, BuildStage { + private readonly method: HttpMethod; + private readonly url: string; + private readonly requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[]; + private readonly handlerOptions?: HttpHandlerBuilderOptions; + + private responseStatusCode: number = 200; + private responseHeaders: Record = {}; + private responseBody: DefaultBodyType = undefined; + + constructor( + method: HttpMethod, + url: string, + requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[], + options?: HttpHandlerBuilderOptions, + ) { + this.method = method; + this.url = url; + this.requestPredicates = requestPredicates; + this.handlerOptions = options; + } + + public statusCode(code: number): ResponseHeaderStage { + this.responseStatusCode = code; + return this; + } + + public header(name: string, value: string): ResponseHeaderStage { + this.responseHeaders[name] = value; + return this; + } + + public headers(headers: Record): ResponseHeaderStage { + this.responseHeaders = { ...this.responseHeaders, ...headers }; + return this; + } + + public jsonBody(body: unknown): BuildStage { + if (body === undefined) { + throw new Error("Undefined is not valid JSON. Do not call jsonBody if you expect an empty body."); + } + this.responseBody = toJson(body); + return this; + } + + public build(): HttpHandler { + const responseResolver: HttpResponseResolver = () => { + const response = new HttpResponse(this.responseBody, { + status: this.responseStatusCode, + headers: this.responseHeaders, + }); + // if no Content-Type header is set, delete the default text content type that is set + if (Object.keys(this.responseHeaders).some((key) => key.toLowerCase() === "content-type") === false) { + response.headers.delete("Content-Type"); + } + return response; + }; + + const finalResolver = this.requestPredicates.reduceRight((acc, predicate) => predicate(acc), responseResolver); + + const handler = http[this.method](this.url, finalResolver, this.handlerOptions); + this.handlerOptions?.onBuild?.(handler); + return handler; + } +} + +export function mockEndpointBuilder(options?: HttpHandlerBuilderOptions): MethodStage { + return new RequestBuilder(options); +} diff --git a/tests/mock-server/randomBaseUrl.ts b/tests/mock-server/randomBaseUrl.ts new file mode 100644 index 0000000..031aa64 --- /dev/null +++ b/tests/mock-server/randomBaseUrl.ts @@ -0,0 +1,4 @@ +export function randomBaseUrl(): string { + const randomString = Math.random().toString(36).substring(2, 15); + return `http://${randomString}.localhost`; +} diff --git a/tests/mock-server/setup.ts b/tests/mock-server/setup.ts new file mode 100644 index 0000000..aeb3a95 --- /dev/null +++ b/tests/mock-server/setup.ts @@ -0,0 +1,10 @@ +import { afterAll, beforeAll } from "vitest"; + +import { mockServerPool } from "./MockServerPool"; + +beforeAll(() => { + mockServerPool.listen(); +}); +afterAll(() => { + mockServerPool.close(); +}); diff --git a/tests/mock-server/withFormUrlEncoded.ts b/tests/mock-server/withFormUrlEncoded.ts new file mode 100644 index 0000000..e250cb3 --- /dev/null +++ b/tests/mock-server/withFormUrlEncoded.ts @@ -0,0 +1,89 @@ +import { type HttpResponseResolver, passthrough } from "msw"; + +import { toJson } from "../../src/core/json"; + +/** + * Creates a request matcher that validates if the request form-urlencoded body exactly matches the expected object + * @param expectedBody - The exact body object to match against + * @param resolver - Response resolver to execute if body matches + */ +export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { + return async (args) => { + const { request } = args; + + let clonedRequest: Request; + let bodyText: string | undefined; + let actualBody: Record; + try { + clonedRequest = request.clone(); + bodyText = await clonedRequest.text(); + if (bodyText === "") { + // Empty body is valid if expected body is also empty + const isExpectedEmpty = + expectedBody != null && + typeof expectedBody === "object" && + Object.keys(expectedBody as Record).length === 0; + if (!isExpectedEmpty) { + console.error("Request body is empty, expected a form-urlencoded body."); + return passthrough(); + } + actualBody = {}; + } else { + const params = new URLSearchParams(bodyText); + actualBody = {}; + for (const [key, value] of params.entries()) { + actualBody[key] = value; + } + } + } catch (error) { + console.error(`Error processing form-urlencoded request body:\n\tError: ${error}\n\tBody: ${bodyText}`); + return passthrough(); + } + + const mismatches = findMismatches(actualBody, expectedBody); + if (Object.keys(mismatches).length > 0) { + console.error("Form-urlencoded body mismatch:", toJson(mismatches, undefined, 2)); + return passthrough(); + } + + return resolver(args); + }; +} + +function findMismatches(actual: any, expected: any): Record { + const mismatches: Record = {}; + + if (typeof actual !== typeof expected) { + return { value: { actual, expected } }; + } + + if (typeof actual !== "object" || actual === null || expected === null) { + if (actual !== expected) { + return { value: { actual, expected } }; + } + return {}; + } + + const actualKeys = Object.keys(actual); + const expectedKeys = Object.keys(expected); + + const allKeys = new Set([...actualKeys, ...expectedKeys]); + + for (const key of allKeys) { + if (!expectedKeys.includes(key)) { + if (actual[key] === undefined) { + continue; + } + mismatches[key] = { actual: actual[key], expected: undefined }; + } else if (!actualKeys.includes(key)) { + if (expected[key] === undefined) { + continue; + } + mismatches[key] = { actual: undefined, expected: expected[key] }; + } else if (actual[key] !== expected[key]) { + mismatches[key] = { actual: actual[key], expected: expected[key] }; + } + } + + return mismatches; +} diff --git a/tests/mock-server/withHeaders.ts b/tests/mock-server/withHeaders.ts new file mode 100644 index 0000000..6599d2b --- /dev/null +++ b/tests/mock-server/withHeaders.ts @@ -0,0 +1,70 @@ +import { type HttpResponseResolver, passthrough } from "msw"; + +/** + * Creates a request matcher that validates if request headers match specified criteria + * @param expectedHeaders - Headers to match against + * @param resolver - Response resolver to execute if headers match + */ +export function withHeaders( + expectedHeaders: Record boolean)>, + resolver: HttpResponseResolver, +): HttpResponseResolver { + return (args) => { + const { request } = args; + const { headers } = request; + + const mismatches: Record< + string, + { actual: string | null; expected: string | RegExp | ((value: string) => boolean) } + > = {}; + + for (const [key, expectedValue] of Object.entries(expectedHeaders)) { + const actualValue = headers.get(key); + + if (actualValue === null) { + mismatches[key] = { actual: null, expected: expectedValue }; + continue; + } + + if (typeof expectedValue === "function") { + if (!expectedValue(actualValue)) { + mismatches[key] = { actual: actualValue, expected: expectedValue }; + } + } else if (expectedValue instanceof RegExp) { + if (!expectedValue.test(actualValue)) { + mismatches[key] = { actual: actualValue, expected: expectedValue }; + } + } else if (expectedValue !== actualValue) { + mismatches[key] = { actual: actualValue, expected: expectedValue }; + } + } + + if (Object.keys(mismatches).length > 0) { + const formattedMismatches = formatHeaderMismatches(mismatches); + console.error("Header mismatch:", formattedMismatches); + return passthrough(); + } + + return resolver(args); + }; +} + +function formatHeaderMismatches( + mismatches: Record boolean) }>, +): Record { + const formatted: Record = {}; + + for (const [key, { actual, expected }] of Object.entries(mismatches)) { + formatted[key] = { + actual, + expected: + expected instanceof RegExp + ? expected.toString() + : typeof expected === "function" + ? "[Function]" + : expected, + }; + } + + return formatted; +} diff --git a/tests/mock-server/withJson.ts b/tests/mock-server/withJson.ts new file mode 100644 index 0000000..3e8800a --- /dev/null +++ b/tests/mock-server/withJson.ts @@ -0,0 +1,173 @@ +import { type HttpResponseResolver, passthrough } from "msw"; + +import { fromJson, toJson } from "../../src/core/json"; + +export interface WithJsonOptions { + /** + * List of field names to ignore when comparing request bodies. + * This is useful for pagination cursor fields that change between requests. + */ + ignoredFields?: string[]; +} + +/** + * Creates a request matcher that validates if the request JSON body exactly matches the expected object + * @param expectedBody - The exact body object to match against + * @param resolver - Response resolver to execute if body matches + * @param options - Optional configuration including fields to ignore + */ +export function withJson( + expectedBody: unknown, + resolver: HttpResponseResolver, + options?: WithJsonOptions, +): HttpResponseResolver { + const ignoredFields = options?.ignoredFields ?? []; + return async (args) => { + const { request } = args; + + let clonedRequest: Request; + let bodyText: string | undefined; + let actualBody: unknown; + try { + clonedRequest = request.clone(); + bodyText = await clonedRequest.text(); + if (bodyText === "") { + console.error("Request body is empty, expected a JSON object."); + return passthrough(); + } + actualBody = fromJson(bodyText); + } catch (error) { + console.error(`Error processing request body:\n\tError: ${error}\n\tBody: ${bodyText}`); + return passthrough(); + } + + const mismatches = findMismatches(actualBody, expectedBody); + const filteredMismatches = Object.keys(mismatches).filter((key) => !ignoredFields.includes(key)); + if (filteredMismatches.length > 0) { + console.error("JSON body mismatch:", toJson(mismatches, undefined, 2)); + return passthrough(); + } + + return resolver(args); + }; +} + +function findMismatches(actual: any, expected: any): Record { + const mismatches: Record = {}; + + if (typeof actual !== typeof expected) { + if (areEquivalent(actual, expected)) { + return {}; + } + return { value: { actual, expected } }; + } + + if (typeof actual !== "object" || actual === null || expected === null) { + if (actual !== expected) { + if (areEquivalent(actual, expected)) { + return {}; + } + return { value: { actual, expected } }; + } + return {}; + } + + if (Array.isArray(actual) && Array.isArray(expected)) { + if (actual.length !== expected.length) { + return { length: { actual: actual.length, expected: expected.length } }; + } + + const arrayMismatches: Record = {}; + for (let i = 0; i < actual.length; i++) { + const itemMismatches = findMismatches(actual[i], expected[i]); + if (Object.keys(itemMismatches).length > 0) { + for (const [mismatchKey, mismatchValue] of Object.entries(itemMismatches)) { + arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : `.${mismatchKey}`}`] = mismatchValue; + } + } + } + return arrayMismatches; + } + + const actualKeys = Object.keys(actual); + const expectedKeys = Object.keys(expected); + + const allKeys = new Set([...actualKeys, ...expectedKeys]); + + for (const key of allKeys) { + if (!expectedKeys.includes(key)) { + if (actual[key] === undefined) { + continue; // Skip undefined values in actual + } + mismatches[key] = { actual: actual[key], expected: undefined }; + } else if (!actualKeys.includes(key)) { + if (expected[key] === undefined) { + continue; // Skip undefined values in expected + } + mismatches[key] = { actual: undefined, expected: expected[key] }; + } else if ( + typeof actual[key] === "object" && + actual[key] !== null && + typeof expected[key] === "object" && + expected[key] !== null + ) { + const nestedMismatches = findMismatches(actual[key], expected[key]); + if (Object.keys(nestedMismatches).length > 0) { + for (const [nestedKey, nestedValue] of Object.entries(nestedMismatches)) { + mismatches[`${key}${nestedKey === "value" ? "" : `.${nestedKey}`}`] = nestedValue; + } + } + } else if (actual[key] !== expected[key]) { + if (areEquivalent(actual[key], expected[key])) { + continue; + } + mismatches[key] = { actual: actual[key], expected: expected[key] }; + } + } + + return mismatches; +} + +function areEquivalent(actual: unknown, expected: unknown): boolean { + if (actual === expected) { + return true; + } + if (isEquivalentBigInt(actual, expected)) { + return true; + } + if (isEquivalentDatetime(actual, expected)) { + return true; + } + return false; +} + +function isEquivalentBigInt(actual: unknown, expected: unknown) { + if (typeof actual === "number") { + actual = BigInt(actual); + } + if (typeof expected === "number") { + expected = BigInt(expected); + } + if (typeof actual === "bigint" && typeof expected === "bigint") { + return actual === expected; + } + return false; +} + +function isEquivalentDatetime(str1: unknown, str2: unknown): boolean { + if (typeof str1 !== "string" || typeof str2 !== "string") { + return false; + } + const isoDatePattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/; + if (!isoDatePattern.test(str1) || !isoDatePattern.test(str2)) { + return false; + } + + try { + const date1 = new Date(str1).getTime(); + const date2 = new Date(str2).getTime(); + return date1 === date2; + } catch { + return false; + } +} diff --git a/tests/setup.ts b/tests/setup.ts new file mode 100644 index 0000000..a5651f8 --- /dev/null +++ b/tests/setup.ts @@ -0,0 +1,80 @@ +import { expect } from "vitest"; + +interface CustomMatchers { + toContainHeaders(expectedHeaders: Record): R; +} + +declare module "vitest" { + interface Assertion extends CustomMatchers {} + interface AsymmetricMatchersContaining extends CustomMatchers {} +} + +expect.extend({ + toContainHeaders(actual: unknown, expectedHeaders: Record) { + const isHeaders = actual instanceof Headers; + const isPlainObject = typeof actual === "object" && actual !== null && !Array.isArray(actual); + + if (!isHeaders && !isPlainObject) { + throw new TypeError("Received value must be an instance of Headers or a plain object!"); + } + + if (typeof expectedHeaders !== "object" || expectedHeaders === null || Array.isArray(expectedHeaders)) { + throw new TypeError("Expected headers must be a plain object!"); + } + + const missingHeaders: string[] = []; + const mismatchedHeaders: Array<{ key: string; expected: string; actual: string | null }> = []; + + for (const [key, value] of Object.entries(expectedHeaders)) { + let actualValue: string | null = null; + + if (isHeaders) { + // Headers.get() is already case-insensitive + actualValue = (actual as Headers).get(key); + } else { + // For plain objects, do case-insensitive lookup + const actualObj = actual as Record; + const lowerKey = key.toLowerCase(); + const foundKey = Object.keys(actualObj).find((k) => k.toLowerCase() === lowerKey); + actualValue = foundKey ? actualObj[foundKey] : null; + } + + if (actualValue === null || actualValue === undefined) { + missingHeaders.push(key); + } else if (actualValue !== value) { + mismatchedHeaders.push({ key, expected: value, actual: actualValue }); + } + } + + const pass = missingHeaders.length === 0 && mismatchedHeaders.length === 0; + + const actualType = isHeaders ? "Headers" : "object"; + + if (pass) { + return { + message: () => `expected ${actualType} not to contain ${this.utils.printExpected(expectedHeaders)}`, + pass: true, + }; + } else { + const messages: string[] = []; + + if (missingHeaders.length > 0) { + messages.push(`Missing headers: ${this.utils.printExpected(missingHeaders.join(", "))}`); + } + + if (mismatchedHeaders.length > 0) { + const mismatches = mismatchedHeaders.map( + ({ key, expected, actual }) => + `${key}: expected ${this.utils.printExpected(expected)} but got ${this.utils.printReceived(actual)}`, + ); + messages.push(mismatches.join("\n")); + } + + return { + message: () => + `expected ${actualType} to contain ${this.utils.printExpected(expectedHeaders)}\n\n${messages.join("\n")}`, + pass: false, + }; + } + }, +}); diff --git a/tests/tsconfig.json b/tests/tsconfig.json new file mode 100644 index 0000000..a477df4 --- /dev/null +++ b/tests/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "outDir": null, + "rootDir": "..", + "baseUrl": "..", + "types": ["vitest/globals"] + }, + "include": ["../src", "../tests"], + "exclude": [] +} diff --git a/tests/unit/auth/BasicAuth.test.ts b/tests/unit/auth/BasicAuth.test.ts new file mode 100644 index 0000000..9b51233 --- /dev/null +++ b/tests/unit/auth/BasicAuth.test.ts @@ -0,0 +1,92 @@ +import { BasicAuth } from "../../../src/core/auth/BasicAuth"; + +describe("BasicAuth", () => { + interface ToHeaderTestCase { + description: string; + input: { username: string; password: string }; + expected: string; + } + + interface FromHeaderTestCase { + description: string; + input: string; + expected: { username: string; password: string }; + } + + interface ErrorTestCase { + description: string; + input: string; + expectedError: string; + } + + describe("toAuthorizationHeader", () => { + const toHeaderTests: ToHeaderTestCase[] = [ + { + description: "correctly converts to header", + input: { username: "username", password: "password" }, + expected: "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", + }, + ]; + + toHeaderTests.forEach(({ description, input, expected }) => { + it(description, () => { + expect(BasicAuth.toAuthorizationHeader(input)).toBe(expected); + }); + }); + }); + + describe("fromAuthorizationHeader", () => { + const fromHeaderTests: FromHeaderTestCase[] = [ + { + description: "correctly parses header", + input: "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", + expected: { username: "username", password: "password" }, + }, + { + description: "handles password with colons", + input: "Basic dXNlcjpwYXNzOndvcmQ=", + expected: { username: "user", password: "pass:word" }, + }, + { + description: "handles empty username and password (just colon)", + input: "Basic Og==", + expected: { username: "", password: "" }, + }, + { + description: "handles empty username", + input: "Basic OnBhc3N3b3Jk", + expected: { username: "", password: "password" }, + }, + { + description: "handles empty password", + input: "Basic dXNlcm5hbWU6", + expected: { username: "username", password: "" }, + }, + ]; + + fromHeaderTests.forEach(({ description, input, expected }) => { + it(description, () => { + expect(BasicAuth.fromAuthorizationHeader(input)).toEqual(expected); + }); + }); + + const errorTests: ErrorTestCase[] = [ + { + description: "throws error for completely empty credentials", + input: "Basic ", + expectedError: "Invalid basic auth", + }, + { + description: "throws error for credentials without colon", + input: "Basic dXNlcm5hbWU=", + expectedError: "Invalid basic auth", + }, + ]; + + errorTests.forEach(({ description, input, expectedError }) => { + it(description, () => { + expect(() => BasicAuth.fromAuthorizationHeader(input)).toThrow(expectedError); + }); + }); + }); +}); diff --git a/tests/unit/auth/BearerToken.test.ts b/tests/unit/auth/BearerToken.test.ts new file mode 100644 index 0000000..7757b87 --- /dev/null +++ b/tests/unit/auth/BearerToken.test.ts @@ -0,0 +1,14 @@ +import { BearerToken } from "../../../src/core/auth/BearerToken"; + +describe("BearerToken", () => { + describe("toAuthorizationHeader", () => { + it("correctly converts to header", () => { + expect(BearerToken.toAuthorizationHeader("my-token")).toBe("Bearer my-token"); + }); + }); + describe("fromAuthorizationHeader", () => { + it("correctly parses header", () => { + expect(BearerToken.fromAuthorizationHeader("Bearer my-token")).toBe("my-token"); + }); + }); +}); diff --git a/tests/unit/base64.test.ts b/tests/unit/base64.test.ts new file mode 100644 index 0000000..939594c --- /dev/null +++ b/tests/unit/base64.test.ts @@ -0,0 +1,53 @@ +import { base64Decode, base64Encode } from "../../src/core/base64"; + +describe("base64", () => { + describe("base64Encode", () => { + it("should encode ASCII strings", () => { + expect(base64Encode("hello")).toBe("aGVsbG8="); + expect(base64Encode("")).toBe(""); + }); + + it("should encode UTF-8 strings", () => { + expect(base64Encode("café")).toBe("Y2Fmw6k="); + expect(base64Encode("🎉")).toBe("8J+OiQ=="); + }); + + it("should handle basic auth credentials", () => { + expect(base64Encode("username:password")).toBe("dXNlcm5hbWU6cGFzc3dvcmQ="); + }); + }); + + describe("base64Decode", () => { + it("should decode ASCII strings", () => { + expect(base64Decode("aGVsbG8=")).toBe("hello"); + expect(base64Decode("")).toBe(""); + }); + + it("should decode UTF-8 strings", () => { + expect(base64Decode("Y2Fmw6k=")).toBe("café"); + expect(base64Decode("8J+OiQ==")).toBe("🎉"); + }); + + it("should handle basic auth credentials", () => { + expect(base64Decode("dXNlcm5hbWU6cGFzc3dvcmQ=")).toBe("username:password"); + }); + }); + + describe("round-trip encoding", () => { + const testStrings = [ + "hello world", + "test@example.com", + "café", + "username:password", + "user@domain.com:super$ecret123!", + ]; + + testStrings.forEach((testString) => { + it(`should round-trip encode/decode: "${testString}"`, () => { + const encoded = base64Encode(testString); + const decoded = base64Decode(encoded); + expect(decoded).toBe(testString); + }); + }); + }); +}); diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts new file mode 100644 index 0000000..6c17624 --- /dev/null +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -0,0 +1,262 @@ +import fs from "fs"; +import { join } from "path"; +import stream from "stream"; +import type { BinaryResponse } from "../../../src/core"; +import { type Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; + +describe("Test fetcherImpl", () => { + it("should handle successful request", async () => { + const mockArgs: Fetcher.Args = { + url: "https://httpbin.org/post", + method: "POST", + headers: { "X-Test": "x-test-header" }, + body: { data: "test" }, + contentType: "application/json", + requestType: "json", + maxRetries: 0, + responseType: "json", + }; + + global.fetch = vi.fn().mockResolvedValue( + new Response(JSON.stringify({ data: "test" }), { + status: 200, + statusText: "OK", + }), + ); + + const result = await fetcherImpl(mockArgs); + expect(result.ok).toBe(true); + if (result.ok) { + expect(result.body).toEqual({ data: "test" }); + } + + expect(global.fetch).toHaveBeenCalledWith( + "https://httpbin.org/post", + expect.objectContaining({ + method: "POST", + headers: expect.toContainHeaders({ "X-Test": "x-test-header" }), + body: JSON.stringify({ data: "test" }), + }), + ); + }); + + it("should send octet stream", async () => { + const url = "https://httpbin.org/post/file"; + const mockArgs: Fetcher.Args = { + url, + method: "POST", + headers: { "X-Test": "x-test-header" }, + contentType: "application/octet-stream", + requestType: "bytes", + maxRetries: 0, + responseType: "json", + body: fs.createReadStream(join(__dirname, "test-file.txt")), + }; + + global.fetch = vi.fn().mockResolvedValue( + new Response(JSON.stringify({ data: "test" }), { + status: 200, + statusText: "OK", + }), + ); + + const result = await fetcherImpl(mockArgs); + + expect(global.fetch).toHaveBeenCalledWith( + url, + expect.objectContaining({ + method: "POST", + headers: expect.toContainHeaders({ "X-Test": "x-test-header" }), + body: expect.any(fs.ReadStream), + }), + ); + expect(result.ok).toBe(true); + if (result.ok) { + expect(result.body).toEqual({ data: "test" }); + } + }); + + it("should receive file as stream", async () => { + const url = "https://httpbin.org/post/file"; + const mockArgs: Fetcher.Args = { + url, + method: "GET", + headers: { "X-Test": "x-test-header" }, + maxRetries: 0, + responseType: "binary-response", + }; + + global.fetch = vi.fn().mockResolvedValue( + new Response( + stream.Readable.toWeb(fs.createReadStream(join(__dirname, "test-file.txt"))) as ReadableStream, + { + status: 200, + statusText: "OK", + }, + ), + ); + + const result = await fetcherImpl(mockArgs); + + expect(global.fetch).toHaveBeenCalledWith( + url, + expect.objectContaining({ + method: "GET", + headers: expect.toContainHeaders({ "X-Test": "x-test-header" }), + }), + ); + expect(result.ok).toBe(true); + if (result.ok) { + const body = result.body as BinaryResponse; + expect(body).toBeDefined(); + expect(body.bodyUsed).toBe(false); + expect(typeof body.stream).toBe("function"); + const stream = body.stream(); + expect(stream).toBeInstanceOf(ReadableStream); + const readableStream = stream as ReadableStream; + const reader = readableStream.getReader(); + const { value } = await reader.read(); + const decoder = new TextDecoder(); + const streamContent = decoder.decode(value); + expect(streamContent.trim()).toBe("This is a test file!"); + expect(body.bodyUsed).toBe(true); + } + }); + + it("should receive file as blob", async () => { + const url = "https://httpbin.org/post/file"; + const mockArgs: Fetcher.Args = { + url, + method: "GET", + headers: { "X-Test": "x-test-header" }, + maxRetries: 0, + responseType: "binary-response", + }; + + global.fetch = vi.fn().mockResolvedValue( + new Response( + stream.Readable.toWeb(fs.createReadStream(join(__dirname, "test-file.txt"))) as ReadableStream, + { + status: 200, + statusText: "OK", + }, + ), + ); + + const result = await fetcherImpl(mockArgs); + + expect(global.fetch).toHaveBeenCalledWith( + url, + expect.objectContaining({ + method: "GET", + headers: expect.toContainHeaders({ "X-Test": "x-test-header" }), + }), + ); + expect(result.ok).toBe(true); + if (result.ok) { + const body = result.body as BinaryResponse; + expect(body).toBeDefined(); + expect(body.bodyUsed).toBe(false); + expect(typeof body.blob).toBe("function"); + const blob = await body.blob(); + expect(blob).toBeInstanceOf(Blob); + const reader = blob.stream().getReader(); + const { value } = await reader.read(); + const decoder = new TextDecoder(); + const streamContent = decoder.decode(value); + expect(streamContent.trim()).toBe("This is a test file!"); + expect(body.bodyUsed).toBe(true); + } + }); + + it("should receive file as arraybuffer", async () => { + const url = "https://httpbin.org/post/file"; + const mockArgs: Fetcher.Args = { + url, + method: "GET", + headers: { "X-Test": "x-test-header" }, + maxRetries: 0, + responseType: "binary-response", + }; + + global.fetch = vi.fn().mockResolvedValue( + new Response( + stream.Readable.toWeb(fs.createReadStream(join(__dirname, "test-file.txt"))) as ReadableStream, + { + status: 200, + statusText: "OK", + }, + ), + ); + + const result = await fetcherImpl(mockArgs); + + expect(global.fetch).toHaveBeenCalledWith( + url, + expect.objectContaining({ + method: "GET", + headers: expect.toContainHeaders({ "X-Test": "x-test-header" }), + }), + ); + expect(result.ok).toBe(true); + if (result.ok) { + const body = result.body as BinaryResponse; + expect(body).toBeDefined(); + expect(body.bodyUsed).toBe(false); + expect(typeof body.arrayBuffer).toBe("function"); + const arrayBuffer = await body.arrayBuffer(); + expect(arrayBuffer).toBeInstanceOf(ArrayBuffer); + const decoder = new TextDecoder(); + const streamContent = decoder.decode(new Uint8Array(arrayBuffer)); + expect(streamContent.trim()).toBe("This is a test file!"); + expect(body.bodyUsed).toBe(true); + } + }); + + it("should receive file as bytes", async () => { + const url = "https://httpbin.org/post/file"; + const mockArgs: Fetcher.Args = { + url, + method: "GET", + headers: { "X-Test": "x-test-header" }, + maxRetries: 0, + responseType: "binary-response", + }; + + global.fetch = vi.fn().mockResolvedValue( + new Response( + stream.Readable.toWeb(fs.createReadStream(join(__dirname, "test-file.txt"))) as ReadableStream, + { + status: 200, + statusText: "OK", + }, + ), + ); + + const result = await fetcherImpl(mockArgs); + + expect(global.fetch).toHaveBeenCalledWith( + url, + expect.objectContaining({ + method: "GET", + headers: expect.toContainHeaders({ "X-Test": "x-test-header" }), + }), + ); + expect(result.ok).toBe(true); + if (result.ok) { + const body = result.body as BinaryResponse; + expect(body).toBeDefined(); + expect(body.bodyUsed).toBe(false); + expect(typeof body.bytes).toBe("function"); + if (!body.bytes) { + return; + } + const bytes = await body.bytes(); + expect(bytes).toBeInstanceOf(Uint8Array); + const decoder = new TextDecoder(); + const streamContent = decoder.decode(bytes); + expect(streamContent.trim()).toBe("This is a test file!"); + expect(body.bodyUsed).toBe(true); + } + }); +}); diff --git a/tests/unit/fetcher/HttpResponsePromise.test.ts b/tests/unit/fetcher/HttpResponsePromise.test.ts new file mode 100644 index 0000000..2ec008e --- /dev/null +++ b/tests/unit/fetcher/HttpResponsePromise.test.ts @@ -0,0 +1,143 @@ +import { beforeEach, describe, expect, it, vi } from "vitest"; + +import { HttpResponsePromise } from "../../../src/core/fetcher/HttpResponsePromise"; +import type { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; + +describe("HttpResponsePromise", () => { + const mockRawResponse: RawResponse = { + headers: new Headers(), + redirected: false, + status: 200, + statusText: "OK", + type: "basic" as ResponseType, + url: "https://example.com", + }; + const mockData = { id: "123", name: "test" }; + const mockWithRawResponse: WithRawResponse = { + data: mockData, + rawResponse: mockRawResponse, + }; + + describe("fromFunction", () => { + it("should create an HttpResponsePromise from a function", async () => { + const mockFn = vi + .fn<(arg1: string, arg2: string) => Promise>>() + .mockResolvedValue(mockWithRawResponse); + + const responsePromise = HttpResponsePromise.fromFunction(mockFn, "arg1", "arg2"); + + const result = await responsePromise; + expect(result).toEqual(mockData); + expect(mockFn).toHaveBeenCalledWith("arg1", "arg2"); + + const resultWithRawResponse = await responsePromise.withRawResponse(); + expect(resultWithRawResponse).toEqual({ + data: mockData, + rawResponse: mockRawResponse, + }); + }); + }); + + describe("fromPromise", () => { + it("should create an HttpResponsePromise from a promise", async () => { + const promise = Promise.resolve(mockWithRawResponse); + + const responsePromise = HttpResponsePromise.fromPromise(promise); + + const result = await responsePromise; + expect(result).toEqual(mockData); + + const resultWithRawResponse = await responsePromise.withRawResponse(); + expect(resultWithRawResponse).toEqual({ + data: mockData, + rawResponse: mockRawResponse, + }); + }); + }); + + describe("fromExecutor", () => { + it("should create an HttpResponsePromise from an executor function", async () => { + const responsePromise = HttpResponsePromise.fromExecutor((resolve) => { + resolve(mockWithRawResponse); + }); + + const result = await responsePromise; + expect(result).toEqual(mockData); + + const resultWithRawResponse = await responsePromise.withRawResponse(); + expect(resultWithRawResponse).toEqual({ + data: mockData, + rawResponse: mockRawResponse, + }); + }); + }); + + describe("fromResult", () => { + it("should create an HttpResponsePromise from a result", async () => { + const responsePromise = HttpResponsePromise.fromResult(mockWithRawResponse); + + const result = await responsePromise; + expect(result).toEqual(mockData); + + const resultWithRawResponse = await responsePromise.withRawResponse(); + expect(resultWithRawResponse).toEqual({ + data: mockData, + rawResponse: mockRawResponse, + }); + }); + }); + + describe("Promise methods", () => { + let responsePromise: HttpResponsePromise; + + beforeEach(() => { + responsePromise = HttpResponsePromise.fromResult(mockWithRawResponse); + }); + + it("should support then() method", async () => { + const result = await responsePromise.then((data) => ({ + ...data, + modified: true, + })); + + expect(result).toEqual({ + ...mockData, + modified: true, + }); + }); + + it("should support catch() method", async () => { + const errorResponsePromise = HttpResponsePromise.fromExecutor((_, reject) => { + reject(new Error("Test error")); + }); + + const catchSpy = vi.fn(); + await errorResponsePromise.catch(catchSpy); + + expect(catchSpy).toHaveBeenCalled(); + const error = catchSpy.mock.calls[0]?.[0]; + expect(error).toBeInstanceOf(Error); + expect((error as Error).message).toBe("Test error"); + }); + + it("should support finally() method", async () => { + const finallySpy = vi.fn(); + await responsePromise.finally(finallySpy); + + expect(finallySpy).toHaveBeenCalled(); + }); + }); + + describe("withRawResponse", () => { + it("should return both data and raw response", async () => { + const responsePromise = HttpResponsePromise.fromResult(mockWithRawResponse); + + const result = await responsePromise.withRawResponse(); + + expect(result).toEqual({ + data: mockData, + rawResponse: mockRawResponse, + }); + }); + }); +}); diff --git a/tests/unit/fetcher/RawResponse.test.ts b/tests/unit/fetcher/RawResponse.test.ts new file mode 100644 index 0000000..375ee3f --- /dev/null +++ b/tests/unit/fetcher/RawResponse.test.ts @@ -0,0 +1,34 @@ +import { describe, expect, it } from "vitest"; + +import { toRawResponse } from "../../../src/core/fetcher/RawResponse"; + +describe("RawResponse", () => { + describe("toRawResponse", () => { + it("should convert Response to RawResponse by removing body, bodyUsed, and ok properties", () => { + const mockHeaders = new Headers({ "content-type": "application/json" }); + const mockResponse = { + body: "test body", + bodyUsed: false, + ok: true, + headers: mockHeaders, + redirected: false, + status: 200, + statusText: "OK", + type: "basic" as ResponseType, + url: "https://example.com", + }; + + const result = toRawResponse(mockResponse as unknown as Response); + + expect("body" in result).toBe(false); + expect("bodyUsed" in result).toBe(false); + expect("ok" in result).toBe(false); + expect(result.headers).toBe(mockHeaders); + expect(result.redirected).toBe(false); + expect(result.status).toBe(200); + expect(result.statusText).toBe("OK"); + expect(result.type).toBe("basic"); + expect(result.url).toBe("https://example.com"); + }); + }); +}); diff --git a/tests/unit/fetcher/createRequestUrl.test.ts b/tests/unit/fetcher/createRequestUrl.test.ts new file mode 100644 index 0000000..a92f1b5 --- /dev/null +++ b/tests/unit/fetcher/createRequestUrl.test.ts @@ -0,0 +1,163 @@ +import { createRequestUrl } from "../../../src/core/fetcher/createRequestUrl"; + +describe("Test createRequestUrl", () => { + const BASE_URL = "https://api.example.com"; + + interface TestCase { + description: string; + baseUrl: string; + queryParams?: Record; + expected: string; + } + + const testCases: TestCase[] = [ + { + description: "should return the base URL when no query parameters are provided", + baseUrl: BASE_URL, + expected: BASE_URL, + }, + { + description: "should append simple query parameters", + baseUrl: BASE_URL, + queryParams: { key: "value", another: "param" }, + expected: "https://api.example.com?key=value&another=param", + }, + { + description: "should handle array query parameters", + baseUrl: BASE_URL, + queryParams: { items: ["a", "b", "c"] }, + expected: "https://api.example.com?items=a&items=b&items=c", + }, + { + description: "should handle object query parameters", + baseUrl: BASE_URL, + queryParams: { filter: { name: "John", age: 30 } }, + expected: "https://api.example.com?filter%5Bname%5D=John&filter%5Bage%5D=30", + }, + { + description: "should handle mixed types of query parameters", + baseUrl: BASE_URL, + queryParams: { + simple: "value", + array: ["x", "y"], + object: { key: "value" }, + }, + expected: "https://api.example.com?simple=value&array=x&array=y&object%5Bkey%5D=value", + }, + { + description: "should handle empty query parameters object", + baseUrl: BASE_URL, + queryParams: {}, + expected: BASE_URL, + }, + { + description: "should encode special characters in query parameters", + baseUrl: BASE_URL, + queryParams: { special: "a&b=c d" }, + expected: "https://api.example.com?special=a%26b%3Dc%20d", + }, + { + description: "should handle numeric values", + baseUrl: BASE_URL, + queryParams: { count: 42, price: 19.99, active: 1, inactive: 0 }, + expected: "https://api.example.com?count=42&price=19.99&active=1&inactive=0", + }, + { + description: "should handle boolean values", + baseUrl: BASE_URL, + queryParams: { enabled: true, disabled: false }, + expected: "https://api.example.com?enabled=true&disabled=false", + }, + { + description: "should handle null and undefined values", + baseUrl: BASE_URL, + queryParams: { + valid: "value", + nullValue: null, + undefinedValue: undefined, + emptyString: "", + }, + expected: "https://api.example.com?valid=value&nullValue=&emptyString=", + }, + { + description: "should handle deeply nested objects", + baseUrl: BASE_URL, + queryParams: { + user: { + profile: { + name: "John", + settings: { theme: "dark" }, + }, + }, + }, + expected: + "https://api.example.com?user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", + }, + { + description: "should handle arrays of objects", + baseUrl: BASE_URL, + queryParams: { + users: [ + { name: "John", age: 30 }, + { name: "Jane", age: 25 }, + ], + }, + expected: + "https://api.example.com?users%5Bname%5D=John&users%5Bage%5D=30&users%5Bname%5D=Jane&users%5Bage%5D=25", + }, + { + description: "should handle mixed arrays", + baseUrl: BASE_URL, + queryParams: { + mixed: ["string", 42, true, { key: "value" }], + }, + expected: "https://api.example.com?mixed=string&mixed=42&mixed=true&mixed%5Bkey%5D=value", + }, + { + description: "should handle empty arrays", + baseUrl: BASE_URL, + queryParams: { emptyArray: [] }, + expected: BASE_URL, + }, + { + description: "should handle empty objects", + baseUrl: BASE_URL, + queryParams: { emptyObject: {} }, + expected: BASE_URL, + }, + { + description: "should handle special characters in keys", + baseUrl: BASE_URL, + queryParams: { "key with spaces": "value", "key[with]brackets": "value" }, + expected: "https://api.example.com?key%20with%20spaces=value&key%5Bwith%5Dbrackets=value", + }, + { + description: "should handle URL with existing query parameters", + baseUrl: "https://api.example.com?existing=param", + queryParams: { new: "value" }, + expected: "https://api.example.com?existing=param?new=value", + }, + { + description: "should handle complex nested structures", + baseUrl: BASE_URL, + queryParams: { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], + }, + }, + sort: { field: "name", direction: "asc" }, + }, + expected: + "https://api.example.com?filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + }, + ]; + + testCases.forEach(({ description, baseUrl, queryParams, expected }) => { + it(description, () => { + expect(createRequestUrl(baseUrl, queryParams)).toBe(expected); + }); + }); +}); diff --git a/tests/unit/fetcher/getRequestBody.test.ts b/tests/unit/fetcher/getRequestBody.test.ts new file mode 100644 index 0000000..8a6c3a5 --- /dev/null +++ b/tests/unit/fetcher/getRequestBody.test.ts @@ -0,0 +1,129 @@ +import { getRequestBody } from "../../../src/core/fetcher/getRequestBody"; +import { RUNTIME } from "../../../src/core/runtime"; + +describe("Test getRequestBody", () => { + interface TestCase { + description: string; + input: any; + type: "json" | "form" | "file" | "bytes" | "other"; + expected: any; + skipCondition?: () => boolean; + } + + const testCases: TestCase[] = [ + { + description: "should stringify body if not FormData in Node environment", + input: { key: "value" }, + type: "json", + expected: '{"key":"value"}', + skipCondition: () => RUNTIME.type !== "node", + }, + { + description: "should stringify body if not FormData in browser environment", + input: { key: "value" }, + type: "json", + expected: '{"key":"value"}', + skipCondition: () => RUNTIME.type !== "browser", + }, + { + description: "should return the Uint8Array", + input: new Uint8Array([1, 2, 3]), + type: "bytes", + expected: new Uint8Array([1, 2, 3]), + }, + { + description: "should serialize objects for form-urlencoded content type", + input: { username: "johndoe", email: "john@example.com" }, + type: "form", + expected: "username=johndoe&email=john%40example.com", + }, + { + description: "should serialize complex nested objects and arrays for form-urlencoded content type", + input: { + user: { + profile: { + name: "John Doe", + settings: { + theme: "dark", + notifications: true, + }, + }, + tags: ["admin", "user"], + contacts: [ + { type: "email", value: "john@example.com" }, + { type: "phone", value: "+1234567890" }, + ], + }, + filters: { + status: ["active", "pending"], + metadata: { + created: "2024-01-01", + categories: ["electronics", "books"], + }, + }, + preferences: ["notifications", "updates"], + }, + type: "form", + expected: + "user%5Bprofile%5D%5Bname%5D=John%20Doe&" + + "user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark&" + + "user%5Bprofile%5D%5Bsettings%5D%5Bnotifications%5D=true&" + + "user%5Btags%5D=admin&" + + "user%5Btags%5D=user&" + + "user%5Bcontacts%5D%5Btype%5D=email&" + + "user%5Bcontacts%5D%5Bvalue%5D=john%40example.com&" + + "user%5Bcontacts%5D%5Btype%5D=phone&" + + "user%5Bcontacts%5D%5Bvalue%5D=%2B1234567890&" + + "filters%5Bstatus%5D=active&" + + "filters%5Bstatus%5D=pending&" + + "filters%5Bmetadata%5D%5Bcreated%5D=2024-01-01&" + + "filters%5Bmetadata%5D%5Bcategories%5D=electronics&" + + "filters%5Bmetadata%5D%5Bcategories%5D=books&" + + "preferences=notifications&" + + "preferences=updates", + }, + { + description: "should return the input for pre-serialized form-urlencoded strings", + input: "key=value&another=param", + type: "other", + expected: "key=value&another=param", + }, + { + description: "should JSON stringify objects", + input: { key: "value" }, + type: "json", + expected: '{"key":"value"}', + }, + ]; + + testCases.forEach(({ description, input, type, expected, skipCondition }) => { + it(description, async () => { + if (skipCondition?.()) { + return; + } + + const result = await getRequestBody({ + body: input, + type, + }); + + if (input instanceof Uint8Array) { + expect(result).toBe(input); + } else { + expect(result).toBe(expected); + } + }); + }); + + it("should return FormData in browser environment", async () => { + if (RUNTIME.type === "browser") { + const formData = new FormData(); + formData.append("key", "value"); + const result = await getRequestBody({ + body: formData, + type: "file", + }); + expect(result).toBe(formData); + } + }); +}); diff --git a/tests/unit/fetcher/getResponseBody.test.ts b/tests/unit/fetcher/getResponseBody.test.ts new file mode 100644 index 0000000..ad6be7f --- /dev/null +++ b/tests/unit/fetcher/getResponseBody.test.ts @@ -0,0 +1,97 @@ +import { getResponseBody } from "../../../src/core/fetcher/getResponseBody"; + +import { RUNTIME } from "../../../src/core/runtime"; + +describe("Test getResponseBody", () => { + interface SimpleTestCase { + description: string; + responseData: string | Record; + responseType?: "blob" | "sse" | "streaming" | "text"; + expected: any; + skipCondition?: () => boolean; + } + + const simpleTestCases: SimpleTestCase[] = [ + { + description: "should handle text response type", + responseData: "test text", + responseType: "text", + expected: "test text", + }, + { + description: "should handle JSON response", + responseData: { key: "value" }, + expected: { key: "value" }, + }, + { + description: "should handle empty response", + responseData: "", + expected: undefined, + }, + { + description: "should handle non-JSON response", + responseData: "invalid json", + expected: { + ok: false, + error: { + reason: "non-json", + statusCode: 200, + rawBody: "invalid json", + }, + }, + }, + ]; + + simpleTestCases.forEach(({ description, responseData, responseType, expected, skipCondition }) => { + it(description, async () => { + if (skipCondition?.()) { + return; + } + + const mockResponse = new Response( + typeof responseData === "string" ? responseData : JSON.stringify(responseData), + ); + const result = await getResponseBody(mockResponse, responseType); + expect(result).toEqual(expected); + }); + }); + + it("should handle blob response type", async () => { + const mockBlob = new Blob(["test"], { type: "text/plain" }); + const mockResponse = new Response(mockBlob); + const result = await getResponseBody(mockResponse, "blob"); + // @ts-expect-error + expect(result.constructor.name).toBe("Blob"); + }); + + it("should handle sse response type", async () => { + if (RUNTIME.type === "node") { + const mockStream = new ReadableStream(); + const mockResponse = new Response(mockStream); + const result = await getResponseBody(mockResponse, "sse"); + expect(result).toBe(mockStream); + } + }); + + it("should handle streaming response type", async () => { + const encoder = new TextEncoder(); + const testData = "test stream data"; + const mockStream = new ReadableStream({ + start(controller) { + controller.enqueue(encoder.encode(testData)); + controller.close(); + }, + }); + + const mockResponse = new Response(mockStream); + const result = (await getResponseBody(mockResponse, "streaming")) as ReadableStream; + + expect(result).toBeInstanceOf(ReadableStream); + + const reader = result.getReader(); + const decoder = new TextDecoder(); + const { value } = await reader.read(); + const streamContent = decoder.decode(value); + expect(streamContent).toBe(testData); + }); +}); diff --git a/tests/unit/fetcher/logging.test.ts b/tests/unit/fetcher/logging.test.ts new file mode 100644 index 0000000..366c9b6 --- /dev/null +++ b/tests/unit/fetcher/logging.test.ts @@ -0,0 +1,517 @@ +import { fetcherImpl } from "../../../src/core/fetcher/Fetcher"; + +function createMockLogger() { + return { + debug: vi.fn(), + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), + }; +} + +function mockSuccessResponse(data: unknown = { data: "test" }, status = 200, statusText = "OK") { + global.fetch = vi.fn().mockResolvedValue( + new Response(JSON.stringify(data), { + status, + statusText, + }), + ); +} + +function mockErrorResponse(data: unknown = { error: "Error" }, status = 404, statusText = "Not Found") { + global.fetch = vi.fn().mockResolvedValue( + new Response(JSON.stringify(data), { + status, + statusText, + }), + ); +} + +describe("Fetcher Logging Integration", () => { + describe("Request Logging", () => { + it("should log successful request at debug level", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "POST", + headers: { "Content-Type": "application/json" }, + body: { test: "data" }, + contentType: "application/json", + requestType: "json", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + method: "POST", + url: "https://example.com/api", + headers: expect.toContainHeaders({ + "Content-Type": "application/json", + }), + hasBody: true, + }), + ); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "HTTP request succeeded", + expect.objectContaining({ + method: "POST", + url: "https://example.com/api", + statusCode: 200, + }), + ); + }); + + it("should not log debug messages at info level for successful requests", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "info", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).not.toHaveBeenCalled(); + expect(mockLogger.info).not.toHaveBeenCalled(); + }); + + it("should log request with body flag", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "POST", + body: { data: "test" }, + contentType: "application/json", + requestType: "json", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + hasBody: true, + }), + ); + }); + + it("should log request without body flag", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + hasBody: false, + }), + ); + }); + + it("should not log when silent mode is enabled", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: true, + }, + }); + + expect(mockLogger.debug).not.toHaveBeenCalled(); + expect(mockLogger.info).not.toHaveBeenCalled(); + expect(mockLogger.warn).not.toHaveBeenCalled(); + expect(mockLogger.error).not.toHaveBeenCalled(); + }); + + it("should not log when no logging config is provided", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + }); + + expect(mockLogger.debug).not.toHaveBeenCalled(); + }); + }); + + describe("Error Logging", () => { + it("should log 4xx errors at error level", async () => { + const mockLogger = createMockLogger(); + mockErrorResponse({ error: "Not found" }, 404, "Not Found"); + + const result = await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "error", + logger: mockLogger, + silent: false, + }, + }); + + expect(result.ok).toBe(false); + expect(mockLogger.error).toHaveBeenCalledWith( + "HTTP request failed with error status", + expect.objectContaining({ + method: "GET", + url: "https://example.com/api", + statusCode: 404, + }), + ); + }); + + it("should log 5xx errors at error level", async () => { + const mockLogger = createMockLogger(); + mockErrorResponse({ error: "Internal error" }, 500, "Internal Server Error"); + + const result = await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "error", + logger: mockLogger, + silent: false, + }, + }); + + expect(result.ok).toBe(false); + expect(mockLogger.error).toHaveBeenCalledWith( + "HTTP request failed with error status", + expect.objectContaining({ + method: "GET", + url: "https://example.com/api", + statusCode: 500, + }), + ); + }); + + it("should log aborted request errors", async () => { + const mockLogger = createMockLogger(); + + const abortController = new AbortController(); + abortController.abort(); + + global.fetch = vi.fn().mockRejectedValue(new Error("Aborted")); + + const result = await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + abortSignal: abortController.signal, + maxRetries: 0, + logging: { + level: "error", + logger: mockLogger, + silent: false, + }, + }); + + expect(result.ok).toBe(false); + expect(mockLogger.error).toHaveBeenCalledWith( + "HTTP request was aborted", + expect.objectContaining({ + method: "GET", + url: "https://example.com/api", + }), + ); + }); + + it("should log timeout errors", async () => { + const mockLogger = createMockLogger(); + + const timeoutError = new Error("Request timeout"); + timeoutError.name = "AbortError"; + + global.fetch = vi.fn().mockRejectedValue(timeoutError); + + const result = await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "error", + logger: mockLogger, + silent: false, + }, + }); + + expect(result.ok).toBe(false); + expect(mockLogger.error).toHaveBeenCalledWith( + "HTTP request timed out", + expect.objectContaining({ + method: "GET", + url: "https://example.com/api", + timeoutMs: undefined, + }), + ); + }); + + it("should log unknown errors", async () => { + const mockLogger = createMockLogger(); + + const unknownError = new Error("Unknown error"); + + global.fetch = vi.fn().mockRejectedValue(unknownError); + + const result = await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "error", + logger: mockLogger, + silent: false, + }, + }); + + expect(result.ok).toBe(false); + expect(mockLogger.error).toHaveBeenCalledWith( + "HTTP request failed with error", + expect.objectContaining({ + method: "GET", + url: "https://example.com/api", + errorMessage: "Unknown error", + }), + ); + }); + }); + + describe("Logging with Redaction", () => { + it("should redact sensitive data in error logs", async () => { + const mockLogger = createMockLogger(); + mockErrorResponse({ error: "Unauthorized" }, 401, "Unauthorized"); + + await fetcherImpl({ + url: "https://example.com/api?api_key=secret", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "error", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.error).toHaveBeenCalledWith( + "HTTP request failed with error status", + expect.objectContaining({ + url: "https://example.com/api?api_key=[REDACTED]", + }), + ); + }); + }); + + describe("Different HTTP Methods", () => { + it("should log GET requests", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + method: "GET", + }), + ); + }); + + it("should log POST requests", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse({ data: "test" }, 201, "Created"); + + await fetcherImpl({ + url: "https://example.com/api", + method: "POST", + body: { data: "test" }, + contentType: "application/json", + requestType: "json", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + method: "POST", + }), + ); + }); + + it("should log PUT requests", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "PUT", + body: { data: "test" }, + contentType: "application/json", + requestType: "json", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + method: "PUT", + }), + ); + }); + + it("should log DELETE requests", async () => { + const mockLogger = createMockLogger(); + global.fetch = vi.fn().mockResolvedValue( + new Response(null, { + status: 200, + statusText: "OK", + }), + ); + + await fetcherImpl({ + url: "https://example.com/api", + method: "DELETE", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + method: "DELETE", + }), + ); + }); + }); + + describe("Status Code Logging", () => { + it("should log 2xx success status codes", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse({ data: "test" }, 201, "Created"); + + await fetcherImpl({ + url: "https://example.com/api", + method: "POST", + body: { data: "test" }, + contentType: "application/json", + requestType: "json", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "HTTP request succeeded", + expect.objectContaining({ + statusCode: 201, + }), + ); + }); + + it("should log 3xx redirect status codes as success", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse({ data: "test" }, 301, "Moved Permanently"); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "HTTP request succeeded", + expect.objectContaining({ + statusCode: 301, + }), + ); + }); + }); +}); diff --git a/tests/unit/fetcher/makeRequest.test.ts b/tests/unit/fetcher/makeRequest.test.ts new file mode 100644 index 0000000..ea49466 --- /dev/null +++ b/tests/unit/fetcher/makeRequest.test.ts @@ -0,0 +1,54 @@ +import type { Mock } from "vitest"; +import { makeRequest } from "../../../src/core/fetcher/makeRequest"; + +describe("Test makeRequest", () => { + const mockPostUrl = "https://httpbin.org/post"; + const mockGetUrl = "https://httpbin.org/get"; + const mockHeaders = { "Content-Type": "application/json" }; + const mockBody = JSON.stringify({ key: "value" }); + + let mockFetch: Mock; + + beforeEach(() => { + mockFetch = vi.fn(); + mockFetch.mockResolvedValue(new Response(JSON.stringify({ test: "successful" }), { status: 200 })); + }); + + it("should handle POST request correctly", async () => { + const response = await makeRequest(mockFetch, mockPostUrl, "POST", mockHeaders, mockBody); + const responseBody = await response.json(); + expect(responseBody).toEqual({ test: "successful" }); + expect(mockFetch).toHaveBeenCalledTimes(1); + const [calledUrl, calledOptions] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe(mockPostUrl); + expect(calledOptions).toEqual( + expect.objectContaining({ + method: "POST", + headers: mockHeaders, + body: mockBody, + credentials: undefined, + }), + ); + expect(calledOptions.signal).toBeDefined(); + expect(calledOptions.signal).toBeInstanceOf(AbortSignal); + }); + + it("should handle GET request correctly", async () => { + const response = await makeRequest(mockFetch, mockGetUrl, "GET", mockHeaders, undefined); + const responseBody = await response.json(); + expect(responseBody).toEqual({ test: "successful" }); + expect(mockFetch).toHaveBeenCalledTimes(1); + const [calledUrl, calledOptions] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe(mockGetUrl); + expect(calledOptions).toEqual( + expect.objectContaining({ + method: "GET", + headers: mockHeaders, + body: undefined, + credentials: undefined, + }), + ); + expect(calledOptions.signal).toBeDefined(); + expect(calledOptions.signal).toBeInstanceOf(AbortSignal); + }); +}); diff --git a/tests/unit/fetcher/redacting.test.ts b/tests/unit/fetcher/redacting.test.ts new file mode 100644 index 0000000..d599376 --- /dev/null +++ b/tests/unit/fetcher/redacting.test.ts @@ -0,0 +1,1115 @@ +import { fetcherImpl } from "../../../src/core/fetcher/Fetcher"; + +function createMockLogger() { + return { + debug: vi.fn(), + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), + }; +} + +function mockSuccessResponse(data: unknown = { data: "test" }, status = 200, statusText = "OK") { + global.fetch = vi.fn().mockResolvedValue( + new Response(JSON.stringify(data), { + status, + statusText, + }), + ); +} + +describe("Redacting Logic", () => { + describe("Header Redaction", () => { + it("should redact authorization header", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { Authorization: "Bearer secret-token-12345" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + Authorization: "[REDACTED]", + }), + }), + ); + }); + + it("should redact api-key header (case-insensitive)", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { "X-API-KEY": "secret-api-key" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + "X-API-KEY": "[REDACTED]", + }), + }), + ); + }); + + it("should redact cookie header", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { Cookie: "session=abc123; token=xyz789" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + Cookie: "[REDACTED]", + }), + }), + ); + }); + + it("should redact x-auth-token header", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { "x-auth-token": "auth-token-12345" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + "x-auth-token": "[REDACTED]", + }), + }), + ); + }); + + it("should redact proxy-authorization header", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { "Proxy-Authorization": "Basic credentials" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + "Proxy-Authorization": "[REDACTED]", + }), + }), + ); + }); + + it("should redact x-csrf-token header", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { "X-CSRF-Token": "csrf-token-abc" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + "X-CSRF-Token": "[REDACTED]", + }), + }), + ); + }); + + it("should redact www-authenticate header", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { "WWW-Authenticate": "Bearer realm=example" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + "WWW-Authenticate": "[REDACTED]", + }), + }), + ); + }); + + it("should redact x-session-token header", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { "X-Session-Token": "session-token-xyz" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + "X-Session-Token": "[REDACTED]", + }), + }), + ); + }); + + it("should not redact non-sensitive headers", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { + "Content-Type": "application/json", + "User-Agent": "Test/1.0", + Accept: "application/json", + }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + "Content-Type": "application/json", + "User-Agent": "Test/1.0", + Accept: "application/json", + }), + }), + ); + }); + + it("should redact multiple sensitive headers at once", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + headers: { + Authorization: "Bearer token", + "X-API-Key": "api-key", + Cookie: "session=123", + "Content-Type": "application/json", + }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + headers: expect.toContainHeaders({ + Authorization: "[REDACTED]", + "X-API-Key": "[REDACTED]", + Cookie: "[REDACTED]", + "Content-Type": "application/json", + }), + }), + ); + }); + }); + + describe("Response Header Redaction", () => { + it("should redact Set-Cookie in response headers", async () => { + const mockLogger = createMockLogger(); + + const mockHeaders = new Headers(); + mockHeaders.set("Set-Cookie", "session=abc123; HttpOnly; Secure"); + mockHeaders.set("Content-Type", "application/json"); + + global.fetch = vi.fn().mockResolvedValue( + new Response(JSON.stringify({ data: "test" }), { + status: 200, + statusText: "OK", + headers: mockHeaders, + }), + ); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "HTTP request succeeded", + expect.objectContaining({ + responseHeaders: expect.toContainHeaders({ + "set-cookie": "[REDACTED]", + "content-type": "application/json", + }), + }), + ); + }); + + it("should redact authorization in response headers", async () => { + const mockLogger = createMockLogger(); + + const mockHeaders = new Headers(); + mockHeaders.set("Authorization", "Bearer token-123"); + mockHeaders.set("Content-Type", "application/json"); + + global.fetch = vi.fn().mockResolvedValue( + new Response(JSON.stringify({ data: "test" }), { + status: 200, + statusText: "OK", + headers: mockHeaders, + }), + ); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "HTTP request succeeded", + expect.objectContaining({ + responseHeaders: expect.toContainHeaders({ + authorization: "[REDACTED]", + "content-type": "application/json", + }), + }), + ); + }); + + it("should redact response headers in error responses", async () => { + const mockLogger = createMockLogger(); + + const mockHeaders = new Headers(); + mockHeaders.set("WWW-Authenticate", "Bearer realm=example"); + mockHeaders.set("Content-Type", "application/json"); + + global.fetch = vi.fn().mockResolvedValue( + new Response(JSON.stringify({ error: "Unauthorized" }), { + status: 401, + statusText: "Unauthorized", + headers: mockHeaders, + }), + ); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "error", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.error).toHaveBeenCalledWith( + "HTTP request failed with error status", + expect.objectContaining({ + responseHeaders: expect.toContainHeaders({ + "www-authenticate": "[REDACTED]", + "content-type": "application/json", + }), + }), + ); + }); + }); + + describe("Query Parameter Redaction", () => { + it("should redact api_key query parameter", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { api_key: "secret-key" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + api_key: "[REDACTED]", + }), + }), + ); + }); + + it("should redact token query parameter", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { token: "secret-token" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + token: "[REDACTED]", + }), + }), + ); + }); + + it("should redact access_token query parameter", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { access_token: "secret-access-token" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + access_token: "[REDACTED]", + }), + }), + ); + }); + + it("should redact password query parameter", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { password: "secret-password" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + password: "[REDACTED]", + }), + }), + ); + }); + + it("should redact secret query parameter", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { secret: "secret-value" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + secret: "[REDACTED]", + }), + }), + ); + }); + + it("should redact session_id query parameter", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { session_id: "session-123" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + session_id: "[REDACTED]", + }), + }), + ); + }); + + it("should not redact non-sensitive query parameters", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { + page: "1", + limit: "10", + sort: "name", + }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + page: "1", + limit: "10", + sort: "name", + }), + }), + ); + }); + + it("should not redact parameters containing 'auth' substring like 'author'", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { + author: "john", + authenticate: "false", + authorization_level: "user", + }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + author: "john", + authenticate: "false", + authorization_level: "user", + }), + }), + ); + }); + + it("should handle undefined query parameters", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: undefined, + }), + ); + }); + + it("should redact case-insensitive query parameters", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryParameters: { API_KEY: "secret-key", Token: "secret-token" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + queryParameters: expect.objectContaining({ + API_KEY: "[REDACTED]", + Token: "[REDACTED]", + }), + }), + ); + }); + }); + + describe("URL Redaction", () => { + it("should redact credentials in URL", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://user:password@example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://[REDACTED]@example.com/api", + }), + ); + }); + + it("should redact api_key in query string", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?api_key=secret-key&page=1", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?api_key=[REDACTED]&page=1", + }), + ); + }); + + it("should redact token in query string", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?token=secret-token", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?token=[REDACTED]", + }), + ); + }); + + it("should redact password in query string", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?username=user&password=secret", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?username=user&password=[REDACTED]", + }), + ); + }); + + it("should not redact non-sensitive query strings", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?page=1&limit=10&sort=name", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?page=1&limit=10&sort=name", + }), + ); + }); + + it("should not redact URL parameters containing 'auth' substring like 'author'", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?author=john&authenticate=false&page=1", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?author=john&authenticate=false&page=1", + }), + ); + }); + + it("should handle URL with fragment", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?token=secret#section", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?token=[REDACTED]#section", + }), + ); + }); + + it("should redact URL-encoded query parameters", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?api%5Fkey=secret", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?api%5Fkey=[REDACTED]", + }), + ); + }); + + it("should handle URL without query string", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api", + }), + ); + }); + + it("should handle empty query string", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?", + }), + ); + }); + + it("should redact multiple sensitive parameters in URL", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?api_key=secret1&token=secret2&page=1", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?api_key=[REDACTED]&token=[REDACTED]&page=1", + }), + ); + }); + + it("should redact both credentials and query parameters", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://user:pass@example.com/api?token=secret", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://[REDACTED]@example.com/api?token=[REDACTED]", + }), + ); + }); + + it("should use fast path for URLs without sensitive keywords", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?page=1&limit=10&sort=name&filter=value", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?page=1&limit=10&sort=name&filter=value", + }), + ); + }); + + it("should handle query parameter without value", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?flag&token=secret", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?flag&token=[REDACTED]", + }), + ); + }); + + it("should handle URL with multiple @ symbols in credentials", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://user@example.com:pass@host.com/api", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://[REDACTED]@host.com/api", + }), + ); + }); + + it("should handle URL with @ in query parameter but not in credentials", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api?email=user@example.com", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?email=user@example.com", + }), + ); + }); + + it("should handle URL with both credentials and @ in path", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://user:pass@example.com/users/@username", + method: "GET", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://[REDACTED]@example.com/users/@username", + }), + ); + }); + }); +}); diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts new file mode 100644 index 0000000..d226613 --- /dev/null +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -0,0 +1,230 @@ +import type { Mock, MockInstance } from "vitest"; +import { requestWithRetries } from "../../../src/core/fetcher/requestWithRetries"; + +describe("requestWithRetries", () => { + let mockFetch: Mock; + let originalMathRandom: typeof Math.random; + let setTimeoutSpy: MockInstance; + + beforeEach(() => { + mockFetch = vi.fn(); + originalMathRandom = Math.random; + + Math.random = vi.fn(() => 0.5); + + vi.useFakeTimers({ + toFake: [ + "setTimeout", + "clearTimeout", + "setInterval", + "clearInterval", + "setImmediate", + "clearImmediate", + "Date", + "performance", + "requestAnimationFrame", + "cancelAnimationFrame", + "requestIdleCallback", + "cancelIdleCallback", + ], + }); + }); + + afterEach(() => { + Math.random = originalMathRandom; + vi.clearAllMocks(); + vi.clearAllTimers(); + }); + + it("should retry on retryable status codes", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + const retryableStatuses = [408, 429, 500, 502]; + let callCount = 0; + + mockFetch.mockImplementation(async () => { + if (callCount < retryableStatuses.length) { + return new Response("", { status: retryableStatuses[callCount++] }); + } + return new Response("", { status: 200 }); + }); + + const responsePromise = requestWithRetries(() => mockFetch(), retryableStatuses.length); + await vi.runAllTimersAsync(); + const response = await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(retryableStatuses.length + 1); + expect(response.status).toBe(200); + }); + + it("should respect maxRetries limit", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + const maxRetries = 2; + mockFetch.mockResolvedValue(new Response("", { status: 500 })); + + const responsePromise = requestWithRetries(() => mockFetch(), maxRetries); + await vi.runAllTimersAsync(); + const response = await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(maxRetries + 1); + expect(response.status).toBe(500); + }); + + it("should not retry on success status codes", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + const successStatuses = [200, 201, 202]; + + for (const status of successStatuses) { + mockFetch.mockReset(); + setTimeoutSpy.mockClear(); + mockFetch.mockResolvedValueOnce(new Response("", { status })); + + const responsePromise = requestWithRetries(() => mockFetch(), 3); + await vi.runAllTimersAsync(); + await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(1); + expect(setTimeoutSpy).not.toHaveBeenCalled(); + } + }); + + interface RetryHeaderTestCase { + description: string; + headerName: string; + headerValue: string | (() => string); + expectedDelayMin: number; + expectedDelayMax: number; + } + + const retryHeaderTests: RetryHeaderTestCase[] = [ + { + description: "should respect retry-after header with seconds value", + headerName: "retry-after", + headerValue: "5", + expectedDelayMin: 4000, + expectedDelayMax: 6000, + }, + { + description: "should respect retry-after header with HTTP date value", + headerName: "retry-after", + headerValue: () => new Date(Date.now() + 3000).toUTCString(), + expectedDelayMin: 2000, + expectedDelayMax: 4000, + }, + { + description: "should respect x-ratelimit-reset header", + headerName: "x-ratelimit-reset", + headerValue: () => Math.floor((Date.now() + 4000) / 1000).toString(), + expectedDelayMin: 3000, + expectedDelayMax: 6000, + }, + ]; + + retryHeaderTests.forEach(({ description, headerName, headerValue, expectedDelayMin, expectedDelayMax }) => { + it(description, async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + const value = typeof headerValue === "function" ? headerValue() : headerValue; + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ [headerName]: value }), + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await vi.runAllTimersAsync(); + const response = await responsePromise; + + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); + const actualDelay = setTimeoutSpy.mock.calls[0][1]; + expect(actualDelay).toBeGreaterThan(expectedDelayMin); + expect(actualDelay).toBeLessThan(expectedDelayMax); + expect(response.status).toBe(200); + }); + }); + + it("should apply correct exponential backoff with jitter", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch.mockResolvedValue(new Response("", { status: 500 })); + const maxRetries = 3; + const expectedDelays = [1000, 2000, 4000]; + + const responsePromise = requestWithRetries(() => mockFetch(), maxRetries); + await vi.runAllTimersAsync(); + await responsePromise; + + expect(setTimeoutSpy).toHaveBeenCalledTimes(expectedDelays.length); + + expectedDelays.forEach((delay, index) => { + expect(setTimeoutSpy).toHaveBeenNthCalledWith(index + 1, expect.any(Function), delay); + }); + + expect(mockFetch).toHaveBeenCalledTimes(maxRetries + 1); + }); + + it("should handle concurrent retries independently", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce(new Response("", { status: 500 })) + .mockResolvedValueOnce(new Response("", { status: 500 })) + .mockResolvedValueOnce(new Response("", { status: 200 })) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const promise1 = requestWithRetries(() => mockFetch(), 1); + const promise2 = requestWithRetries(() => mockFetch(), 1); + + await vi.runAllTimersAsync(); + const [response1, response2] = await Promise.all([promise1, promise2]); + + expect(response1.status).toBe(200); + expect(response2.status).toBe(200); + }); + + it("should cap delay at MAX_RETRY_DELAY for large header values", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce( + new Response("", { + status: 429, + headers: new Headers({ "retry-after": "120" }), // 120 seconds = 120000ms > MAX_RETRY_DELAY (60000ms) + }), + ) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 1); + await vi.runAllTimersAsync(); + const response = await responsePromise; + + expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 60000); + expect(response.status).toBe(200); + }); +}); diff --git a/tests/unit/fetcher/signals.test.ts b/tests/unit/fetcher/signals.test.ts new file mode 100644 index 0000000..d7b6d1e --- /dev/null +++ b/tests/unit/fetcher/signals.test.ts @@ -0,0 +1,69 @@ +import { anySignal, getTimeoutSignal } from "../../../src/core/fetcher/signals"; + +describe("Test getTimeoutSignal", () => { + beforeEach(() => { + vi.useFakeTimers(); + }); + + afterEach(() => { + vi.useRealTimers(); + }); + + it("should return an object with signal and abortId", () => { + const { signal, abortId } = getTimeoutSignal(1000); + + expect(signal).toBeDefined(); + expect(abortId).toBeDefined(); + expect(signal).toBeInstanceOf(AbortSignal); + expect(signal.aborted).toBe(false); + }); + + it("should create a signal that aborts after the specified timeout", () => { + const timeoutMs = 5000; + const { signal } = getTimeoutSignal(timeoutMs); + + expect(signal.aborted).toBe(false); + + vi.advanceTimersByTime(timeoutMs - 1); + expect(signal.aborted).toBe(false); + + vi.advanceTimersByTime(1); + expect(signal.aborted).toBe(true); + }); +}); + +describe("Test anySignal", () => { + it("should return an AbortSignal", () => { + const signal = anySignal(new AbortController().signal); + expect(signal).toBeInstanceOf(AbortSignal); + }); + + it("should abort when any of the input signals is aborted", () => { + const controller1 = new AbortController(); + const controller2 = new AbortController(); + const signal = anySignal(controller1.signal, controller2.signal); + + expect(signal.aborted).toBe(false); + controller1.abort(); + expect(signal.aborted).toBe(true); + }); + + it("should handle an array of signals", () => { + const controller1 = new AbortController(); + const controller2 = new AbortController(); + const signal = anySignal([controller1.signal, controller2.signal]); + + expect(signal.aborted).toBe(false); + controller2.abort(); + expect(signal.aborted).toBe(true); + }); + + it("should abort immediately if one of the input signals is already aborted", () => { + const controller1 = new AbortController(); + const controller2 = new AbortController(); + controller1.abort(); + + const signal = anySignal(controller1.signal, controller2.signal); + expect(signal.aborted).toBe(true); + }); +}); diff --git a/tests/unit/fetcher/test-file.txt b/tests/unit/fetcher/test-file.txt new file mode 100644 index 0000000..c66d471 --- /dev/null +++ b/tests/unit/fetcher/test-file.txt @@ -0,0 +1 @@ +This is a test file! diff --git a/tests/unit/file/file.test.ts b/tests/unit/file/file.test.ts new file mode 100644 index 0000000..d7c4570 --- /dev/null +++ b/tests/unit/file/file.test.ts @@ -0,0 +1,498 @@ +import fs from "fs"; +import { join } from "path"; +import { Readable } from "stream"; +import { toBinaryUploadRequest, type Uploadable } from "../../../src/core/file/index"; + +describe("toBinaryUploadRequest", () => { + const TEST_FILE_PATH = join(__dirname, "..", "test-file.txt"); + + beforeEach(() => { + vi.clearAllMocks(); + }); + + describe("Buffer input", () => { + it("should handle Buffer with all metadata", async () => { + const buffer = Buffer.from("test data"); + const input: Uploadable.WithMetadata = { + data: buffer, + filename: "test.txt", + contentType: "text/plain", + contentLength: 42, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test.txt"', + "Content-Type": "text/plain", + "Content-Length": "42", + }); + }); + + it("should handle Buffer without metadata", async () => { + const buffer = Buffer.from("test data"); + const input: Uploadable.WithMetadata = { + data: buffer, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Length": "9", // buffer.length + }); + }); + + it("should handle Buffer passed directly", async () => { + const buffer = Buffer.from("test data"); + + const result = await toBinaryUploadRequest(buffer); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Length": "9", // buffer.length + }); + }); + }); + + describe("ArrayBuffer input", () => { + it("should handle ArrayBuffer with metadata", async () => { + const arrayBuffer = new ArrayBuffer(10); + const input: Uploadable.WithMetadata = { + data: arrayBuffer, + filename: "data.bin", + contentType: "application/octet-stream", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(arrayBuffer); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="data.bin"', + "Content-Type": "application/octet-stream", + "Content-Length": "10", // arrayBuffer.byteLength + }); + }); + + it("should handle ArrayBuffer passed directly", async () => { + const arrayBuffer = new ArrayBuffer(10); + + const result = await toBinaryUploadRequest(arrayBuffer); + + expect(result.body).toBe(arrayBuffer); + expect(result.headers).toEqual({ + "Content-Length": "10", // arrayBuffer.byteLength + }); + }); + }); + + describe("Uint8Array input", () => { + it("should handle Uint8Array with metadata", async () => { + const uint8Array = new Uint8Array([1, 2, 3, 4, 5]); + const input: Uploadable.WithMetadata = { + data: uint8Array, + filename: "bytes.bin", + contentType: "application/octet-stream", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(uint8Array); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="bytes.bin"', + "Content-Type": "application/octet-stream", + "Content-Length": "5", // uint8Array.byteLength + }); + }); + + it("should handle Uint8Array passed directly", async () => { + const uint8Array = new Uint8Array([1, 2, 3, 4, 5]); + + const result = await toBinaryUploadRequest(uint8Array); + + expect(result.body).toBe(uint8Array); + expect(result.headers).toEqual({ + "Content-Length": "5", // uint8Array.byteLength + }); + }); + }); + + describe("Blob input", () => { + it("should handle Blob with metadata", async () => { + const blob = new Blob(["test content"], { type: "text/plain" }); + const input: Uploadable.WithMetadata = { + data: blob, + filename: "override.txt", + contentType: "text/html", // Override blob's type + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(blob); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="override.txt"', + "Content-Type": "text/html", // Should use provided contentType + "Content-Length": "12", // blob.size + }); + }); + + it("should handle Blob with intrinsic type", async () => { + const blob = new Blob(["test content"], { type: "application/json" }); + const input: Uploadable.WithMetadata = { + data: blob, + filename: "data.json", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(blob); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="data.json"', + "Content-Type": "application/json", // Should use blob's type + "Content-Length": "12", // blob.size + }); + }); + + it("should handle Blob passed directly", async () => { + const blob = new Blob(["test content"], { type: "text/plain" }); + + const result = await toBinaryUploadRequest(blob); + + expect(result.body).toBe(blob); + expect(result.headers).toEqual({ + "Content-Type": "text/plain", // Should use blob's type + "Content-Length": "12", // blob.size + }); + }); + }); + + describe("File input", () => { + it("should handle File with metadata", async () => { + const file = new File(["file content"], "original.txt", { type: "text/plain" }); + const input: Uploadable.WithMetadata = { + data: file, + filename: "renamed.txt", + contentType: "text/html", // Override file's type + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(file); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="renamed.txt"', + "Content-Type": "text/html", // Should use provided contentType + "Content-Length": "12", // file.size + }); + }); + + it("should handle File with intrinsic properties", async () => { + const file = new File(["file content"], "test.json", { type: "application/json" }); + const input: Uploadable.WithMetadata = { + data: file, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(file); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test.json"', // Should use file's name + "Content-Type": "application/json", // Should use file's type + "Content-Length": "12", // file.size + }); + }); + + it("should handle File passed directly", async () => { + const file = new File(["file content"], "direct.txt", { type: "text/plain" }); + + const result = await toBinaryUploadRequest(file); + + expect(result.body).toBe(file); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="direct.txt"', + "Content-Type": "text/plain", + "Content-Length": "12", // file.size + }); + }); + }); + + describe("ReadableStream input", () => { + it("should handle ReadableStream with metadata", async () => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("stream data")); + controller.close(); + }, + }); + const input: Uploadable.WithMetadata = { + data: stream, + filename: "stream.txt", + contentType: "text/plain", + contentLength: 100, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(stream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="stream.txt"', + "Content-Type": "text/plain", + "Content-Length": "100", // Should use provided contentLength + }); + }); + + it("should handle ReadableStream without size", async () => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("stream data")); + controller.close(); + }, + }); + const input: Uploadable.WithMetadata = { + data: stream, + filename: "stream.txt", + contentType: "text/plain", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(stream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="stream.txt"', + "Content-Type": "text/plain", + // No Content-Length header since it cannot be determined from ReadableStream + }); + }); + + it("should handle ReadableStream passed directly", async () => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("stream data")); + controller.close(); + }, + }); + + const result = await toBinaryUploadRequest(stream); + + expect(result.body).toBe(stream); + expect(result.headers).toEqual({ + // No headers since no metadata provided and cannot be determined + }); + }); + }); + + describe("Node.js Readable stream input", () => { + it("should handle Readable stream with metadata", async () => { + const readable = new Readable({ + read() { + this.push("readable data"); + this.push(null); + }, + }); + const input: Uploadable.WithMetadata = { + data: readable, + filename: "readable.txt", + contentType: "text/plain", + contentLength: 50, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(readable); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="readable.txt"', + "Content-Type": "text/plain", + "Content-Length": "50", // Should use provided contentLength + }); + }); + + it("should handle Readable stream without size", async () => { + const readable = new Readable({ + read() { + this.push("readable data"); + this.push(null); + }, + }); + const input: Uploadable.WithMetadata = { + data: readable, + filename: "readable.txt", + contentType: "text/plain", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(readable); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="readable.txt"', + "Content-Type": "text/plain", + // No Content-Length header since it cannot be determined from Readable + }); + }); + + it("should handle Readable stream passed directly", async () => { + const readable = new Readable({ + read() { + this.push("readable data"); + this.push(null); + }, + }); + + const result = await toBinaryUploadRequest(readable); + + expect(result.body).toBe(readable); + expect(result.headers).toEqual({ + // No headers since no metadata provided and cannot be determined + }); + }); + }); + + describe("File path input (FromPath type)", () => { + it("should handle file path with all metadata", async () => { + const input: Uploadable.FromPath = { + path: TEST_FILE_PATH, + filename: "custom.txt", + contentType: "text/html", + contentLength: 42, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBeInstanceOf(fs.ReadStream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="custom.txt"', + "Content-Type": "text/html", + "Content-Length": "42", // Should use provided contentLength + }); + }); + + it("should handle file path with minimal metadata", async () => { + const input: Uploadable.FromPath = { + path: TEST_FILE_PATH, + contentType: "text/plain", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBeInstanceOf(fs.ReadStream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path + "Content-Type": "text/plain", + "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + }); + }); + + it("should handle file path with no metadata", async () => { + const input: Uploadable.FromPath = { + path: TEST_FILE_PATH, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBeInstanceOf(fs.ReadStream); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path + "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + }); + }); + }); + + describe("ArrayBufferView input", () => { + it("should handle ArrayBufferView with metadata", async () => { + const arrayBuffer = new ArrayBuffer(10); + const arrayBufferView = new Int8Array(arrayBuffer); + const input: Uploadable.WithMetadata = { + data: arrayBufferView, + filename: "view.bin", + contentType: "application/octet-stream", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(arrayBufferView); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="view.bin"', + "Content-Type": "application/octet-stream", + "Content-Length": "10", // arrayBufferView.byteLength + }); + }); + + it("should handle ArrayBufferView passed directly", async () => { + const arrayBuffer = new ArrayBuffer(10); + const arrayBufferView = new Int8Array(arrayBuffer); + + const result = await toBinaryUploadRequest(arrayBufferView); + + expect(result.body).toBe(arrayBufferView); + expect(result.headers).toEqual({ + "Content-Length": "10", // arrayBufferView.byteLength + }); + }); + }); + + describe("Edge cases", () => { + it("should handle empty headers when no metadata is available", async () => { + const buffer = Buffer.from(""); + const input: Uploadable.WithMetadata = { + data: buffer, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Length": "0", + }); + }); + + it("should handle zero contentLength", async () => { + const buffer = Buffer.from("test"); + const input: Uploadable.WithMetadata = { + data: buffer, + contentLength: 0, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Length": "0", // Should use provided 0 + }); + }); + + it("should handle null filename", async () => { + const buffer = Buffer.from("test"); + const input: Uploadable.WithMetadata = { + data: buffer, + filename: undefined, + contentType: "text/plain", + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Type": "text/plain", + "Content-Length": "4", + // No Content-Disposition since filename is undefined + }); + }); + + it("should handle null contentType", async () => { + const buffer = Buffer.from("test"); + const input: Uploadable.WithMetadata = { + data: buffer, + filename: "test.txt", + contentType: undefined, + }; + + const result = await toBinaryUploadRequest(input); + + expect(result.body).toBe(buffer); + expect(result.headers).toEqual({ + "Content-Disposition": 'attachment; filename="test.txt"', + "Content-Length": "4", + // No Content-Type since contentType is undefined + }); + }); + }); +}); diff --git a/tests/unit/form-data-utils/encodeAsFormParameter.test.ts b/tests/unit/form-data-utils/encodeAsFormParameter.test.ts new file mode 100644 index 0000000..d4b0c45 --- /dev/null +++ b/tests/unit/form-data-utils/encodeAsFormParameter.test.ts @@ -0,0 +1,344 @@ +import { encodeAsFormParameter } from "../../../src/core/form-data-utils/encodeAsFormParameter"; + +describe("encodeAsFormParameter", () => { + describe("Basic functionality", () => { + it("should return empty object for null/undefined", () => { + expect(encodeAsFormParameter(null)).toEqual({}); + expect(encodeAsFormParameter(undefined)).toEqual({}); + }); + + it("should return empty object for primitive values", () => { + expect(encodeAsFormParameter("hello")).toEqual({}); + expect(encodeAsFormParameter(42)).toEqual({}); + expect(encodeAsFormParameter(true)).toEqual({}); + }); + + it("should handle simple key-value pairs", () => { + const obj = { name: "John", age: 30 }; + expect(encodeAsFormParameter(obj)).toEqual({ + name: "John", + age: "30", + }); + }); + + it("should handle empty objects", () => { + expect(encodeAsFormParameter({})).toEqual({}); + }); + }); + + describe("Array handling", () => { + it("should handle arrays with indices format (default)", () => { + const obj = { items: ["a", "b", "c"] }; + expect(encodeAsFormParameter(obj)).toEqual({ + "items[0]": "a", + "items[1]": "b", + "items[2]": "c", + }); + }); + + it("should handle empty arrays", () => { + const obj = { items: [] }; + expect(encodeAsFormParameter(obj)).toEqual({}); + }); + + it("should handle arrays with mixed types", () => { + const obj = { mixed: ["string", 42, true, false] }; + expect(encodeAsFormParameter(obj)).toEqual({ + "mixed[0]": "string", + "mixed[1]": "42", + "mixed[2]": "true", + "mixed[3]": "false", + }); + }); + + it("should handle arrays with objects", () => { + const obj = { users: [{ name: "John" }, { name: "Jane" }] }; + expect(encodeAsFormParameter(obj)).toEqual({ + "users[0][name]": "John", + "users[1][name]": "Jane", + }); + }); + + it("should handle arrays with null/undefined values", () => { + const obj = { items: ["a", null, "c", undefined, "e"] }; + expect(encodeAsFormParameter(obj)).toEqual({ + "items[0]": "a", + "items[1]": "", + "items[2]": "c", + "items[4]": "e", + }); + }); + }); + + describe("Nested objects", () => { + it("should handle nested objects", () => { + const obj = { user: { name: "John", age: 30 } }; + expect(encodeAsFormParameter(obj)).toEqual({ + "user[name]": "John", + "user[age]": "30", + }); + }); + + it("should handle deeply nested objects", () => { + const obj = { user: { profile: { name: "John", settings: { theme: "dark" } } } }; + expect(encodeAsFormParameter(obj)).toEqual({ + "user[profile][name]": "John", + "user[profile][settings][theme]": "dark", + }); + }); + + it("should handle empty nested objects", () => { + const obj = { user: {} }; + expect(encodeAsFormParameter(obj)).toEqual({}); + }); + }); + + describe("Special characters and encoding", () => { + it("should not encode values (encode: false is used)", () => { + const obj = { name: "John Doe", email: "john@example.com" }; + expect(encodeAsFormParameter(obj)).toEqual({ + name: "John Doe", + email: "john@example.com", + }); + }); + + it("should not encode special characters in keys", () => { + const obj = { "user name": "John", "email[primary]": "john@example.com" }; + expect(encodeAsFormParameter(obj)).toEqual({ + "user name": "John", + "email[primary]": "john@example.com", + }); + }); + + it("should handle values that contain special characters", () => { + const obj = { + query: "search term with spaces", + filter: "category:electronics", + }; + expect(encodeAsFormParameter(obj)).toEqual({ + query: "search term with spaces", + filter: "category:electronics", + }); + }); + + it("should handle ampersand and equals characters (edge case)", () => { + // Note: Values containing & and = may be problematic because + // encodeAsFormParameter splits on these characters when parsing the stringified result + const obj = { + message: "Hello & welcome", + equation: "x = y + z", + }; + // This demonstrates the limitation - ampersands and equals signs in values + // will cause the parameter to be split incorrectly + const result = encodeAsFormParameter(obj); + + // We expect this to be parsed incorrectly due to the implementation + expect(result.message).toBe("Hello "); + expect(result[" welcome"]).toBeUndefined(); + expect(result.equation).toBe("x "); + expect(result[" y + z"]).toBeUndefined(); + }); + }); + + describe("Form data specific scenarios", () => { + it("should handle file upload metadata", () => { + const metadata = { + file: { + name: "document.pdf", + size: 1024, + type: "application/pdf", + }, + options: { + compress: true, + quality: 0.8, + }, + }; + expect(encodeAsFormParameter(metadata)).toEqual({ + "file[name]": "document.pdf", + "file[size]": "1024", + "file[type]": "application/pdf", + "options[compress]": "true", + "options[quality]": "0.8", + }); + }); + + it("should handle form validation data", () => { + const formData = { + fields: ["name", "email", "phone"], + validation: { + required: ["name", "email"], + patterns: { + email: "^[^@]+@[^@]+\\.[^@]+$", + phone: "^\\+?[1-9]\\d{1,14}$", + }, + }, + }; + expect(encodeAsFormParameter(formData)).toEqual({ + "fields[0]": "name", + "fields[1]": "email", + "fields[2]": "phone", + "validation[required][0]": "name", + "validation[required][1]": "email", + "validation[patterns][email]": "^[^@]+@[^@]+\\.[^@]+$", + "validation[patterns][phone]": "^\\+?[1-9]\\d{1,14}$", + }); + }); + + it("should handle search/filter parameters", () => { + const searchParams = { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], + }, + }, + sort: { field: "name", direction: "asc" }, + pagination: { page: 1, limit: 20 }, + }; + expect(encodeAsFormParameter(searchParams)).toEqual({ + "filters[status][0]": "active", + "filters[status][1]": "pending", + "filters[category][type]": "electronics", + "filters[category][subcategories][0]": "phones", + "filters[category][subcategories][1]": "laptops", + "sort[field]": "name", + "sort[direction]": "asc", + "pagination[page]": "1", + "pagination[limit]": "20", + }); + }); + }); + + describe("Edge cases", () => { + it("should handle boolean values", () => { + const obj = { enabled: true, disabled: false }; + expect(encodeAsFormParameter(obj)).toEqual({ + enabled: "true", + disabled: "false", + }); + }); + + it("should handle empty strings", () => { + const obj = { name: "", description: "test" }; + expect(encodeAsFormParameter(obj)).toEqual({ + name: "", + description: "test", + }); + }); + + it("should handle zero values", () => { + const obj = { count: 0, price: 0.0 }; + expect(encodeAsFormParameter(obj)).toEqual({ + count: "0", + price: "0", + }); + }); + + it("should handle numeric keys", () => { + const obj = { "0": "zero", "1": "one" }; + expect(encodeAsFormParameter(obj)).toEqual({ + "0": "zero", + "1": "one", + }); + }); + + it("should handle objects with null/undefined values", () => { + const obj = { name: "John", age: null, email: undefined, active: true }; + expect(encodeAsFormParameter(obj)).toEqual({ + name: "John", + age: "", + active: "true", + }); + }); + }); + + describe("Integration with form submission", () => { + it("should produce form-compatible key-value pairs", () => { + const formObject = { + username: "john_doe", + preferences: { + theme: "dark", + notifications: ["email", "push"], + settings: { + autoSave: true, + timeout: 300, + }, + }, + }; + + const result = encodeAsFormParameter(formObject); + + // Verify all values are strings (as required for form data) + Object.values(result).forEach((value) => { + expect(typeof value).toBe("string"); + }); + + // Verify the structure can be reconstructed + expect(result).toEqual({ + username: "john_doe", + "preferences[theme]": "dark", + "preferences[notifications][0]": "email", + "preferences[notifications][1]": "push", + "preferences[settings][autoSave]": "true", + "preferences[settings][timeout]": "300", + }); + }); + + it("should handle complex nested arrays for API parameters", () => { + const apiParams = { + query: { + filters: [ + { field: "status", operator: "eq", value: "active" }, + { field: "created", operator: "gte", value: "2023-01-01" }, + ], + sort: [ + { field: "name", direction: "asc" }, + { field: "created", direction: "desc" }, + ], + }, + }; + + const result = encodeAsFormParameter(apiParams); + expect(result).toEqual({ + "query[filters][0][field]": "status", + "query[filters][0][operator]": "eq", + "query[filters][0][value]": "active", + "query[filters][1][field]": "created", + "query[filters][1][operator]": "gte", + "query[filters][1][value]": "2023-01-01", + "query[sort][0][field]": "name", + "query[sort][0][direction]": "asc", + "query[sort][1][field]": "created", + "query[sort][1][direction]": "desc", + }); + }); + }); + + describe("Error cases and malformed input", () => { + it("should handle circular references gracefully", () => { + const obj: any = { name: "test" }; + obj.self = obj; + + // This will throw a RangeError due to stack overflow - this is expected behavior + expect(() => encodeAsFormParameter(obj)).toThrow("Maximum call stack size exceeded"); + }); + + it("should handle very deeply nested objects", () => { + let deepObj: any = { value: "deep" }; + for (let i = 0; i < 100; i++) { + deepObj = { level: deepObj }; + } + + expect(() => encodeAsFormParameter(deepObj)).not.toThrow(); + const result = encodeAsFormParameter(deepObj); + expect(Object.keys(result).length).toBeGreaterThan(0); + }); + + it("should handle empty string splitting edge case", () => { + // Test what happens when qs returns an empty string + const result = encodeAsFormParameter({}); + expect(result).toEqual({}); + }); + }); +}); diff --git a/tests/unit/form-data-utils/formDataWrapper.test.ts b/tests/unit/form-data-utils/formDataWrapper.test.ts new file mode 100644 index 0000000..4770508 --- /dev/null +++ b/tests/unit/form-data-utils/formDataWrapper.test.ts @@ -0,0 +1,346 @@ +import { Blob, File } from "buffer"; +import { join } from "path"; +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import { Readable } from "stream"; +import { FormDataWrapper, newFormData } from "../../../src/core/form-data-utils/FormDataWrapper"; + +// Helper function to serialize FormData to string for inspection +async function serializeFormData(formData: FormData): Promise { + const request = new Request("http://localhost", { + method: "POST", + body: formData, + }); + + const buffer = await request.arrayBuffer(); + return new TextDecoder().decode(buffer); +} + +describe("FormDataWrapper", () => { + let formData: FormDataWrapper; + + beforeEach(async () => { + formData = new FormDataWrapper(); + await formData.setup(); + }); + + it("Upload file by path", async () => { + await formData.appendFile("file", { + path: join(__dirname, "..", "test-file.txt"), + }); + + const serialized = await serializeFormData(formData.getRequest().body); + + expect(serialized).toContain('Content-Disposition: form-data; name="file"'); + expect(serialized).toContain('filename="test-file.txt"'); + expect(serialized).toContain("This is a test file!"); + }); + + it("Upload file by path with filename", async () => { + await formData.appendFile("file", { + path: join(__dirname, "..", "test-file.txt"), + filename: "custom-file.txt", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + + expect(serialized).toContain('Content-Disposition: form-data; name="file"'); + expect(serialized).toContain('filename="custom-file.txt"'); + expect(serialized).toContain("This is a test file!"); + }); + + describe("Stream handling", () => { + it("serializes Node.js Readable stream with filename", async () => { + const stream = Readable.from(["file content"]); + await formData.appendFile("file", { + data: stream, + filename: "testfile.txt", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + + expect(serialized).toContain('Content-Disposition: form-data; name="file"'); + expect(serialized).toContain('filename="testfile.txt"'); + expect(serialized).toContain("file content"); + }); + + it("auto-detects filename from stream path property", async () => { + const stream = Readable.from(["file content"]); + (stream as { path?: string }).path = "/test/path/testfile.txt"; + + await formData.appendFile("file", stream); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="testfile.txt"'); + }); + + it("handles Windows-style paths", async () => { + const stream = Readable.from(["file content"]); + (stream as { path?: string }).path = "C:\\test\\path\\testfile.txt"; + + await formData.appendFile("file", stream); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="testfile.txt"'); + }); + + it("handles empty streams", async () => { + const stream = Readable.from([]); + await formData.appendFile("file", { + data: stream, + filename: "empty.txt", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="empty.txt"'); + expect(serialized).toMatch(/------formdata-undici-\w+|------WebKitFormBoundary\w+/); + }); + + it("serializes Web ReadableStream with filename", async () => { + const stream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("web stream content")); + controller.close(); + }, + }); + + await formData.appendFile("file", { + data: stream, + filename: "webstream.txt", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="webstream.txt"'); + expect(serialized).toContain("web stream content"); + }); + + it("handles empty Web ReadableStream", async () => { + const stream = new ReadableStream({ + start(controller) { + controller.close(); + }, + }); + + await formData.appendFile("file", { + data: stream, + filename: "empty.txt", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="empty.txt"'); + expect(serialized).toMatch(/------formdata-undici-\w+|------WebKitFormBoundary\w+/); + }); + }); + + describe("Blob and File types", () => { + it("serializes Blob with specified filename", async () => { + const blob = new Blob(["file content"], { type: "text/plain" }); + await formData.appendFile("file", { + data: blob, + filename: "testfile.txt", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="testfile.txt"'); + expect(serialized).toContain("Content-Type: text/plain"); + expect(serialized).toContain("file content"); + }); + + it("uses default filename for Blob without explicit filename", async () => { + const blob = new Blob(["file content"], { type: "text/plain" }); + await formData.appendFile("file", blob); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="blob"'); + }); + + it("preserves File object filename", async () => { + if (typeof File !== "undefined") { + const file = new File(["file content"], "original.txt", { type: "text/plain" }); + await formData.appendFile("file", file); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="original.txt"'); + expect(serialized).toContain("file content"); + } + }); + + it("allows filename override for File objects", async () => { + if (typeof File !== "undefined") { + const file = new File(["file content"], "original.txt", { type: "text/plain" }); + await formData.appendFile("file", { + data: file, + filename: "override.txt", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="override.txt"'); + expect(serialized).not.toContain('filename="original.txt"'); + } + }); + }); + + describe("Binary data types", () => { + it("serializes ArrayBuffer with filename", async () => { + const arrayBuffer = new ArrayBuffer(8); + new Uint8Array(arrayBuffer).set([1, 2, 3, 4, 5, 6, 7, 8]); + + await formData.appendFile("file", { + data: arrayBuffer, + filename: "binary.bin", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="binary.bin"'); + expect(serialized).toMatch(/------formdata-undici-\w+|------WebKitFormBoundary\w+/); + }); + + it("serializes Uint8Array with filename", async () => { + const uint8Array = new Uint8Array([72, 101, 108, 108, 111]); // "Hello" + await formData.appendFile("file", { + data: uint8Array, + filename: "binary.bin", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="binary.bin"'); + expect(serialized).toContain("Hello"); + }); + + it("serializes other typed arrays", async () => { + const int16Array = new Int16Array([1000, 2000, 3000]); + await formData.appendFile("file", { + data: int16Array, + filename: "numbers.bin", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="numbers.bin"'); + }); + + it("serializes Buffer data with filename", async () => { + if (typeof Buffer !== "undefined" && typeof Buffer.isBuffer === "function") { + const buffer = Buffer.from("test content"); + await formData.appendFile("file", { + data: buffer, + filename: "test.txt", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="test.txt"'); + expect(serialized).toContain("test content"); + } + }); + }); + + describe("Text and primitive types", () => { + it("serializes string as regular form field", async () => { + formData.append("text", "test string"); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('name="text"'); + expect(serialized).not.toContain("filename="); + expect(serialized).toContain("test string"); + }); + + it("serializes numbers and booleans as strings", async () => { + formData.append("number", 12345); + formData.append("flag", true); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain("12345"); + expect(serialized).toContain("true"); + }); + }); + + describe("Edge cases and error handling", () => { + it("handles empty filename gracefully", async () => { + await formData.appendFile("file", { + data: new Blob(["content"], { type: "text/plain" }), + filename: "", + }); + + const serialized = await serializeFormData(formData.getRequest().body); + expect(serialized).toContain('filename="blob"'); // Default fallback + }); + + it("handles multiple files in single form", async () => { + await formData.appendFile("file1", { + data: new Blob(["content1"], { type: "text/plain" }), + filename: "file1.txt", + }); + await formData.appendFile("file2", { + data: new Blob(["content2"], { type: "text/plain" }), + filename: "file2.txt", + }); + formData.append("text", "regular field"); + + const serialized = await serializeFormData(formData.getRequest().body); + + expect(serialized).toContain('filename="file1.txt"'); + expect(serialized).toContain('filename="file2.txt"'); + expect(serialized).toContain('name="text"'); + expect(serialized).not.toContain('filename="text"'); + }); + }); + + describe("Request structure", () => { + it("returns correct request structure", async () => { + await formData.appendFile("file", { + data: new Blob(["content"], { type: "text/plain" }), + filename: "test.txt", + }); + + const request = formData.getRequest(); + + expect(request).toHaveProperty("body"); + expect(request).toHaveProperty("headers"); + expect(request).toHaveProperty("duplex"); + expect(request.body).toBeInstanceOf(FormData); + expect(request.headers).toEqual({}); + expect(request.duplex).toBe("half"); + }); + + it("generates proper multipart boundary structure", async () => { + await formData.appendFile("file", { + data: new Blob(["test content"], { type: "text/plain" }), + filename: "test.txt", + }); + formData.append("field", "value"); + + const serialized = await serializeFormData(formData.getRequest().body); + + expect(serialized).toMatch(/------formdata-undici-\w+|------WebKitFormBoundary\w+/); + expect(serialized).toContain("Content-Disposition: form-data;"); + expect(serialized).toMatch(/------formdata-undici-\w+--|------WebKitFormBoundary\w+--/); + }); + }); + + describe("Factory function", () => { + it("returns FormDataWrapper instance", async () => { + const formData = await newFormData(); + expect(formData).toBeInstanceOf(FormDataWrapper); + }); + + it("creates independent instances", async () => { + const formData1 = await newFormData(); + const formData2 = await newFormData(); + + await formData1.setup(); + await formData2.setup(); + + formData1.append("test1", "value1"); + formData2.append("test2", "value2"); + + const request1 = formData1.getRequest() as { body: FormData }; + const request2 = formData2.getRequest() as { body: FormData }; + + const entries1 = Array.from(request1.body.entries()); + const entries2 = Array.from(request2.body.entries()); + + expect(entries1).toHaveLength(1); + expect(entries2).toHaveLength(1); + expect(entries1[0][0]).toBe("test1"); + expect(entries2[0][0]).toBe("test2"); + }); + }); +}); diff --git a/tests/unit/logging/logger.test.ts b/tests/unit/logging/logger.test.ts new file mode 100644 index 0000000..2e0b5fe --- /dev/null +++ b/tests/unit/logging/logger.test.ts @@ -0,0 +1,454 @@ +import { ConsoleLogger, createLogger, Logger, LogLevel } from "../../../src/core/logging/logger"; + +function createMockLogger() { + return { + debug: vi.fn(), + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), + }; +} + +describe("Logger", () => { + describe("LogLevel", () => { + it("should have correct log levels", () => { + expect(LogLevel.Debug).toBe("debug"); + expect(LogLevel.Info).toBe("info"); + expect(LogLevel.Warn).toBe("warn"); + expect(LogLevel.Error).toBe("error"); + }); + }); + + describe("ConsoleLogger", () => { + let consoleLogger: ConsoleLogger; + let consoleSpy: { + debug: ReturnType; + info: ReturnType; + warn: ReturnType; + error: ReturnType; + }; + + beforeEach(() => { + consoleLogger = new ConsoleLogger(); + consoleSpy = { + debug: vi.spyOn(console, "debug").mockImplementation(() => {}), + info: vi.spyOn(console, "info").mockImplementation(() => {}), + warn: vi.spyOn(console, "warn").mockImplementation(() => {}), + error: vi.spyOn(console, "error").mockImplementation(() => {}), + }; + }); + + afterEach(() => { + consoleSpy.debug.mockRestore(); + consoleSpy.info.mockRestore(); + consoleSpy.warn.mockRestore(); + consoleSpy.error.mockRestore(); + }); + + it("should log debug messages", () => { + consoleLogger.debug("debug message", { data: "test" }); + expect(consoleSpy.debug).toHaveBeenCalledWith("debug message", { data: "test" }); + }); + + it("should log info messages", () => { + consoleLogger.info("info message", { data: "test" }); + expect(consoleSpy.info).toHaveBeenCalledWith("info message", { data: "test" }); + }); + + it("should log warn messages", () => { + consoleLogger.warn("warn message", { data: "test" }); + expect(consoleSpy.warn).toHaveBeenCalledWith("warn message", { data: "test" }); + }); + + it("should log error messages", () => { + consoleLogger.error("error message", { data: "test" }); + expect(consoleSpy.error).toHaveBeenCalledWith("error message", { data: "test" }); + }); + + it("should handle multiple arguments", () => { + consoleLogger.debug("message", "arg1", "arg2", { key: "value" }); + expect(consoleSpy.debug).toHaveBeenCalledWith("message", "arg1", "arg2", { key: "value" }); + }); + }); + + describe("Logger with level filtering", () => { + let mockLogger: { + debug: ReturnType; + info: ReturnType; + warn: ReturnType; + error: ReturnType; + }; + + beforeEach(() => { + mockLogger = createMockLogger(); + }); + + describe("Debug level", () => { + it("should log all levels when set to debug", () => { + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: false, + }); + + logger.debug("debug"); + logger.info("info"); + logger.warn("warn"); + logger.error("error"); + + expect(mockLogger.debug).toHaveBeenCalledWith("debug"); + expect(mockLogger.info).toHaveBeenCalledWith("info"); + expect(mockLogger.warn).toHaveBeenCalledWith("warn"); + expect(mockLogger.error).toHaveBeenCalledWith("error"); + }); + + it("should report correct level checks", () => { + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: false, + }); + + expect(logger.isDebug()).toBe(true); + expect(logger.isInfo()).toBe(true); + expect(logger.isWarn()).toBe(true); + expect(logger.isError()).toBe(true); + }); + }); + + describe("Info level", () => { + it("should log info, warn, and error when set to info", () => { + const logger = new Logger({ + level: LogLevel.Info, + logger: mockLogger, + silent: false, + }); + + logger.debug("debug"); + logger.info("info"); + logger.warn("warn"); + logger.error("error"); + + expect(mockLogger.debug).not.toHaveBeenCalled(); + expect(mockLogger.info).toHaveBeenCalledWith("info"); + expect(mockLogger.warn).toHaveBeenCalledWith("warn"); + expect(mockLogger.error).toHaveBeenCalledWith("error"); + }); + + it("should report correct level checks", () => { + const logger = new Logger({ + level: LogLevel.Info, + logger: mockLogger, + silent: false, + }); + + expect(logger.isDebug()).toBe(false); + expect(logger.isInfo()).toBe(true); + expect(logger.isWarn()).toBe(true); + expect(logger.isError()).toBe(true); + }); + }); + + describe("Warn level", () => { + it("should log warn and error when set to warn", () => { + const logger = new Logger({ + level: LogLevel.Warn, + logger: mockLogger, + silent: false, + }); + + logger.debug("debug"); + logger.info("info"); + logger.warn("warn"); + logger.error("error"); + + expect(mockLogger.debug).not.toHaveBeenCalled(); + expect(mockLogger.info).not.toHaveBeenCalled(); + expect(mockLogger.warn).toHaveBeenCalledWith("warn"); + expect(mockLogger.error).toHaveBeenCalledWith("error"); + }); + + it("should report correct level checks", () => { + const logger = new Logger({ + level: LogLevel.Warn, + logger: mockLogger, + silent: false, + }); + + expect(logger.isDebug()).toBe(false); + expect(logger.isInfo()).toBe(false); + expect(logger.isWarn()).toBe(true); + expect(logger.isError()).toBe(true); + }); + }); + + describe("Error level", () => { + it("should only log error when set to error", () => { + const logger = new Logger({ + level: LogLevel.Error, + logger: mockLogger, + silent: false, + }); + + logger.debug("debug"); + logger.info("info"); + logger.warn("warn"); + logger.error("error"); + + expect(mockLogger.debug).not.toHaveBeenCalled(); + expect(mockLogger.info).not.toHaveBeenCalled(); + expect(mockLogger.warn).not.toHaveBeenCalled(); + expect(mockLogger.error).toHaveBeenCalledWith("error"); + }); + + it("should report correct level checks", () => { + const logger = new Logger({ + level: LogLevel.Error, + logger: mockLogger, + silent: false, + }); + + expect(logger.isDebug()).toBe(false); + expect(logger.isInfo()).toBe(false); + expect(logger.isWarn()).toBe(false); + expect(logger.isError()).toBe(true); + }); + }); + + describe("Silent mode", () => { + it("should not log anything when silent is true", () => { + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: true, + }); + + logger.debug("debug"); + logger.info("info"); + logger.warn("warn"); + logger.error("error"); + + expect(mockLogger.debug).not.toHaveBeenCalled(); + expect(mockLogger.info).not.toHaveBeenCalled(); + expect(mockLogger.warn).not.toHaveBeenCalled(); + expect(mockLogger.error).not.toHaveBeenCalled(); + }); + + it("should report all level checks as false when silent", () => { + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: true, + }); + + expect(logger.isDebug()).toBe(false); + expect(logger.isInfo()).toBe(false); + expect(logger.isWarn()).toBe(false); + expect(logger.isError()).toBe(false); + }); + }); + + describe("shouldLog", () => { + it("should correctly determine if level should be logged", () => { + const logger = new Logger({ + level: LogLevel.Info, + logger: mockLogger, + silent: false, + }); + + expect(logger.shouldLog(LogLevel.Debug)).toBe(false); + expect(logger.shouldLog(LogLevel.Info)).toBe(true); + expect(logger.shouldLog(LogLevel.Warn)).toBe(true); + expect(logger.shouldLog(LogLevel.Error)).toBe(true); + }); + + it("should return false for all levels when silent", () => { + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: true, + }); + + expect(logger.shouldLog(LogLevel.Debug)).toBe(false); + expect(logger.shouldLog(LogLevel.Info)).toBe(false); + expect(logger.shouldLog(LogLevel.Warn)).toBe(false); + expect(logger.shouldLog(LogLevel.Error)).toBe(false); + }); + }); + + describe("Multiple arguments", () => { + it("should pass multiple arguments to logger", () => { + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: false, + }); + + logger.debug("message", "arg1", { key: "value" }, 123); + expect(mockLogger.debug).toHaveBeenCalledWith("message", "arg1", { key: "value" }, 123); + }); + }); + }); + + describe("createLogger", () => { + it("should return default logger when no config provided", () => { + const logger = createLogger(); + expect(logger).toBeInstanceOf(Logger); + }); + + it("should return same logger instance when Logger is passed", () => { + const customLogger = new Logger({ + level: LogLevel.Debug, + logger: new ConsoleLogger(), + silent: false, + }); + + const result = createLogger(customLogger); + expect(result).toBe(customLogger); + }); + + it("should create logger with custom config", () => { + const mockLogger = createMockLogger(); + + const logger = createLogger({ + level: LogLevel.Warn, + logger: mockLogger, + silent: false, + }); + + expect(logger).toBeInstanceOf(Logger); + logger.warn("test"); + expect(mockLogger.warn).toHaveBeenCalledWith("test"); + }); + + it("should use default values for missing config", () => { + const logger = createLogger({}); + expect(logger).toBeInstanceOf(Logger); + }); + + it("should override default level", () => { + const mockLogger = createMockLogger(); + + const logger = createLogger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: false, + }); + + logger.debug("test"); + expect(mockLogger.debug).toHaveBeenCalledWith("test"); + }); + + it("should override default silent mode", () => { + const mockLogger = createMockLogger(); + + const logger = createLogger({ + logger: mockLogger, + silent: false, + }); + + logger.info("test"); + expect(mockLogger.info).toHaveBeenCalledWith("test"); + }); + + it("should use provided logger implementation", () => { + const customLogger = createMockLogger(); + + const logger = createLogger({ + logger: customLogger, + level: LogLevel.Debug, + silent: false, + }); + + logger.debug("test"); + expect(customLogger.debug).toHaveBeenCalledWith("test"); + }); + + it("should default to silent: true", () => { + const mockLogger = createMockLogger(); + + const logger = createLogger({ + logger: mockLogger, + level: LogLevel.Debug, + }); + + logger.debug("test"); + expect(mockLogger.debug).not.toHaveBeenCalled(); + }); + }); + + describe("Default logger", () => { + it("should have silent: true by default", () => { + const logger = createLogger(); + expect(logger.shouldLog(LogLevel.Info)).toBe(false); + }); + + it("should not log when using default logger", () => { + const logger = createLogger(); + + logger.info("test"); + expect(logger.isInfo()).toBe(false); + }); + }); + + describe("Edge cases", () => { + it("should handle empty message", () => { + const mockLogger = createMockLogger(); + + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: false, + }); + + logger.debug(""); + expect(mockLogger.debug).toHaveBeenCalledWith(""); + }); + + it("should handle no arguments", () => { + const mockLogger = createMockLogger(); + + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: false, + }); + + logger.debug("message"); + expect(mockLogger.debug).toHaveBeenCalledWith("message"); + }); + + it("should handle complex objects", () => { + const mockLogger = createMockLogger(); + + const logger = new Logger({ + level: LogLevel.Debug, + logger: mockLogger, + silent: false, + }); + + const complexObject = { + nested: { key: "value" }, + array: [1, 2, 3], + fn: () => "test", + }; + + logger.debug("message", complexObject); + expect(mockLogger.debug).toHaveBeenCalledWith("message", complexObject); + }); + + it("should handle errors as arguments", () => { + const mockLogger = createMockLogger(); + + const logger = new Logger({ + level: LogLevel.Error, + logger: mockLogger, + silent: false, + }); + + const error = new Error("Test error"); + logger.error("Error occurred", error); + expect(mockLogger.error).toHaveBeenCalledWith("Error occurred", error); + }); + }); +}); diff --git a/tests/unit/test-file.txt b/tests/unit/test-file.txt new file mode 100644 index 0000000..c66d471 --- /dev/null +++ b/tests/unit/test-file.txt @@ -0,0 +1 @@ +This is a test file! diff --git a/tests/unit/url/join.test.ts b/tests/unit/url/join.test.ts new file mode 100644 index 0000000..123488f --- /dev/null +++ b/tests/unit/url/join.test.ts @@ -0,0 +1,284 @@ +import { join } from "../../../src/core/url/index"; + +describe("join", () => { + interface TestCase { + description: string; + base: string; + segments: string[]; + expected: string; + } + + describe("basic functionality", () => { + const basicTests: TestCase[] = [ + { description: "should return empty string for empty base", base: "", segments: [], expected: "" }, + { + description: "should return empty string for empty base with path", + base: "", + segments: ["path"], + expected: "", + }, + { + description: "should handle single segment", + base: "base", + segments: ["segment"], + expected: "base/segment", + }, + { + description: "should handle single segment with trailing slash on base", + base: "base/", + segments: ["segment"], + expected: "base/segment", + }, + { + description: "should handle single segment with leading slash", + base: "base", + segments: ["/segment"], + expected: "base/segment", + }, + { + description: "should handle single segment with both slashes", + base: "base/", + segments: ["/segment"], + expected: "base/segment", + }, + { + description: "should handle multiple segments", + base: "base", + segments: ["path1", "path2", "path3"], + expected: "base/path1/path2/path3", + }, + { + description: "should handle multiple segments with slashes", + base: "base/", + segments: ["/path1/", "/path2/", "/path3/"], + expected: "base/path1/path2/path3/", + }, + ]; + + basicTests.forEach(({ description, base, segments, expected }) => { + it(description, () => { + expect(join(base, ...segments)).toBe(expected); + }); + }); + }); + + describe("URL handling", () => { + const urlTests: TestCase[] = [ + { + description: "should handle absolute URLs", + base: "https://example.com", + segments: ["api", "v1"], + expected: "https://example.com/api/v1", + }, + { + description: "should handle absolute URLs with slashes", + base: "https://example.com/", + segments: ["/api/", "/v1/"], + expected: "https://example.com/api/v1/", + }, + { + description: "should handle absolute URLs with base path", + base: "https://example.com/base", + segments: ["api", "v1"], + expected: "https://example.com/base/api/v1", + }, + { + description: "should preserve URL query parameters", + base: "https://example.com?query=1", + segments: ["api"], + expected: "https://example.com/api?query=1", + }, + { + description: "should preserve URL fragments", + base: "https://example.com#fragment", + segments: ["api"], + expected: "https://example.com/api#fragment", + }, + { + description: "should preserve URL query and fragments", + base: "https://example.com?query=1#fragment", + segments: ["api"], + expected: "https://example.com/api?query=1#fragment", + }, + { + description: "should handle http protocol", + base: "http://example.com", + segments: ["api"], + expected: "http://example.com/api", + }, + { + description: "should handle ftp protocol", + base: "ftp://example.com", + segments: ["files"], + expected: "ftp://example.com/files", + }, + { + description: "should handle ws protocol", + base: "ws://example.com", + segments: ["socket"], + expected: "ws://example.com/socket", + }, + { + description: "should fallback to path joining for malformed URLs", + base: "not-a-url://", + segments: ["path"], + expected: "not-a-url:///path", + }, + ]; + + urlTests.forEach(({ description, base, segments, expected }) => { + it(description, () => { + expect(join(base, ...segments)).toBe(expected); + }); + }); + }); + + describe("edge cases", () => { + const edgeCaseTests: TestCase[] = [ + { + description: "should handle empty segments", + base: "base", + segments: ["", "path"], + expected: "base/path", + }, + { + description: "should handle null segments", + base: "base", + segments: [null as any, "path"], + expected: "base/path", + }, + { + description: "should handle undefined segments", + base: "base", + segments: [undefined as any, "path"], + expected: "base/path", + }, + { + description: "should handle segments with only single slash", + base: "base", + segments: ["/", "path"], + expected: "base/path", + }, + { + description: "should handle segments with only double slash", + base: "base", + segments: ["//", "path"], + expected: "base/path", + }, + { + description: "should handle base paths with trailing slashes", + base: "base/", + segments: ["path"], + expected: "base/path", + }, + { + description: "should handle complex nested paths", + base: "api/v1/", + segments: ["/users/", "/123/", "/profile"], + expected: "api/v1/users/123/profile", + }, + ]; + + edgeCaseTests.forEach(({ description, base, segments, expected }) => { + it(description, () => { + expect(join(base, ...segments)).toBe(expected); + }); + }); + }); + + describe("real-world scenarios", () => { + const realWorldTests: TestCase[] = [ + { + description: "should handle API endpoint construction", + base: "https://api.example.com/v1", + segments: ["users", "123", "posts"], + expected: "https://api.example.com/v1/users/123/posts", + }, + { + description: "should handle file path construction", + base: "/var/www", + segments: ["html", "assets", "images"], + expected: "/var/www/html/assets/images", + }, + { + description: "should handle relative path construction", + base: "../parent", + segments: ["child", "grandchild"], + expected: "../parent/child/grandchild", + }, + { + description: "should handle Windows-style paths", + base: "C:\\Users", + segments: ["Documents", "file.txt"], + expected: "C:\\Users/Documents/file.txt", + }, + ]; + + realWorldTests.forEach(({ description, base, segments, expected }) => { + it(description, () => { + expect(join(base, ...segments)).toBe(expected); + }); + }); + }); + + describe("performance scenarios", () => { + it("should handle many segments efficiently", () => { + const segments = Array(100).fill("segment"); + const result = join("base", ...segments); + expect(result).toBe(`base/${segments.join("/")}`); + }); + + it("should handle long URLs", () => { + const longPath = "a".repeat(1000); + expect(join("https://example.com", longPath)).toBe(`https://example.com/${longPath}`); + }); + }); + + describe("trailing slash preservation", () => { + const trailingSlashTests: TestCase[] = [ + { + description: + "should preserve trailing slash on final result when base has trailing slash and no segments", + base: "https://api.example.com/", + segments: [], + expected: "https://api.example.com/", + }, + { + description: "should preserve trailing slash on v1 path", + base: "https://api.example.com/v1/", + segments: [], + expected: "https://api.example.com/v1/", + }, + { + description: "should preserve trailing slash when last segment has trailing slash", + base: "https://api.example.com", + segments: ["users/"], + expected: "https://api.example.com/users/", + }, + { + description: "should preserve trailing slash with relative path", + base: "api/v1", + segments: ["users/"], + expected: "api/v1/users/", + }, + { + description: "should preserve trailing slash with multiple segments", + base: "https://api.example.com", + segments: ["v1", "collections/"], + expected: "https://api.example.com/v1/collections/", + }, + { + description: "should preserve trailing slash with base path", + base: "base", + segments: ["path1", "path2/"], + expected: "base/path1/path2/", + }, + ]; + + trailingSlashTests.forEach(({ description, base, segments, expected }) => { + it(description, () => { + expect(join(base, ...segments)).toBe(expected); + }); + }); + }); +}); diff --git a/tests/unit/url/qs.test.ts b/tests/unit/url/qs.test.ts new file mode 100644 index 0000000..42cdffb --- /dev/null +++ b/tests/unit/url/qs.test.ts @@ -0,0 +1,278 @@ +import { toQueryString } from "../../../src/core/url/index"; + +describe("Test qs toQueryString", () => { + interface BasicTestCase { + description: string; + input: any; + expected: string; + } + + describe("Basic functionality", () => { + const basicTests: BasicTestCase[] = [ + { description: "should return empty string for null", input: null, expected: "" }, + { description: "should return empty string for undefined", input: undefined, expected: "" }, + { description: "should return empty string for string primitive", input: "hello", expected: "" }, + { description: "should return empty string for number primitive", input: 42, expected: "" }, + { description: "should return empty string for true boolean", input: true, expected: "" }, + { description: "should return empty string for false boolean", input: false, expected: "" }, + { description: "should handle empty objects", input: {}, expected: "" }, + { + description: "should handle simple key-value pairs", + input: { name: "John", age: 30 }, + expected: "name=John&age=30", + }, + ]; + + basicTests.forEach(({ description, input, expected }) => { + it(description, () => { + expect(toQueryString(input)).toBe(expected); + }); + }); + }); + + describe("Array handling", () => { + interface ArrayTestCase { + description: string; + input: any; + options?: { arrayFormat?: "repeat" | "indices" }; + expected: string; + } + + const arrayTests: ArrayTestCase[] = [ + { + description: "should handle arrays with indices format (default)", + input: { items: ["a", "b", "c"] }, + expected: "items%5B0%5D=a&items%5B1%5D=b&items%5B2%5D=c", + }, + { + description: "should handle arrays with repeat format", + input: { items: ["a", "b", "c"] }, + options: { arrayFormat: "repeat" }, + expected: "items=a&items=b&items=c", + }, + { + description: "should handle empty arrays", + input: { items: [] }, + expected: "", + }, + { + description: "should handle arrays with mixed types", + input: { mixed: ["string", 42, true, false] }, + expected: "mixed%5B0%5D=string&mixed%5B1%5D=42&mixed%5B2%5D=true&mixed%5B3%5D=false", + }, + { + description: "should handle arrays with objects", + input: { users: [{ name: "John" }, { name: "Jane" }] }, + expected: "users%5B0%5D%5Bname%5D=John&users%5B1%5D%5Bname%5D=Jane", + }, + { + description: "should handle arrays with objects in repeat format", + input: { users: [{ name: "John" }, { name: "Jane" }] }, + options: { arrayFormat: "repeat" }, + expected: "users%5Bname%5D=John&users%5Bname%5D=Jane", + }, + ]; + + arrayTests.forEach(({ description, input, options, expected }) => { + it(description, () => { + expect(toQueryString(input, options)).toBe(expected); + }); + }); + }); + + describe("Nested objects", () => { + const nestedTests: BasicTestCase[] = [ + { + description: "should handle nested objects", + input: { user: { name: "John", age: 30 } }, + expected: "user%5Bname%5D=John&user%5Bage%5D=30", + }, + { + description: "should handle deeply nested objects", + input: { user: { profile: { name: "John", settings: { theme: "dark" } } } }, + expected: "user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", + }, + { + description: "should handle empty nested objects", + input: { user: {} }, + expected: "", + }, + ]; + + nestedTests.forEach(({ description, input, expected }) => { + it(description, () => { + expect(toQueryString(input)).toBe(expected); + }); + }); + }); + + describe("Encoding", () => { + interface EncodingTestCase { + description: string; + input: any; + options?: { encode?: boolean }; + expected: string; + } + + const encodingTests: EncodingTestCase[] = [ + { + description: "should encode by default", + input: { name: "John Doe", email: "john@example.com" }, + expected: "name=John%20Doe&email=john%40example.com", + }, + { + description: "should not encode when encode is false", + input: { name: "John Doe", email: "john@example.com" }, + options: { encode: false }, + expected: "name=John Doe&email=john@example.com", + }, + { + description: "should encode special characters in keys", + input: { "user name": "John", "email[primary]": "john@example.com" }, + expected: "user%20name=John&email%5Bprimary%5D=john%40example.com", + }, + { + description: "should not encode special characters in keys when encode is false", + input: { "user name": "John", "email[primary]": "john@example.com" }, + options: { encode: false }, + expected: "user name=John&email[primary]=john@example.com", + }, + ]; + + encodingTests.forEach(({ description, input, options, expected }) => { + it(description, () => { + expect(toQueryString(input, options)).toBe(expected); + }); + }); + }); + + describe("Mixed scenarios", () => { + interface MixedTestCase { + description: string; + input: any; + options?: { arrayFormat?: "repeat" | "indices" }; + expected: string; + } + + const mixedTests: MixedTestCase[] = [ + { + description: "should handle complex nested structures", + input: { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], + }, + }, + sort: { field: "name", direction: "asc" }, + }, + expected: + "filters%5Bstatus%5D%5B0%5D=active&filters%5Bstatus%5D%5B1%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D%5B0%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D%5B1%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + }, + { + description: "should handle complex nested structures with repeat format", + input: { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], + }, + }, + sort: { field: "name", direction: "asc" }, + }, + options: { arrayFormat: "repeat" }, + expected: + "filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + }, + { + description: "should handle arrays with null/undefined values", + input: { items: ["a", null, "c", undefined, "e"] }, + expected: "items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c&items%5B4%5D=e", + }, + { + description: "should handle objects with null/undefined values", + input: { name: "John", age: null, email: undefined, active: true }, + expected: "name=John&age=&active=true", + }, + ]; + + mixedTests.forEach(({ description, input, options, expected }) => { + it(description, () => { + expect(toQueryString(input, options)).toBe(expected); + }); + }); + }); + + describe("Edge cases", () => { + const edgeCaseTests: BasicTestCase[] = [ + { + description: "should handle numeric keys", + input: { "0": "zero", "1": "one" }, + expected: "0=zero&1=one", + }, + { + description: "should handle boolean values in objects", + input: { enabled: true, disabled: false }, + expected: "enabled=true&disabled=false", + }, + { + description: "should handle empty strings", + input: { name: "", description: "test" }, + expected: "name=&description=test", + }, + { + description: "should handle zero values", + input: { count: 0, price: 0.0 }, + expected: "count=0&price=0", + }, + { + description: "should handle arrays with empty strings", + input: { items: ["a", "", "c"] }, + expected: "items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c", + }, + ]; + + edgeCaseTests.forEach(({ description, input, expected }) => { + it(description, () => { + expect(toQueryString(input)).toBe(expected); + }); + }); + }); + + describe("Options combinations", () => { + interface OptionsTestCase { + description: string; + input: any; + options?: { arrayFormat?: "repeat" | "indices"; encode?: boolean }; + expected: string; + } + + const optionsTests: OptionsTestCase[] = [ + { + description: "should respect both arrayFormat and encode options", + input: { items: ["a & b", "c & d"] }, + options: { arrayFormat: "repeat", encode: false }, + expected: "items=a & b&items=c & d", + }, + { + description: "should use default options when none provided", + input: { items: ["a", "b"] }, + expected: "items%5B0%5D=a&items%5B1%5D=b", + }, + { + description: "should merge provided options with defaults", + input: { items: ["a", "b"], name: "John Doe" }, + options: { encode: false }, + expected: "items[0]=a&items[1]=b&name=John Doe", + }, + ]; + + optionsTests.forEach(({ description, input, options, expected }) => { + it(description, () => { + expect(toQueryString(input, options)).toBe(expected); + }); + }); + }); +}); diff --git a/tests/wire/.gitkeep b/tests/wire/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/wire/account.test.ts b/tests/wire/account.test.ts new file mode 100644 index 0000000..507359a --- /dev/null +++ b/tests/wire/account.test.ts @@ -0,0 +1,232 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("AccountClient", () => { + test("getAccount", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + organization_id: "5fa2b8c123456789abcdef01", + user_id: 1234567, + enterprise: false, + companyName: "Acme Marketing Corp", + email: "michael.davis@example.com", + firstName: "Michael", + lastName: "Davis", + address: { city: "New York", country: "United States", street: "456 Business Ave", zipCode: "10001" }, + dateTimePreferences: { timezone: "America/New_York", timeFormat: "12", dateFormat: "mm-dd-yyyy" }, + marketingAutomation: { enabled: true, key: "ma8k2x9v4h7p3d6f1c5e8b2a" }, + plan: [ + { + credits: 250, + creditsType: "sendLimit", + endDate: "1753826567", + startDate: "1751234567", + type: "free", + }, + { credits: 15, creditsType: "sendLimit", endDate: "1753826567", startDate: "1751234567", type: "sms" }, + ], + planVerticals: [ + { + planCategory: "Marketing", + planType: "free", + name: "Free", + status: "active", + startDate: "1751234567", + endDate: "1753826567", + users: { purchasedSeats: "1", usedSeats: "1" }, + credits: "250", + }, + { + planCategory: "Chat", + planType: "free", + name: "Free", + status: "active", + startDate: "1735678901", + endDate: "1767214901", + users: { purchasedSeats: "1", usedSeats: "1" }, + credits: "250", + }, + { + planCategory: "CRM", + planType: "free", + name: "Free", + status: "active", + startDate: "1735678900", + endDate: "1767214900", + users: { purchasedSeats: "1", usedSeats: "1" }, + credits: "250", + }, + ], + relay: { + data: { port: 587, relay: "smtp-relay.brevo.com", userName: "michael.davis@example.com" }, + enabled: true, + }, + }; + server.mockEndpoint().get("/account").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.account.getAccount(); + expect(response).toEqual({ + organization_id: "5fa2b8c123456789abcdef01", + user_id: 1234567, + enterprise: false, + companyName: "Acme Marketing Corp", + email: "michael.davis@example.com", + firstName: "Michael", + lastName: "Davis", + address: { + city: "New York", + country: "United States", + street: "456 Business Ave", + zipCode: "10001", + }, + dateTimePreferences: { + timezone: "America/New_York", + timeFormat: "12", + dateFormat: "mm-dd-yyyy", + }, + marketingAutomation: { + enabled: true, + key: "ma8k2x9v4h7p3d6f1c5e8b2a", + }, + plan: [ + { + credits: 250, + creditsType: "sendLimit", + endDate: "1753826567", + startDate: "1751234567", + type: "free", + }, + { + credits: 15, + creditsType: "sendLimit", + endDate: "1753826567", + startDate: "1751234567", + type: "sms", + }, + ], + planVerticals: [ + { + planCategory: "Marketing", + planType: "free", + name: "Free", + status: "active", + startDate: "1751234567", + endDate: "1753826567", + users: { + purchasedSeats: "1", + usedSeats: "1", + }, + credits: "250", + }, + { + planCategory: "Chat", + planType: "free", + name: "Free", + status: "active", + startDate: "1735678901", + endDate: "1767214901", + users: { + purchasedSeats: "1", + usedSeats: "1", + }, + credits: "250", + }, + { + planCategory: "CRM", + planType: "free", + name: "Free", + status: "active", + startDate: "1735678900", + endDate: "1767214900", + users: { + purchasedSeats: "1", + usedSeats: "1", + }, + credits: "250", + }, + ], + relay: { + data: { + port: 587, + relay: "smtp-relay.brevo.com", + userName: "michael.davis@example.com", + }, + enabled: true, + }, + }); + }); + + test("getAccountActivity (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + logs: [ + { + action: "login-success", + date: "2023-03-16T16:49:23+05:30", + user_agent: "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)", + user_email: "test@mycompany.com", + user_ip: "192.158.1.34", + }, + { + action: "update-profile", + date: "2023-03-15T16:49:23+05:30", + user_agent: "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)", + user_email: "test@myexample.com", + user_ip: "192.158.1.38", + }, + ], + }; + server + .mockEndpoint() + .get("/organization/activities") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.account.getAccountActivity(); + expect(response).toEqual({ + logs: [ + { + action: "login-success", + date: "2023-03-16T16:49:23+05:30", + user_agent: "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)", + user_email: "test@mycompany.com", + user_ip: "192.158.1.34", + }, + { + action: "update-profile", + date: "2023-03-15T16:49:23+05:30", + user_agent: "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)", + user_email: "test@myexample.com", + user_ip: "192.158.1.38", + }, + ], + }); + }); + + test("getAccountActivity (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/organization/activities") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.account.getAccountActivity(); + }).rejects.toThrow(Brevo.BadRequestError); + }); +}); diff --git a/tests/wire/balance.test.ts b/tests/wire/balance.test.ts new file mode 100644 index 0000000..7d005b7 --- /dev/null +++ b/tests/wire/balance.test.ts @@ -0,0 +1,2995 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("BalanceClient", () => { + test("getActiveBalancesApi (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + balanceDefinitionId: "balanceDefinitionId", + constraintType: "constraintType", + createdAt: "createdAt", + durationUnit: "durationUnit", + durationValue: 1, + id: "id", + slidingSchedule: true, + transactionType: "transactionType", + updatedAt: "updatedAt", + value: 1, + }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/active-balance") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.getActiveBalancesApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + expect(response).toEqual({ + balanceDefinitionId: "balanceDefinitionId", + constraintType: "constraintType", + createdAt: "createdAt", + durationUnit: "durationUnit", + durationValue: 1, + id: "id", + slidingSchedule: true, + transactionType: "transactionType", + updatedAt: "updatedAt", + value: 1, + }); + }); + + test("getActiveBalancesApi (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/active-balance") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getActiveBalancesApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getActiveBalancesApi (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/active-balance") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getActiveBalancesApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getActiveBalancesApi (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/active-balance") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getActiveBalancesApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getActiveBalancesApi (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/active-balance") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getActiveBalancesApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getActiveBalancesApi (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/active-balance") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getActiveBalancesApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getBalanceDefinitionList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + balanceAvailabilityDurationModifier: "startOfPeriod", + balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", + balanceAvailabilityDurationValue: 1, + balanceExpirationDate: "2024-01-15T09:30:00Z", + balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", + balanceOptionCreditRounding: "balanceOptionCreditRounding", + balanceOptionDebitRounding: "balanceOptionDebitRounding", + createdAt: "2024-01-15T09:30:00Z", + deletedAt: "deletedAt", + description: "description", + id: "id", + imageRef: "imageRef", + maxAmount: 1.1, + maxCreditAmountLimit: 1.1, + maxDebitAmountLimit: 1.1, + meta: { key: "value" }, + minAmount: 1.1, + name: "name", + unit: "unit", + updatedAt: "updatedAt", + }, + ], + }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.getBalanceDefinitionList({ + pid: "pid", + }); + expect(response).toEqual({ + items: [ + { + balanceAvailabilityDurationModifier: "startOfPeriod", + balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", + balanceAvailabilityDurationValue: 1, + balanceExpirationDate: "2024-01-15T09:30:00Z", + balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", + balanceOptionCreditRounding: "balanceOptionCreditRounding", + balanceOptionDebitRounding: "balanceOptionDebitRounding", + createdAt: "2024-01-15T09:30:00Z", + deletedAt: "deletedAt", + description: "description", + id: "id", + imageRef: "imageRef", + maxAmount: 1.1, + maxCreditAmountLimit: 1.1, + maxDebitAmountLimit: 1.1, + meta: { + key: "value", + }, + minAmount: 1.1, + name: "name", + unit: "unit", + updatedAt: "updatedAt", + }, + ], + }); + }); + + test("getBalanceDefinitionList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinitionList({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getBalanceDefinitionList (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinitionList({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getBalanceDefinitionList (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinitionList({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getBalanceDefinitionList (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinitionList({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createBalanceDefinition (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { + balanceAvailabilityDurationModifier: "startOfPeriod", + balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", + balanceAvailabilityDurationValue: 1, + balanceExpirationDate: "2024-01-15T09:30:00Z", + balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", + balanceOptionCreditRounding: "balanceOptionCreditRounding", + balanceOptionDebitRounding: "balanceOptionDebitRounding", + createdAt: "2024-01-15T09:30:00Z", + deletedAt: "deletedAt", + description: "description", + id: "id", + imageRef: "imageRef", + maxAmount: 1.1, + maxCreditAmountLimit: 1.1, + maxDebitAmountLimit: 1.1, + meta: { key: "value" }, + minAmount: 1.1, + name: "name", + unit: "unit", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.createBalanceDefinition({ + pid: "pid", + name: "name", + unit: "POINTS", + }); + expect(response).toEqual({ + balanceAvailabilityDurationModifier: "startOfPeriod", + balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", + balanceAvailabilityDurationValue: 1, + balanceExpirationDate: "2024-01-15T09:30:00Z", + balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", + balanceOptionCreditRounding: "balanceOptionCreditRounding", + balanceOptionDebitRounding: "balanceOptionDebitRounding", + createdAt: "2024-01-15T09:30:00Z", + deletedAt: "deletedAt", + description: "description", + id: "id", + imageRef: "imageRef", + maxAmount: 1.1, + maxCreditAmountLimit: 1.1, + maxDebitAmountLimit: 1.1, + meta: { + key: "value", + }, + minAmount: 1.1, + name: "name", + unit: "unit", + updatedAt: "updatedAt", + }); + }); + + test("createBalanceDefinition (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceDefinition({ + pid: "pid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createBalanceDefinition (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceDefinition({ + pid: "pid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createBalanceDefinition (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceDefinition({ + pid: "pid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("createBalanceDefinition (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceDefinition({ + pid: "pid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("createBalanceDefinition (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceDefinition({ + pid: "pid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getBalanceDefinition (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + balanceAvailabilityDurationModifier: "startOfPeriod", + balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", + balanceAvailabilityDurationValue: 1, + balanceExpirationDate: "2024-01-15T09:30:00Z", + balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", + balanceOptionCreditRounding: "balanceOptionCreditRounding", + balanceOptionDebitRounding: "balanceOptionDebitRounding", + createdAt: "2024-01-15T09:30:00Z", + deletedAt: "deletedAt", + description: "description", + id: "id", + imageRef: "imageRef", + maxAmount: 1.1, + maxCreditAmountLimit: 1.1, + maxDebitAmountLimit: 1.1, + meta: { key: "value" }, + minAmount: 1.1, + name: "name", + unit: "unit", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.getBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + expect(response).toEqual({ + balanceAvailabilityDurationModifier: "startOfPeriod", + balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", + balanceAvailabilityDurationValue: 1, + balanceExpirationDate: "2024-01-15T09:30:00Z", + balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", + balanceOptionCreditRounding: "balanceOptionCreditRounding", + balanceOptionDebitRounding: "balanceOptionDebitRounding", + createdAt: "2024-01-15T09:30:00Z", + deletedAt: "deletedAt", + description: "description", + id: "id", + imageRef: "imageRef", + maxAmount: 1.1, + maxCreditAmountLimit: 1.1, + maxDebitAmountLimit: 1.1, + meta: { + key: "value", + }, + minAmount: 1.1, + name: "name", + unit: "unit", + updatedAt: "updatedAt", + }); + }); + + test("getBalanceDefinition (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getBalanceDefinition (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getBalanceDefinition (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getBalanceDefinition (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getBalanceDefinition (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("updateBalanceDefinition (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { + balanceAvailabilityDurationModifier: "startOfPeriod", + balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", + balanceAvailabilityDurationValue: 1, + balanceExpirationDate: "2024-01-15T09:30:00Z", + balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", + balanceOptionCreditRounding: "balanceOptionCreditRounding", + balanceOptionDebitRounding: "balanceOptionDebitRounding", + createdAt: "2024-01-15T09:30:00Z", + deletedAt: "deletedAt", + description: "description", + id: "id", + imageRef: "imageRef", + maxAmount: 1.1, + maxCreditAmountLimit: 1.1, + maxDebitAmountLimit: 1.1, + meta: { key: "value" }, + minAmount: 1.1, + name: "name", + unit: "unit", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.updateBalanceDefinition({ + pid: "pid", + bdid: "bdid", + name: "name", + unit: "POINTS", + }); + expect(response).toEqual({ + balanceAvailabilityDurationModifier: "startOfPeriod", + balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", + balanceAvailabilityDurationValue: 1, + balanceExpirationDate: "2024-01-15T09:30:00Z", + balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", + balanceOptionCreditRounding: "balanceOptionCreditRounding", + balanceOptionDebitRounding: "balanceOptionDebitRounding", + createdAt: "2024-01-15T09:30:00Z", + deletedAt: "deletedAt", + description: "description", + id: "id", + imageRef: "imageRef", + maxAmount: 1.1, + maxCreditAmountLimit: 1.1, + maxDebitAmountLimit: 1.1, + meta: { + key: "value", + }, + minAmount: 1.1, + name: "name", + unit: "unit", + updatedAt: "updatedAt", + }); + }); + + test("updateBalanceDefinition (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceDefinition({ + pid: "pid", + bdid: "bdid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("updateBalanceDefinition (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceDefinition({ + pid: "pid", + bdid: "bdid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("updateBalanceDefinition (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceDefinition({ + pid: "pid", + bdid: "bdid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateBalanceDefinition (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceDefinition({ + pid: "pid", + bdid: "bdid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("updateBalanceDefinition (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceDefinition({ + pid: "pid", + bdid: "bdid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.FailedDependencyError); + }); + + test("updateBalanceDefinition (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", unit: "POINTS" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceDefinition({ + pid: "pid", + bdid: "bdid", + name: "name", + unit: "POINTS", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("deleteBalanceDefinition (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.balance.deleteBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + expect(response).toEqual(undefined); + }); + + test("deleteBalanceDefinition (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deleteBalanceDefinition (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteBalanceDefinition (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteBalanceDefinition (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("deleteBalanceDefinition (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceDefinition({ + pid: "pid", + bdid: "bdid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createBalanceLimit (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { + balanceDefinitionId: "balanceDefinitionId", + constraintType: "constraintType", + createdAt: "createdAt", + durationUnit: "durationUnit", + durationValue: 1, + id: "id", + slidingSchedule: true, + transactionType: "transactionType", + updatedAt: "updatedAt", + value: 1, + }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.createBalanceLimit({ + pid: "pid", + bdid: "bdid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + expect(response).toEqual({ + balanceDefinitionId: "balanceDefinitionId", + constraintType: "constraintType", + createdAt: "createdAt", + durationUnit: "durationUnit", + durationValue: 1, + id: "id", + slidingSchedule: true, + transactionType: "transactionType", + updatedAt: "updatedAt", + value: 1, + }); + }); + + test("createBalanceLimit (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceLimit({ + pid: "pid", + bdid: "bdid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createBalanceLimit (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceLimit({ + pid: "pid", + bdid: "bdid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createBalanceLimit (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceLimit({ + pid: "pid", + bdid: "bdid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("createBalanceLimit (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceLimit({ + pid: "pid", + bdid: "bdid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.FailedDependencyError); + }); + + test("createBalanceLimit (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceLimit({ + pid: "pid", + bdid: "bdid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getBalanceLimit (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + balanceDefinitionId: "balanceDefinitionId", + constraintType: "constraintType", + createdAt: "createdAt", + durationUnit: "durationUnit", + durationValue: 1, + id: "id", + slidingSchedule: true, + transactionType: "transactionType", + updatedAt: "updatedAt", + value: 1, + }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.getBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + expect(response).toEqual({ + balanceDefinitionId: "balanceDefinitionId", + constraintType: "constraintType", + createdAt: "createdAt", + durationUnit: "durationUnit", + durationValue: 1, + id: "id", + slidingSchedule: true, + transactionType: "transactionType", + updatedAt: "updatedAt", + value: 1, + }); + }); + + test("getBalanceLimit (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getBalanceLimit (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getBalanceLimit (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getBalanceLimit (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getBalanceLimit (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("updateBalanceLimit (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { + balanceDefinitionId: "balanceDefinitionId", + constraintType: "constraintType", + createdAt: "createdAt", + durationUnit: "durationUnit", + durationValue: 1, + id: "id", + slidingSchedule: true, + transactionType: "transactionType", + updatedAt: "updatedAt", + value: 1, + }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.updateBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + expect(response).toEqual({ + balanceDefinitionId: "balanceDefinitionId", + constraintType: "constraintType", + createdAt: "createdAt", + durationUnit: "durationUnit", + durationValue: 1, + id: "id", + slidingSchedule: true, + transactionType: "transactionType", + updatedAt: "updatedAt", + value: 1, + }); + }); + + test("updateBalanceLimit (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("updateBalanceLimit (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("updateBalanceLimit (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateBalanceLimit (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("updateBalanceLimit (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.updateBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + constraintType: "transaction", + durationUnit: "day", + durationValue: 1, + transactionType: "credit", + value: 1, + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("deleteBalanceLimit (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.balance.deleteBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + expect(response).toEqual(undefined); + }); + + test("deleteBalanceLimit (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deleteBalanceLimit (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteBalanceLimit (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteBalanceLimit (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("deleteBalanceLimit (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.deleteBalanceLimit({ + pid: "pid", + bdid: "bdid", + blid: "blid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getContactBalances (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + balanceDefinitionId: "balanceDefinitionId", + balances: [ + { contactId: 1, loyaltySubscriptionId: "loyaltySubscriptionId", updatedAt: "updatedAt", value: 1.1 }, + ], + count: 1, + loyaltyProgramId: "loyaltyProgramId", + }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/contact-balances") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.getContactBalances({ + pid: "pid", + }); + expect(response).toEqual({ + balanceDefinitionId: "balanceDefinitionId", + balances: [ + { + contactId: 1, + loyaltySubscriptionId: "loyaltySubscriptionId", + updatedAt: "updatedAt", + value: 1.1, + }, + ], + count: 1, + loyaltyProgramId: "loyaltyProgramId", + }); + }); + + test("getContactBalances (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/contact-balances") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getContactBalances({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getContactBalances (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/contact-balances") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getContactBalances({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getContactBalances (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/contact-balances") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getContactBalances({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getContactBalances (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/contact-balances") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getContactBalances({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getContactBalances (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/contact-balances") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getContactBalances({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createBalanceOrder (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }; + const rawResponseBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + createdAt: "createdAt", + dueAt: "dueAt", + expiresAt: "expiresAt", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + processedAt: "processedAt", + transactionid: "transactionid", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/create-order") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.createBalanceOrder({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }); + expect(response).toEqual({ + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + createdAt: "createdAt", + dueAt: "dueAt", + expiresAt: "expiresAt", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + processedAt: "processedAt", + transactionid: "transactionid", + updatedAt: "updatedAt", + }); + }); + + test("createBalanceOrder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/create-order") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceOrder({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createBalanceOrder (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/create-order") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceOrder({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createBalanceOrder (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/create-order") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceOrder({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("createBalanceOrder (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/create-order") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createBalanceOrder({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + dueAt: "dueAt", + source: "source", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getSubscriptionBalances (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { balance: [{ balanceDefinitionId: "balanceDefinitionId", value: 1.1 }] }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.getSubscriptionBalances({ + pid: "pid", + cid: "cid", + }); + expect(response).toEqual({ + balance: [ + { + balanceDefinitionId: "balanceDefinitionId", + value: 1.1, + }, + ], + }); + }); + + test("getSubscriptionBalances (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getSubscriptionBalances({ + pid: "pid", + cid: "cid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getSubscriptionBalances (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getSubscriptionBalances({ + pid: "pid", + cid: "cid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getSubscriptionBalances (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getSubscriptionBalances({ + pid: "pid", + cid: "cid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getSubscriptionBalances (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getSubscriptionBalances({ + pid: "pid", + cid: "cid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getSubscriptionBalances (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getSubscriptionBalances({ + pid: "pid", + cid: "cid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createSubscriptionBalances (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + consumedAt: "consumedAt", + contactId: 1, + createdAt: "createdAt", + expiresAt: "expiresAt", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + organizationId: 1, + }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.createSubscriptionBalances({ + pid: "pid", + cid: "cid", + balanceDefinitionId: "balanceDefinitionId", + }); + expect(response).toEqual({ + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + consumedAt: "consumedAt", + contactId: 1, + createdAt: "createdAt", + expiresAt: "expiresAt", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + organizationId: 1, + }); + }); + + test("createSubscriptionBalances (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createSubscriptionBalances({ + pid: "pid", + cid: "cid", + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createSubscriptionBalances (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createSubscriptionBalances({ + pid: "pid", + cid: "cid", + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createSubscriptionBalances (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createSubscriptionBalances({ + pid: "pid", + cid: "cid", + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("createSubscriptionBalances (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createSubscriptionBalances({ + pid: "pid", + cid: "cid", + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("createSubscriptionBalances (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.createSubscriptionBalances({ + pid: "pid", + cid: "cid", + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getTransactionHistoryApi (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + count: 1, + loyaltyProgramId: "loyaltyProgramId", + transactionHistory: [ + { + amount: 1.1, + balanceExpirationDate: "balanceExpirationDate", + cancelledAt: "cancelledAt", + completedAt: "completedAt", + createdAt: "createdAt", + id: "id", + meta: { key: "value" }, + rejectReason: "rejectReason", + rejectedAt: "rejectedAt", + status: "status", + }, + ], + }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/transaction-history") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.getTransactionHistoryApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + expect(response).toEqual({ + balanceDefinitionId: "balanceDefinitionId", + contactId: 1, + count: 1, + loyaltyProgramId: "loyaltyProgramId", + transactionHistory: [ + { + amount: 1.1, + balanceExpirationDate: "balanceExpirationDate", + cancelledAt: "cancelledAt", + completedAt: "completedAt", + createdAt: "createdAt", + id: "id", + meta: { + key: "value", + }, + rejectReason: "rejectReason", + rejectedAt: "rejectedAt", + status: "status", + }, + ], + }); + }); + + test("getTransactionHistoryApi (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/transaction-history") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getTransactionHistoryApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getTransactionHistoryApi (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/transaction-history") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getTransactionHistoryApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getTransactionHistoryApi (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/transaction-history") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getTransactionHistoryApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getTransactionHistoryApi (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/transaction-history") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getTransactionHistoryApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getTransactionHistoryApi (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/balance/programs/pid/transaction-history") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.getTransactionHistoryApi({ + pid: "pid", + contact_id: 1, + balance_definition_id: "balance_definition_id", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("beginTransaction (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + cancelledAt: "cancelledAt", + completedAt: "completedAt", + contactId: 1, + createdAt: "createdAt", + eventTime: "eventTime", + expirationDate: "expirationDate", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + rejectReason: "rejectReason", + rejectedAt: "rejectedAt", + status: "status", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.beginTransaction({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + }); + expect(response).toEqual({ + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + cancelledAt: "cancelledAt", + completedAt: "completedAt", + contactId: 1, + createdAt: "createdAt", + eventTime: "eventTime", + expirationDate: "expirationDate", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + rejectReason: "rejectReason", + rejectedAt: "rejectedAt", + status: "status", + updatedAt: "updatedAt", + }); + }); + + test("beginTransaction (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.beginTransaction({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("beginTransaction (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.beginTransaction({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("beginTransaction (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.beginTransaction({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("beginTransaction (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.beginTransaction({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("beginTransaction (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.beginTransaction({ + pid: "pid", + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("cancelTransaction (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + cancelledAt: "cancelledAt", + completedAt: "completedAt", + contactId: 1, + createdAt: "createdAt", + eventTime: "eventTime", + expirationDate: "expirationDate", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + rejectReason: "rejectReason", + rejectedAt: "rejectedAt", + status: "status", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/cancel") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.cancelTransaction({ + pid: "pid", + tid: "tid", + }); + expect(response).toEqual({ + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + cancelledAt: "cancelledAt", + completedAt: "completedAt", + contactId: 1, + createdAt: "createdAt", + eventTime: "eventTime", + expirationDate: "expirationDate", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + rejectReason: "rejectReason", + rejectedAt: "rejectedAt", + status: "status", + updatedAt: "updatedAt", + }); + }); + + test("cancelTransaction (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/cancel") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.cancelTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("cancelTransaction (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/cancel") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.cancelTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("cancelTransaction (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/cancel") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.cancelTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("cancelTransaction (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/cancel") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.cancelTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("cancelTransaction (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/cancel") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.cancelTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("completeTransaction (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + cancelledAt: "cancelledAt", + completedAt: "completedAt", + contactId: 1, + createdAt: "createdAt", + eventTime: "eventTime", + expirationDate: "expirationDate", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + rejectReason: "rejectReason", + rejectedAt: "rejectedAt", + status: "status", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/complete") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.balance.completeTransaction({ + pid: "pid", + tid: "tid", + }); + expect(response).toEqual({ + amount: 1.1, + balanceDefinitionId: "balanceDefinitionId", + cancelledAt: "cancelledAt", + completedAt: "completedAt", + contactId: 1, + createdAt: "createdAt", + eventTime: "eventTime", + expirationDate: "expirationDate", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + rejectReason: "rejectReason", + rejectedAt: "rejectedAt", + status: "status", + updatedAt: "updatedAt", + }); + }); + + test("completeTransaction (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/complete") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.completeTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("completeTransaction (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/complete") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.completeTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("completeTransaction (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/complete") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.completeTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("completeTransaction (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/complete") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.completeTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("completeTransaction (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/balance/programs/pid/transactions/tid/complete") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.balance.completeTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); +}); diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts new file mode 100644 index 0000000..9fcb13f --- /dev/null +++ b/tests/wire/companies.test.ts @@ -0,0 +1,447 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("CompaniesClient", () => { + test("getAllCompanies (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + attributes: { + created_at: "2022-01-13T19:04:24.376+05:30", + domain: "xyz", + last_updated_at: "2022-04-01T18:47:48.283+05:30", + name: "text", + number_of_contacts: 0, + owner: "62260474111b1101704a9d85", + owner_assign_date: "2022-04-01T18:21:13.379+05:30", + phone_number: 8171844192, + revenue: 10, + }, + id: "629475917295261d9b1f4403", + linkedContactsIds: [1, 2, 3], + linkedDealsIds: [ + "61a5ce58c5d4795761045990", + "61a5ce58c5d4795761045991", + "61a5ce58c5d4795761045992", + ], + }, + ], + }; + server.mockEndpoint().get("/companies").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.companies.getAllCompanies(); + expect(response).toEqual({ + items: [ + { + attributes: { + created_at: "2022-01-13T19:04:24.376+05:30", + domain: "xyz", + last_updated_at: "2022-04-01T18:47:48.283+05:30", + name: "text", + number_of_contacts: 0, + owner: "62260474111b1101704a9d85", + owner_assign_date: "2022-04-01T18:21:13.379+05:30", + phone_number: 8171844192, + revenue: 10, + }, + id: "629475917295261d9b1f4403", + linkedContactsIds: [1, 2, 3], + linkedDealsIds: [ + "61a5ce58c5d4795761045990", + "61a5ce58c5d4795761045991", + "61a5ce58c5d4795761045992", + ], + }, + ], + }); + }); + + test("getAllCompanies (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/companies").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.companies.getAllCompanies(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createACompany (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "company" }; + const rawResponseBody = { id: "61a5cd07ca1347c82306ad06" }; + server + .mockEndpoint() + .post("/companies") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.companies.createACompany({ + name: "company", + }); + expect(response).toEqual({ + id: "61a5cd07ca1347c82306ad06", + }); + }); + + test("createACompany (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/companies") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.createACompany({ + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("linkAndUnlinkCompanyWithContactAndDeal (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .patch("/companies/link-unlink/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.companies.linkAndUnlinkCompanyWithContactAndDeal({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("linkAndUnlinkCompanyWithContactAndDeal (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/companies/link-unlink/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.linkAndUnlinkCompanyWithContactAndDeal({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getACompany (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + attributes: { + created_at: "2022-01-13T19:04:24.376+05:30", + domain: "xyz", + last_updated_at: "2022-04-01T18:47:48.283+05:30", + name: "text", + number_of_contacts: 0, + owner: "62260474111b1101704a9d85", + owner_assign_date: "2022-04-01T18:21:13.379+05:30", + phone_number: 8171844192, + revenue: 10, + }, + id: "629475917295261d9b1f4403", + linkedContactsIds: [1, 2, 3], + linkedDealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + }; + server.mockEndpoint().get("/companies/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.companies.getACompany({ + id: "id", + }); + expect(response).toEqual({ + attributes: { + created_at: "2022-01-13T19:04:24.376+05:30", + domain: "xyz", + last_updated_at: "2022-04-01T18:47:48.283+05:30", + name: "text", + number_of_contacts: 0, + owner: "62260474111b1101704a9d85", + owner_assign_date: "2022-04-01T18:21:13.379+05:30", + phone_number: 8171844192, + revenue: 10, + }, + id: "629475917295261d9b1f4403", + linkedContactsIds: [1, 2, 3], + linkedDealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + }); + }); + + test("getACompany (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/companies/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.companies.getACompany({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getACompany (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/companies/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.companies.getACompany({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteACompany (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/companies/id").respondWith().statusCode(200).build(); + + const response = await client.companies.deleteACompany({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteACompany (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/companies/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.companies.deleteACompany({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteACompany (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/companies/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.companies.deleteACompany({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateACompany (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + attributes: { + created_at: "2022-01-13T19:04:24.376+05:30", + domain: "xyz", + last_updated_at: "2022-04-01T18:47:48.283+05:30", + name: "text", + number_of_contacts: 0, + owner: "62260474111b1101704a9d85", + owner_assign_date: "2022-04-01T18:21:13.379+05:30", + phone_number: 8171844192, + revenue: 10, + }, + id: "629475917295261d9b1f4403", + linkedContactsIds: [1, 2, 3], + linkedDealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + }; + server + .mockEndpoint() + .patch("/companies/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.companies.updateACompany({ + id: "id", + }); + expect(response).toEqual({ + attributes: { + created_at: "2022-01-13T19:04:24.376+05:30", + domain: "xyz", + last_updated_at: "2022-04-01T18:47:48.283+05:30", + name: "text", + number_of_contacts: 0, + owner: "62260474111b1101704a9d85", + owner_assign_date: "2022-04-01T18:21:13.379+05:30", + phone_number: 8171844192, + revenue: 10, + }, + id: "629475917295261d9b1f4403", + linkedContactsIds: [1, 2, 3], + linkedDealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + }); + }); + + test("updateACompany (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/companies/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.updateACompany({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateACompany (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/companies/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.updateACompany({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("createACompanyDealAttribute (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { attributeType: "text", label: "Attribute Label", objectType: "companies" }; + const rawResponseBody = { id: "61a5cd07ca1347c82306ad07" }; + server + .mockEndpoint() + .post("/crm/attributes") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.companies.createACompanyDealAttribute({ + attributeType: "text", + label: "Attribute Label", + objectType: "companies", + }); + expect(response).toEqual({ + id: "61a5cd07ca1347c82306ad07", + }); + }); + + test("createACompanyDealAttribute (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { attributeType: "text", label: "label", objectType: "companies" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/crm/attributes") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.createACompanyDealAttribute({ + attributeType: "text", + label: "label", + objectType: "companies", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getCompanyAttributes", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { + attributeOptions: [{ key: "custom key", value: "custom label" }], + attributeTypeName: "text", + internalName: "name", + isRequired: true, + label: "Company Name", + }, + ]; + server + .mockEndpoint() + .get("/crm/attributes/companies") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.companies.getCompanyAttributes(); + expect(response).toEqual([ + { + attributeOptions: [ + { + key: "custom key", + value: "custom label", + }, + ], + attributeTypeName: "text", + internalName: "name", + isRequired: true, + label: "Company Name", + }, + ]); + }); +}); diff --git a/tests/wire/contacts.test.ts b/tests/wire/contacts.test.ts new file mode 100644 index 0000000..b5f5d35 --- /dev/null +++ b/tests/wire/contacts.test.ts @@ -0,0 +1,2791 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("ContactsClient", () => { + test("getContacts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + contacts: [ + { + attributes: {}, + createdAt: "2017-05-01T17:05:03Z", + email: "contact1@example.com", + emailBlacklisted: true, + id: 247, + listIds: [43, 58], + listUnsubscribed: [1000000], + modifiedAt: "2017-05-01T17:05:03Z", + smsBlacklisted: true, + }, + { + attributes: {}, + createdAt: "2017-05-01T17:05:03Z", + email: "33058407248@mailin-sms.com", + emailBlacklisted: true, + id: 245, + listIds: [43, 61, 58], + listUnsubscribed: [1000000], + modifiedAt: "2017-05-01T17:05:03Z", + smsBlacklisted: false, + }, + ], + count: 3, + }; + server.mockEndpoint().get("/contacts").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.contacts.getContacts(); + expect(response).toEqual({ + contacts: [ + { + attributes: {}, + createdAt: "2017-05-01T17:05:03Z", + email: "contact1@example.com", + emailBlacklisted: true, + id: 247, + listIds: [43, 58], + listUnsubscribed: [1000000], + modifiedAt: "2017-05-01T17:05:03Z", + smsBlacklisted: true, + }, + { + attributes: {}, + createdAt: "2017-05-01T17:05:03Z", + email: "33058407248@mailin-sms.com", + emailBlacklisted: true, + id: 245, + listIds: [43, 61, 58], + listUnsubscribed: [1000000], + modifiedAt: "2017-05-01T17:05:03Z", + smsBlacklisted: false, + }, + ], + count: 3, + }); + }); + + test("getContacts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/contacts").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.contacts.getContacts(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getContacts (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server.mockEndpoint().get("/contacts").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.contacts.getContacts(); + }).rejects.toThrow(Brevo.TooManyRequestsError); + }); + + test("createContact (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { id: 21 }; + server + .mockEndpoint() + .post("/contacts") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.createContact(); + expect(response).toEqual({ + id: 21, + }); + }); + + test("createContact (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.createContact(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createContact (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { code: "invalid_parameter", message: "message" }; + server + .mockEndpoint() + .post("/contacts") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(425) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.createContact(); + }).rejects.toThrow(Brevo.TooEarlyError); + }); + + test("getAttributes", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + attributes: [ + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [{ label: "Women", value: 1 }], + multiCategoryOptions: ["USA"], + name: "LASTNAME", + type: "text", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [{ label: "Women", value: 1 }], + multiCategoryOptions: ["USA"], + name: "FIRSTNAME", + type: "text", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [{ label: "Women", value: 1 }], + multiCategoryOptions: ["USA"], + name: "DOB", + type: "date", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "category", + enumeration: [ + { label: "Men", value: 1 }, + { label: "Women", value: 2 }, + { label: "Kid", value: 3 }, + ], + multiCategoryOptions: ["USA"], + name: "GENDER", + type: "text", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [{ label: "Women", value: 1 }], + multiCategoryOptions: ["USA"], + name: "BDO", + type: "user", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [{ label: "Women", value: 1 }], + multiCategoryOptions: ["USA", "India", "France"], + name: "COUNTRY", + type: "multiple-choice", + }, + ], + }; + server + .mockEndpoint() + .get("/contacts/attributes") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.getAttributes(); + expect(response).toEqual({ + attributes: [ + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [ + { + label: "Women", + value: 1, + }, + ], + multiCategoryOptions: ["USA"], + name: "LASTNAME", + type: "text", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [ + { + label: "Women", + value: 1, + }, + ], + multiCategoryOptions: ["USA"], + name: "FIRSTNAME", + type: "text", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [ + { + label: "Women", + value: 1, + }, + ], + multiCategoryOptions: ["USA"], + name: "DOB", + type: "date", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "category", + enumeration: [ + { + label: "Men", + value: 1, + }, + { + label: "Women", + value: 2, + }, + { + label: "Kid", + value: 3, + }, + ], + multiCategoryOptions: ["USA"], + name: "GENDER", + type: "text", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [ + { + label: "Women", + value: 1, + }, + ], + multiCategoryOptions: ["USA"], + name: "BDO", + type: "user", + }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "normal", + enumeration: [ + { + label: "Women", + value: 1, + }, + ], + multiCategoryOptions: ["USA", "India", "France"], + name: "COUNTRY", + type: "multiple-choice", + }, + ], + }); + }); + + test("createAttribute (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .post("/contacts/attributes/normal/attributeName") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.contacts.createAttribute({ + attributeCategory: "normal", + attributeName: "attributeName", + }); + expect(response).toEqual(undefined); + }); + + test("createAttribute (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/attributes/normal/attributeName") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.createAttribute({ + attributeCategory: "normal", + attributeName: "attributeName", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateAttribute (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/contacts/attributes/category/attributeName") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.contacts.updateAttribute({ + attributeCategory: "category", + attributeName: "attributeName", + }); + expect(response).toEqual(undefined); + }); + + test("updateAttribute (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/contacts/attributes/category/attributeName") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateAttribute({ + attributeCategory: "category", + attributeName: "attributeName", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateAttribute (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/contacts/attributes/category/attributeName") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateAttribute({ + attributeCategory: "category", + attributeName: "attributeName", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteAttribute (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/contacts/attributes/normal/attributeName").respondWith().statusCode(200).build(); + + const response = await client.contacts.deleteAttribute({ + attributeCategory: "normal", + attributeName: "attributeName", + }); + expect(response).toEqual(undefined); + }); + + test("deleteAttribute (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/attributes/normal/attributeName") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteAttribute({ + attributeCategory: "normal", + attributeName: "attributeName", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteAttribute (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/attributes/normal/attributeName") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteAttribute({ + attributeCategory: "normal", + attributeName: "attributeName", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteMultiAttributeOptions (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/contacts/attributes/multiple-choice/multipleChoiceAttribute/multipleChoiceAttributeOption") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.contacts.deleteMultiAttributeOptions({ + attributeType: "multiple-choice", + multipleChoiceAttribute: "multipleChoiceAttribute", + multipleChoiceAttributeOption: "multipleChoiceAttributeOption", + }); + expect(response).toEqual(undefined); + }); + + test("deleteMultiAttributeOptions (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/attributes/multiple-choice/multipleChoiceAttribute/multipleChoiceAttributeOption") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteMultiAttributeOptions({ + attributeType: "multiple-choice", + multipleChoiceAttribute: "multipleChoiceAttribute", + multipleChoiceAttributeOption: "multipleChoiceAttributeOption", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteMultiAttributeOptions (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/attributes/multiple-choice/multipleChoiceAttribute/multipleChoiceAttributeOption") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteMultiAttributeOptions({ + attributeType: "multiple-choice", + multipleChoiceAttribute: "multipleChoiceAttribute", + multipleChoiceAttributeOption: "multipleChoiceAttributeOption", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateBatchContacts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server.mockEndpoint().post("/contacts/batch").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.contacts.updateBatchContacts(); + expect(response).toEqual(undefined); + }); + + test("updateBatchContacts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateBatchContacts(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createDoiContact (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + email: "elly@example.com", + includeListIds: [36], + redirectionUrl: "http://requestb.in/173lyyx1", + templateId: 2, + }; + + server + .mockEndpoint() + .post("/contacts/doubleOptinConfirmation") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.contacts.createDoiContact({ + email: "elly@example.com", + includeListIds: [36], + redirectionUrl: "http://requestb.in/173lyyx1", + templateId: 2, + }); + expect(response).toEqual(undefined); + }); + + test("createDoiContact (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + email: "email", + includeListIds: [1000000, 1000000], + redirectionUrl: "redirectionUrl", + templateId: 1000000, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/doubleOptinConfirmation") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.createDoiContact({ + email: "email", + includeListIds: [1000000, 1000000], + redirectionUrl: "redirectionUrl", + templateId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("requestContactExport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { customContactFilter: {} }; + const rawResponseBody = { processId: 78 }; + server + .mockEndpoint() + .post("/contacts/export") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.requestContactExport({ + customContactFilter: {}, + }); + expect(response).toEqual({ + processId: 78, + }); + }); + + test("requestContactExport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { customContactFilter: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/export") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.requestContactExport({ + customContactFilter: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("requestContactExport (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { customContactFilter: {} }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/contacts/export") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.requestContactExport({ + customContactFilter: {}, + }); + }).rejects.toThrow(Brevo.TooManyRequestsError); + }); + + test("getFolders (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 2, + folders: [ + { id: 42, name: "Ninja_Form", totalBlacklisted: 98, totalSubscribers: 4567, uniqueSubscribers: 4665 }, + { id: 29, name: "Prestashop", totalBlacklisted: 10, totalSubscribers: 6543, uniqueSubscribers: 6553 }, + ], + }; + server.mockEndpoint().get("/contacts/folders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.contacts.getFolders(); + expect(response).toEqual({ + count: 2, + folders: [ + { + id: 42, + name: "Ninja_Form", + totalBlacklisted: 98, + totalSubscribers: 4567, + uniqueSubscribers: 4665, + }, + { + id: 29, + name: "Prestashop", + totalBlacklisted: 10, + totalSubscribers: 6543, + uniqueSubscribers: 6553, + }, + ], + }); + }); + + test("getFolders (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/contacts/folders").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.contacts.getFolders(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createFolder (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { id: 5 }; + server + .mockEndpoint() + .post("/contacts/folders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.createFolder({}); + expect(response).toEqual({ + id: 5, + }); + }); + + test("createFolder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/folders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.createFolder({}); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getFolder (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: 1, + name: "Client_Folder", + totalBlacklisted: 987, + totalSubscribers: 16778, + uniqueSubscribers: 17765, + }; + server + .mockEndpoint() + .get("/contacts/folders/1000000") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.getFolder({ + folderId: 1000000, + }); + expect(response).toEqual({ + id: 1, + name: "Client_Folder", + totalBlacklisted: 987, + totalSubscribers: 16778, + uniqueSubscribers: 17765, + }); + }); + + test("getFolder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/folders/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getFolder({ + folderId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getFolder (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/folders/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getFolder({ + folderId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateFolder (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/contacts/folders/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.contacts.updateFolder({ + folderId: 1000000, + body: {}, + }); + expect(response).toEqual(undefined); + }); + + test("updateFolder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/contacts/folders/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateFolder({ + folderId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateFolder (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/contacts/folders/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateFolder({ + folderId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteFolder (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/contacts/folders/1000000").respondWith().statusCode(200).build(); + + const response = await client.contacts.deleteFolder({ + folderId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteFolder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/folders/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteFolder({ + folderId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteFolder (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/folders/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteFolder({ + folderId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getFolderLists (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 3, + lists: [ + { id: 46, name: "Reactiv", totalBlacklisted: 0, totalSubscribers: 7655, uniqueSubscribers: 7655 }, + { id: 41, name: "NY_Area", totalBlacklisted: 23, totalSubscribers: 3654, uniqueSubscribers: 3677 }, + { id: 22, name: "VIP_Customer", totalBlacklisted: 72, totalSubscribers: 8753, uniqueSubscribers: 8826 }, + ], + }; + server + .mockEndpoint() + .get("/contacts/folders/1000000/lists") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.getFolderLists({ + folderId: 1000000, + }); + expect(response).toEqual({ + count: 3, + lists: [ + { + id: 46, + name: "Reactiv", + totalBlacklisted: 0, + totalSubscribers: 7655, + uniqueSubscribers: 7655, + }, + { + id: 41, + name: "NY_Area", + totalBlacklisted: 23, + totalSubscribers: 3654, + uniqueSubscribers: 3677, + }, + { + id: 22, + name: "VIP_Customer", + totalBlacklisted: 72, + totalSubscribers: 8753, + uniqueSubscribers: 8826, + }, + ], + }); + }); + + test("getFolderLists (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/folders/1000000/lists") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getFolderLists({ + folderId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getFolderLists (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/folders/1000000/lists") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getFolderLists({ + folderId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("importContacts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { processId: 78 }; + server + .mockEndpoint() + .post("/contacts/import") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.importContacts(); + expect(response).toEqual({ + processId: 78, + }); + }); + + test("importContacts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/import") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.importContacts(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getLists (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 2, + lists: [ + { + id: 53, + name: "Spanish_Speakers", + totalBlacklisted: 65, + totalSubscribers: 5432, + uniqueSubscribers: 5497, + folderId: 1, + }, + { + id: 50, + name: "Other", + totalBlacklisted: 765, + totalSubscribers: 10976, + uniqueSubscribers: 11741, + folderId: 2, + }, + ], + }; + server.mockEndpoint().get("/contacts/lists").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.contacts.getLists(); + expect(response).toEqual({ + count: 2, + lists: [ + { + id: 53, + name: "Spanish_Speakers", + totalBlacklisted: 65, + totalSubscribers: 5432, + uniqueSubscribers: 5497, + folderId: 1, + }, + { + id: 50, + name: "Other", + totalBlacklisted: 765, + totalSubscribers: 10976, + uniqueSubscribers: 11741, + folderId: 2, + }, + ], + }); + }); + + test("getLists (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/contacts/lists").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.contacts.getLists(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { folderId: 2, name: "Magento Customer - ES" }; + const rawResponseBody = { id: 5 }; + server + .mockEndpoint() + .post("/contacts/lists") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.createList({ + folderId: 2, + name: "Magento Customer - ES", + }); + expect(response).toEqual({ + id: 5, + }); + }); + + test("createList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { folderId: 1000000, name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/lists") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.createList({ + folderId: 1000000, + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: 12, + name: "Newsletter_Weekly", + totalBlacklisted: 63, + totalSubscribers: 6533, + uniqueSubscribers: 6596, + campaignStats: [ + { + campaignId: 15, + stats: { + appleMppOpens: 10, + clickers: 789, + complaints: 0, + deferred: 0, + delivered: 6632, + estimatedViews: 560, + hardBounces: 4, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 6645, + softBounces: 34, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 701, + uniqueViews: 3442, + unsubscriptions: 4, + viewed: 4322, + }, + }, + { + campaignId: 45, + stats: { + appleMppOpens: 10, + clickers: 788, + complaints: 1, + deferred: 0, + delivered: 4078, + estimatedViews: 560, + hardBounces: 2, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 4334, + softBounces: 18, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 654, + uniqueViews: 987, + unsubscriptions: 4, + viewed: 1555, + }, + }, + ], + createdAt: "2016-02-26T11:56:08Z", + dynamicList: false, + folderId: 1, + }; + server + .mockEndpoint() + .get("/contacts/lists/1000000") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.getList({ + listId: 1000000, + }); + expect(response).toEqual({ + id: 12, + name: "Newsletter_Weekly", + totalBlacklisted: 63, + totalSubscribers: 6533, + uniqueSubscribers: 6596, + campaignStats: [ + { + campaignId: 15, + stats: { + appleMppOpens: 10, + clickers: 789, + complaints: 0, + deferred: 0, + delivered: 6632, + estimatedViews: 560, + hardBounces: 4, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 6645, + softBounces: 34, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 701, + uniqueViews: 3442, + unsubscriptions: 4, + viewed: 4322, + }, + }, + { + campaignId: 45, + stats: { + appleMppOpens: 10, + clickers: 788, + complaints: 1, + deferred: 0, + delivered: 4078, + estimatedViews: 560, + hardBounces: 2, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 4334, + softBounces: 18, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 654, + uniqueViews: 987, + unsubscriptions: 4, + viewed: 1555, + }, + }, + ], + createdAt: "2016-02-26T11:56:08Z", + dynamicList: false, + folderId: 1, + }); + }); + + test("getList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/lists/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getList (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/lists/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/contacts/lists/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.contacts.updateList({ + listId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("updateList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/contacts/lists/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateList (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/contacts/lists/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/contacts/lists/1000000").respondWith().statusCode(200).build(); + + const response = await client.contacts.deleteList({ + listId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/lists/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteList (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/lists/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getContactsFromList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + contacts: [ + { + attributes: {}, + createdAt: "2017-05-12T12:30:00Z", + email: "alex.pain@example.com", + emailBlacklisted: false, + id: 45, + listIds: [12, 9, 20], + listUnsubscribed: [1, 2], + modifiedAt: "2017-05-12T12:30:00Z", + smsBlacklisted: true, + }, + { + attributes: {}, + createdAt: "2017-05-12T12:30:00Z", + email: "john.smith@example.com", + emailBlacklisted: true, + id: 32, + listIds: [12], + listUnsubscribed: [1], + modifiedAt: "2017-05-12T12:30:00Z", + smsBlacklisted: false, + }, + { + attributes: {}, + createdAt: "2017-05-12T12:30:00Z", + email: "helen.rose@example.com", + emailBlacklisted: true, + id: 65, + listIds: [12, 9, 20], + listUnsubscribed: [1], + modifiedAt: "2017-05-12T12:30:00Z", + smsBlacklisted: false, + }, + ], + count: 17655, + }; + server + .mockEndpoint() + .get("/contacts/lists/1000000/contacts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.getContactsFromList({ + listId: 1000000, + }); + expect(response).toEqual({ + contacts: [ + { + attributes: {}, + createdAt: "2017-05-12T12:30:00Z", + email: "alex.pain@example.com", + emailBlacklisted: false, + id: 45, + listIds: [12, 9, 20], + listUnsubscribed: [1, 2], + modifiedAt: "2017-05-12T12:30:00Z", + smsBlacklisted: true, + }, + { + attributes: {}, + createdAt: "2017-05-12T12:30:00Z", + email: "john.smith@example.com", + emailBlacklisted: true, + id: 32, + listIds: [12], + listUnsubscribed: [1], + modifiedAt: "2017-05-12T12:30:00Z", + smsBlacklisted: false, + }, + { + attributes: {}, + createdAt: "2017-05-12T12:30:00Z", + email: "helen.rose@example.com", + emailBlacklisted: true, + id: 65, + listIds: [12, 9, 20], + listUnsubscribed: [1], + modifiedAt: "2017-05-12T12:30:00Z", + smsBlacklisted: false, + }, + ], + count: 17655, + }); + }); + + test("getContactsFromList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/lists/1000000/contacts") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getContactsFromList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getContactsFromList (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/lists/1000000/contacts") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getContactsFromList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("addContactToList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { emails: ["jeff32@example.com", "jim56@example.com"] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/add") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.addContactToList({ + listId: 1000000, + body: { + emails: ["jeff32@example.com", "jim56@example.com"], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("addContactToList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { extIds: ["ext234", "ext456"] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/add") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.addContactToList({ + listId: 1000000, + body: { + extIds: ["ext234", "ext456"], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("addContactToList (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { ids: [1, 2] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/add") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.addContactToList({ + listId: 1000000, + body: { + ids: [1, 2], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("addContactToList (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { emails: ["jeff32@example.com", "jim56@example.com"] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/add") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.addContactToList({ + listId: 1000000, + body: { + emails: ["jeff32@example.com", "jim56@example.com"], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("addContactToList (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { emails: ["jeff32@example.com", "jim56@example.com"] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/add") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.addContactToList({ + listId: 1000000, + body: { + emails: ["jeff32@example.com", "jim56@example.com"], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("addContactToList (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { emails: ["jeff32@example.com", "jim56@example.com"] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/add") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.addContactToList({ + listId: 1000000, + body: { + emails: ["jeff32@example.com", "jim56@example.com"], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("addContactToList (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/add") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.addContactToList({ + listId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("addContactToList (8)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/add") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.addContactToList({ + listId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("removeContactFromList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all: true }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + all: true, + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("removeContactFromList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { emails: ["jeff32@example.com", "jim56@example.com"] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + emails: ["jeff32@example.com", "jim56@example.com"], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("removeContactFromList (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { extIds: ["ext234", "ext456"] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + extIds: ["ext234", "ext456"], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("removeContactFromList (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { ids: [1, 2] }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + ids: [1, 2], + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("removeContactFromList (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all: true }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + all: true, + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("removeContactFromList (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all: true }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + all: true, + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("removeContactFromList (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all: true }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + all: true, + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("removeContactFromList (8)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all: true }; + const rawResponseBody = { + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.removeContactFromList({ + listId: 1000000, + body: { + all: true, + }, + }); + expect(response).toEqual({ + contacts: { + failure: ["jeff32@example.com, jim56@example.com"], + processId: 78, + success: ["success"], + total: 27, + }, + }); + }); + + test("removeContactFromList (9)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.removeContactFromList({ + listId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("removeContactFromList (10)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/contacts/lists/1000000/contacts/remove") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.removeContactFromList({ + listId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getSegments (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 2, + segments: [ + { categoryName: "Name1", id: 53, segmentName: "Segment1", updatedAt: "2017-03-12T12:30:00Z" }, + { categoryName: "Name2", id: 50, segmentName: "Segment2", updatedAt: "2017-03-12T12:30:00Z" }, + ], + }; + server.mockEndpoint().get("/contacts/segments").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.contacts.getSegments(); + expect(response).toEqual({ + count: 2, + segments: [ + { + categoryName: "Name1", + id: 53, + segmentName: "Segment1", + updatedAt: "2017-03-12T12:30:00Z", + }, + { + categoryName: "Name2", + id: 50, + segmentName: "Segment2", + updatedAt: "2017-03-12T12:30:00Z", + }, + ], + }); + }); + + test("getSegments (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/contacts/segments").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.contacts.getSegments(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getContactInfo (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + attributes: {}, + createdAt: "2017-05-02T16:40:31Z", + email: "peggy.rain@example.com", + emailBlacklisted: false, + id: 42, + listIds: [40], + listUnsubscribed: [1000000], + modifiedAt: "2017-05-02T16:40:31Z", + smsBlacklisted: false, + statistics: { + clicked: [ + { + campaignId: 21, + links: [ + { + count: 2, + eventTime: "2016-05-03T21:25:01Z", + ip: "66.249.93.118", + url: "https://url.domain.com/fbe5387ec717e333628380454f68670010b205ff/1/go?uid={EMAIL}&utm_source=brevo&utm_campaign=test_camp&utm_medium=email", + }, + ], + }, + ], + complaints: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z" }], + delivered: [{ campaignId: 21, eventTime: "2016-05-03T21:24:56Z" }], + hardBounces: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z" }], + messagesSent: [ + { campaignId: 21, eventTime: "2016-05-03T20:15:13Z" }, + { campaignId: 42, eventTime: "2016-10-17T10:30:01Z" }, + ], + opened: [ + { campaignId: 21, count: 2, eventTime: "2016-05-03T21:24:56Z", ip: "66.249.93.118" }, + { campaignId: 68, count: 1, eventTime: "2017-01-30T13:56:40Z", ip: "66.249.93.217" }, + ], + softBounces: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z" }], + transacAttributes: [{}], + unsubscriptions: { + adminUnsubscription: [{ eventTime: "2017-03-12T20:15:13Z", ip: "165.87.3.15" }], + userUnsubscription: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z", ip: "165.87.3.15" }], + }, + }, + }; + server + .mockEndpoint() + .get("/contacts/identifier") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.getContactInfo({ + identifier: "identifier", + }); + expect(response).toEqual({ + attributes: {}, + createdAt: "2017-05-02T16:40:31Z", + email: "peggy.rain@example.com", + emailBlacklisted: false, + id: 42, + listIds: [40], + listUnsubscribed: [1000000], + modifiedAt: "2017-05-02T16:40:31Z", + smsBlacklisted: false, + statistics: { + clicked: [ + { + campaignId: 21, + links: [ + { + count: 2, + eventTime: "2016-05-03T21:25:01Z", + ip: "66.249.93.118", + url: "https://url.domain.com/fbe5387ec717e333628380454f68670010b205ff/1/go?uid={EMAIL}&utm_source=brevo&utm_campaign=test_camp&utm_medium=email", + }, + ], + }, + ], + complaints: [ + { + campaignId: 3, + eventTime: "2017-03-12T20:15:13Z", + }, + ], + delivered: [ + { + campaignId: 21, + eventTime: "2016-05-03T21:24:56Z", + }, + ], + hardBounces: [ + { + campaignId: 3, + eventTime: "2017-03-12T20:15:13Z", + }, + ], + messagesSent: [ + { + campaignId: 21, + eventTime: "2016-05-03T20:15:13Z", + }, + { + campaignId: 42, + eventTime: "2016-10-17T10:30:01Z", + }, + ], + opened: [ + { + campaignId: 21, + count: 2, + eventTime: "2016-05-03T21:24:56Z", + ip: "66.249.93.118", + }, + { + campaignId: 68, + count: 1, + eventTime: "2017-01-30T13:56:40Z", + ip: "66.249.93.217", + }, + ], + softBounces: [ + { + campaignId: 3, + eventTime: "2017-03-12T20:15:13Z", + }, + ], + transacAttributes: [{}], + unsubscriptions: { + adminUnsubscription: [ + { + eventTime: "2017-03-12T20:15:13Z", + ip: "165.87.3.15", + }, + ], + userUnsubscription: [ + { + campaignId: 3, + eventTime: "2017-03-12T20:15:13Z", + ip: "165.87.3.15", + }, + ], + }, + }, + }); + }); + + test("getContactInfo (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/identifier") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getContactInfo({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getContactInfo (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/identifier") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getContactInfo({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateContact (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/contacts/identifier") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.contacts.updateContact({ + identifier: "identifier", + }); + expect(response).toEqual(undefined); + }); + + test("updateContact (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/contacts/identifier") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateContact({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateContact (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/contacts/identifier") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateContact({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateContact (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { code: "invalid_parameter", message: "message" }; + server + .mockEndpoint() + .put("/contacts/identifier") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(425) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.updateContact({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.TooEarlyError); + }); + + test("deleteContact (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/contacts/identifier").respondWith().statusCode(200).build(); + + const response = await client.contacts.deleteContact({ + identifier: "identifier", + }); + expect(response).toEqual(undefined); + }); + + test("deleteContact (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/identifier") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteContact({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteContact (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/contacts/identifier") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteContact({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteContact (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/contacts/identifier") + .respondWith() + .statusCode(405) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.deleteContact({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.MethodNotAllowedError); + }); + + test("getContactStats (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + clicked: [ + { + campaignId: 21, + links: [ + { + count: 2, + eventTime: "2016-05-03T21:25:01Z", + ip: "66.249.93.118", + url: "https://url.domain.com/fbe5387ec717e333628380454f68670010b205ff/1/go?uid={EMAIL}&utm_source=brevo&utm_campaign=test_camp&utm_medium=email", + }, + ], + }, + ], + complaints: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z" }], + delivered: [{ campaignId: 21, eventTime: "2016-05-03T21:24:56Z" }], + hardBounces: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z" }], + messagesSent: [ + { campaignId: 21, eventTime: "2016-05-03T20:15:13Z" }, + { campaignId: 42, eventTime: "2016-10-17T10:30:01Z" }, + { campaignId: 45, eventTime: "2016-11-09T11:45:02Z" }, + ], + opened: [ + { campaignId: 21, count: 2, eventTime: "2016-05-03T21:24:56Z", ip: "66.249.93.118" }, + { campaignId: 45, count: 1, eventTime: "2017-01-30T13:56:40Z", ip: "66.249.93.217" }, + ], + softBounces: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z" }], + transacAttributes: [{ orderDate: "2017-03-12", orderId: 248, orderPrice: 24.99 }], + unsubscriptions: { + adminUnsubscription: [{ eventTime: "2017-03-12T20:15:13Z", ip: "165.87.3.15" }], + userUnsubscription: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z", ip: "165.87.3.15" }], + }, + }; + server + .mockEndpoint() + .get("/contacts/identifier/campaignStats") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.contacts.getContactStats({ + identifier: "identifier", + }); + expect(response).toEqual({ + clicked: [ + { + campaignId: 21, + links: [ + { + count: 2, + eventTime: "2016-05-03T21:25:01Z", + ip: "66.249.93.118", + url: "https://url.domain.com/fbe5387ec717e333628380454f68670010b205ff/1/go?uid={EMAIL}&utm_source=brevo&utm_campaign=test_camp&utm_medium=email", + }, + ], + }, + ], + complaints: [ + { + campaignId: 3, + eventTime: "2017-03-12T20:15:13Z", + }, + ], + delivered: [ + { + campaignId: 21, + eventTime: "2016-05-03T21:24:56Z", + }, + ], + hardBounces: [ + { + campaignId: 3, + eventTime: "2017-03-12T20:15:13Z", + }, + ], + messagesSent: [ + { + campaignId: 21, + eventTime: "2016-05-03T20:15:13Z", + }, + { + campaignId: 42, + eventTime: "2016-10-17T10:30:01Z", + }, + { + campaignId: 45, + eventTime: "2016-11-09T11:45:02Z", + }, + ], + opened: [ + { + campaignId: 21, + count: 2, + eventTime: "2016-05-03T21:24:56Z", + ip: "66.249.93.118", + }, + { + campaignId: 45, + count: 1, + eventTime: "2017-01-30T13:56:40Z", + ip: "66.249.93.217", + }, + ], + softBounces: [ + { + campaignId: 3, + eventTime: "2017-03-12T20:15:13Z", + }, + ], + transacAttributes: [ + { + orderDate: "2017-03-12", + orderId: 248, + orderPrice: 24.99, + }, + ], + unsubscriptions: { + adminUnsubscription: [ + { + eventTime: "2017-03-12T20:15:13Z", + ip: "165.87.3.15", + }, + ], + userUnsubscription: [ + { + campaignId: 3, + eventTime: "2017-03-12T20:15:13Z", + ip: "165.87.3.15", + }, + ], + }, + }); + }); + + test("getContactStats (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/identifier/campaignStats") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getContactStats({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getContactStats (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/contacts/identifier/campaignStats") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getContactStats({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/conversations.test.ts b/tests/wire/conversations.test.ts new file mode 100644 index 0000000..5c7a79e --- /dev/null +++ b/tests/wire/conversations.test.ts @@ -0,0 +1,1925 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("ConversationsClient", () => { + test("setsAgentsStatusToOnlineFor23Minutes (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { agentId: "d9nKoegKSjmCtyK78" }; + + server + .mockEndpoint() + .post("/conversations/agentOnlinePing") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.conversations.setsAgentsStatusToOnlineFor23Minutes({ + agentId: "d9nKoegKSjmCtyK78", + }); + expect(response).toEqual(undefined); + }); + + test("setsAgentsStatusToOnlineFor23Minutes (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + agentEmail: "liz@getwear.com", + agentName: "Liz", + receivedFrom: "SuperAwesomeHelpdesk", + }; + + server + .mockEndpoint() + .post("/conversations/agentOnlinePing") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.conversations.setsAgentsStatusToOnlineFor23Minutes({ + agentEmail: "liz@getwear.com", + agentName: "Liz", + receivedFrom: "SuperAwesomeHelpdesk", + }); + expect(response).toEqual(undefined); + }); + + test("setsAgentsStatusToOnlineFor23Minutes (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/conversations/agentOnlinePing") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.setsAgentsStatusToOnlineFor23Minutes(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendAMessageAsAnAgent (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + agentId: "d9nKoegKSjmCtyK78", + text: "Hello! How can I help you?", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .post("/conversations/messages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.sendAMessageAsAnAgent({ + agentId: "d9nKoegKSjmCtyK78", + text: "Hello! How can I help you?", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("sendAMessageAsAnAgent (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + agentEmail: "liz@getwear.com", + agentName: "Liz", + receivedFrom: "SuperAwesomeHelpdesk", + text: "Hello! How can I help you?", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .post("/conversations/messages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.sendAMessageAsAnAgent({ + agentEmail: "liz@getwear.com", + agentName: "Liz", + receivedFrom: "SuperAwesomeHelpdesk", + text: "Hello! How can I help you?", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("sendAMessageAsAnAgent (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + agentId: "d9nKoegKSjmCtyK78", + receivedFrom: "SuperAwesomeHelpdesk", + text: "Hello! How can I help you?", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .post("/conversations/messages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.sendAMessageAsAnAgent({ + agentId: "d9nKoegKSjmCtyK78", + receivedFrom: "SuperAwesomeHelpdesk", + text: "Hello! How can I help you?", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("sendAMessageAsAnAgent (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: { key: "value" }, visitorId: { key: "value" } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/conversations/messages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.sendAMessageAsAnAgent({ + text: { + key: "value", + }, + visitorId: { + key: "value", + }, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAMessage (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .get("/conversations/messages/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.getAMessage({ + id: "id", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("getAMessage (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/conversations/messages/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.getAMessage({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAMessage (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/conversations/messages/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.getAMessage({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateAMessageSentByAnAgent (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "Good morning! How can I help you?" }; + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .put("/conversations/messages/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.updateAMessageSentByAnAgent({ + id: "id", + text: "Good morning! How can I help you?", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1482512803740, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Hello! How can I help you?", + id: "eYBEm3gq3zc5ayE2g", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: false, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Hello! How can I help you?", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("updateAMessageSentByAnAgent (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "text" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/conversations/messages/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.updateAMessageSentByAnAgent({ + id: "id", + text: "text", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateAMessageSentByAnAgent (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "text" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/conversations/messages/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.updateAMessageSentByAnAgent({ + id: "id", + text: "text", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteAMessageSentByAnAgent (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/conversations/messages/id").respondWith().statusCode(200).build(); + + const response = await client.conversations.deleteAMessageSentByAnAgent({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteAMessageSentByAnAgent (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/conversations/messages/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.deleteAMessageSentByAnAgent({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteAMessageSentByAnAgent (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/conversations/messages/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.deleteAMessageSentByAnAgent({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("sendAnAutomatedMessageToAVisitor (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + groupId: "PjRBMhWGen6aRHjif", + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + id: "AXCR3k9bpSY7bpuh7", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .post("/conversations/pushedMessages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.sendAnAutomatedMessageToAVisitor({ + groupId: "PjRBMhWGen6aRHjif", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + id: "AXCR3k9bpSY7bpuh7", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("sendAnAutomatedMessageToAVisitor (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + id: "AXCR3k9bpSY7bpuh7", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .post("/conversations/pushedMessages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.sendAnAutomatedMessageToAVisitor({ + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + id: "AXCR3k9bpSY7bpuh7", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("sendAnAutomatedMessageToAVisitor (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + agentId: "d9nKoegKSjmCtyK78", + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + id: "AXCR3k9bpSY7bpuh7", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .post("/conversations/pushedMessages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.sendAnAutomatedMessageToAVisitor({ + agentId: "d9nKoegKSjmCtyK78", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + id: "AXCR3k9bpSY7bpuh7", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("sendAnAutomatedMessageToAVisitor (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: { key: "value" }, visitorId: { key: "value" } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/conversations/pushedMessages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.sendAnAutomatedMessageToAVisitor({ + text: { + key: "value", + }, + visitorId: { + key: "value", + }, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAnAutomatedMessage (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + id: "AXCR3k9bpSY7bpuh7", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .get("/conversations/pushedMessages/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.getAnAutomatedMessage({ + id: "id", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + id: "AXCR3k9bpSY7bpuh7", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("getAnAutomatedMessage (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/conversations/pushedMessages/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.getAnAutomatedMessage({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAnAutomatedMessage (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/conversations/pushedMessages/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.getAnAutomatedMessage({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateAnAutomatedMessage (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + text: "Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54", + }; + const rawResponseBody = { + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54", + id: "AXCR3k9bpSY7bpuh7", + integrations: { key: "value" }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { email: "email", name: "name" }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54", + to: [{ email: "email", name: "name" }], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + server + .mockEndpoint() + .put("/conversations/pushedMessages/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.updateAnAutomatedMessage({ + id: "id", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54", + }); + expect(response).toEqual({ + agentId: "d9nKoegKSjmCtyK78", + agentName: "Liz", + agentUserpic: "https://www.brevo.com/", + attachments: [ + { + fileName: "fileName", + inlineId: "inlineId", + isImage: true, + isInline: "isInline", + size: 1000000, + url: "url", + }, + ], + bcc: [ + { + email: "email", + name: "name", + }, + ], + cc: [ + { + email: "email", + name: "name", + }, + ], + createdAt: 1470222622433, + file: { + filename: "conversations.png", + imageInfo: { + height: 525, + previewUrl: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", + width: 1129, + }, + isImage: true, + size: 15538, + url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + }, + forwardedToSourceStatus: { + error: "error", + isSuccess: true, + }, + from: { + email: "email", + name: "name", + }, + html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54", + id: "AXCR3k9bpSY7bpuh7", + integrations: { + key: "value", + }, + isBot: true, + isMissed: false, + isMissedByVisitor: false, + isPushed: true, + isTrigger: false, + rawUnsafeHtml: "Good morning!
How can I help you?", + receivedFrom: "SuperAwesomeHelpdesk", + replyTo: { + email: "email", + name: "name", + }, + sourceMessageId: "sourceMessageId", + subject: "Invitation to a meeting", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54", + to: [ + { + email: "email", + name: "name", + }, + ], + type: "agent", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }); + }); + + test("updateAnAutomatedMessage (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "text" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/conversations/pushedMessages/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.updateAnAutomatedMessage({ + id: "id", + text: "text", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateAnAutomatedMessage (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "text" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/conversations/pushedMessages/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.updateAnAutomatedMessage({ + id: "id", + text: "text", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteAnAutomatedMessage (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/conversations/pushedMessages/id").respondWith().statusCode(200).build(); + + const response = await client.conversations.deleteAnAutomatedMessage({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteAnAutomatedMessage (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/conversations/pushedMessages/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.deleteAnAutomatedMessage({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteAnAutomatedMessage (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/conversations/pushedMessages/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.deleteAnAutomatedMessage({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("setVisitorGroupAssignment (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { groupId: "PjRBMhWGen6aRHjif" }; + const rawResponseBody = { groupId: "PjRBMhWGen6aRHjif", visitorId: "AXCR3k9bpSY7bpuh7" }; + server + .mockEndpoint() + .put("/conversations/visitorGroup") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.setVisitorGroupAssignment({ + groupId: "PjRBMhWGen6aRHjif", + }); + expect(response).toEqual({ + groupId: "PjRBMhWGen6aRHjif", + visitorId: "AXCR3k9bpSY7bpuh7", + }); + }); + + test("setVisitorGroupAssignment (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { groupId: { key: "value" } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/conversations/visitorGroup") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.setVisitorGroupAssignment({ + groupId: { + key: "value", + }, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("setVisitorGroupAssignment (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { groupId: { key: "value" } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/conversations/visitorGroup") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.conversations.setVisitorGroupAssignment({ + groupId: { + key: "value", + }, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/coupons.test.ts b/tests/wire/coupons.test.ts new file mode 100644 index 0000000..9d5a22b --- /dev/null +++ b/tests/wire/coupons.test.ts @@ -0,0 +1,378 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("CouponsClient", () => { + test("getCouponCollections (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + createdAt: "2023-01-06T05:03:47Z", + defaultCoupon: "10 OFF", + expirationDate: "2024-01-01T00:00:00Z", + id: "23befbae-1505-47a8-bd27-e30ef739f32c", + name: "SummerPromotions", + remainingCoupons: 5000, + remainingCouponsAlert: 5, + remainingDaysAlert: 5, + totalCoupons: 10000, + }; + server.mockEndpoint().get("/couponCollections").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.coupons.getCouponCollections(); + expect(response).toEqual({ + createdAt: "2023-01-06T05:03:47Z", + defaultCoupon: "10 OFF", + expirationDate: "2024-01-01T00:00:00Z", + id: "23befbae-1505-47a8-bd27-e30ef739f32c", + name: "SummerPromotions", + remainingCoupons: 5000, + remainingCouponsAlert: 5, + remainingDaysAlert: 5, + totalCoupons: 10000, + }); + }); + + test("getCouponCollections (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/couponCollections").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.coupons.getCouponCollections(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getCouponCollections (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/couponCollections").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.coupons.getCouponCollections(); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createCouponCollection (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { defaultCoupon: "Winter", name: "10%OFF" }; + const rawResponseBody = { id: "23befbae-1505-47a8-bd27-e30ef739f32c" }; + server + .mockEndpoint() + .post("/couponCollections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.coupons.createCouponCollection({ + defaultCoupon: "Winter", + name: "10%OFF", + }); + expect(response).toEqual({ + id: "23befbae-1505-47a8-bd27-e30ef739f32c", + }); + }); + + test("createCouponCollection (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { defaultCoupon: "defaultCoupon", name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/couponCollections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.createCouponCollection({ + defaultCoupon: "defaultCoupon", + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createCouponCollection (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { defaultCoupon: "defaultCoupon", name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/couponCollections") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.createCouponCollection({ + defaultCoupon: "defaultCoupon", + name: "name", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getCouponCollection (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + createdAt: "2023-01-06T05:03:47Z", + defaultCoupon: "10 OFF", + expirationDate: "2024-01-01T00:00:00Z", + id: "23befbae-1505-47a8-bd27-e30ef739f32c", + name: "SummerPromotions", + remainingCoupons: 5000, + remainingCouponsAlert: 5, + remainingDaysAlert: 5, + totalCoupons: 10000, + }; + server + .mockEndpoint() + .get("/couponCollections/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.coupons.getCouponCollection({ + id: "id", + }); + expect(response).toEqual({ + createdAt: "2023-01-06T05:03:47Z", + defaultCoupon: "10 OFF", + expirationDate: "2024-01-01T00:00:00Z", + id: "23befbae-1505-47a8-bd27-e30ef739f32c", + name: "SummerPromotions", + remainingCoupons: 5000, + remainingCouponsAlert: 5, + remainingDaysAlert: 5, + totalCoupons: 10000, + }); + }); + + test("getCouponCollection (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/couponCollections/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.getCouponCollection({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getCouponCollection (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/couponCollections/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.getCouponCollection({ + id: "id", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getCouponCollection (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/couponCollections/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.getCouponCollection({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateCouponCollection (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + defaultCoupon: "10 OFF", + id: "23befbae-1505-47a8-bd27-e30ef739f32c", + name: "SummerPromotions", + }; + server + .mockEndpoint() + .patch("/couponCollections/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.coupons.updateCouponCollection({ + id: "id", + }); + expect(response).toEqual({ + defaultCoupon: "10 OFF", + id: "23befbae-1505-47a8-bd27-e30ef739f32c", + name: "SummerPromotions", + }); + }); + + test("updateCouponCollection (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/couponCollections/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.updateCouponCollection({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateCouponCollection (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/couponCollections/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.updateCouponCollection({ + id: "id", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createCoupons (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { collectionId: "23befbae-1505-47a8-bd27-e30ef739f32c", coupons: ["Uf12AF"] }; + + server.mockEndpoint().post("/coupons").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.coupons.createCoupons({ + collectionId: "23befbae-1505-47a8-bd27-e30ef739f32c", + coupons: ["Uf12AF"], + }); + expect(response).toEqual(undefined); + }); + + test("createCoupons (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { collectionId: "collectionId", coupons: ["coupons", "coupons"] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/coupons") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.createCoupons({ + collectionId: "collectionId", + coupons: ["coupons", "coupons"], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createCoupons (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { collectionId: "collectionId", coupons: ["coupons", "coupons"] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/coupons") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.createCoupons({ + collectionId: "collectionId", + coupons: ["coupons", "coupons"], + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createCoupons (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { collectionId: "collectionId", coupons: ["coupons", "coupons"] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/coupons") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.coupons.createCoupons({ + collectionId: "collectionId", + coupons: ["coupons", "coupons"], + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/customObjects.test.ts b/tests/wire/customObjects.test.ts new file mode 100644 index 0000000..b937282 --- /dev/null +++ b/tests/wire/customObjects.test.ts @@ -0,0 +1,373 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("CustomObjectsClient", () => { + test("upsertrecords (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { records: [{}] }; + const rawResponseBody = { message: "Batch object records are being processed", processId: 21 }; + server + .mockEndpoint() + .post("/objects/vehicle/batch/upsert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.customObjects.upsertrecords({ + object_type: "vehicle", + records: [{}], + }); + expect(response).toEqual({ + message: "Batch object records are being processed", + processId: 21, + }); + }); + + test("upsertrecords (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { records: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/objects/object_type/batch/upsert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.upsertrecords({ + object_type: "object_type", + records: [{}, {}], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("upsertrecords (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { records: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/objects/object_type/batch/upsert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.upsertrecords({ + object_type: "object_type", + records: [{}, {}], + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("upsertrecords (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { records: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/objects/object_type/batch/upsert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.upsertrecords({ + object_type: "object_type", + records: [{}, {}], + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("upsertrecords (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { records: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/objects/object_type/batch/upsert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.upsertrecords({ + object_type: "object_type", + records: [{}, {}], + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getrecords (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 350, + records: [ + { + associations: [{ object_type: "garage" }], + attributes: { color: "Black", engine_type: "Hybrid", make: "Toyoto", model: "Corolla", year: 2020 }, + createdAt: "2025-07-22T10:20:30Z", + identifiers: { ext_id: "507f1f77bc", id: 16789 }, + updatedAt: "2025-07-22T10:20:30Z", + }, + ], + }; + server + .mockEndpoint() + .get("/objects/vehicle/records") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.customObjects.getrecords({ + object_type: "vehicle", + limit: 1000000, + page_num: 1000000, + }); + expect(response).toEqual({ + count: 350, + records: [ + { + associations: [ + { + object_type: "garage", + }, + ], + attributes: { + color: "Black", + engine_type: "Hybrid", + make: "Toyoto", + model: "Corolla", + year: 2020, + }, + createdAt: "2025-07-22T10:20:30Z", + identifiers: { + ext_id: "507f1f77bc", + id: 16789, + }, + updatedAt: "2025-07-22T10:20:30Z", + }, + ], + }); + }); + + test("getrecords (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/objects/object_type/records") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.getrecords({ + object_type: "object_type", + limit: 1000000, + page_num: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getrecords (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/objects/object_type/records") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.getrecords({ + object_type: "object_type", + limit: 1000000, + page_num: 1000000, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getrecords (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/objects/object_type/records") + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.getrecords({ + object_type: "object_type", + limit: 1000000, + page_num: 1000000, + }); + }).rejects.toThrow(Brevo.FailedDependencyError); + }); + + test("getrecords (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/objects/object_type/records") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.getrecords({ + object_type: "object_type", + limit: 1000000, + page_num: 1000000, + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("batchDeleteObjectRecords (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { identifiers: { ext_ids: ["ext-001", "ext-002"] } }; + const rawResponseBody = { processId: 21, message: "Batch object records are being processed for deletion." }; + server + .mockEndpoint() + .post("/objects/vehicle/batch/delete") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.customObjects.batchDeleteObjectRecords({ + object_type: "vehicle", + identifiers: { + ext_ids: ["ext-001", "ext-002"], + }, + }); + expect(response).toEqual({ + processId: 21, + message: "Batch object records are being processed for deletion.", + }); + }); + + test("batchDeleteObjectRecords (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/objects/object_type/batch/delete") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.batchDeleteObjectRecords({ + object_type: "object_type", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("batchDeleteObjectRecords (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/objects/object_type/batch/delete") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.batchDeleteObjectRecords({ + object_type: "object_type", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("batchDeleteObjectRecords (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/objects/object_type/batch/delete") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.batchDeleteObjectRecords({ + object_type: "object_type", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("batchDeleteObjectRecords (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/objects/object_type/batch/delete") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.customObjects.batchDeleteObjectRecords({ + object_type: "object_type", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); +}); diff --git a/tests/wire/deals.test.ts b/tests/wire/deals.test.ts new file mode 100644 index 0000000..9827fb8 --- /dev/null +++ b/tests/wire/deals.test.ts @@ -0,0 +1,513 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("DealsClient", () => { + test("getDealAttributes", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { + attributeOptions: [{ key: "custom key", value: "custom label" }], + attributeTypeName: "text", + internalName: "deal_name", + isRequired: true, + label: "Deal Name", + }, + ]; + server + .mockEndpoint() + .get("/crm/attributes/deals") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.deals.getDealAttributes(); + expect(response).toEqual([ + { + attributeOptions: [ + { + key: "custom key", + value: "custom label", + }, + ], + attributeTypeName: "text", + internalName: "deal_name", + isRequired: true, + label: "Deal Name", + }, + ]); + }); + + test("getAllDeals (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + attributes: { + amount: 12, + created_at: "2022-05-30T07:42:05.671Z", + deal_name: "testname", + deal_owner: "6093d2425a9b436e9519d034", + deal_stage: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", + last_activity_date: "2022-06-06T08:38:36.000Z", + last_updated_date: "2022-06-06T08:38:36.761Z", + number_of_activities: 0, + number_of_contacts: 1, + pipeline: "6093d296ad1e9c5cf2140a58", + stage_updated_at: "2022-05-30T07:42:05.671Z", + }, + id: "629475917295261d9b1f4403", + linkedCompaniesIds: [ + "61a5ce58c5d4795761045990", + "61a5ce58c5d4795761045991", + "61a5ce58c5d4795761045992", + ], + linkedContactsIds: [1, 2, 3], + }, + ], + }; + server.mockEndpoint().get("/crm/deals").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.deals.getAllDeals(); + expect(response).toEqual({ + items: [ + { + attributes: { + amount: 12, + created_at: "2022-05-30T07:42:05.671Z", + deal_name: "testname", + deal_owner: "6093d2425a9b436e9519d034", + deal_stage: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", + last_activity_date: "2022-06-06T08:38:36.000Z", + last_updated_date: "2022-06-06T08:38:36.761Z", + number_of_activities: 0, + number_of_contacts: 1, + pipeline: "6093d296ad1e9c5cf2140a58", + stage_updated_at: "2022-05-30T07:42:05.671Z", + }, + id: "629475917295261d9b1f4403", + linkedCompaniesIds: [ + "61a5ce58c5d4795761045990", + "61a5ce58c5d4795761045991", + "61a5ce58c5d4795761045992", + ], + linkedContactsIds: [1, 2, 3], + }, + ], + }); + }); + + test("getAllDeals (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/deals").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.deals.getAllDeals(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createADeal (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "Deal: Connect with company" }; + const rawResponseBody = { id: "61a5cd07ca1347c82306ad06" }; + server + .mockEndpoint() + .post("/crm/deals") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.deals.createADeal({ + name: "Deal: Connect with company", + }); + expect(response).toEqual({ + id: "61a5cd07ca1347c82306ad06", + }); + }); + + test("createADeal (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/crm/deals") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.deals.createADeal({ + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("linkAndUnlinkADealWithContactsAndCompanies (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .patch("/crm/deals/link-unlink/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.deals.linkAndUnlinkADealWithContactsAndCompanies({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("linkAndUnlinkADealWithContactsAndCompanies (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/deals/link-unlink/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.deals.linkAndUnlinkADealWithContactsAndCompanies({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getADeal (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + attributes: { + amount: 12, + created_at: "2022-05-30T07:42:05.671Z", + deal_name: "testname", + deal_owner: "6093d2425a9b436e9519d034", + deal_stage: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", + last_activity_date: "2022-06-06T08:38:36.000Z", + last_updated_date: "2022-06-06T08:38:36.761Z", + next_activity_date: { key: "value" }, + number_of_activities: 0, + number_of_contacts: 1, + pipeline: "6093d296ad1e9c5cf2140a58", + stage_updated_at: "2022-05-30T07:42:05.671Z", + }, + id: "629475917295261d9b1f4403", + linkedCompaniesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + linkedContactsIds: [1, 2, 3], + }; + server.mockEndpoint().get("/crm/deals/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.deals.getADeal({ + id: "id", + }); + expect(response).toEqual({ + attributes: { + amount: 12, + created_at: "2022-05-30T07:42:05.671Z", + deal_name: "testname", + deal_owner: "6093d2425a9b436e9519d034", + deal_stage: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", + last_activity_date: "2022-06-06T08:38:36.000Z", + last_updated_date: "2022-06-06T08:38:36.761Z", + next_activity_date: { + key: "value", + }, + number_of_activities: 0, + number_of_contacts: 1, + pipeline: "6093d296ad1e9c5cf2140a58", + stage_updated_at: "2022-05-30T07:42:05.671Z", + }, + id: "629475917295261d9b1f4403", + linkedCompaniesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + linkedContactsIds: [1, 2, 3], + }); + }); + + test("getADeal (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/deals/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.deals.getADeal({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getADeal (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/deals/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.deals.getADeal({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteADeal (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/crm/deals/id").respondWith().statusCode(200).build(); + + const response = await client.deals.deleteADeal({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteADeal (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/deals/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.deals.deleteADeal({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteADeal (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/deals/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.deals.deleteADeal({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateADeal (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server.mockEndpoint().patch("/crm/deals/id").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.deals.updateADeal({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("updateADeal (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/deals/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.deals.updateADeal({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateADeal (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/deals/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.deals.updateADeal({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getPipelineStages", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + pipeline: "5ea675e3da0dd085acaea610", + pipeline_name: "Sales Pipeline", + stages: [{ id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", name: "New" }], + }; + server + .mockEndpoint() + .get("/crm/pipeline/details") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.deals.getPipelineStages(); + expect(response).toEqual({ + pipeline: "5ea675e3da0dd085acaea610", + pipeline_name: "Sales Pipeline", + stages: [ + { + id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", + name: "New", + }, + ], + }); + }); + + test("getAllPipelines (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { + pipeline: "5ea675e3da0dd085acaea610", + pipeline_name: "Sales Pipeline", + stages: [{ id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", name: "New" }], + }, + ]; + server + .mockEndpoint() + .get("/crm/pipeline/details/all") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.deals.getAllPipelines(); + expect(response).toEqual([ + { + pipeline: "5ea675e3da0dd085acaea610", + pipeline_name: "Sales Pipeline", + stages: [ + { + id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", + name: "New", + }, + ], + }, + ]); + }); + + test("getAllPipelines (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/crm/pipeline/details/all") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.deals.getAllPipelines(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAPipeline (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { + pipeline: "5ea675e3da0dd085acaea610", + pipeline_name: "Sales Pipeline", + stages: [{ id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", name: "New" }], + }, + ]; + server + .mockEndpoint() + .get("/crm/pipeline/details/pipelineID") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.deals.getAPipeline({ + pipelineID: "pipelineID", + }); + expect(response).toEqual([ + { + pipeline: "5ea675e3da0dd085acaea610", + pipeline_name: "Sales Pipeline", + stages: [ + { + id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", + name: "New", + }, + ], + }, + ]); + }); + + test("getAPipeline (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/crm/pipeline/details/pipelineID") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.deals.getAPipeline({ + pipelineID: "pipelineID", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); +}); diff --git a/tests/wire/domains.test.ts b/tests/wire/domains.test.ts new file mode 100644 index 0000000..e0e42c6 --- /dev/null +++ b/tests/wire/domains.test.ts @@ -0,0 +1,768 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("DomainsClient", () => { + test("getDomains (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + domains: [ + { + id: "67e57b40130375f045064c45", + domain_name: "mycompany.com", + authenticated: true, + verified: true, + ip: "192.168.1.100", + provider: "Cloudflare", + creator: { + id: "62e4fce597550d0b0177cb0c", + email: "admin@mycompany.com", + creationDate: "2025-03-27T16:22:24Z", + }, + }, + { + id: "67f778570dd65f97c70910ed", + domain_name: "newsletter.mycompany.com", + authenticated: false, + verified: true, + provider: "GoDaddy", + creator: { + id: "62e4fce597550d0b0177cb0c", + email: "admin@mycompany.com", + creationDate: "2025-04-10T07:50:47Z", + }, + }, + { + id: "688cd306d8893504e50ea615", + domain_name: "test.example.com", + authenticated: false, + verified: false, + provider: "Other", + creator: { + id: "62e4fce597550d0b0177cb0c", + email: "admin@mycompany.com", + creationDate: "2025-08-01T14:45:26Z", + }, + }, + ], + count: 3, + current_page: 1, + total_pages: 1, + }; + server.mockEndpoint().get("/senders/domains").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.domains.getDomains(); + expect(response).toEqual({ + domains: [ + { + id: "67e57b40130375f045064c45", + domain_name: "mycompany.com", + authenticated: true, + verified: true, + ip: "192.168.1.100", + provider: "Cloudflare", + creator: { + id: "62e4fce597550d0b0177cb0c", + email: "admin@mycompany.com", + creationDate: "2025-03-27T16:22:24Z", + }, + }, + { + id: "67f778570dd65f97c70910ed", + domain_name: "newsletter.mycompany.com", + authenticated: false, + verified: true, + provider: "GoDaddy", + creator: { + id: "62e4fce597550d0b0177cb0c", + email: "admin@mycompany.com", + creationDate: "2025-04-10T07:50:47Z", + }, + }, + { + id: "688cd306d8893504e50ea615", + domain_name: "test.example.com", + authenticated: false, + verified: false, + provider: "Other", + creator: { + id: "62e4fce597550d0b0177cb0c", + email: "admin@mycompany.com", + creationDate: "2025-08-01T14:45:26Z", + }, + }, + ], + count: 3, + current_page: 1, + total_pages: 1, + }); + }); + + test("getDomains (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/senders/domains").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.domains.getDomains(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createDomain (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "mycompany.com" }; + const rawResponseBody = { + id: 5, + domain_name: "mycompany.com", + domain_provider: "Cloudflare", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { host_name: "@", type: "TXT", value: "brevo-code=abc123def456", status: false }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", + status: false, + }, + }, + }; + server + .mockEndpoint() + .post("/senders/domains") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.createDomain({ + name: "mycompany.com", + }); + expect(response).toEqual({ + id: 5, + domain_name: "mycompany.com", + domain_provider: "Cloudflare", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { + host_name: "@", + type: "TXT", + value: "brevo-code=abc123def456", + status: false, + }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", + status: false, + }, + }, + }); + }); + + test("createDomain (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "newsletter.mycompany.com" }; + const rawResponseBody = { + id: 5, + domain_name: "mycompany.com", + domain_provider: "Cloudflare", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { host_name: "@", type: "TXT", value: "brevo-code=abc123def456", status: false }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", + status: false, + }, + }, + }; + server + .mockEndpoint() + .post("/senders/domains") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.createDomain({ + name: "newsletter.mycompany.com", + }); + expect(response).toEqual({ + id: 5, + domain_name: "mycompany.com", + domain_provider: "Cloudflare", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { + host_name: "@", + type: "TXT", + value: "brevo-code=abc123def456", + status: false, + }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", + status: false, + }, + }, + }); + }); + + test("createDomain (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "test.example.com" }; + const rawResponseBody = { + id: 5, + domain_name: "mycompany.com", + domain_provider: "Cloudflare", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { host_name: "@", type: "TXT", value: "brevo-code=abc123def456", status: false }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", + status: false, + }, + }, + }; + server + .mockEndpoint() + .post("/senders/domains") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.createDomain({ + name: "test.example.com", + }); + expect(response).toEqual({ + id: 5, + domain_name: "mycompany.com", + domain_provider: "Cloudflare", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { + host_name: "@", + type: "TXT", + value: "brevo-code=abc123def456", + status: false, + }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", + status: false, + }, + }, + }); + }); + + test("createDomain (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "mycompany.com" }; + const rawResponseBody = { + id: 5, + domain_name: "mycompany.com", + domain_provider: "Cloudflare", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { host_name: "@", type: "TXT", value: "brevo-code=abc123def456", status: false }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", + status: false, + }, + }, + }; + server + .mockEndpoint() + .post("/senders/domains") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.createDomain({ + name: "mycompany.com", + }); + expect(response).toEqual({ + id: 5, + domain_name: "mycompany.com", + domain_provider: "Cloudflare", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { + host_name: "@", + type: "TXT", + value: "brevo-code=abc123def456", + status: false, + }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", + status: false, + }, + }, + }); + }); + + test("createDomain (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "mycompany.com" }; + const rawResponseBody = { + id: 6, + domain_name: "example.com", + domain_provider: "GoDaddy", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { host_name: "@", type: "TXT", value: "brevo-code=xyz789abc123", status: false }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com", + status: false, + }, + }, + }; + server + .mockEndpoint() + .post("/senders/domains") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.createDomain({ + name: "mycompany.com", + }); + expect(response).toEqual({ + id: 6, + domain_name: "example.com", + domain_provider: "GoDaddy", + message: "Domain added successfully. To authenticate it, add following DNS records", + dns_records: { + brevo_code: { + host_name: "@", + type: "TXT", + value: "brevo-code=xyz789abc123", + status: false, + }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: false, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com", + status: false, + }, + }, + }); + }); + + test("createDomain (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/senders/domains") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.domains.createDomain({ + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getDomainConfiguration (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + domain: "mycompany.com", + verified: true, + authenticated: true, + dns_records: { + brevo_code: { host_name: "@", type: "TXT", value: "brevo-code=abc123def456", status: true }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: true, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=quarantine; rua=mailto:dmarc@mycompany.com", + status: true, + }, + }, + }; + server + .mockEndpoint() + .get("/senders/domains/domainName") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.getDomainConfiguration({ + domainName: "domainName", + }); + expect(response).toEqual({ + domain: "mycompany.com", + verified: true, + authenticated: true, + dns_records: { + brevo_code: { + host_name: "@", + type: "TXT", + value: "brevo-code=abc123def456", + status: true, + }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: true, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=quarantine; rua=mailto:dmarc@mycompany.com", + status: true, + }, + }, + }); + }); + + test("getDomainConfiguration (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + domain: "test.example.com", + verified: false, + authenticated: false, + dns_records: { + brevo_code: { host_name: "@", type: "TXT", value: "brevo-code=xyz789abc123", status: false }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: true, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@example.com", + status: false, + }, + }, + }; + server + .mockEndpoint() + .get("/senders/domains/domainName") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.getDomainConfiguration({ + domainName: "domainName", + }); + expect(response).toEqual({ + domain: "test.example.com", + verified: false, + authenticated: false, + dns_records: { + brevo_code: { + host_name: "@", + type: "TXT", + value: "brevo-code=xyz789abc123", + status: false, + }, + dkim_record: { + host_name: "mail._domainkey", + type: "TXT", + value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", + status: true, + }, + dmarc_record: { + host_name: "_dmarc", + type: "TXT", + value: "v=DMARC1; p=none; rua=mailto:dmarc@example.com", + status: false, + }, + }, + }); + }); + + test("getDomainConfiguration (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/senders/domains/domainName") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.domains.getDomainConfiguration({ + domainName: "domainName", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getDomainConfiguration (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/senders/domains/domainName") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.domains.getDomainConfiguration({ + domainName: "domainName", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteDomain (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/senders/domains/domainName").respondWith().statusCode(200).build(); + + const response = await client.domains.deleteDomain({ + domainName: "domainName", + }); + expect(response).toEqual(undefined); + }); + + test("deleteDomain (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/senders/domains/domainName") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.domains.deleteDomain({ + domainName: "domainName", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteDomain (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/senders/domains/domainName") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.domains.deleteDomain({ + domainName: "domainName", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("authenticateDomain (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + domain_name: "mycompany.com", + message: "Domain has been authenticated successfully.", + }; + server + .mockEndpoint() + .put("/senders/domains/domainName/authenticate") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.authenticateDomain({ + domainName: "domainName", + }); + expect(response).toEqual({ + domain_name: "mycompany.com", + message: "Domain has been authenticated successfully.", + }); + }); + + test("authenticateDomain (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + domain_name: "newsletter.example.com", + message: "Domain authentication completed. Your domain is now ready for sending.", + }; + server + .mockEndpoint() + .put("/senders/domains/domainName/authenticate") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.domains.authenticateDomain({ + domainName: "domainName", + }); + expect(response).toEqual({ + domain_name: "newsletter.example.com", + message: "Domain authentication completed. Your domain is now ready for sending.", + }); + }); + + test("authenticateDomain (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/senders/domains/domainName/authenticate") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.domains.authenticateDomain({ + domainName: "domainName", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("authenticateDomain (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/senders/domains/domainName/authenticate") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.domains.authenticateDomain({ + domainName: "domainName", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/ecommerce.test.ts b/tests/wire/ecommerce.test.ts new file mode 100644 index 0000000..24535a9 --- /dev/null +++ b/tests/wire/ecommerce.test.ts @@ -0,0 +1,1347 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("EcommerceClient", () => { + test("getCategories (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + categories: [ + { + createdAt: "2021-12-31T11:42:35.638Z", + id: "C19", + isDeleted: true, + modifiedAt: "2022-03-03T14:48:31.867Z", + name: "Food", + url: "http://mydomain.com/category/food", + }, + { + createdAt: "2021-12-31T11:42:35.638Z", + id: "C20", + isDeleted: true, + modifiedAt: "2022-03-03T14:48:31.867Z", + name: "clothing", + url: "http://mydomain.com/category/clothing", + }, + ], + count: 2, + }; + server.mockEndpoint().get("/categories").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.ecommerce.getCategories(); + expect(response).toEqual({ + categories: [ + { + createdAt: "2021-12-31T11:42:35.638Z", + id: "C19", + isDeleted: true, + modifiedAt: "2022-03-03T14:48:31.867Z", + name: "Food", + url: "http://mydomain.com/category/food", + }, + { + createdAt: "2021-12-31T11:42:35.638Z", + id: "C20", + isDeleted: true, + modifiedAt: "2022-03-03T14:48:31.867Z", + name: "clothing", + url: "http://mydomain.com/category/clothing", + }, + ], + count: 2, + }); + }); + + test("getCategories (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/categories").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.ecommerce.getCategories(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createUpdateCategory (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "CAT123" }; + const rawResponseBody = { id: 21 }; + server + .mockEndpoint() + .post("/categories") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.createUpdateCategory({ + id: "CAT123", + }); + expect(response).toEqual({ + id: 21, + }); + }); + + test("createUpdateCategory (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/categories") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createUpdateCategory({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createUpdateBatchCategory (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { categories: [{ id: "CAT123" }] }; + const rawResponseBody = { createdCount: 2, updatedCount: 7 }; + server + .mockEndpoint() + .post("/categories/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.createUpdateBatchCategory({ + categories: [ + { + id: "CAT123", + }, + ], + }); + expect(response).toEqual({ + createdCount: 2, + updatedCount: 7, + }); + }); + + test("createUpdateBatchCategory (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { categories: [{ id: "id" }, { id: "id" }] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/categories/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createUpdateBatchCategory({ + categories: [ + { + id: "id", + }, + { + id: "id", + }, + ], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getCategoryInfo (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + createdAt: "2017-05-12T12:30:00Z", + id: "C11", + isDeleted: true, + modifiedAt: "2017-05-12T12:30:00Z", + name: "Electronics", + url: "http://mydomain.com/category/clothing", + }; + server.mockEndpoint().get("/categories/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.ecommerce.getCategoryInfo({ + id: "id", + }); + expect(response).toEqual({ + createdAt: "2017-05-12T12:30:00Z", + id: "C11", + isDeleted: true, + modifiedAt: "2017-05-12T12:30:00Z", + name: "Electronics", + url: "http://mydomain.com/category/clothing", + }); + }); + + test("getCategoryInfo (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/categories/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.ecommerce.getCategoryInfo({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getCategoryInfo (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/categories/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.ecommerce.getCategoryInfo({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("activateTheECommerceApp (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().post("/ecommerce/activate").respondWith().statusCode(200).build(); + + const response = await client.ecommerce.activateTheECommerceApp(); + expect(response).toEqual(undefined); + }); + + test("activateTheECommerceApp (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/ecommerce/activate") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.activateTheECommerceApp(); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("activateTheECommerceApp (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/ecommerce/activate") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.activateTheECommerceApp(); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + results: [ + { averageBasket: 3, conversionSource: "email_campaign", id: 1.1, ordersCount: 300, revenue: 900 }, + { averageBasket: 4, conversionSource: "email_campaign", id: 1.1, ordersCount: 200, revenue: 800 }, + ], + totals: { averageBasket: 3.4, ordersCount: 500, revenue: 1700 }, + }; + server + .mockEndpoint() + .get("/ecommerce/attribution/metrics") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows({ + periodFrom: "2022-01-02T00:00:00Z", + periodTo: "2022-01-03T00:00:00Z", + }); + expect(response).toEqual({ + results: [ + { + averageBasket: 3, + conversionSource: "email_campaign", + id: 1.1, + ordersCount: 300, + revenue: 900, + }, + { + averageBasket: 4, + conversionSource: "email_campaign", + id: 1.1, + ordersCount: 200, + revenue: 800, + }, + ], + totals: { + averageBasket: 3.4, + ordersCount: 500, + revenue: 1700, + }, + }); + }); + + test("getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/ecommerce/attribution/metrics") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + averageBasket: 1.1, + conversionSource: "email_campaign", + id: 1.1, + ordersCount: 1.1, + revenue: 1.1, + newCustomersCount: 1.1, + }; + server + .mockEndpoint() + .get("/ecommerce/attribution/metrics/email_campaign/sale") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow({ + conversionSource: "email_campaign", + conversionSourceId: "sale", + }); + expect(response).toEqual({ + averageBasket: 1.1, + conversionSource: "email_campaign", + id: 1.1, + ordersCount: 1.1, + revenue: 1.1, + newCustomersCount: 1.1, + }); + }); + + test("getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/ecommerce/attribution/metrics/email_campaign/conversionSourceId") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow({ + conversionSource: "email_campaign", + conversionSourceId: "conversionSourceId", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAttributedProductSalesForASingleBrevoCampaignOrWorkflow (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + products: [ + { + id: "1", + imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", + name: "Milky Way Galaxy", + ordersCount: 200, + price: 1000, + revenue: 999.99, + sku: "sku-1", + url: "https://mydomain.com/products/alpina-panoma-classic", + }, + ], + }; + server + .mockEndpoint() + .get("/ecommerce/attribution/products/email_campaign/sale") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.getAttributedProductSalesForASingleBrevoCampaignOrWorkflow({ + conversionSource: "email_campaign", + conversionSourceId: "sale", + }); + expect(response).toEqual({ + products: [ + { + id: "1", + imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", + name: "Milky Way Galaxy", + ordersCount: 200, + price: 1000, + revenue: 999.99, + sku: "sku-1", + url: "https://mydomain.com/products/alpina-panoma-classic", + }, + ], + }); + }); + + test("getAttributedProductSalesForASingleBrevoCampaignOrWorkflow (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/ecommerce/attribution/products/email_campaign/conversionSourceId") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getAttributedProductSalesForASingleBrevoCampaignOrWorkflow({ + conversionSource: "email_campaign", + conversionSourceId: "conversionSourceId", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { code: "EUR" }; + server + .mockEndpoint() + .get("/ecommerce/config/displayCurrency") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(); + expect(response).toEqual({ + code: "EUR", + }); + }); + + test("getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/ecommerce/config/displayCurrency") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/ecommerce/config/displayCurrency") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/ecommerce/config/displayCurrency") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("setConfigDisplayCurrency (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { code: "EUR" }; + const rawResponseBody = { code: "EUR" }; + server + .mockEndpoint() + .post("/ecommerce/config/displayCurrency") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.setConfigDisplayCurrency({ + code: "EUR", + }); + expect(response).toEqual({ + code: "EUR", + }); + }); + + test("setConfigDisplayCurrency (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { code: "code" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/ecommerce/config/displayCurrency") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.setConfigDisplayCurrency({ + code: "code", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("setConfigDisplayCurrency (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { code: "code" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/ecommerce/config/displayCurrency") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.setConfigDisplayCurrency({ + code: "code", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("setConfigDisplayCurrency (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { code: "code" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/ecommerce/config/displayCurrency") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.setConfigDisplayCurrency({ + code: "code", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("setConfigDisplayCurrency (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { code: "code" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/ecommerce/config/displayCurrency") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.setConfigDisplayCurrency({ + code: "code", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getOrders (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 1, + orders: [ + { + amount: 2000, + billing: { + address: "Sec 62, Noida", + city: "Noida", + country: "India", + countryCode: "IN", + paymentMethod: "Net banking", + phone: 9238283982, + postCode: 110001, + region: "North India", + }, + contact_id: 2, + coupons: ["flat50", "flat40"], + createdAt: "2021-12-31T11:42:35.638Z", + email: "testvisitor@sendinblue.com", + id: "order1803", + identifiers: { ext_id: "ab12", loyalty_subscription_id: "1234" }, + products: [ + { price: 100, productId: 21, quantity: 2, variantId: "P100" }, + { price: 100, productId: 21, quantity: 2, variantId: "P15756" }, + ], + status: "complete", + storeId: "123", + updatedAt: "2022-03-03T14:48:31.867Z", + }, + ], + }; + server.mockEndpoint().get("/orders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.ecommerce.getOrders(); + expect(response).toEqual({ + count: 1, + orders: [ + { + amount: 2000, + billing: { + address: "Sec 62, Noida", + city: "Noida", + country: "India", + countryCode: "IN", + paymentMethod: "Net banking", + phone: 9238283982, + postCode: 110001, + region: "North India", + }, + contact_id: 2, + coupons: ["flat50", "flat40"], + createdAt: "2021-12-31T11:42:35.638Z", + email: "testvisitor@sendinblue.com", + id: "order1803", + identifiers: { + ext_id: "ab12", + loyalty_subscription_id: "1234", + }, + products: [ + { + price: 100, + productId: 21, + quantity: 2, + variantId: "P100", + }, + { + price: 100, + productId: 21, + quantity: 2, + variantId: "P15756", + }, + ], + status: "complete", + storeId: "123", + updatedAt: "2022-03-03T14:48:31.867Z", + }, + ], + }); + }); + + test("getOrders (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/orders").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.ecommerce.getOrders(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createOrder (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + amount: 308.42, + createdAt: "2021-07-29T20:59:23.383Z", + id: "14", + products: [{ price: 99.99, productId: "P1", quantity: 10 }], + status: "completed", + updatedAt: "2021-07-30T10:59:23.383Z", + }; + + server.mockEndpoint().post("/orders/status").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.ecommerce.createOrder({ + amount: 308.42, + createdAt: "2021-07-29T20:59:23.383Z", + id: "14", + products: [ + { + price: 99.99, + productId: "P1", + quantity: 10, + }, + ], + status: "completed", + updatedAt: "2021-07-30T10:59:23.383Z", + }); + expect(response).toEqual(undefined); + }); + + test("createOrder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + amount: 1.1, + createdAt: "createdAt", + id: "id", + products: [ + { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId", quantity: 1.1 }, + ], + status: "status", + updatedAt: "updatedAt", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/orders/status") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createOrder({ + amount: 1.1, + createdAt: "createdAt", + id: "id", + products: [ + { + price: 1.1, + productId: "productId", + quantity: 1.1, + }, + { + price: 1.1, + productId: "productId", + quantity: 1.1, + }, + ], + status: "status", + updatedAt: "updatedAt", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createBatchOrder (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + orders: [ + { + amount: 308.42, + createdAt: "2021-07-29T20:59:23.383Z", + id: "14", + products: [{ price: 99.99, productId: "P1", quantity: 10 }], + status: "completed", + updatedAt: "2021-07-30T10:59:23.383Z", + }, + ], + }; + const rawResponseBody = { batchId: 1.1, count: 17655 }; + server + .mockEndpoint() + .post("/orders/status/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.createBatchOrder({ + orders: [ + { + amount: 308.42, + createdAt: "2021-07-29T20:59:23.383Z", + id: "14", + products: [ + { + price: 99.99, + productId: "P1", + quantity: 10, + }, + ], + status: "completed", + updatedAt: "2021-07-30T10:59:23.383Z", + }, + ], + }); + expect(response).toEqual({ + batchId: 1.1, + count: 17655, + }); + }); + + test("createBatchOrder (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + orders: [ + { + amount: 1.1, + createdAt: "createdAt", + id: "id", + products: [ + { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId", quantity: 1.1 }, + ], + status: "status", + updatedAt: "updatedAt", + }, + { + amount: 1.1, + createdAt: "createdAt", + id: "id", + products: [ + { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId", quantity: 1.1 }, + ], + status: "status", + updatedAt: "updatedAt", + }, + ], + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/orders/status/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createBatchOrder({ + orders: [ + { + amount: 1.1, + createdAt: "createdAt", + id: "id", + products: [ + { + price: 1.1, + productId: "productId", + quantity: 1.1, + }, + { + price: 1.1, + productId: "productId", + quantity: 1.1, + }, + ], + status: "status", + updatedAt: "updatedAt", + }, + { + amount: 1.1, + createdAt: "createdAt", + id: "id", + products: [ + { + price: 1.1, + productId: "productId", + quantity: 1.1, + }, + { + price: 1.1, + productId: "productId", + quantity: 1.1, + }, + ], + status: "status", + updatedAt: "updatedAt", + }, + ], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getProducts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 2, + products: [ + { + categories: ["279638835374", "279502848174"], + createdAt: "2022-06-30T10:29:16.078Z", + id: "P11", + imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", + isDeleted: true, + metaInfo: { brand: "addidas", description: "Shoes for sports" }, + modifiedAt: "2022-06-30T10:29:16.078Z", + name: "Alpina Panoma Classic", + parentId: "parentId", + price: 49.95, + s3Original: "https://img-ecom.mailinblue.com/path-to-original/img.jpg", + s3ThumbAnalytics: "https://img-ecom.mailinblue.com/path-to-analytics/img.jpg", + s3ThumbEditor: "https://img-ecom.mailinblue.com/path-to-editor/img.jpg", + sku: "186622-9", + stock: 100, + url: "https://mydomain.com/products/alpina-panoma-classic", + }, + { + categories: ["2d79638835374", "27d9502848174"], + createdAt: "2022-06-30T10:29:16.078Z", + id: "P11", + imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", + isDeleted: true, + metaInfo: { brand: "addidas", description: "Shoes for sports" }, + modifiedAt: "2022-06-30T10:29:16.078Z", + name: "Alpina Panoma Classic2", + parentId: "parentId", + price: 49.95, + s3Original: "https://img-ecom.mailinblue.com/path-to-original/img.jpg", + s3ThumbAnalytics: "https://img-ecom.mailinblue.com/path-to-analytics/img.jpg", + s3ThumbEditor: "https://img-ecom.mailinblue.com/path-to-editor/img.jpg", + sku: "186622-9", + stock: 350, + url: "https://mydomain.com/products/alpina-panoma-classic2", + }, + ], + }; + server.mockEndpoint().get("/products").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.ecommerce.getProducts(); + expect(response).toEqual({ + count: 2, + products: [ + { + categories: ["279638835374", "279502848174"], + createdAt: "2022-06-30T10:29:16.078Z", + id: "P11", + imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", + isDeleted: true, + metaInfo: { + brand: "addidas", + description: "Shoes for sports", + }, + modifiedAt: "2022-06-30T10:29:16.078Z", + name: "Alpina Panoma Classic", + parentId: "parentId", + price: 49.95, + s3Original: "https://img-ecom.mailinblue.com/path-to-original/img.jpg", + s3ThumbAnalytics: "https://img-ecom.mailinblue.com/path-to-analytics/img.jpg", + s3ThumbEditor: "https://img-ecom.mailinblue.com/path-to-editor/img.jpg", + sku: "186622-9", + stock: 100, + url: "https://mydomain.com/products/alpina-panoma-classic", + }, + { + categories: ["2d79638835374", "27d9502848174"], + createdAt: "2022-06-30T10:29:16.078Z", + id: "P11", + imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", + isDeleted: true, + metaInfo: { + brand: "addidas", + description: "Shoes for sports", + }, + modifiedAt: "2022-06-30T10:29:16.078Z", + name: "Alpina Panoma Classic2", + parentId: "parentId", + price: 49.95, + s3Original: "https://img-ecom.mailinblue.com/path-to-original/img.jpg", + s3ThumbAnalytics: "https://img-ecom.mailinblue.com/path-to-analytics/img.jpg", + s3ThumbEditor: "https://img-ecom.mailinblue.com/path-to-editor/img.jpg", + sku: "186622-9", + stock: 350, + url: "https://mydomain.com/products/alpina-panoma-classic2", + }, + ], + }); + }); + + test("getProducts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/products").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.ecommerce.getProducts(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createUpdateProduct (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "P11", name: "Iphone 11" }; + const rawResponseBody = { id: 21 }; + server + .mockEndpoint() + .post("/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.createUpdateProduct({ + id: "P11", + name: "Iphone 11", + }); + expect(response).toEqual({ + id: 21, + }); + }); + + test("createUpdateProduct (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id", name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/products") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createUpdateProduct({ + id: "id", + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createUpdateBatchProducts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { products: [{ id: "P11", name: "Iphone 11" }] }; + const rawResponseBody = { createdCount: 2, updatedCount: 7 }; + server + .mockEndpoint() + .post("/products/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.ecommerce.createUpdateBatchProducts({ + products: [ + { + id: "P11", + name: "Iphone 11", + }, + ], + }); + expect(response).toEqual({ + createdCount: 2, + updatedCount: 7, + }); + }); + + test("createUpdateBatchProducts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + products: [ + { id: "id", name: "name" }, + { id: "id", name: "name" }, + ], + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/products/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createUpdateBatchProducts({ + products: [ + { + id: "id", + name: "name", + }, + { + id: "id", + name: "name", + }, + ], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getProductInfo (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + categories: ["categories"], + createdAt: "2017-05-12T12:30:00Z", + id: "P11", + imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", + isDeleted: true, + metaInfo: { brand: "addidas", description: "Shoes for sports" }, + modifiedAt: "2017-05-12T12:30:00Z", + name: "Iphone 11", + parentId: "parentId", + price: 1.1, + s3Original: "s3Original", + s3ThumbAnalytics: "s3ThumbAnalytics", + s3ThumbEditor: "s3ThumbEditor", + sku: "sku", + stock: 100, + url: "http://mydomain.com/product/electronics/product1", + }; + server.mockEndpoint().get("/products/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.ecommerce.getProductInfo({ + id: "id", + }); + expect(response).toEqual({ + categories: ["categories"], + createdAt: "2017-05-12T12:30:00Z", + id: "P11", + imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", + isDeleted: true, + metaInfo: { + brand: "addidas", + description: "Shoes for sports", + }, + modifiedAt: "2017-05-12T12:30:00Z", + name: "Iphone 11", + parentId: "parentId", + price: 1.1, + s3Original: "s3Original", + s3ThumbAnalytics: "s3ThumbAnalytics", + s3ThumbEditor: "s3ThumbEditor", + sku: "sku", + stock: 100, + url: "http://mydomain.com/product/electronics/product1", + }); + }); + + test("getProductInfo (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/products/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.ecommerce.getProductInfo({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getProductInfo (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/products/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.ecommerce.getProductInfo({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("createProductAlert (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .post("/products/id/alerts/back_in_stock") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.ecommerce.createProductAlert({ + id: "id", + type: "back_in_stock", + }); + expect(response).toEqual(undefined); + }); + + test("createProductAlert (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/products/id/alerts/back_in_stock") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createProductAlert({ + id: "id", + type: "back_in_stock", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createProductAlert (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/products/id/alerts/back_in_stock") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createProductAlert({ + id: "id", + type: "back_in_stock", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createProductAlert (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/products/id/alerts/back_in_stock") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createProductAlert({ + id: "id", + type: "back_in_stock", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createProductAlert (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/products/id/alerts/back_in_stock") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.ecommerce.createProductAlert({ + id: "id", + type: "back_in_stock", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/emailCampaigns.test.ts b/tests/wire/emailCampaigns.test.ts new file mode 100644 index 0000000..cf7e061 --- /dev/null +++ b/tests/wire/emailCampaigns.test.ts @@ -0,0 +1,1712 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("EmailCampaignsClient", () => { + test("getEmailCampaigns (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + campaigns: [ + { + abTesting: true, + id: 12, + name: "EN - Sales Summer 2017", + previewText: "Don't miss the sale!", + scheduledAt: "2017-06-01T12:30:00Z", + sendAtBestTime: true, + splitRule: 25, + status: "sent", + subject: "20% OFF for 2017 Summer Sales", + subjectA: "Discover the New Collection!", + subjectB: "Want to discover the New Collection?", + type: "classic", + winnerCriteria: "open", + winnerDelay: 50, + createdAt: "2017-05-01T12:30:00Z", + footer: "[DEFAULT_FOOTER]", + header: "[DEFAULT_HEADER]", + htmlContent: "This is my HTML Content", + inlineImageActivation: true, + mirrorActive: true, + modifiedAt: "2017-05-01T12:30:00Z", + recurring: false, + replyTo: "replyto@domain.com", + returnBounce: 5, + sender: { email: "marketing@mycompany.com", id: 26, name: "Marketing" }, + sentDate: "2018-12-01T16:30:00Z", + shareLink: "http://example.com/fhsgccc.html?t=9865448900", + tag: "Newsletter", + testSent: true, + toField: "{FNAME} {LNAME}", + utmCampaignValue: "myutm", + utmIDActive: true, + utmMedium: "EMAIL", + utmSource: "Brevo", + recipients: { exclusionLists: [13], lists: [5] }, + statistics: { + campaignStats: [ + { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 5, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + ], + globalStats: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + linksStats: {}, + mirrorClick: 120, + remaining: 1000, + statsByBrowser: { + key: { clickers: 2665, uniqueClicks: 2300, uniqueViews: 7779, viewed: 8999 }, + }, + statsByDevice: {}, + statsByDomain: { + "hotmail.co.uk": { + appleMppOpens: 10, + clickers: 2720, + complaints: 5, + deferred: 30, + delivered: 117056, + estimatedViews: 560, + hardBounces: 0, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 117055, + softBounces: 111, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 1970, + uniqueViews: 21111, + unsubscriptions: 105, + viewed: 35251, + }, + "yahoo.com": { + appleMppOpens: 10, + clickers: 533, + complaints: 0, + deferred: 30, + delivered: 25596, + estimatedViews: 560, + hardBounces: 0, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 25601, + softBounces: 5, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 298, + uniqueViews: 3527, + unsubscriptions: 17, + viewed: 5255, + }, + }, + }, + }, + { + abTesting: true, + id: 22, + name: "Weekly - 1", + previewText: "your weekly newsletter!", + scheduledAt: "", + sendAtBestTime: true, + splitRule: 25, + status: "draft", + subject: "Week 1 - Newsletter", + subjectA: "Discover the New Collection!", + subjectB: "Want to discover the New Collection?", + type: "classic", + winnerCriteria: "open", + winnerDelay: 50, + createdAt: "2017-05-01T12:30:00Z", + footer: "[DEFAULT_FOOTER]", + header: "[DEFAULT_HEADER]", + htmlContent: "This is my HTML Content", + inlineImageActivation: true, + mirrorActive: true, + modifiedAt: "2017-05-01T12:30:00Z", + recurring: false, + replyTo: "replyto@domain.com", + returnBounce: 5, + sender: { email: "newsletter@mycompany.com", id: 26, name: "Newsletter" }, + sentDate: "2018-12-01T16:30:00Z", + shareLink: "http://example.com/fhsgccc.html?t=9865448900", + tag: "Newsletter", + testSent: false, + toField: "{FNAME} {LNAME}", + utmCampaignValue: "myutm", + utmIDActive: true, + utmMedium: "EMAIL", + utmSource: "Brevo", + recipients: { exclusionLists: [45], lists: [10] }, + statistics: { + campaignStats: [ + { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 10, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + ], + globalStats: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.42, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + linksStats: {}, + mirrorClick: 120, + remaining: 1000, + statsByBrowser: { + key: { clickers: 2665, uniqueClicks: 2300, uniqueViews: 7779, viewed: 8999 }, + }, + statsByDevice: {}, + statsByDomain: { + aol: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + gmail: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + }, + }, + }, + ], + count: 2, + }; + server.mockEndpoint().get("/emailCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.emailCampaigns.getEmailCampaigns(); + expect(response).toEqual({ + campaigns: [ + { + abTesting: true, + id: 12, + name: "EN - Sales Summer 2017", + previewText: "Don't miss the sale!", + scheduledAt: "2017-06-01T12:30:00Z", + sendAtBestTime: true, + splitRule: 25, + status: "sent", + subject: "20% OFF for 2017 Summer Sales", + subjectA: "Discover the New Collection!", + subjectB: "Want to discover the New Collection?", + type: "classic", + winnerCriteria: "open", + winnerDelay: 50, + createdAt: "2017-05-01T12:30:00Z", + footer: "[DEFAULT_FOOTER]", + header: "[DEFAULT_HEADER]", + htmlContent: "This is my HTML Content", + inlineImageActivation: true, + mirrorActive: true, + modifiedAt: "2017-05-01T12:30:00Z", + recurring: false, + replyTo: "replyto@domain.com", + returnBounce: 5, + sender: { + email: "marketing@mycompany.com", + id: 26, + name: "Marketing", + }, + sentDate: "2018-12-01T16:30:00Z", + shareLink: "http://example.com/fhsgccc.html?t=9865448900", + tag: "Newsletter", + testSent: true, + toField: "{FNAME} {LNAME}", + utmCampaignValue: "myutm", + utmIDActive: true, + utmMedium: "EMAIL", + utmSource: "Brevo", + recipients: { + exclusionLists: [13], + lists: [5], + }, + statistics: { + campaignStats: [ + { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 5, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + ], + globalStats: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + linksStats: {}, + mirrorClick: 120, + remaining: 1000, + statsByBrowser: { + key: { + clickers: 2665, + uniqueClicks: 2300, + uniqueViews: 7779, + viewed: 8999, + }, + }, + statsByDevice: {}, + statsByDomain: { + "hotmail.co.uk": { + appleMppOpens: 10, + clickers: 2720, + complaints: 5, + deferred: 30, + delivered: 117056, + estimatedViews: 560, + hardBounces: 0, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 117055, + softBounces: 111, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 1970, + uniqueViews: 21111, + unsubscriptions: 105, + viewed: 35251, + }, + "yahoo.com": { + appleMppOpens: 10, + clickers: 533, + complaints: 0, + deferred: 30, + delivered: 25596, + estimatedViews: 560, + hardBounces: 0, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 25601, + softBounces: 5, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 298, + uniqueViews: 3527, + unsubscriptions: 17, + viewed: 5255, + }, + }, + }, + }, + { + abTesting: true, + id: 22, + name: "Weekly - 1", + previewText: "your weekly newsletter!", + scheduledAt: "", + sendAtBestTime: true, + splitRule: 25, + status: "draft", + subject: "Week 1 - Newsletter", + subjectA: "Discover the New Collection!", + subjectB: "Want to discover the New Collection?", + type: "classic", + winnerCriteria: "open", + winnerDelay: 50, + createdAt: "2017-05-01T12:30:00Z", + footer: "[DEFAULT_FOOTER]", + header: "[DEFAULT_HEADER]", + htmlContent: "This is my HTML Content", + inlineImageActivation: true, + mirrorActive: true, + modifiedAt: "2017-05-01T12:30:00Z", + recurring: false, + replyTo: "replyto@domain.com", + returnBounce: 5, + sender: { + email: "newsletter@mycompany.com", + id: 26, + name: "Newsletter", + }, + sentDate: "2018-12-01T16:30:00Z", + shareLink: "http://example.com/fhsgccc.html?t=9865448900", + tag: "Newsletter", + testSent: false, + toField: "{FNAME} {LNAME}", + utmCampaignValue: "myutm", + utmIDActive: true, + utmMedium: "EMAIL", + utmSource: "Brevo", + recipients: { + exclusionLists: [45], + lists: [10], + }, + statistics: { + campaignStats: [ + { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 10, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + ], + globalStats: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.42, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + linksStats: {}, + mirrorClick: 120, + remaining: 1000, + statsByBrowser: { + key: { + clickers: 2665, + uniqueClicks: 2300, + uniqueViews: 7779, + viewed: 8999, + }, + }, + statsByDevice: {}, + statsByDomain: { + aol: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + gmail: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + }, + }, + }, + ], + count: 2, + }); + }); + + test("getEmailCampaigns (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/emailCampaigns").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.emailCampaigns.getEmailCampaigns(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createEmailCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "Newsletter - May 2017", sender: {} }; + const rawResponseBody = { id: 5 }; + server + .mockEndpoint() + .post("/emailCampaigns") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.emailCampaigns.createEmailCampaign({ + name: "Newsletter - May 2017", + sender: {}, + }); + expect(response).toEqual({ + id: 5, + }); + }); + + test("createEmailCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", sender: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.createEmailCampaign({ + name: "name", + sender: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("uploadImageToGallery (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { imageUrl: "https://somedomain.com/image1.jpg" }; + const rawResponseBody = { + url: "https://img.mailinblue.com/100000/images/rnb/original/62casdase8wewq9df1c2f27c.jpeg", + }; + server + .mockEndpoint() + .post("/emailCampaigns/images") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.emailCampaigns.uploadImageToGallery({ + imageUrl: "https://somedomain.com/image1.jpg", + }); + expect(response).toEqual({ + url: "https://img.mailinblue.com/100000/images/rnb/original/62casdase8wewq9df1c2f27c.jpeg", + }); + }); + + test("uploadImageToGallery (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { imageUrl: "imageUrl" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/images") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.uploadImageToGallery({ + imageUrl: "imageUrl", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getEmailCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + abTesting: true, + id: 22, + name: "Weekly - 1", + previewText: "your weekly newsletter", + scheduledAt: "2017-09-22T12:30:00Z", + sendAtBestTime: true, + splitRule: 25, + status: "draft", + subject: "Week 1 - Newsletter", + subjectA: "Discover the New Collection!", + subjectB: "Want to discover the New Collection?", + type: "classic", + winnerCriteria: "open", + winnerDelay: 50, + createdAt: "2017-05-01T12:30:00Z", + footer: "[DEFAULT_FOOTER]", + header: "[DEFAULT_HEADER]", + htmlContent: "This is my HTML Content", + inlineImageActivation: true, + mirrorActive: true, + modifiedAt: "2017-05-01T12:30:00Z", + recurring: false, + replyTo: "replyto@domain.com", + returnBounce: 5, + sender: { email: "newsletter@mycompany.com", id: 26, name: "Newsletter" }, + sentDate: "2018-12-01T16:30:00Z", + shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", + tag: "Newsletter", + testSent: false, + toField: "{FNAME} {LNAME}", + utmCampaignValue: "myutm", + utmIDActive: true, + utmMedium: "EMAIL", + utmSource: "Brevo", + recipients: { exclusionLists: [45], lists: [22] }, + statistics: { + campaignStats: [ + { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 22, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + ], + globalStats: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 24.59, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + linksStats: {}, + mirrorClick: 120, + remaining: 1000, + statsByBrowser: { + internetExplorer: { clickers: 0, uniqueClicks: 0, uniqueViews: 0, viewed: 1 }, + safari: { clickers: 1, uniqueClicks: 0, uniqueViews: 0, viewed: 1 }, + thunderbird: { clickers: 1, uniqueClicks: 0, uniqueViews: 0, viewed: 1 }, + }, + statsByDevice: { + desktop: { mac: { clickers: 1, uniqueClicks: 0, uniqueViews: 1, viewed: 2 } }, + mobile: { + androidMobile: { clickers: 1, uniqueClicks: 0, uniqueViews: 0, viewed: 1 }, + iPhone: { clickers: 1, uniqueClicks: 0, uniqueViews: 0, viewed: 2 }, + }, + tablet: { key: { clickers: 2665, uniqueClicks: 2300, uniqueViews: 7779, viewed: 8999 } }, + unknown: { key: { clickers: 2665, uniqueClicks: 2300, uniqueViews: 7779, viewed: 8999 } }, + }, + statsByDomain: { + gmail: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + }, + }, + }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.emailCampaigns.getEmailCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual({ + abTesting: true, + id: 22, + name: "Weekly - 1", + previewText: "your weekly newsletter", + scheduledAt: "2017-09-22T12:30:00Z", + sendAtBestTime: true, + splitRule: 25, + status: "draft", + subject: "Week 1 - Newsletter", + subjectA: "Discover the New Collection!", + subjectB: "Want to discover the New Collection?", + type: "classic", + winnerCriteria: "open", + winnerDelay: 50, + createdAt: "2017-05-01T12:30:00Z", + footer: "[DEFAULT_FOOTER]", + header: "[DEFAULT_HEADER]", + htmlContent: "This is my HTML Content", + inlineImageActivation: true, + mirrorActive: true, + modifiedAt: "2017-05-01T12:30:00Z", + recurring: false, + replyTo: "replyto@domain.com", + returnBounce: 5, + sender: { + email: "newsletter@mycompany.com", + id: 26, + name: "Newsletter", + }, + sentDate: "2018-12-01T16:30:00Z", + shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", + tag: "Newsletter", + testSent: false, + toField: "{FNAME} {LNAME}", + utmCampaignValue: "myutm", + utmIDActive: true, + utmMedium: "EMAIL", + utmSource: "Brevo", + recipients: { + exclusionLists: [45], + lists: [22], + }, + statistics: { + campaignStats: [ + { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 22, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + ], + globalStats: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 24.59, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + linksStats: {}, + mirrorClick: 120, + remaining: 1000, + statsByBrowser: { + internetExplorer: { + clickers: 0, + uniqueClicks: 0, + uniqueViews: 0, + viewed: 1, + }, + safari: { + clickers: 1, + uniqueClicks: 0, + uniqueViews: 0, + viewed: 1, + }, + thunderbird: { + clickers: 1, + uniqueClicks: 0, + uniqueViews: 0, + viewed: 1, + }, + }, + statsByDevice: { + desktop: { + mac: { + clickers: 1, + uniqueClicks: 0, + uniqueViews: 1, + viewed: 2, + }, + }, + mobile: { + androidMobile: { + clickers: 1, + uniqueClicks: 0, + uniqueViews: 0, + viewed: 1, + }, + iPhone: { + clickers: 1, + uniqueClicks: 0, + uniqueViews: 0, + viewed: 2, + }, + }, + tablet: { + key: { + clickers: 2665, + uniqueClicks: 2300, + uniqueViews: 7779, + viewed: 8999, + }, + }, + unknown: { + key: { + clickers: 2665, + uniqueClicks: 2300, + uniqueViews: 7779, + viewed: 8999, + }, + }, + }, + statsByDomain: { + gmail: { + appleMppOpens: 10, + clickers: 2665, + complaints: 1, + deferred: 30, + delivered: 19765, + estimatedViews: 560, + hardBounces: 87, + listId: 2, + opensRate: 29.54, + returnBounce: 5, + sent: 19887, + softBounces: 100, + trackableViews: 5661, + trackableViewsRate: 23.45, + uniqueClicks: 2300, + uniqueViews: 7779, + unsubscriptions: 2, + viewed: 8999, + }, + }, + }, + }); + }); + + test("getEmailCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.getEmailCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getEmailCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.getEmailCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateEmailCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/emailCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.emailCampaigns.updateEmailCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("updateEmailCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/emailCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.updateEmailCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateEmailCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/emailCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.updateEmailCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteEmailCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/emailCampaigns/1000000").respondWith().statusCode(200).build(); + + const response = await client.emailCampaigns.deleteEmailCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteEmailCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/emailCampaigns/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.deleteEmailCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteEmailCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/emailCampaigns/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.deleteEmailCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getAbTestCampaignResult (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + clickRate: "50%", + clickedLinks: { + "Version A": [ + { clickRate: "0%", clicksCount: 0, link: "https://google.com" }, + { clickRate: "0%", clicksCount: 0, link: "https://youtube.com" }, + ], + "Version B": [ + { clickRate: "40%", clicksCount: 2, link: "http://www.github.com" }, + { clickRate: "60%", clicksCount: 3, link: "http://www.stackoverflow.com" }, + ], + }, + openRate: "100%", + statistics: { + clicks: { "Version A": "0%", "Version B": "50%" }, + complaints: { "Version A": "0%", "Version B": "0%" }, + hardBounces: { "Version A": "0%", "Version B": "0%" }, + openers: { "Version A": "20%", "Version B": "100%" }, + softBounces: { "Version A": "0%", "Version B": "0%" }, + unsubscribed: { "Version A": "20%", "Version B": "0%" }, + }, + winningCriteria: "Click", + winningSubjectLine: "Subject Line A", + winningVersion: "B", + winningVersionRate: "0%", + }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000/abTestCampaignResult") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.emailCampaigns.getAbTestCampaignResult({ + campaignId: 1000000, + }); + expect(response).toEqual({ + clickRate: "50%", + clickedLinks: { + "Version A": [ + { + clickRate: "0%", + clicksCount: 0, + link: "https://google.com", + }, + { + clickRate: "0%", + clicksCount: 0, + link: "https://youtube.com", + }, + ], + "Version B": [ + { + clickRate: "40%", + clicksCount: 2, + link: "http://www.github.com", + }, + { + clickRate: "60%", + clicksCount: 3, + link: "http://www.stackoverflow.com", + }, + ], + }, + openRate: "100%", + statistics: { + clicks: { + "Version A": "0%", + "Version B": "50%", + }, + complaints: { + "Version A": "0%", + "Version B": "0%", + }, + hardBounces: { + "Version A": "0%", + "Version B": "0%", + }, + openers: { + "Version A": "20%", + "Version B": "100%", + }, + softBounces: { + "Version A": "0%", + "Version B": "0%", + }, + unsubscribed: { + "Version A": "20%", + "Version B": "0%", + }, + }, + winningCriteria: "Click", + winningSubjectLine: "Subject Line A", + winningVersion: "B", + winningVersionRate: "0%", + }); + }); + + test("getAbTestCampaignResult (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000/abTestCampaignResult") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.getAbTestCampaignResult({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAbTestCampaignResult (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000/abTestCampaignResult") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.getAbTestCampaignResult({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("emailExportRecipients (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipientsType: "all" }; + const rawResponseBody = { processId: 78 }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/exportRecipients") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.emailCampaigns.emailExportRecipients({ + campaignId: 1000000, + recipientsType: "all", + }); + expect(response).toEqual({ + processId: 78, + }); + }); + + test("emailExportRecipients (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipientsType: "all" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/exportRecipients") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.emailExportRecipients({ + campaignId: 1000000, + recipientsType: "all", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("emailExportRecipients (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipientsType: "all" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/exportRecipients") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.emailExportRecipients({ + campaignId: 1000000, + recipientsType: "all", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("sendEmailCampaignNow (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().post("/emailCampaigns/1000000/sendNow").respondWith().statusCode(200).build(); + + const response = await client.emailCampaigns.sendEmailCampaignNow({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("sendEmailCampaignNow (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendNow") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.sendEmailCampaignNow({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendEmailCampaignNow (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendNow") + .respondWith() + .statusCode(402) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.sendEmailCampaignNow({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.PaymentRequiredError); + }); + + test("sendEmailCampaignNow (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendNow") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.sendEmailCampaignNow({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("sendReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + email: { + body: "Please find attached the report of our last email campaign.", + to: ["jim.suehan@example.com"], + }, + }; + + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendReport") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.emailCampaigns.sendReport({ + campaignId: 1000000, + body: { + email: { + body: "Please find attached the report of our last email campaign.", + to: ["jim.suehan@example.com"], + }, + }, + }); + expect(response).toEqual(undefined); + }); + + test("sendReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: { body: "body", to: ["to", "to"] } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendReport") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.sendReport({ + campaignId: 1000000, + body: { + email: { + body: "body", + to: ["to", "to"], + }, + }, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendReport (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: { body: "body", to: ["to", "to"] } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendReport") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.sendReport({ + campaignId: 1000000, + body: { + email: { + body: "body", + to: ["to", "to"], + }, + }, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("sendTestEmail (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.emailCampaigns.sendTestEmail({ + campaignId: 1000000, + body: {}, + }); + expect(response).toEqual(undefined); + }); + + test("sendTestEmail (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.sendTestEmail({ + campaignId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendTestEmail (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/emailCampaigns/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.sendTestEmail({ + campaignId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getSharedTemplateUrl (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + sharedUrl: "https://my.brevo.com/pt2YU7R5W_guXlowgumy_VX4pFsKu._zd0Gjj96x1_GMmzc1Qps5ZIpj6nx-", + }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000/sharedUrl") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.emailCampaigns.getSharedTemplateUrl({ + campaignId: 1000000, + }); + expect(response).toEqual({ + sharedUrl: "https://my.brevo.com/pt2YU7R5W_guXlowgumy_VX4pFsKu._zd0Gjj96x1_GMmzc1Qps5ZIpj6nx-", + }); + }); + + test("getSharedTemplateUrl (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000/sharedUrl") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.getSharedTemplateUrl({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSharedTemplateUrl (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000/sharedUrl") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.getSharedTemplateUrl({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getSharedTemplateUrl (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/emailCampaigns/1000000/sharedUrl") + .respondWith() + .statusCode(405) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.getSharedTemplateUrl({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.MethodNotAllowedError); + }); + + test("updateCampaignStatus (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/emailCampaigns/1000000/status") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.emailCampaigns.updateCampaignStatus({ + campaignId: 1000000, + body: {}, + }); + expect(response).toEqual(undefined); + }); + + test("updateCampaignStatus (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/emailCampaigns/1000000/status") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.updateCampaignStatus({ + campaignId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateCampaignStatus (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/emailCampaigns/1000000/status") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.updateCampaignStatus({ + campaignId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/event.test.ts b/tests/wire/event.test.ts new file mode 100644 index 0000000..80ed7f0 --- /dev/null +++ b/tests/wire/event.test.ts @@ -0,0 +1,65 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("EventClient", () => { + test("createEvent (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { event_name: "video_played", identifiers: {} }; + + server.mockEndpoint().post("/events").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.event.createEvent({ + event_name: "video_played", + identifiers: {}, + }); + expect(response).toEqual(undefined); + }); + + test("createEvent (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { event_name: "event_name", identifiers: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/events") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.event.createEvent({ + event_name: "event_name", + identifiers: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createEvent (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { event_name: "event_name", identifiers: {} }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/events") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.event.createEvent({ + event_name: "event_name", + identifiers: {}, + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); +}); diff --git a/tests/wire/externalFeeds.test.ts b/tests/wire/externalFeeds.test.ts new file mode 100644 index 0000000..0022c4a --- /dev/null +++ b/tests/wire/externalFeeds.test.ts @@ -0,0 +1,670 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("ExternalFeedsClient", () => { + test("getAllExternalFeeds (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 18, + feeds: [ + { + id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + name: "Product Catalog Feed", + alias: "product_catalog_feed", + url: "https://api.example.com/products", + authType: "noAuth", + username: "apiuser", + password: "apipass", + token: "abc123token456", + maxRetries: 3, + cache: true, + isInternal: false, + headers: [{ name: "Authorization", value: "Bearer xyz789" }], + createdAt: "2025-09-18T13:29:27Z", + modifiedAt: "2025-09-18T13:29:27Z", + }, + { + id: "c2d3e4f5-a6b7-48c9-90d1-e2f3a4b5c6d7", + name: "Blog News Feed", + alias: "blog_news_feed", + url: "https://blog.example.com/api/posts", + authType: "noAuth", + username: "apiuser", + password: "apipass", + token: "abc123token456", + maxRetries: 3, + cache: true, + isInternal: true, + headers: [{ name: "Authorization", value: "Bearer xyz789" }], + createdAt: "2025-09-17T16:03:25Z", + modifiedAt: "2025-09-17T16:03:25Z", + }, + { + id: "d3e4f5a6-b7c8-49d0-91e2-f3a4b5c6d7e8", + name: "Public Data Feed", + alias: "public_data_feed", + url: "https://jsonplaceholder.typicode.com/posts", + authType: "noAuth", + username: "apiuser", + password: "apipass", + token: "abc123token456", + maxRetries: 3, + cache: true, + isInternal: true, + headers: [{ name: "Authorization", value: "Bearer xyz789" }], + createdAt: "2025-09-05T09:06:42Z", + modifiedAt: "2025-09-05T09:06:42Z", + }, + ], + }; + server.mockEndpoint().get("/feeds").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.externalFeeds.getAllExternalFeeds({ + search: "product", + startDate: "2024-01-01", + endDate: "2024-01-31", + }); + expect(response).toEqual({ + count: 18, + feeds: [ + { + id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + name: "Product Catalog Feed", + alias: "product_catalog_feed", + url: "https://api.example.com/products", + authType: "noAuth", + username: "apiuser", + password: "apipass", + token: "abc123token456", + maxRetries: 3, + cache: true, + isInternal: false, + headers: [ + { + name: "Authorization", + value: "Bearer xyz789", + }, + ], + createdAt: "2025-09-18T13:29:27Z", + modifiedAt: "2025-09-18T13:29:27Z", + }, + { + id: "c2d3e4f5-a6b7-48c9-90d1-e2f3a4b5c6d7", + name: "Blog News Feed", + alias: "blog_news_feed", + url: "https://blog.example.com/api/posts", + authType: "noAuth", + username: "apiuser", + password: "apipass", + token: "abc123token456", + maxRetries: 3, + cache: true, + isInternal: true, + headers: [ + { + name: "Authorization", + value: "Bearer xyz789", + }, + ], + createdAt: "2025-09-17T16:03:25Z", + modifiedAt: "2025-09-17T16:03:25Z", + }, + { + id: "d3e4f5a6-b7c8-49d0-91e2-f3a4b5c6d7e8", + name: "Public Data Feed", + alias: "public_data_feed", + url: "https://jsonplaceholder.typicode.com/posts", + authType: "noAuth", + username: "apiuser", + password: "apipass", + token: "abc123token456", + maxRetries: 3, + cache: true, + isInternal: true, + headers: [ + { + name: "Authorization", + value: "Bearer xyz789", + }, + ], + createdAt: "2025-09-05T09:06:42Z", + modifiedAt: "2025-09-05T09:06:42Z", + }, + ], + }); + }); + + test("getAllExternalFeeds (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/feeds").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.externalFeeds.getAllExternalFeeds(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAllExternalFeeds (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/feeds").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.externalFeeds.getAllExternalFeeds(); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("createExternalFeed (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + name: "Public API Feed", + url: "https://jsonplaceholder.typicode.com/posts", + authType: "noAuth", + maxRetries: 3, + cache: true, + }; + const rawResponseBody = { id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" }; + server + .mockEndpoint() + .post("/feeds") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.externalFeeds.createExternalFeed({ + name: "Public API Feed", + url: "https://jsonplaceholder.typicode.com/posts", + authType: "noAuth", + maxRetries: 3, + cache: true, + }); + expect(response).toEqual({ + id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + }); + }); + + test("createExternalFeed (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + name: "Product Catalog", + url: "https://api.example.com/products", + authType: "noAuth", + maxRetries: 3, + cache: true, + }; + const rawResponseBody = { id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" }; + server + .mockEndpoint() + .post("/feeds") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.externalFeeds.createExternalFeed({ + name: "Product Catalog", + url: "https://api.example.com/products", + authType: "noAuth", + maxRetries: 3, + cache: true, + }); + expect(response).toEqual({ + id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + }); + }); + + test("createExternalFeed (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + name: "Internal Blog Feed", + url: "https://blog.example.com/api/posts", + authType: "noAuth", + maxRetries: 3, + cache: true, + }; + const rawResponseBody = { id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" }; + server + .mockEndpoint() + .post("/feeds") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.externalFeeds.createExternalFeed({ + name: "Internal Blog Feed", + url: "https://blog.example.com/api/posts", + authType: "noAuth", + maxRetries: 3, + cache: true, + }); + expect(response).toEqual({ + id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + }); + }); + + test("createExternalFeed (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", url: "url" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/feeds") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.externalFeeds.createExternalFeed({ + name: "name", + url: "url", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getExternalFeedByUUID (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + name: "Product Catalog Feed", + url: "https://api.example.com/products", + authType: "noAuth", + personalization: false, + defaultAttr: "", + defaultContact: "", + maxRetries: 0, + cache: false, + createdAt: "2025-09-18T13:29:27Z", + modifiedAt: "2025-09-18T13:29:27Z", + }; + server + .mockEndpoint() + .get("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.externalFeeds.getExternalFeedByUuid({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + }); + expect(response).toEqual({ + id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + name: "Product Catalog Feed", + url: "https://api.example.com/products", + authType: "noAuth", + personalization: false, + defaultAttr: "", + defaultContact: "", + maxRetries: 0, + cache: false, + createdAt: "2025-09-18T13:29:27Z", + modifiedAt: "2025-09-18T13:29:27Z", + }); + }); + + test("getExternalFeedByUUID (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "c2d3e4f5-a6b7-48c9-90d1-e2f3a4b5c6d7", + name: "Internal Blog Feed", + url: "https://blog.example.com/api/posts", + authType: "noAuth", + personalization: false, + defaultAttr: "", + defaultContact: "", + maxRetries: 0, + cache: false, + createdAt: "2025-09-17T16:03:25Z", + modifiedAt: "2025-09-17T16:03:25Z", + }; + server + .mockEndpoint() + .get("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.externalFeeds.getExternalFeedByUuid({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + }); + expect(response).toEqual({ + id: "c2d3e4f5-a6b7-48c9-90d1-e2f3a4b5c6d7", + name: "Internal Blog Feed", + url: "https://blog.example.com/api/posts", + authType: "noAuth", + personalization: false, + defaultAttr: "", + defaultContact: "", + maxRetries: 0, + cache: false, + createdAt: "2025-09-17T16:03:25Z", + modifiedAt: "2025-09-17T16:03:25Z", + }); + }); + + test("getExternalFeedByUUID (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "d3e4f5a6-b7c8-49d0-91e2-f3a4b5c6d7e8", + name: "Public Data Feed", + url: "https://jsonplaceholder.typicode.com/posts", + authType: "noAuth", + personalization: false, + defaultAttr: "", + defaultContact: "", + maxRetries: 0, + cache: false, + createdAt: "2025-09-05T09:06:42Z", + modifiedAt: "2025-09-05T09:06:42Z", + }; + server + .mockEndpoint() + .get("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.externalFeeds.getExternalFeedByUuid({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + }); + expect(response).toEqual({ + id: "d3e4f5a6-b7c8-49d0-91e2-f3a4b5c6d7e8", + name: "Public Data Feed", + url: "https://jsonplaceholder.typicode.com/posts", + authType: "noAuth", + personalization: false, + defaultAttr: "", + defaultContact: "", + maxRetries: 0, + cache: false, + createdAt: "2025-09-05T09:06:42Z", + modifiedAt: "2025-09-05T09:06:42Z", + }); + }); + + test("getExternalFeedByUUID (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/feeds/uuid").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.externalFeeds.getExternalFeedByUuid({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getExternalFeedByUUID (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/feeds/uuid").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.externalFeeds.getExternalFeedByUuid({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateExternalFeed (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "Updated Product Catalog", url: "https://api.newstore.com/products/v2" }; + + server + .mockEndpoint() + .put("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.externalFeeds.updateExternalFeed({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + name: "Updated Product Catalog", + url: "https://api.newstore.com/products/v2", + }); + expect(response).toEqual(undefined); + }); + + test("updateExternalFeed (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { authType: "token", token: "newabc123token789" }; + + server + .mockEndpoint() + .put("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.externalFeeds.updateExternalFeed({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + authType: "token", + token: "newabc123token789", + }); + expect(response).toEqual(undefined); + }); + + test("updateExternalFeed (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { maxRetries: 5, cache: true }; + + server + .mockEndpoint() + .put("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.externalFeeds.updateExternalFeed({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + maxRetries: 5, + cache: true, + }); + expect(response).toEqual(undefined); + }); + + test("updateExternalFeed (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + headers: [ + { name: "X-API-Version", value: "v2" }, + { name: "User-Agent", value: "Brevo-Feed-Client/1.0" }, + ], + }; + + server + .mockEndpoint() + .put("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.externalFeeds.updateExternalFeed({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + headers: [ + { + name: "X-API-Version", + value: "v2", + }, + { + name: "User-Agent", + value: "Brevo-Feed-Client/1.0", + }, + ], + }); + expect(response).toEqual(undefined); + }); + + test("updateExternalFeed (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + name: "Enterprise Product Feed", + url: "https://enterprise-api.company.com/catalog", + authType: "token", + token: "enterprise789token123", + headers: [ + { name: "Authorization", value: "Bearer enterprise789token123" }, + { name: "Accept", value: "application/json" }, + ], + maxRetries: 3, + cache: true, + }; + + server + .mockEndpoint() + .put("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.externalFeeds.updateExternalFeed({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + name: "Enterprise Product Feed", + url: "https://enterprise-api.company.com/catalog", + authType: "token", + token: "enterprise789token123", + headers: [ + { + name: "Authorization", + value: "Bearer enterprise789token123", + }, + { + name: "Accept", + value: "application/json", + }, + ], + maxRetries: 3, + cache: true, + }); + expect(response).toEqual(undefined); + }); + + test("updateExternalFeed (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/feeds/uuid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.externalFeeds.updateExternalFeed({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateExternalFeed (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/feeds/uuid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.externalFeeds.updateExternalFeed({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteExternalFeed (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.externalFeeds.deleteExternalFeed({ + uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", + }); + expect(response).toEqual(undefined); + }); + + test("deleteExternalFeed (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/feeds/uuid").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.externalFeeds.deleteExternalFeed({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteExternalFeed (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/feeds/uuid").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.externalFeeds.deleteExternalFeed({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/files.test.ts b/tests/wire/files.test.ts new file mode 100644 index 0000000..98795fa --- /dev/null +++ b/tests/wire/files.test.ts @@ -0,0 +1,190 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("FilesClient", () => { + test("getAllFiles (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { + authorId: "61a5ce58y5d4795761045991", + companyId: "61a5ce58c5d4795761045991", + contactId: 1, + createdAt: "2017-05-01T17:05:03Z", + dealId: "61a5ce58c5d4795761045991", + name: "example.png", + size: 10, + }, + ]; + server.mockEndpoint().get("/crm/files").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.files.getAllFiles(); + expect(response).toEqual([ + { + authorId: "61a5ce58y5d4795761045991", + companyId: "61a5ce58c5d4795761045991", + contactId: 1, + createdAt: "2017-05-01T17:05:03Z", + dealId: "61a5ce58c5d4795761045991", + name: "example.png", + size: 10, + }, + ]); + }); + + test("getAllFiles (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.files.getAllFiles(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("downloadAFile (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { fileUrl: "https://storage.googleapis.com/brevo-app-crm.......-sample.pdf" }; + server.mockEndpoint().get("/crm/files/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.files.downloadAFile({ + id: "id", + }); + expect(response).toEqual({ + fileUrl: "https://storage.googleapis.com/brevo-app-crm.......-sample.pdf", + }); + }); + + test("downloadAFile (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.files.downloadAFile({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("downloadAFile (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.files.downloadAFile({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteAFile (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/crm/files/id").respondWith().statusCode(200).build(); + + const response = await client.files.deleteAFile({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteAFile (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/files/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.files.deleteAFile({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteAFile (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/files/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.files.deleteAFile({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getFileDetails (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + authorId: "61a5ce58y5d4795761045991", + companyId: "61a5ce58c5d4795761045991", + contactId: 1, + createdAt: "2017-05-01T17:05:03Z", + dealId: "61a5ce58c5d4795761045991", + name: "example.png", + size: 10, + }; + server.mockEndpoint().get("/crm/files/id/data").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.files.getFileDetails({ + id: "id", + }); + expect(response).toEqual({ + authorId: "61a5ce58y5d4795761045991", + companyId: "61a5ce58c5d4795761045991", + contactId: 1, + createdAt: "2017-05-01T17:05:03Z", + dealId: "61a5ce58c5d4795761045991", + name: "example.png", + size: 10, + }); + }); + + test("getFileDetails (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files/id/data").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.files.getFileDetails({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getFileDetails (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files/id/data").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.files.getFileDetails({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/inboundParsing.test.ts b/tests/wire/inboundParsing.test.ts new file mode 100644 index 0000000..4445cc0 --- /dev/null +++ b/tests/wire/inboundParsing.test.ts @@ -0,0 +1,140 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("InboundParsingClient", () => { + test("getInboundEmailEvents (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + events: [ + { + date: "2017-03-11T12:30:00Z", + recipient: "alexa@example.com", + sender: "john@example.com", + uuid: "1a825d56-029b-4a41-b8e4-1a825d56", + }, + { + date: "2017-03-12T12:30:00Z", + recipient: "bob@example.com", + sender: "alice@example.com", + uuid: "1a825d56-029b-4a41-b8e4-61670463431b", + }, + ], + }; + server.mockEndpoint().get("/inbound/events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.inboundParsing.getInboundEmailEvents(); + expect(response).toEqual({ + events: [ + { + date: "2017-03-11T12:30:00Z", + recipient: "alexa@example.com", + sender: "john@example.com", + uuid: "1a825d56-029b-4a41-b8e4-1a825d56", + }, + { + date: "2017-03-12T12:30:00Z", + recipient: "bob@example.com", + sender: "alice@example.com", + uuid: "1a825d56-029b-4a41-b8e4-61670463431b", + }, + ], + }); + }); + + test("getInboundEmailEvents (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/inbound/events").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.inboundParsing.getInboundEmailEvents(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getInboundEmailEventsByUuid (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + attachments: [{ contentLength: 12345, contentType: "application/pdf", name: "invoice.pdf" }], + deliveredAt: "2017-03-12T12:31:00Z", + logs: [ + { date: "2017-03-12T12:30:00Z", type: "received" }, + { date: "2017-03-12T12:30:04Z", type: "webhookFailed" }, + { date: "2017-03-12T12:31:04Z", type: "webhookDelivered" }, + ], + messageId: "", + receivedAt: "2017-03-12T12:30:00Z", + recipient: "bob@example.com", + sender: "alice@example.com", + subject: "Re: Question about your API", + }; + server + .mockEndpoint() + .get("/inbound/events/uuid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.inboundParsing.getInboundEmailEventsByUuid({ + uuid: "uuid", + }); + expect(response).toEqual({ + attachments: [ + { + contentLength: 12345, + contentType: "application/pdf", + name: "invoice.pdf", + }, + ], + deliveredAt: "2017-03-12T12:31:00Z", + logs: [ + { + date: "2017-03-12T12:30:00Z", + type: "received", + }, + { + date: "2017-03-12T12:30:04Z", + type: "webhookFailed", + }, + { + date: "2017-03-12T12:31:04Z", + type: "webhookDelivered", + }, + ], + messageId: "", + receivedAt: "2017-03-12T12:30:00Z", + recipient: "bob@example.com", + sender: "alice@example.com", + subject: "Re: Question about your API", + }); + }); + + test("getInboundEmailEventsByUuid (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/inbound/events/uuid") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inboundParsing.getInboundEmailEventsByUuid({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); +}); diff --git a/tests/wire/masterAccount.test.ts b/tests/wire/masterAccount.test.ts new file mode 100644 index 0000000..bf32fb1 --- /dev/null +++ b/tests/wire/masterAccount.test.ts @@ -0,0 +1,1590 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("MasterAccountClient", () => { + test("createANewGroupOfSubAccounts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { groupName: "My group" }; + const rawResponseBody = { id: "659xxxxxxxxxxxxxxxx6ef9c8" }; + server + .mockEndpoint() + .post("/corporate/group") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.createANewGroupOfSubAccounts({ + groupName: "My group", + }); + expect(response).toEqual({ + id: "659xxxxxxxxxxxxxxxx6ef9c8", + }); + }); + + test("createANewGroupOfSubAccounts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { groupName: "groupName" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/group") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.createANewGroupOfSubAccounts({ + groupName: "groupName", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteSubAccountFromGroup (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { subAccountIds: [423432, 234323, 87678] }; + + server + .mockEndpoint() + .put("/corporate/group/unlink/groupId/subAccounts") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.masterAccount.deleteSubAccountFromGroup({ + groupId: "groupId", + subAccountIds: [423432, 234323, 87678], + }); + expect(response).toEqual(undefined); + }); + + test("deleteSubAccountFromGroup (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { subAccountIds: [1000000, 1000000] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/group/unlink/groupId/subAccounts") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.deleteSubAccountFromGroup({ + groupId: "groupId", + subAccountIds: [1000000, 1000000], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getAGroupDetails", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + group: { createdAt: "2024-02-09T06:14:40+00:00", groupName: "My group", id: "5f926dba72a405440a4efc97" }, + "sub-accounts": [ + { companyName: "My sub organization", createdAt: "2024-02-09T06:14:40+00:00", id: 7866556 }, + { companyName: "Your sub organization", createdAt: "2024-01-05T03:11:40+00:00", id: 6563051 }, + ], + users: [ + { email: "my-user@my-org.com", firstName: "John", lastName: "Smith" }, + { email: "your-user@your-org.com", firstName: "firstName", lastName: "lastName" }, + ], + }; + server + .mockEndpoint() + .get("/corporate/group/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.getAGroupDetails({ + id: "id", + }); + expect(response).toEqual({ + group: { + createdAt: "2024-02-09T06:14:40+00:00", + groupName: "My group", + id: "5f926dba72a405440a4efc97", + }, + "sub-accounts": [ + { + companyName: "My sub organization", + createdAt: "2024-02-09T06:14:40+00:00", + id: 7866556, + }, + { + companyName: "Your sub organization", + createdAt: "2024-01-05T03:11:40+00:00", + id: 6563051, + }, + ], + users: [ + { + email: "my-user@my-org.com", + firstName: "John", + lastName: "Smith", + }, + { + email: "your-user@your-org.com", + firstName: "firstName", + lastName: "lastName", + }, + ], + }); + }); + + test("updateAGroupOfSubAccounts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server.mockEndpoint().put("/corporate/group/id").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.masterAccount.updateAGroupOfSubAccounts({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("updateAGroupOfSubAccounts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/group/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.updateAGroupOfSubAccounts({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteAGroup (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/corporate/group/id").respondWith().statusCode(200).build(); + + const response = await client.masterAccount.deleteAGroup({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteAGroup (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/corporate/group/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.deleteAGroup({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSubAccountGroups", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { groupName: "My group 1", id: "d3b142c709d6ed67ef1cd903" }, + { groupName: "My group 2", id: "a5b192a709d6ed67ef8fd922" }, + { groupName: "My group 3", id: "bbb142c709d6ed67ef1cd910" }, + ]; + server.mockEndpoint().get("/corporate/groups").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.masterAccount.getSubAccountGroups(); + expect(response).toEqual([ + { + groupName: "My group 1", + id: "d3b142c709d6ed67ef1cd903", + }, + { + groupName: "My group 2", + id: "a5b192a709d6ed67ef8fd922", + }, + { + groupName: "My group 3", + id: "bbb142c709d6ed67ef1cd910", + }, + ]); + }); + + test("getCorporateInvitedUsersList", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + users: [ + { + email: "master-user2@company.com", + feature_access: { + analytics: ["download_data", "create_alerts", "my_looks", "explore_create"], + api_keys: ["all"], + apps_management: ["none"], + create_sub_organizations: ["all"], + manage_sub_organizations: ["all"], + my_plan: ["all", "all"], + sub_organization_groups: ["create", "edit_delete"], + user_management: ["none"], + }, + groups: { id: "a5c4f22c08d9ed37ef1ca342", name: "My group" }, + is_owner: "is_owner", + status: "active", + }, + { + email: "master-user3@company.com", + feature_access: { + analytics: ["create_alerts", "my_looks"], + api_keys: ["none"], + apps_management: ["all"], + create_sub_organizations: ["all"], + manage_sub_organizations: ["all"], + my_plan: ["none", "none"], + sub_organization_groups: ["edit_delete"], + user_management: ["all"], + }, + groups: { id: "a5c4f22c08d9ed37ef1ca342", name: "My group" }, + is_owner: "is_owner", + status: "active", + }, + ], + }; + server + .mockEndpoint() + .get("/corporate/invited/users") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.getCorporateInvitedUsersList(); + expect(response).toEqual({ + users: [ + { + email: "master-user2@company.com", + feature_access: { + analytics: ["download_data", "create_alerts", "my_looks", "explore_create"], + api_keys: ["all"], + apps_management: ["none"], + create_sub_organizations: ["all"], + manage_sub_organizations: ["all"], + my_plan: ["all", "all"], + sub_organization_groups: ["create", "edit_delete"], + user_management: ["none"], + }, + groups: { + id: "a5c4f22c08d9ed37ef1ca342", + name: "My group", + }, + is_owner: "is_owner", + status: "active", + }, + { + email: "master-user3@company.com", + feature_access: { + analytics: ["create_alerts", "my_looks"], + api_keys: ["none"], + apps_management: ["all"], + create_sub_organizations: ["all"], + manage_sub_organizations: ["all"], + my_plan: ["none", "none"], + sub_organization_groups: ["edit_delete"], + user_management: ["all"], + }, + groups: { + id: "a5c4f22c08d9ed37ef1ca342", + name: "My group", + }, + is_owner: "is_owner", + status: "active", + }, + ], + }); + }); + + test("listOfAllIPs", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { domain: "example.com", ip: "192.168.1.1", transactional: true }, + { domain: "example.com", ip: "192.168.1.2", transactional: false }, + ]; + server.mockEndpoint().get("/corporate/ip").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.masterAccount.listOfAllIPs(); + expect(response).toEqual([ + { + domain: "example.com", + ip: "192.168.1.1", + transactional: true, + }, + { + domain: "example.com", + ip: "192.168.1.2", + transactional: false, + }, + ]); + }); + + test("getTheDetailsOfRequestedMasterAccount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + billingInfo: { + address: { + countryCode: "IN", + locality: "Pandav Nagar, New Delhi", + postalCode: "560048", + stateCode: "UP", + streetAddress: "C-92", + }, + companyName: "Corp Sample 1-1", + email: "sample@example.com", + name: { familyName: "Pandit", givenName: "Uday" }, + }, + companyName: "Corp Sample 1-1", + currencyCode: "INR", + email: "sample@example.com", + id: 1003286, + planInfo: { + currencyCode: "INR", + features: [ + { name: "MULTI_USER", quantity: 10, remaining: 0, unitValue: "unitValue", used: 15 }, + { name: "ADVANCED_REPORTING", quantity: 12, remaining: 11, unitValue: "unitValue", used: 1 }, + { name: "INBOX", quantity: 10, remaining: 0, unitValue: "unitValue", used: 10 }, + { name: "LANDING_PAGE", quantity: 10, remaining: 0, unitValue: "unitValue", used: 11 }, + { name: "RECURRING_CREDITS", quantity: 500, remaining: 499, unitValue: "unitValue", used: 1 }, + ], + nextBillingAt: 1637739295, + planPeriod: "month", + price: 2100, + subAccounts: 15, + }, + timezone: "Europe/Paris", + }; + server + .mockEndpoint() + .get("/corporate/masterAccount") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.getTheDetailsOfRequestedMasterAccount(); + expect(response).toEqual({ + billingInfo: { + address: { + countryCode: "IN", + locality: "Pandav Nagar, New Delhi", + postalCode: "560048", + stateCode: "UP", + streetAddress: "C-92", + }, + companyName: "Corp Sample 1-1", + email: "sample@example.com", + name: { + familyName: "Pandit", + givenName: "Uday", + }, + }, + companyName: "Corp Sample 1-1", + currencyCode: "INR", + email: "sample@example.com", + id: 1003286, + planInfo: { + currencyCode: "INR", + features: [ + { + name: "MULTI_USER", + quantity: 10, + remaining: 0, + unitValue: "unitValue", + used: 15, + }, + { + name: "ADVANCED_REPORTING", + quantity: 12, + remaining: 11, + unitValue: "unitValue", + used: 1, + }, + { + name: "INBOX", + quantity: 10, + remaining: 0, + unitValue: "unitValue", + used: 10, + }, + { + name: "LANDING_PAGE", + quantity: 10, + remaining: 0, + unitValue: "unitValue", + used: 11, + }, + { + name: "RECURRING_CREDITS", + quantity: 500, + remaining: 499, + unitValue: "unitValue", + used: 1, + }, + ], + nextBillingAt: 1637739295, + planPeriod: "month", + price: 2100, + subAccounts: 15, + }, + timezone: "Europe/Paris", + }); + }); + + test("getTheDetailsOfRequestedMasterAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/corporate/masterAccount") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.getTheDetailsOfRequestedMasterAccount(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("generateSsoTokenToAccessAdminAccount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "vipin+ent-user@brevo.com" }; + const rawResponseBody = { token: "5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0" }; + server + .mockEndpoint() + .post("/corporate/ssoToken") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.generateSsoTokenToAccessAdminAccount({ + email: "vipin+ent-user@brevo.com", + }); + expect(response).toEqual({ + token: "5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0", + }); + }); + + test("generateSsoTokenToAccessAdminAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/ssoToken") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.generateSsoTokenToAccessAdminAccount({ + email: "email", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("generateSsoTokenToAccessAdminAccount (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/ssoToken") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.generateSsoTokenToAccessAdminAccount({ + email: "email", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getTheListOfAllTheSubAccountsOfTheMasterAccount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 3, + subAccounts: [ + { + active: true, + companyName: "Company1", + createdAt: 1631523176, + groups: [ + { id: "5f8f8c3b5f56a02d4433b3a8", name: "Group 1" }, + { id: "4fbf3c3b1f56a02ac465b1a0", name: "Group 2" }, + ], + id: 4043629, + }, + { active: true, companyName: "Company2", createdAt: 1629439311, groups: [{}], id: 3984002 }, + { active: true, companyName: "Company3", createdAt: 1614713641, groups: [{}], id: 3524191 }, + ], + }; + server + .mockEndpoint() + .get("/corporate/subAccount") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.getTheListOfAllTheSubAccountsOfTheMasterAccount({ + offset: 1, + limit: 1, + }); + expect(response).toEqual({ + count: 3, + subAccounts: [ + { + active: true, + companyName: "Company1", + createdAt: 1631523176, + groups: [ + { + id: "5f8f8c3b5f56a02d4433b3a8", + name: "Group 1", + }, + { + id: "4fbf3c3b1f56a02ac465b1a0", + name: "Group 2", + }, + ], + id: 4043629, + }, + { + active: true, + companyName: "Company2", + createdAt: 1629439311, + groups: [{}], + id: 3984002, + }, + { + active: true, + companyName: "Company3", + createdAt: 1614713641, + groups: [{}], + id: 3524191, + }, + ], + }); + }); + + test("getTheListOfAllTheSubAccountsOfTheMasterAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/corporate/subAccount") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.getTheListOfAllTheSubAccountsOfTheMasterAccount({ + offset: 1, + limit: 1, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createANewSubAccountUnderAMasterAccount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + companyName: "Test Sub-account", + email: "test-sub@example.com", + groupIds: ["5f8f8c3b5f56a02d4433b3a7", "5f8f8c3b5f56a02d4433b3a8"], + language: "fr", + timezone: "Europe/Paris", + }; + const rawResponseBody = { id: 4109344 }; + server + .mockEndpoint() + .post("/corporate/subAccount") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.createANewSubAccountUnderAMasterAccount({ + companyName: "Test Sub-account", + email: "test-sub@example.com", + groupIds: ["5f8f8c3b5f56a02d4433b3a7", "5f8f8c3b5f56a02d4433b3a8"], + language: "fr", + timezone: "Europe/Paris", + }); + expect(response).toEqual({ + id: 4109344, + }); + }); + + test("createANewSubAccountUnderAMasterAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { companyName: "companyName", email: "email" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/subAccount") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.createANewSubAccountUnderAMasterAccount({ + companyName: "companyName", + email: "email", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("associateAnIpToSubAccounts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { ids: [234322, 325553, 893432], ip: "103.11.32.88" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/subAccount/ip/associate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.associateAnIpToSubAccounts({ + ids: [234322, 325553, 893432], + ip: "103.11.32.88", + }); + expect(response).toEqual({ + key: "value", + }); + }); + + test("associateAnIpToSubAccounts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { ids: [1000000, 1000000], ip: "ip" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/subAccount/ip/associate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.associateAnIpToSubAccounts({ + ids: [1000000, 1000000], + ip: "ip", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("dissociateAnIpToSubAccounts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { ids: [234322, 325553, 893432], ip: "103.11.32.88" }; + + server + .mockEndpoint() + .put("/corporate/subAccount/ip/dissociate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.masterAccount.dissociateAnIpToSubAccounts({ + ids: [234322, 325553, 893432], + ip: "103.11.32.88", + }); + expect(response).toEqual(undefined); + }); + + test("dissociateAnIpToSubAccounts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { ids: [1000000, 1000000], ip: "ip" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/subAccount/ip/dissociate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.dissociateAnIpToSubAccounts({ + ids: [1000000, 1000000], + ip: "ip", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createAnApiKeyForASubAccount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: 3232323, name: "My Api Key" }; + const rawResponseBody = { key: "xkeysib-21881axxxxxcc92e04-mIrexxxx7z", status: "success" }; + server + .mockEndpoint() + .post("/corporate/subAccount/key") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.createAnApiKeyForASubAccount({ + id: 3232323, + name: "My Api Key", + }); + expect(response).toEqual({ + key: "xkeysib-21881axxxxxcc92e04-mIrexxxx7z", + status: "success", + }); + }); + + test("createAnApiKeyForASubAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: 1000000, name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/subAccount/key") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.createAnApiKeyForASubAccount({ + id: 1000000, + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("generateSsoTokenToAccessSubAccount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: 3232323 }; + const rawResponseBody = { token: "5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0" }; + server + .mockEndpoint() + .post("/corporate/subAccount/ssoToken") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.generateSsoTokenToAccessSubAccount({ + id: 3232323, + }); + expect(response).toEqual({ + token: "5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0", + }); + }); + + test("generateSsoTokenToAccessSubAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: 1000000 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/subAccount/ssoToken") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.generateSsoTokenToAccessSubAccount({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("generateSsoTokenToAccessSubAccount (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: 1000000 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/subAccount/ssoToken") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.generateSsoTokenToAccessSubAccount({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getSubAccountDetails (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + companyName: "API-Sub-26thOct21-4", + email: "uday+1@brevo.com", + groups: [ + { id: "5f8f8c3b5f56a02d4433b3a7", name: "Group 1" }, + { id: "5f8f8c3b5f56a02d4433b3a8", name: "Group 2" }, + ], + name: "Uday Pandit", + planInfo: { + credits: { + emails: { quantity: 2000, remaining: 1955 }, + externalFeeds: { quantity: 1, remaining: 1 }, + sms: { quantity: 2000, remaining: 1955 }, + whatsapp: { quantity: 100, remaining: 50 }, + wpSubscribers: { quantity: 2000, remaining: 1955 }, + }, + features: { + inbox: { quantity: 20, remaining: 12 }, + landingPage: { quantity: 25, remaining: 14 }, + salesUsers: { quantity: 30, remaining: 14 }, + users: { quantity: 30, remaining: 14 }, + }, + planType: "paid", + }, + }; + server + .mockEndpoint() + .get("/corporate/subAccount/1000000") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.getSubAccountDetails({ + id: 1000000, + }); + expect(response).toEqual({ + companyName: "API-Sub-26thOct21-4", + email: "uday+1@brevo.com", + groups: [ + { + id: "5f8f8c3b5f56a02d4433b3a7", + name: "Group 1", + }, + { + id: "5f8f8c3b5f56a02d4433b3a8", + name: "Group 2", + }, + ], + name: "Uday Pandit", + planInfo: { + credits: { + emails: { + quantity: 2000, + remaining: 1955, + }, + externalFeeds: { + quantity: 1, + remaining: 1, + }, + sms: { + quantity: 2000, + remaining: 1955, + }, + whatsapp: { + quantity: 100, + remaining: 50, + }, + wpSubscribers: { + quantity: 2000, + remaining: 1955, + }, + }, + features: { + inbox: { + quantity: 20, + remaining: 12, + }, + landingPage: { + quantity: 25, + remaining: 14, + }, + salesUsers: { + quantity: 30, + remaining: 14, + }, + users: { + quantity: 30, + remaining: 14, + }, + }, + planType: "paid", + }, + }); + }); + + test("getSubAccountDetails (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/corporate/subAccount/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.getSubAccountDetails({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteASubAccount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/corporate/subAccount/1000000").respondWith().statusCode(200).build(); + + const response = await client.masterAccount.deleteASubAccount({ + id: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteASubAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/corporate/subAccount/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.deleteASubAccount({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteASubAccount (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/corporate/subAccount/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.deleteASubAccount({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("enableDisableSubAccountApplicationS (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + "landing-pages": true, + meetings: true, + "sms-campaigns": false, + "web-push": false, + whatsapp: true, + }; + + server + .mockEndpoint() + .put("/corporate/subAccount/1000000/applications/toggle") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.masterAccount.enableDisableSubAccountApplicationS({ + id: 1000000, + "landing-pages": true, + meetings: true, + "sms-campaigns": false, + "web-push": false, + whatsapp: true, + }); + expect(response).toEqual(undefined); + }); + + test("enableDisableSubAccountApplicationS (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/subAccount/1000000/applications/toggle") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.enableDisableSubAccountApplicationS({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("enableDisableSubAccountApplicationS (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/subAccount/1000000/applications/toggle") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.enableDisableSubAccountApplicationS({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("updateSubAccountPlan (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + credits: { email: 5000, externalFeeds: 1, sms: 2000, whatsapp: 100, wpSubscribers: -1 }, + features: { inbox: 10, landingPage: 20, salesUsers: 6, users: 15 }, + }; + + server + .mockEndpoint() + .put("/corporate/subAccount/1000000/plan") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.masterAccount.updateSubAccountPlan({ + id: 1000000, + credits: { + email: 5000, + externalFeeds: 1, + sms: 2000, + whatsapp: 100, + wpSubscribers: -1, + }, + features: { + inbox: 10, + landingPage: 20, + salesUsers: 6, + users: 15, + }, + }); + expect(response).toEqual(undefined); + }); + + test("updateSubAccountPlan (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/subAccount/1000000/plan") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.updateSubAccountPlan({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateSubAccountPlan (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/subAccount/1000000/plan") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.updateSubAccountPlan({ + id: 1000000, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("updateSubAccountsPlan (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + credits: { email: 5000, externalFeeds: 1, sms: 2000, whatsapp: 100, wpSubscribers: -1 }, + features: { landingPage: 20, salesUsers: 6, users: 15 }, + subAccountIds: [4534345, 987893, 876785], + }; + + server + .mockEndpoint() + .put("/corporate/subAccounts/plan") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.masterAccount.updateSubAccountsPlan({ + credits: { + email: 5000, + externalFeeds: 1, + sms: 2000, + whatsapp: 100, + wpSubscribers: -1, + }, + features: { + landingPage: 20, + salesUsers: 6, + users: 15, + }, + subAccountIds: [4534345, 987893, 876785], + }); + expect(response).toEqual(undefined); + }); + + test("updateSubAccountsPlan (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/subAccounts/plan") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.updateSubAccountsPlan(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateSubAccountsPlan (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/subAccounts/plan") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.updateSubAccountsPlan(); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("inviteAdminUser (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all_features_access: true, email: "inviteuser@example.com", privileges: [{}] }; + const rawResponseBody = { id: "659xxxxxxxxxxxxxxxx6ef9c8" }; + server + .mockEndpoint() + .post("/corporate/user/invitation/send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.inviteAdminUser({ + all_features_access: true, + email: "inviteuser@example.com", + privileges: [{}], + }); + expect(response).toEqual({ + id: "659xxxxxxxxxxxxxxxx6ef9c8", + }); + }); + + test("inviteAdminUser (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all_features_access: true, email: "email", privileges: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/corporate/user/invitation/send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.inviteAdminUser({ + all_features_access: true, + email: "email", + privileges: [{}, {}], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("resendCancelAdminUserInvitation (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "Invitation resent successfully" }; + server + .mockEndpoint() + .put("/corporate/user/invitation/resend/email") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.resendCancelAdminUserInvitation({ + action: "resend", + email: "email", + }); + expect(response).toEqual({ + message: "Invitation resent successfully", + }); + }); + + test("resendCancelAdminUserInvitation (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/user/invitation/resend/email") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.resendCancelAdminUserInvitation({ + action: "resend", + email: "email", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("revokeAnAdminUser (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/corporate/user/revoke/email").respondWith().statusCode(200).build(); + + const response = await client.masterAccount.revokeAnAdminUser({ + email: "email", + }); + expect(response).toEqual(undefined); + }); + + test("revokeAnAdminUser (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/corporate/user/revoke/email") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.revokeAnAdminUser({ + email: "email", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getCorporateUserPermission (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + email: "invitedUser@company.com", + feature_access: { + analytics: ["download_data", "create_alerts", "my_looks", "explore_create"], + api_keys: ["all"], + apps_management: ["all"], + create_sub_organizations: ["all"], + manage_sub_organizations: ["all"], + my_plan: ["all", "all"], + sub_organization_groups: ["create", "edit_delete"], + user_management: ["none"], + }, + groups: [ + { id: "6543ab3667ffbb00142e4486", name: "Support" }, + { id: "174bab366732bbce142e4412", name: "Technical" }, + ], + status: "active", + }; + server + .mockEndpoint() + .get("/corporate/user/email/permissions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.masterAccount.getCorporateUserPermission({ + email: "email", + }); + expect(response).toEqual({ + email: "invitedUser@company.com", + feature_access: { + analytics: ["download_data", "create_alerts", "my_looks", "explore_create"], + api_keys: ["all"], + apps_management: ["all"], + create_sub_organizations: ["all"], + manage_sub_organizations: ["all"], + my_plan: ["all", "all"], + sub_organization_groups: ["create", "edit_delete"], + user_management: ["none"], + }, + groups: [ + { + id: "6543ab3667ffbb00142e4486", + name: "Support", + }, + { + id: "174bab366732bbce142e4412", + name: "Technical", + }, + ], + status: "active", + }); + }); + + test("getCorporateUserPermission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/corporate/user/email/permissions") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.getCorporateUserPermission({ + email: "email", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("changeAdminUserPermissions (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + all_features_access: false, + privileges: [ + { feature: "user_management", permissions: ["all"] }, + { feature: "api", permissions: ["all"] }, + { feature: "my_plan", permissions: ["none"] }, + { feature: "apps_management", permissions: ["all"] }, + { feature: "create_sub_organizations", permissions: ["all"] }, + { feature: "sub_organization_groups", permissions: ["create", "edit_delete"] }, + { feature: "manage_sub_organizations", permissions: ["all"] }, + { feature: "security", permissions: ["none"] }, + { feature: "analytics", permissions: ["create_alerts", "download_data", "my_looks", "explore_create"] }, + ], + }; + + server + .mockEndpoint() + .put("/corporate/user/email/permissions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.masterAccount.changeAdminUserPermissions({ + email: "email", + all_features_access: false, + privileges: [ + { + feature: "user_management", + permissions: ["all"], + }, + { + feature: "api", + permissions: ["all"], + }, + { + feature: "my_plan", + permissions: ["none"], + }, + { + feature: "apps_management", + permissions: ["all"], + }, + { + feature: "create_sub_organizations", + permissions: ["all"], + }, + { + feature: "sub_organization_groups", + permissions: ["create", "edit_delete"], + }, + { + feature: "manage_sub_organizations", + permissions: ["all"], + }, + { + feature: "security", + permissions: ["none"], + }, + { + feature: "analytics", + permissions: ["create_alerts", "download_data", "my_looks", "explore_create"], + }, + ], + }); + expect(response).toEqual(undefined); + }); + + test("changeAdminUserPermissions (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all_features_access: true, privileges: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/corporate/user/email/permissions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.changeAdminUserPermissions({ + email: "email", + all_features_access: true, + privileges: [{}, {}], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); +}); diff --git a/tests/wire/notes.test.ts b/tests/wire/notes.test.ts new file mode 100644 index 0000000..545c01c --- /dev/null +++ b/tests/wire/notes.test.ts @@ -0,0 +1,327 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("NotesClient", () => { + test("getAllNotes (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { + authorId: { + email: "johndoe@example.com", + id: "61a5ce58y5d4795761045991", + locale: "en_GB", + name: { fullName: "John Doe" }, + timezone: "Asia/Kolkata", + }, + contactIds: [247, 1, 2], + createdAt: "2017-05-01T17:05:03Z", + dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], + id: "61a5cd07ca1347c82306ad09", + text: "In communication with client_dev for resolution of queries.", + updatedAt: "2017-05-01T17:05:03Z", + }, + ]; + server.mockEndpoint().get("/crm/notes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.notes.getAllNotes(); + expect(response).toEqual([ + { + authorId: { + email: "johndoe@example.com", + id: "61a5ce58y5d4795761045991", + locale: "en_GB", + name: { + fullName: "John Doe", + }, + timezone: "Asia/Kolkata", + }, + contactIds: [247, 1, 2], + createdAt: "2017-05-01T17:05:03Z", + dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], + id: "61a5cd07ca1347c82306ad09", + text: "In communication with client_dev for resolution of queries.", + updatedAt: "2017-05-01T17:05:03Z", + }, + ]); + }); + + test("getAllNotes (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/notes").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.notes.getAllNotes(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createANote (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "In communication with client_dev for resolution of queries." }; + const rawResponseBody = { id: "61a5cd07ca1347c82306ad09" }; + server + .mockEndpoint() + .post("/crm/notes") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.notes.createANote({ + text: "In communication with client_dev for resolution of queries.", + }); + expect(response).toEqual({ + id: "61a5cd07ca1347c82306ad09", + }); + }); + + test("createANote (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "x" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/crm/notes") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.notes.createANote({ + text: "x", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createANote (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "x" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/crm/notes") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(415) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.notes.createANote({ + text: "x", + }); + }).rejects.toThrow(Brevo.UnsupportedMediaTypeError); + }); + + test("getANote (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + authorId: { + email: "johndoe@example.com", + id: "61a5ce58y5d4795761045991", + locale: "en_GB", + name: { fullName: "John Doe" }, + timezone: "Asia/Kolkata", + }, + contactIds: [247, 1, 2], + createdAt: "2017-05-01T17:05:03Z", + dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], + id: "61a5cd07ca1347c82306ad09", + text: "In communication with client_dev for resolution of queries.", + updatedAt: "2017-05-01T17:05:03Z", + }; + server.mockEndpoint().get("/crm/notes/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.notes.getANote({ + id: "id", + }); + expect(response).toEqual({ + authorId: { + email: "johndoe@example.com", + id: "61a5ce58y5d4795761045991", + locale: "en_GB", + name: { + fullName: "John Doe", + }, + timezone: "Asia/Kolkata", + }, + contactIds: [247, 1, 2], + createdAt: "2017-05-01T17:05:03Z", + dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], + id: "61a5cd07ca1347c82306ad09", + text: "In communication with client_dev for resolution of queries.", + updatedAt: "2017-05-01T17:05:03Z", + }); + }); + + test("getANote (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/notes/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.notes.getANote({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getANote (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/notes/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.notes.getANote({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteANote (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/crm/notes/id").respondWith().statusCode(200).build(); + + const response = await client.notes.deleteANote({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteANote (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/notes/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.notes.deleteANote({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteANote (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/notes/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.notes.deleteANote({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateANote (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "In communication with client_dev for resolution of queries." }; + + server.mockEndpoint().patch("/crm/notes/id").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.notes.updateANote({ + id: "id", + body: { + text: "In communication with client_dev for resolution of queries.", + }, + }); + expect(response).toEqual(undefined); + }); + + test("updateANote (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "x" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/notes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.notes.updateANote({ + id: "id", + body: { + text: "x", + }, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateANote (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "x" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/notes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.notes.updateANote({ + id: "id", + body: { + text: "x", + }, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateANote (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { text: "x" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .patch("/crm/notes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(415) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.notes.updateANote({ + id: "id", + body: { + text: "x", + }, + }); + }).rejects.toThrow(Brevo.UnsupportedMediaTypeError); + }); +}); diff --git a/tests/wire/payments.test.ts b/tests/wire/payments.test.ts new file mode 100644 index 0000000..8e9056b --- /dev/null +++ b/tests/wire/payments.test.ts @@ -0,0 +1,329 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("PaymentsClient", () => { + test("createPaymentRequest (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + cart: { currency: "EUR", specificAmount: 1200 }, + contactId: 43, + reference: "Invoice #INV0001", + }; + const rawResponseBody = { id: 122, url: "https://pay.brevo.com/payment/6d4ec0b2b48ef803df4103ve" }; + server + .mockEndpoint() + .post("/payments/requests") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.payments.createPaymentRequest({ + cart: { + currency: "EUR", + specificAmount: 1200, + }, + contactId: 43, + reference: "Invoice #INV0001", + }); + expect(response).toEqual({ + id: 122, + url: "https://pay.brevo.com/payment/6d4ec0b2b48ef803df4103ve", + }); + }); + + test("createPaymentRequest (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + cart: { currency: "EUR", specificAmount: 1000000 }, + contactId: 1000000, + reference: "reference", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/payments/requests") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.createPaymentRequest({ + cart: { + currency: "EUR", + specificAmount: 1000000, + }, + contactId: 1000000, + reference: "reference", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createPaymentRequest (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + cart: { currency: "EUR", specificAmount: 1000000 }, + contactId: 1000000, + reference: "reference", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/payments/requests") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.createPaymentRequest({ + cart: { + currency: "EUR", + specificAmount: 1000000, + }, + contactId: 1000000, + reference: "reference", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createPaymentRequest (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + cart: { currency: "EUR", specificAmount: 1000000 }, + contactId: 1000000, + reference: "reference", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/payments/requests") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.createPaymentRequest({ + cart: { + currency: "EUR", + specificAmount: 1000000, + }, + contactId: 1000000, + reference: "reference", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getPaymentRequest (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + cart: { currency: "EUR", specificAmount: 1200 }, + configuration: { customSuccessUrl: "https://my-company.com/payment-success" }, + contactId: 43, + notification: { channel: "email", text: "Please pay for your yoga class." }, + numberOfRemindersSent: 5, + reference: "Invoice #INV0001\n", + status: "paid", + }; + server + .mockEndpoint() + .get("/payments/requests/050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.payments.getPaymentRequest({ + id: "050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc", + }); + expect(response).toEqual({ + cart: { + currency: "EUR", + specificAmount: 1200, + }, + configuration: { + customSuccessUrl: "https://my-company.com/payment-success", + }, + contactId: 43, + notification: { + channel: "email", + text: "Please pay for your yoga class.", + }, + numberOfRemindersSent: 5, + reference: "Invoice #INV0001\n", + status: "paid", + }); + }); + + test("getPaymentRequest (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/payments/requests/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.getPaymentRequest({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getPaymentRequest (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/payments/requests/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.getPaymentRequest({ + id: "id", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getPaymentRequest (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/payments/requests/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.getPaymentRequest({ + id: "id", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getPaymentRequest (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/payments/requests/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.getPaymentRequest({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deletePaymentRequest (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/payments/requests/9ae7d68a-565c-4695-9381-d8fb3e3a14cc") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.payments.deletePaymentRequest({ + id: "9ae7d68a-565c-4695-9381-d8fb3e3a14cc", + }); + expect(response).toEqual(undefined); + }); + + test("deletePaymentRequest (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/payments/requests/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.deletePaymentRequest({ + id: "id", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deletePaymentRequest (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/payments/requests/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.deletePaymentRequest({ + id: "id", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deletePaymentRequest (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/payments/requests/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.payments.deletePaymentRequest({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/process.test.ts b/tests/wire/process.test.ts new file mode 100644 index 0000000..fdb41ab --- /dev/null +++ b/tests/wire/process.test.ts @@ -0,0 +1,324 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("ProcessClient", () => { + test("getProcesses (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 198, + processes: [ + { + id: 217, + name: "IMPORTUSER", + status: "completed", + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:35:00Z", + }, + { + id: 213, + name: "SEARCH_EXPORT_USERS", + status: "completed", + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:35:00Z", + }, + { + id: 212, + name: "IMPORTUSER", + status: "queued", + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:35:00Z", + }, + ], + }; + server.mockEndpoint().get("/processes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.process.getProcesses(); + expect(response).toEqual({ + count: 198, + processes: [ + { + id: 217, + name: "IMPORTUSER", + status: "completed", + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:35:00Z", + }, + { + id: 213, + name: "SEARCH_EXPORT_USERS", + status: "completed", + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:35:00Z", + }, + { + id: 212, + name: "IMPORTUSER", + status: "queued", + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:35:00Z", + }, + ], + }); + }); + + test("getProcesses (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/processes").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.process.getProcesses(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getProcess (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: 217, + name: "IMPORTUSER", + status: "queued", + info: { + import: { + invalid_emails: 2, + duplicate_contact_id: 0, + duplicate_ext_id: 1, + duplicate_email_id: 5, + duplicate_phone_id: 1, + duplicate_whatsapp_id: 1, + duplicate_landline_number_id: 1, + }, + export: { total_records: 1250, file_size: 102400 }, + }, + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded after 30 minutes", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:32:15Z", + }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.process.getProcess({ + processId: 1000000, + }); + expect(response).toEqual({ + id: 217, + name: "IMPORTUSER", + status: "queued", + info: { + import: { + invalid_emails: 2, + duplicate_contact_id: 0, + duplicate_ext_id: 1, + duplicate_email_id: 5, + duplicate_phone_id: 1, + duplicate_whatsapp_id: 1, + duplicate_landline_number_id: 1, + }, + export: { + total_records: 1250, + file_size: 102400, + }, + }, + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded after 30 minutes", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:32:15Z", + }); + }); + + test("getProcess (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: 217, + name: "IMPORTUSER", + status: "completed", + info: { export: { total_records: 1250, file_size: 102400 } }, + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded after 30 minutes", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:32:15Z", + }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.process.getProcess({ + processId: 1000000, + }); + expect(response).toEqual({ + id: 217, + name: "IMPORTUSER", + status: "completed", + info: { + export: { + total_records: 1250, + file_size: 102400, + }, + }, + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded after 30 minutes", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:32:15Z", + }); + }); + + test("getProcess (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: 213, + name: "SEARCH_EXPORT_USERS", + status: "completed", + info: { + import: { + invalid_emails: 2, + duplicate_contact_id: 0, + duplicate_ext_id: 1, + duplicate_email_id: 5, + duplicate_phone_id: 1, + duplicate_whatsapp_id: 1, + duplicate_landline_number_id: 1, + }, + export: { total_records: 1250, file_size: 102400 }, + }, + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded after 30 minutes", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:32:15Z", + }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.process.getProcess({ + processId: 1000000, + }); + expect(response).toEqual({ + id: 213, + name: "SEARCH_EXPORT_USERS", + status: "completed", + info: { + import: { + invalid_emails: 2, + duplicate_contact_id: 0, + duplicate_ext_id: 1, + duplicate_email_id: 5, + duplicate_phone_id: 1, + duplicate_whatsapp_id: 1, + duplicate_landline_number_id: 1, + }, + export: { + total_records: 1250, + file_size: 102400, + }, + }, + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded after 30 minutes", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:32:15Z", + }); + }); + + test("getProcess (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: 189, + name: "TRANS-GLOBAL-CALC", + status: "failed", + info: { + import: { + invalid_emails: 2, + duplicate_contact_id: 0, + duplicate_ext_id: 1, + duplicate_email_id: 5, + duplicate_phone_id: 1, + duplicate_whatsapp_id: 1, + duplicate_landline_number_id: 1, + }, + export: { total_records: 1250, file_size: 102400 }, + }, + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded after 30 minutes", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:32:15Z", + }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.process.getProcess({ + processId: 1000000, + }); + expect(response).toEqual({ + id: 189, + name: "TRANS-GLOBAL-CALC", + status: "failed", + info: { + import: { + invalid_emails: 2, + duplicate_contact_id: 0, + duplicate_ext_id: 1, + duplicate_email_id: 5, + duplicate_phone_id: 1, + duplicate_whatsapp_id: 1, + duplicate_landline_number_id: 1, + }, + export: { + total_records: 1250, + file_size: 102400, + }, + }, + export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", + error: "Processing timeout exceeded after 30 minutes", + created_at: "2024-01-15T10:30:00Z", + completed_at: "2024-01-15T10:32:15Z", + }); + }); + + test("getProcess (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.process.getProcess({ + processId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getProcess (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.process.getProcess({ + processId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/program.test.ts b/tests/wire/program.test.ts new file mode 100644 index 0000000..44e2bcc --- /dev/null +++ b/tests/wire/program.test.ts @@ -0,0 +1,1712 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("ProgramClient", () => { + test("getLPList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { key: "value" }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }, + ], + }; + server + .mockEndpoint() + .get("/loyalty/config/programs") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.program.getLpList(); + expect(response).toEqual({ + items: [ + { + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { + key: "value", + }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }, + ], + }); + }); + + test("getLPList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLpList(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getLPList (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLpList(); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getLPList (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLpList(); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getLPList (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLpList(); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getLPList (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/config/programs") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLpList(); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getLPList (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLpList(); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createNewLP (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { key: "value" }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .post("/loyalty/config/programs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.program.createNewLp({ + name: "name", + }); + expect(response).toEqual({ + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { + key: "value", + }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }); + }); + + test("createNewLP (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.createNewLp({ + name: "name", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createNewLP (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.createNewLp({ + name: "name", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createNewLP (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/config/programs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.createNewLp({ + name: "name", + }); + }).rejects.toThrow(Brevo.ConflictError); + }); + + test("createNewLP (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/config/programs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.createNewLp({ + name: "name", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("createNewLP (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.createNewLp({ + name: "name", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getLoyaltyProgramInfo (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { key: "value" }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.program.getLoyaltyProgramInfo({ + pid: "pid", + }); + expect(response).toEqual({ + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { + key: "value", + }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }); + }); + + test("getLoyaltyProgramInfo (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLoyaltyProgramInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getLoyaltyProgramInfo (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLoyaltyProgramInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getLoyaltyProgramInfo (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLoyaltyProgramInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getLoyaltyProgramInfo (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLoyaltyProgramInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getLoyaltyProgramInfo (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getLoyaltyProgramInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("updateLoyaltyProgram (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { key: "value" }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .put("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.program.updateLoyaltyProgram({ + pid: "pid", + name: "name", + }); + expect(response).toEqual({ + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { + key: "value", + }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }); + }); + + test("updateLoyaltyProgram (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.updateLoyaltyProgram({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("updateLoyaltyProgram (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.updateLoyaltyProgram({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("updateLoyaltyProgram (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.updateLoyaltyProgram({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateLoyaltyProgram (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.updateLoyaltyProgram({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.ConflictError); + }); + + test("updateLoyaltyProgram (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.updateLoyaltyProgram({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("updateLoyaltyProgram (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.updateLoyaltyProgram({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("deleteLoyaltyProgram (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/loyalty/config/programs/pid").respondWith().statusCode(200).build(); + + const response = await client.program.deleteLoyaltyProgram({ + pid: "pid", + }); + expect(response).toEqual(undefined); + }); + + test("deleteLoyaltyProgram (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deleteLoyaltyProgram (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteLoyaltyProgram (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteLoyaltyProgram (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("deleteLoyaltyProgram (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("partiallyUpdateLoyaltyProgram (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { key: "value" }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .patch("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.program.partiallyUpdateLoyaltyProgram({ + pid: "pid", + }); + expect(response).toEqual({ + codeCount: 1, + createdAt: "createdAt", + description: "description", + documentId: "documentId", + id: "id", + meta: { + key: "value", + }, + name: "name", + pattern: "pattern", + state: "inactive", + subscriptionGeneratorId: "subscriptionGeneratorId", + subscriptionPoolId: "subscriptionPoolId", + updatedAt: "updatedAt", + }); + }); + + test("partiallyUpdateLoyaltyProgram (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.partiallyUpdateLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("partiallyUpdateLoyaltyProgram (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.partiallyUpdateLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("partiallyUpdateLoyaltyProgram (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.partiallyUpdateLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("partiallyUpdateLoyaltyProgram (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .patch("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.partiallyUpdateLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ConflictError); + }); + + test("partiallyUpdateLoyaltyProgram (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .patch("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.partiallyUpdateLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("partiallyUpdateLoyaltyProgram (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/loyalty/config/programs/pid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.partiallyUpdateLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getParameterSubscriptionInfo (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + balance: { balances: [{}], contactId: 1, loyaltyProgramId: "loyaltyProgramId" }, + members: [{ createdAt: "createdAt", memberContactId: 1, updatedAt: "updatedAt" }], + reward: [ + { + code: "code", + contactId: 1, + createdAt: "createdAt", + expirationDate: "expirationDate", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + rewardId: "rewardId", + updatedAt: "updatedAt", + }, + ], + tier: [ + { + contactId: 1, + createdAt: "createdAt", + groupId: "groupId", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + tierId: "tierId", + updatedAt: "updatedAt", + }, + ], + }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid/account-info") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.program.getParameterSubscriptionInfo({ + pid: "pid", + }); + expect(response).toEqual({ + balance: { + balances: [{}], + contactId: 1, + loyaltyProgramId: "loyaltyProgramId", + }, + members: [ + { + createdAt: "createdAt", + memberContactId: 1, + updatedAt: "updatedAt", + }, + ], + reward: [ + { + code: "code", + contactId: 1, + createdAt: "createdAt", + expirationDate: "expirationDate", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + rewardId: "rewardId", + updatedAt: "updatedAt", + }, + ], + tier: [ + { + contactId: 1, + createdAt: "createdAt", + groupId: "groupId", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + tierId: "tierId", + updatedAt: "updatedAt", + }, + ], + }); + }); + + test("getParameterSubscriptionInfo (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid/account-info") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getParameterSubscriptionInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getParameterSubscriptionInfo (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid/account-info") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getParameterSubscriptionInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getParameterSubscriptionInfo (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid/account-info") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getParameterSubscriptionInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getParameterSubscriptionInfo (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid/account-info") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getParameterSubscriptionInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getParameterSubscriptionInfo (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/config/programs/pid/account-info") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.getParameterSubscriptionInfo({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("publishLoyaltyProgram (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().post("/loyalty/config/programs/pid/publish").respondWith().statusCode(200).build(); + + const response = await client.program.publishLoyaltyProgram({ + pid: "pid", + }); + expect(response).toEqual(undefined); + }); + + test("publishLoyaltyProgram (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/publish") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.publishLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("publishLoyaltyProgram (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/publish") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.publishLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("publishLoyaltyProgram (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/publish") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.publishLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("publishLoyaltyProgram (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/publish") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.publishLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("publishLoyaltyProgram (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/publish") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.publishLoyaltyProgram({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("subscribeMemberToASubscription (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { memberContactIds: [1] }; + const rawResponseBody = { + createdAt: "createdAt", + memberContactIds: [1], + organizationId: 1, + ownerContactId: 1, + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscription-members") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.program.subscribeMemberToASubscription({ + pid: "pid", + memberContactIds: [1], + }); + expect(response).toEqual({ + createdAt: "createdAt", + memberContactIds: [1], + organizationId: 1, + ownerContactId: 1, + updatedAt: "updatedAt", + }); + }); + + test("subscribeMemberToASubscription (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { memberContactIds: [1, 1] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscription-members") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeMemberToASubscription({ + pid: "pid", + memberContactIds: [1, 1], + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("subscribeMemberToASubscription (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { memberContactIds: [1, 1] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscription-members") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeMemberToASubscription({ + pid: "pid", + memberContactIds: [1, 1], + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("subscribeMemberToASubscription (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { memberContactIds: [1, 1] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscription-members") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeMemberToASubscription({ + pid: "pid", + memberContactIds: [1, 1], + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("subscribeMemberToASubscription (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { memberContactIds: [1, 1] }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscription-members") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeMemberToASubscription({ + pid: "pid", + memberContactIds: [1, 1], + }); + }).rejects.toThrow(Brevo.ConflictError); + }); + + test("subscribeMemberToASubscription (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { memberContactIds: [1, 1] }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscription-members") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeMemberToASubscription({ + pid: "pid", + memberContactIds: [1, 1], + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("subscribeMemberToASubscription (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { memberContactIds: [1, 1] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscription-members") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeMemberToASubscription({ + pid: "pid", + memberContactIds: [1, 1], + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("deleteContactMembers (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/subscription-members") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.program.deleteContactMembers({ + pid: "pid", + memberContactIds: "memberContactIds", + }); + expect(response).toEqual(undefined); + }); + + test("deleteContactMembers (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/subscription-members") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactMembers({ + pid: "pid", + memberContactIds: "memberContactIds", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteContactMembers (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/subscription-members") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactMembers({ + pid: "pid", + memberContactIds: "memberContactIds", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deleteContactMembers (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/subscription-members") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactMembers({ + pid: "pid", + memberContactIds: "memberContactIds", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteContactMembers (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/subscription-members") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactMembers({ + pid: "pid", + memberContactIds: "memberContactIds", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteContactMembers (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/subscription-members") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactMembers({ + pid: "pid", + memberContactIds: "memberContactIds", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("deleteContactMembers (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/subscription-members") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactMembers({ + pid: "pid", + memberContactIds: "memberContactIds", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("subscribeToLoyaltyProgram (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { contactId: 1 }; + const rawResponseBody = { + contactId: 1, + createdAt: "createdAt", + loyaltyProgramId: "loyaltyProgramId", + loyaltySubscriptionId: "loyaltySubscriptionId", + organizationId: 1, + updatedAt: "updatedAt", + versionId: 1, + }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscriptions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.program.subscribeToLoyaltyProgram({ + pid: "pid", + contactId: 1, + }); + expect(response).toEqual({ + contactId: 1, + createdAt: "createdAt", + loyaltyProgramId: "loyaltyProgramId", + loyaltySubscriptionId: "loyaltySubscriptionId", + organizationId: 1, + updatedAt: "updatedAt", + versionId: 1, + }); + }); + + test("subscribeToLoyaltyProgram (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { contactId: 1 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscriptions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeToLoyaltyProgram({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("subscribeToLoyaltyProgram (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { contactId: 1 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscriptions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeToLoyaltyProgram({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("subscribeToLoyaltyProgram (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { contactId: 1 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscriptions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeToLoyaltyProgram({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("subscribeToLoyaltyProgram (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { contactId: 1 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscriptions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeToLoyaltyProgram({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("subscribeToLoyaltyProgram (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { contactId: 1 }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscriptions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeToLoyaltyProgram({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("subscribeToLoyaltyProgram (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { contactId: 1 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/config/programs/pid/subscriptions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.subscribeToLoyaltyProgram({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); +}); diff --git a/tests/wire/reward.test.ts b/tests/wire/reward.test.ts new file mode 100644 index 0000000..d3a03e2 --- /dev/null +++ b/tests/wire/reward.test.ts @@ -0,0 +1,1731 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("RewardClient", () => { + test("getCodeCount (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { count: 1000000 }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.getCodeCount({ + pid: "pid", + cpid: "cpid", + }); + expect(response).toEqual({ + count: 1000000, + }); + }); + + test("getCodeCount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getCodeCount({ + pid: "pid", + cpid: "cpid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getCodeCount (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getCodeCount({ + pid: "pid", + cpid: "cpid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getCodeCount (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getCodeCount({ + pid: "pid", + cpid: "cpid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getCodeCount (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getCodeCount({ + pid: "pid", + cpid: "cpid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getCodeCount (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getCodeCount({ + pid: "pid", + cpid: "cpid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getRewardPageApi (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + createdAt: "2024-01-15T09:30:00Z", + endDate: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + publicImage: "publicImage", + startDate: "2024-01-15T09:30:00Z", + state: "state", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + totalCount: 1, + }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/offers") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.getRewardPageApi({ + pid: "pid", + }); + expect(response).toEqual({ + items: [ + { + createdAt: "2024-01-15T09:30:00Z", + endDate: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + publicImage: "publicImage", + startDate: "2024-01-15T09:30:00Z", + state: "state", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + totalCount: 1, + }); + }); + + test("getRewardPageApi (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/offers") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardPageApi({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getRewardPageApi (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/offers") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardPageApi({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getRewardPageApi (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/offers") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardPageApi({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getRewardPageApi (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/offers") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardPageApi({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getRewardPageApi (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/offers") + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardPageApi({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.FailedDependencyError); + }); + + test("getRewardPageApi (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/offers") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardPageApi({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createReward (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { + createdAt: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + publicDescription: "publicDescription", + publicImage: "publicImage", + publicName: "publicName", + updatedAt: "updatedAt", + }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/offers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.createReward({ + pid: "pid", + name: "name", + }); + expect(response).toEqual({ + createdAt: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + publicDescription: "publicDescription", + publicImage: "publicImage", + publicName: "publicName", + updatedAt: "updatedAt", + }); + }); + + test("createReward (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/offers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createReward({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createReward (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/offers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createReward({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createReward (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/offers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createReward({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("createReward (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/offers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createReward({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createVoucher (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { rewardId: "rewardId" }; + const rawResponseBody = { + code: "code", + consumedAt: "consumedAt", + contactId: 1000000, + createdAt: "2024-01-15T09:30:00Z", + expirationDate: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + rewardId: "rewardId", + updatedAt: "2024-01-15T09:30:00Z", + value: 1.1, + }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/attribute") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.createVoucher({ + pid: "pid", + rewardId: "rewardId", + }); + expect(response).toEqual({ + code: "code", + consumedAt: "consumedAt", + contactId: 1000000, + createdAt: "2024-01-15T09:30:00Z", + expirationDate: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + rewardId: "rewardId", + updatedAt: "2024-01-15T09:30:00Z", + value: 1.1, + }); + }); + + test("createVoucher (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { rewardId: "rewardId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/attribute") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createVoucher({ + pid: "pid", + rewardId: "rewardId", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createVoucher (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { rewardId: "rewardId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/attribute") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createVoucher({ + pid: "pid", + rewardId: "rewardId", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createVoucher (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { rewardId: "rewardId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/attribute") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createVoucher({ + pid: "pid", + rewardId: "rewardId", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createVoucher (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { rewardId: "rewardId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/attribute") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createVoucher({ + pid: "pid", + rewardId: "rewardId", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("createVoucher (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { rewardId: "rewardId" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/attribute") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createVoucher({ + pid: "pid", + rewardId: "rewardId", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("createVoucher (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { rewardId: "rewardId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/attribute") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.createVoucher({ + pid: "pid", + rewardId: "rewardId", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("redeemVoucher (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + cancelledAt: "2024-01-15T09:30:00Z", + completedAt: "2024-01-15T09:30:00Z", + contactId: 1000000, + createdAt: "2024-01-15T09:30:00Z", + debitTransactionId: "debitTransactionId", + expiresAt: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + rejectReason: "rejectReason", + rejectedAt: "2024-01-15T09:30:00Z", + rewardAttributionId: "rewardAttributionId", + status: "status", + updatedAt: "2024-01-15T09:30:00Z", + }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.redeemVoucher({ + pid: "pid", + }); + expect(response).toEqual({ + cancelledAt: "2024-01-15T09:30:00Z", + completedAt: "2024-01-15T09:30:00Z", + contactId: 1000000, + createdAt: "2024-01-15T09:30:00Z", + debitTransactionId: "debitTransactionId", + expiresAt: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + rejectReason: "rejectReason", + rejectedAt: "2024-01-15T09:30:00Z", + rewardAttributionId: "rewardAttributionId", + status: "status", + updatedAt: "2024-01-15T09:30:00Z", + }); + }); + + test("redeemVoucher (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.redeemVoucher({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("redeemVoucher (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.redeemVoucher({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("redeemVoucher (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.redeemVoucher({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("redeemVoucher (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.redeemVoucher({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("redeemVoucher (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(412) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.redeemVoucher({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.PreconditionFailedError); + }); + + test("redeemVoucher (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(417) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.redeemVoucher({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ExpectationFailedError); + }); + + test("redeemVoucher (8)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.redeemVoucher({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("redeemVoucher (9)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.redeemVoucher({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("completeRedeemTransaction (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + cancelledAt: "2024-01-15T09:30:00Z", + completedAt: "2024-01-15T09:30:00Z", + contactId: 1000000, + createdAt: "2024-01-15T09:30:00Z", + debitTransactionId: "debitTransactionId", + expiresAt: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + rejectReason: "rejectReason", + rejectedAt: "2024-01-15T09:30:00Z", + rewardAttributionId: "rewardAttributionId", + status: "status", + updatedAt: "2024-01-15T09:30:00Z", + }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + expect(response).toEqual({ + cancelledAt: "2024-01-15T09:30:00Z", + completedAt: "2024-01-15T09:30:00Z", + contactId: 1000000, + createdAt: "2024-01-15T09:30:00Z", + debitTransactionId: "debitTransactionId", + expiresAt: "2024-01-15T09:30:00Z", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + rejectReason: "rejectReason", + rejectedAt: "2024-01-15T09:30:00Z", + rewardAttributionId: "rewardAttributionId", + status: "status", + updatedAt: "2024-01-15T09:30:00Z", + }); + }); + + test("completeRedeemTransaction (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("completeRedeemTransaction (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("completeRedeemTransaction (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("completeRedeemTransaction (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("completeRedeemTransaction (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(412) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.PreconditionFailedError); + }); + + test("completeRedeemTransaction (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(417) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.ExpectationFailedError); + }); + + test("completeRedeemTransaction (8)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("completeRedeemTransaction (9)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.completeRedeemTransaction({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("revokeVouchers (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/loyalty/offer/programs/pid/rewards/revoke") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.reward.revokeVouchers({ + pid: "pid", + }); + expect(response).toEqual(undefined); + }); + + test("revokeVouchers (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/offer/programs/pid/rewards/revoke") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.revokeVouchers({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("revokeVouchers (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/offer/programs/pid/rewards/revoke") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.revokeVouchers({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("validateReward (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { authorize: true }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.validateReward({ + pid: "pid", + }); + expect(response).toEqual({ + authorize: true, + }); + }); + + test("validateReward (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.validateReward({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("validateReward (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.validateReward({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("validateReward (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.validateReward({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("validateReward (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.validateReward({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("validateReward (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.validateReward({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.FailedDependencyError); + }); + + test("validateReward (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/offer/programs/pid/rewards/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.validateReward({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getRewardInformation (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + attributionPerConsumer: 1, + balanceDefinitionId: "balanceDefinitionId", + code: "code", + codeCount: 1000000, + codeGeneratorId: "codeGeneratorId", + codePoolId: "codePoolId", + config: "config", + createdAt: "2024-01-15T09:30:00Z", + disabledAt: "2024-01-15T09:30:00Z", + endDate: "2024-01-15T09:30:00Z", + expirationDate: "2024-01-15T09:30:00Z", + expirationModifier: "startOfPeriod", + expirationUnit: "expirationUnit", + expirationValue: 1, + generator: { + createdAt: "createdAt", + description: "description", + id: "id", + name: "name", + pattern: "pattern", + updatedAt: "2024-01-15T09:30:00Z", + }, + id: "id", + limits: [ + { + createdAt: "2024-01-15T09:30:00Z", + durationUnit: "durationUnit", + durationValue: 1, + limitValue: 1, + rewardLimitId: "rewardLimitId", + slidingSchedule: true, + type: "type", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + name: "name", + products: [{ createdAt: "createdAt", imageRef: "imageRef", productId: "productId", value: "value" }], + publicDescription: "publicDescription", + publicImage: "publicImage", + publicName: "publicName", + redeemPerConsumer: 1, + redeemRules: ["redeemRules"], + rewardConfigs: { attribution: "attribution", code: "code", value: "value" }, + rule: { + condition: { op: "op" }, + createdAt: "createdAt", + description: "description", + event: { name: "name", source: "source" }, + isInternal: true, + loyaltyProgramId: "loyaltyProgramId", + loyaltyVersionId: 1, + meta: { key: "value" }, + name: "name", + results: [{}], + ruleId: "ruleId", + ruleType: "ruleType", + updatedAt: "updatedAt", + }, + startDate: "2024-01-15T09:30:00Z", + subtractBalanceDefinitionId: "subtractBalanceDefinitionId", + subtractBalanceStrategy: "subtractBalanceStrategy", + subtractBalanceValue: 1, + subtractTotalBalance: true, + totalAttribution: 1, + totalRedeem: 1, + triggerId: "triggerId", + unit: "unit", + updatedAt: "updatedAt", + value: 1.1, + valueType: "valueType", + }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/rewards/rid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.getRewardInformation({ + pid: "pid", + rid: "rid", + }); + expect(response).toEqual({ + attributionPerConsumer: 1, + balanceDefinitionId: "balanceDefinitionId", + code: "code", + codeCount: 1000000, + codeGeneratorId: "codeGeneratorId", + codePoolId: "codePoolId", + config: "config", + createdAt: "2024-01-15T09:30:00Z", + disabledAt: "2024-01-15T09:30:00Z", + endDate: "2024-01-15T09:30:00Z", + expirationDate: "2024-01-15T09:30:00Z", + expirationModifier: "startOfPeriod", + expirationUnit: "expirationUnit", + expirationValue: 1, + generator: { + createdAt: "createdAt", + description: "description", + id: "id", + name: "name", + pattern: "pattern", + updatedAt: "2024-01-15T09:30:00Z", + }, + id: "id", + limits: [ + { + createdAt: "2024-01-15T09:30:00Z", + durationUnit: "durationUnit", + durationValue: 1, + limitValue: 1, + rewardLimitId: "rewardLimitId", + slidingSchedule: true, + type: "type", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + name: "name", + products: [ + { + createdAt: "createdAt", + imageRef: "imageRef", + productId: "productId", + value: "value", + }, + ], + publicDescription: "publicDescription", + publicImage: "publicImage", + publicName: "publicName", + redeemPerConsumer: 1, + redeemRules: ["redeemRules"], + rewardConfigs: { + attribution: "attribution", + code: "code", + value: "value", + }, + rule: { + condition: { + op: "op", + }, + createdAt: "createdAt", + description: "description", + event: { + name: "name", + source: "source", + }, + isInternal: true, + loyaltyProgramId: "loyaltyProgramId", + loyaltyVersionId: 1, + meta: { + key: "value", + }, + name: "name", + results: [{}], + ruleId: "ruleId", + ruleType: "ruleType", + updatedAt: "updatedAt", + }, + startDate: "2024-01-15T09:30:00Z", + subtractBalanceDefinitionId: "subtractBalanceDefinitionId", + subtractBalanceStrategy: "subtractBalanceStrategy", + subtractBalanceValue: 1, + subtractTotalBalance: true, + totalAttribution: 1, + totalRedeem: 1, + triggerId: "triggerId", + unit: "unit", + updatedAt: "updatedAt", + value: 1.1, + valueType: "valueType", + }); + }); + + test("getRewardInformation (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/rewards/rid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardInformation({ + pid: "pid", + rid: "rid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getRewardInformation (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/rewards/rid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardInformation({ + pid: "pid", + rid: "rid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getRewardInformation (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/rewards/rid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardInformation({ + pid: "pid", + rid: "rid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getRewardInformation (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/rewards/rid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardInformation({ + pid: "pid", + rid: "rid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getRewardInformation (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/rewards/rid") + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardInformation({ + pid: "pid", + rid: "rid", + }); + }).rejects.toThrow(Brevo.FailedDependencyError); + }); + + test("getRewardInformation (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/rewards/rid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getRewardInformation({ + pid: "pid", + rid: "rid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getVoucherForAContact (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + contactId: 1000000, + contactRewards: [ + { + code: "code", + consumedAt: "consumedAt", + createdAt: "createdAt", + expirationDate: "expirationDate", + id: "id", + meta: { key: "value" }, + rewardId: "rewardId", + unit: "unit", + updatedAt: "updatedAt", + value: 1.1, + }, + ], + count: 1, + loyaltyProgramId: "loyaltyProgramId", + loyaltySubscriptionId: "loyaltySubscriptionId", + }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/vouchers") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.reward.getVoucherForAContact({ + pid: "pid", + contactId: 1, + }); + expect(response).toEqual({ + contactId: 1000000, + contactRewards: [ + { + code: "code", + consumedAt: "consumedAt", + createdAt: "createdAt", + expirationDate: "expirationDate", + id: "id", + meta: { + key: "value", + }, + rewardId: "rewardId", + unit: "unit", + updatedAt: "updatedAt", + value: 1.1, + }, + ], + count: 1, + loyaltyProgramId: "loyaltyProgramId", + loyaltySubscriptionId: "loyaltySubscriptionId", + }); + }); + + test("getVoucherForAContact (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/vouchers") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getVoucherForAContact({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getVoucherForAContact (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/vouchers") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getVoucherForAContact({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getVoucherForAContact (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/vouchers") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getVoucherForAContact({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getVoucherForAContact (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/vouchers") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getVoucherForAContact({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getVoucherForAContact (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/offer/programs/pid/vouchers") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.reward.getVoucherForAContact({ + pid: "pid", + contactId: 1, + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); +}); diff --git a/tests/wire/senders.test.ts b/tests/wire/senders.test.ts new file mode 100644 index 0000000..183fc00 --- /dev/null +++ b/tests/wire/senders.test.ts @@ -0,0 +1,798 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("SendersClient", () => { + test("getSenders (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + senders: [ + { + active: true, + email: "support@example.com", + id: 1, + ips: [{ domain: "example.com", ip: "203.0.113.100", weight: 50 }], + name: "Support Team", + }, + { + active: false, + email: "hello@example.com", + id: 3, + ips: [{ domain: "example.com", ip: "203.0.113.100", weight: 50 }], + name: "Customer Service", + }, + { + active: false, + email: "marketing@testcompany.com", + id: 5, + ips: [{ domain: "example.com", ip: "203.0.113.100", weight: 50 }], + name: "Marketing Team", + }, + ], + }; + server.mockEndpoint().get("/senders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.senders.getSenders(); + expect(response).toEqual({ + senders: [ + { + active: true, + email: "support@example.com", + id: 1, + ips: [ + { + domain: "example.com", + ip: "203.0.113.100", + weight: 50, + }, + ], + name: "Support Team", + }, + { + active: false, + email: "hello@example.com", + id: 3, + ips: [ + { + domain: "example.com", + ip: "203.0.113.100", + weight: 50, + }, + ], + name: "Customer Service", + }, + { + active: false, + email: "marketing@testcompany.com", + id: 5, + ips: [ + { + domain: "example.com", + ip: "203.0.113.100", + weight: 50, + }, + ], + name: "Marketing Team", + }, + ], + }); + }); + + test("getSenders (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + senders: [ + { + active: true, + email: "marketing@example.com", + id: 10, + ips: [{ domain: "example.com", ip: "203.0.113.100", weight: 100 }], + name: "Marketing", + }, + { + active: false, + email: "newsletter@example.com", + id: 11, + ips: [ + { domain: "example.com", ip: "203.0.113.100", weight: 50 }, + { domain: "news.example.com", ip: "203.0.113.101", weight: 50 }, + ], + name: "Newsletter", + }, + ], + }; + server.mockEndpoint().get("/senders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.senders.getSenders(); + expect(response).toEqual({ + senders: [ + { + active: true, + email: "marketing@example.com", + id: 10, + ips: [ + { + domain: "example.com", + ip: "203.0.113.100", + weight: 100, + }, + ], + name: "Marketing", + }, + { + active: false, + email: "newsletter@example.com", + id: 11, + ips: [ + { + domain: "example.com", + ip: "203.0.113.100", + weight: 50, + }, + { + domain: "news.example.com", + ip: "203.0.113.101", + weight: 50, + }, + ], + name: "Newsletter", + }, + ], + }); + }); + + test("getSenders (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/senders").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.senders.getSenders(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createSender (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "support@example.com", name: "Support Team" }; + const rawResponseBody = { dkimError: false, id: 15, spfError: false }; + server + .mockEndpoint() + .post("/senders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.senders.createSender({ + email: "support@example.com", + name: "Support Team", + }); + expect(response).toEqual({ + dkimError: false, + id: 15, + spfError: false, + }); + }); + + test("createSender (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + email: "marketing@example.com", + ips: [{ domain: "example.com", ip: "203.0.113.100", weight: 100 }], + name: "Marketing Team", + }; + const rawResponseBody = { dkimError: false, id: 15, spfError: false }; + server + .mockEndpoint() + .post("/senders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.senders.createSender({ + email: "marketing@example.com", + ips: [ + { + domain: "example.com", + ip: "203.0.113.100", + weight: 100, + }, + ], + name: "Marketing Team", + }); + expect(response).toEqual({ + dkimError: false, + id: 15, + spfError: false, + }); + }); + + test("createSender (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + email: "newsletter@example.com", + ips: [ + { domain: "example.com", ip: "203.0.113.100", weight: 60 }, + { domain: "news.example.com", ip: "203.0.113.101", weight: 40 }, + ], + name: "Newsletter", + }; + const rawResponseBody = { dkimError: false, id: 15, spfError: false }; + server + .mockEndpoint() + .post("/senders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.senders.createSender({ + email: "newsletter@example.com", + ips: [ + { + domain: "example.com", + ip: "203.0.113.100", + weight: 60, + }, + { + domain: "news.example.com", + ip: "203.0.113.101", + weight: 40, + }, + ], + name: "Newsletter", + }); + expect(response).toEqual({ + dkimError: false, + id: 15, + spfError: false, + }); + }); + + test("createSender (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "support@example.com", name: "Support Team" }; + const rawResponseBody = { dkimError: false, id: 15, spfError: false }; + server + .mockEndpoint() + .post("/senders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.senders.createSender({ + email: "support@example.com", + name: "Support Team", + }); + expect(response).toEqual({ + dkimError: false, + id: 15, + spfError: false, + }); + }); + + test("createSender (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "support@example.com", name: "Support Team" }; + const rawResponseBody = { dkimError: true, id: 16, spfError: false }; + server + .mockEndpoint() + .post("/senders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.senders.createSender({ + email: "support@example.com", + name: "Support Team", + }); + expect(response).toEqual({ + dkimError: true, + id: 16, + spfError: false, + }); + }); + + test("createSender (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email", name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/senders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.createSender({ + email: "email", + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getIps (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + ips: [{ active: true, domain: "mailing.enterprise.com", id: 3, ip: "192.168.1.100" }], + }; + server.mockEndpoint().get("/senders/ips").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.senders.getIps(); + expect(response).toEqual({ + ips: [ + { + active: true, + domain: "mailing.enterprise.com", + id: 3, + ip: "192.168.1.100", + }, + ], + }); + }); + + test("getIps (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + ips: [ + { active: true, domain: "mailing.enterprise.com", id: 3, ip: "192.168.1.100" }, + { active: true, domain: "newsletter.enterprise.com", id: 5, ip: "192.168.1.101" }, + { active: false, domain: "notifications.enterprise.com", id: 6, ip: "192.168.1.102" }, + ], + }; + server.mockEndpoint().get("/senders/ips").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.senders.getIps(); + expect(response).toEqual({ + ips: [ + { + active: true, + domain: "mailing.enterprise.com", + id: 3, + ip: "192.168.1.100", + }, + { + active: true, + domain: "newsletter.enterprise.com", + id: 5, + ip: "192.168.1.101", + }, + { + active: false, + domain: "notifications.enterprise.com", + id: 6, + ip: "192.168.1.102", + }, + ], + }); + }); + + test("getIps (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/senders/ips").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.senders.getIps(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateSender (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "New Support Team" }; + + server.mockEndpoint().put("/senders/1000000").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.senders.updateSender({ + senderId: 1000000, + name: "New Support Team", + }); + expect(response).toEqual(undefined); + }); + + test("updateSender (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "newsupport@mycompany.com" }; + + server.mockEndpoint().put("/senders/1000000").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.senders.updateSender({ + senderId: 1000000, + email: "newsupport@mycompany.com", + }); + expect(response).toEqual(undefined); + }); + + test("updateSender (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "marketing@mycompany.com", name: "Marketing Team" }; + + server.mockEndpoint().put("/senders/1000000").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.senders.updateSender({ + senderId: 1000000, + email: "marketing@mycompany.com", + name: "Marketing Team", + }); + expect(response).toEqual(undefined); + }); + + test("updateSender (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + email: "marketing@enterprise.com", + ips: [{ domain: "enterprise.com", ip: "192.168.1.100", weight: 100 }], + name: "Enterprise Marketing", + }; + + server.mockEndpoint().put("/senders/1000000").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.senders.updateSender({ + senderId: 1000000, + email: "marketing@enterprise.com", + ips: [ + { + domain: "enterprise.com", + ip: "192.168.1.100", + weight: 100, + }, + ], + name: "Enterprise Marketing", + }); + expect(response).toEqual(undefined); + }); + + test("updateSender (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + email: "campaigns@enterprise.com", + ips: [ + { domain: "enterprise.com", ip: "192.168.1.100", weight: 70 }, + { domain: "mail.enterprise.com", ip: "192.168.1.101", weight: 30 }, + ], + name: "Multi-IP Sender", + }; + + server.mockEndpoint().put("/senders/1000000").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.senders.updateSender({ + senderId: 1000000, + email: "campaigns@enterprise.com", + ips: [ + { + domain: "enterprise.com", + ip: "192.168.1.100", + weight: 70, + }, + { + domain: "mail.enterprise.com", + ip: "192.168.1.101", + weight: 30, + }, + ], + name: "Multi-IP Sender", + }); + expect(response).toEqual(undefined); + }); + + test("updateSender (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/senders/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.updateSender({ + senderId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateSender (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/senders/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.updateSender({ + senderId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteSender (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/senders/1000000").respondWith().statusCode(200).build(); + + const response = await client.senders.deleteSender({ + senderId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteSender (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/senders/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.deleteSender({ + senderId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteSender (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/senders/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.deleteSender({ + senderId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getIpsFromSender (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { ips: [{ domain: "mailing.enterprise.com", id: 3, ip: "192.168.1.100", weight: 75 }] }; + server + .mockEndpoint() + .get("/senders/1000000/ips") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.senders.getIpsFromSender({ + senderId: 1000000, + }); + expect(response).toEqual({ + ips: [ + { + domain: "mailing.enterprise.com", + id: 3, + ip: "192.168.1.100", + weight: 75, + }, + ], + }); + }); + + test("getIpsFromSender (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + ips: [ + { domain: "mailing.enterprise.com", id: 3, ip: "192.168.1.100", weight: 40 }, + { domain: "newsletter.enterprise.com", id: 5, ip: "192.168.1.101", weight: 60 }, + ], + }; + server + .mockEndpoint() + .get("/senders/1000000/ips") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.senders.getIpsFromSender({ + senderId: 1000000, + }); + expect(response).toEqual({ + ips: [ + { + domain: "mailing.enterprise.com", + id: 3, + ip: "192.168.1.100", + weight: 40, + }, + { + domain: "newsletter.enterprise.com", + id: 5, + ip: "192.168.1.101", + weight: 60, + }, + ], + }); + }); + + test("getIpsFromSender (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/senders/1000000/ips") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.getIpsFromSender({ + senderId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getIpsFromSender (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/senders/1000000/ips") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.getIpsFromSender({ + senderId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("validateSenderByOTP (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { otp: 123456 }; + + server + .mockEndpoint() + .put("/senders/1000000/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.senders.validateSenderByOtp({ + senderId: 1000000, + otp: 123456, + }); + expect(response).toEqual(undefined); + }); + + test("validateSenderByOTP (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { otp: 789012 }; + + server + .mockEndpoint() + .put("/senders/1000000/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.senders.validateSenderByOtp({ + senderId: 1000000, + otp: 789012, + }); + expect(response).toEqual(undefined); + }); + + test("validateSenderByOTP (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { otp: 999999 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/senders/1000000/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.validateSenderByOtp({ + senderId: 1000000, + otp: 999999, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("validateSenderByOTP (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { otp: 999999 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/senders/1000000/validate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.senders.validateSenderByOtp({ + senderId: 1000000, + otp: 999999, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/smsCampaigns.test.ts b/tests/wire/smsCampaigns.test.ts new file mode 100644 index 0000000..8892932 --- /dev/null +++ b/tests/wire/smsCampaigns.test.ts @@ -0,0 +1,736 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("SmsCampaignsClient", () => { + test("getSmsCampaigns (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + campaigns: [ + { + content: "Visit our Store and get some discount !", + createdAt: "2017-06-01T12:30:00Z", + id: 2, + modifiedAt: "2017-05-01T12:30:00Z", + name: "PROMO CODE", + scheduledAt: "2017-06-01T12:30:00Z", + sender: "MyCompany", + status: "sent", + recipients: { exclusionLists: [13], lists: [21] }, + statistics: { + answered: 2, + delivered: 2987, + hardBounces: 1, + processing: 0, + sent: 3000, + softBounces: 3, + unsubscriptions: 3, + }, + }, + { + content: "Summer Sale is starting tomorrow. Get extra 10% with this code:SUM17", + createdAt: "2017-06-01T12:30:00Z", + id: 10, + modifiedAt: "2017-05-01T12:30:00Z", + name: "SUMMER SALE", + scheduledAt: "2017-08-04T12:30:00Z", + sender: "MyCompany", + status: "draft", + recipients: { exclusionLists: [13], lists: [21] }, + statistics: { + answered: 2, + delivered: 2987, + hardBounces: 1, + processing: 0, + sent: 3000, + softBounces: 3, + unsubscriptions: 3, + }, + }, + ], + count: 12, + }; + server.mockEndpoint().get("/smsCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.smsCampaigns.getSmsCampaigns(); + expect(response).toEqual({ + campaigns: [ + { + content: "Visit our Store and get some discount !", + createdAt: "2017-06-01T12:30:00Z", + id: 2, + modifiedAt: "2017-05-01T12:30:00Z", + name: "PROMO CODE", + scheduledAt: "2017-06-01T12:30:00Z", + sender: "MyCompany", + status: "sent", + recipients: { + exclusionLists: [13], + lists: [21], + }, + statistics: { + answered: 2, + delivered: 2987, + hardBounces: 1, + processing: 0, + sent: 3000, + softBounces: 3, + unsubscriptions: 3, + }, + }, + { + content: "Summer Sale is starting tomorrow. Get extra 10% with this code:SUM17", + createdAt: "2017-06-01T12:30:00Z", + id: 10, + modifiedAt: "2017-05-01T12:30:00Z", + name: "SUMMER SALE", + scheduledAt: "2017-08-04T12:30:00Z", + sender: "MyCompany", + status: "draft", + recipients: { + exclusionLists: [13], + lists: [21], + }, + statistics: { + answered: 2, + delivered: 2987, + hardBounces: 1, + processing: 0, + sent: 3000, + softBounces: 3, + unsubscriptions: 3, + }, + }, + ], + count: 12, + }); + }); + + test("getSmsCampaigns (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/smsCampaigns").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.smsCampaigns.getSmsCampaigns(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createSmsCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + content: "Get a discount by visiting our NY store and saying : Happy Spring!", + name: "Spring Promo Code", + sender: "MyShop", + }; + const rawResponseBody = { id: 5 }; + server + .mockEndpoint() + .post("/smsCampaigns") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.smsCampaigns.createSmsCampaign({ + content: "Get a discount by visiting our NY store and saying : Happy Spring!", + name: "Spring Promo Code", + sender: "MyShop", + }); + expect(response).toEqual({ + id: 5, + }); + }); + + test("createSmsCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { content: "content", name: "name", sender: "sender" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.createSmsCampaign({ + content: "content", + name: "name", + sender: "sender", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSmsCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + content: "Visit our Store and get some discount !", + createdAt: "2017-06-01T12:30:00Z", + id: 2, + modifiedAt: "2017-05-01T12:30:00Z", + name: "PROMO CODE", + scheduledAt: "2017-06-01T12:30:00Z", + sender: "MyCompany", + status: "sent", + recipients: { exclusionLists: [13], lists: [21] }, + statistics: { + answered: 2, + delivered: 2987, + hardBounces: 1, + processing: 0, + sent: 3000, + softBounces: 3, + unsubscriptions: 3, + }, + }; + server + .mockEndpoint() + .get("/smsCampaigns/1000000") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.smsCampaigns.getSmsCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual({ + content: "Visit our Store and get some discount !", + createdAt: "2017-06-01T12:30:00Z", + id: 2, + modifiedAt: "2017-05-01T12:30:00Z", + name: "PROMO CODE", + scheduledAt: "2017-06-01T12:30:00Z", + sender: "MyCompany", + status: "sent", + recipients: { + exclusionLists: [13], + lists: [21], + }, + statistics: { + answered: 2, + delivered: 2987, + hardBounces: 1, + processing: 0, + sent: 3000, + softBounces: 3, + unsubscriptions: 3, + }, + }); + }); + + test("getSmsCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smsCampaigns/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.getSmsCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSmsCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smsCampaigns/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.getSmsCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateSmsCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/smsCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.smsCampaigns.updateSmsCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("updateSmsCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/smsCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.updateSmsCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateSmsCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/smsCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.updateSmsCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteSmsCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/smsCampaigns/1000000").respondWith().statusCode(200).build(); + + const response = await client.smsCampaigns.deleteSmsCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteSmsCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smsCampaigns/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.deleteSmsCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteSmsCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smsCampaigns/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.deleteSmsCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("requestSmsRecipientExport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipientsType: "all" }; + const rawResponseBody = { processId: 78 }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/exportRecipients") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.smsCampaigns.requestSmsRecipientExport({ + campaignId: 1000000, + recipientsType: "all", + }); + expect(response).toEqual({ + processId: 78, + }); + }); + + test("requestSmsRecipientExport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipientsType: "all" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/exportRecipients") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.requestSmsRecipientExport({ + campaignId: 1000000, + recipientsType: "all", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("requestSmsRecipientExport (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipientsType: "all" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/exportRecipients") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.requestSmsRecipientExport({ + campaignId: 1000000, + recipientsType: "all", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("sendSmsCampaignNow (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().post("/smsCampaigns/1000000/sendNow").respondWith().statusCode(200).build(); + + const response = await client.smsCampaigns.sendSmsCampaignNow({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("sendSmsCampaignNow (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendNow") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.sendSmsCampaignNow({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendSmsCampaignNow (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendNow") + .respondWith() + .statusCode(402) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.sendSmsCampaignNow({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.PaymentRequiredError); + }); + + test("sendSmsCampaignNow (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendNow") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.sendSmsCampaignNow({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("sendSmsReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + email: { + body: "Please find attached the report of our last email campaign.", + to: ["jim.suehan@example.com"], + }, + }; + + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendReport") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.smsCampaigns.sendSmsReport({ + campaignId: 1000000, + body: { + email: { + body: "Please find attached the report of our last email campaign.", + to: ["jim.suehan@example.com"], + }, + }, + }); + expect(response).toEqual(undefined); + }); + + test("sendSmsReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: { body: "body", to: ["to", "to"] } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendReport") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.sendSmsReport({ + campaignId: 1000000, + body: { + email: { + body: "body", + to: ["to", "to"], + }, + }, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendSmsReport (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: { body: "body", to: ["to", "to"] } }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendReport") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.sendSmsReport({ + campaignId: 1000000, + body: { + email: { + body: "body", + to: ["to", "to"], + }, + }, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("sendTestSms (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.smsCampaigns.sendTestSms({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("sendTestSms (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.sendTestSms({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendTestSms (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smsCampaigns/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.sendTestSms({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateSmsCampaignStatus (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/smsCampaigns/1000000/status") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.smsCampaigns.updateSmsCampaignStatus({ + campaignId: 1000000, + body: {}, + }); + expect(response).toEqual(undefined); + }); + + test("updateSmsCampaignStatus (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/smsCampaigns/1000000/status") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.updateSmsCampaignStatus({ + campaignId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateSmsCampaignStatus (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/smsCampaigns/1000000/status") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsCampaigns.updateSmsCampaignStatus({ + campaignId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/smsTemplates.test.ts b/tests/wire/smsTemplates.test.ts new file mode 100644 index 0000000..00e6d68 --- /dev/null +++ b/tests/wire/smsTemplates.test.ts @@ -0,0 +1,84 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("SmsTemplatesClient", () => { + test("getSMSTemplates (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 1, + templates: [ + { + id: 4, + name: "Order Confirmation - EN", + short_url_enabled: false, + message: "Thanks for your order !", + compliance: { compliance_toggle: true, organisation_prefix: "BREVO", stop_keyword: "STOP" }, + encryption: true, + unicode_sms: true, + media_file: "brv-logo.png", + media_file_size: "media_file_size", + media_url: + "https://img-st2.mailinblue.com/1232/images/content_library/original/69282fe28f55fd22de6e0cf9.png", + createdAt: "2025-05-01T12:30:00Z", + updatedAt: "2025-05-01T12:30:00Z", + }, + ], + }; + server + .mockEndpoint() + .get("/transactionalSMS/templates") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.smsTemplates.getSmsTemplates(); + expect(response).toEqual({ + count: 1, + templates: [ + { + id: 4, + name: "Order Confirmation - EN", + short_url_enabled: false, + message: "Thanks for your order !", + compliance: { + compliance_toggle: true, + organisation_prefix: "BREVO", + stop_keyword: "STOP", + }, + encryption: true, + unicode_sms: true, + media_file: "brv-logo.png", + media_file_size: "media_file_size", + media_url: + "https://img-st2.mailinblue.com/1232/images/content_library/original/69282fe28f55fd22de6e0cf9.png", + createdAt: "2025-05-01T12:30:00Z", + updatedAt: "2025-05-01T12:30:00Z", + }, + ], + }); + }); + + test("getSMSTemplates (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/transactionalSMS/templates") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.smsTemplates.getSmsTemplates(); + }).rejects.toThrow(Brevo.BadRequestError); + }); +}); diff --git a/tests/wire/tasks.test.ts b/tests/wire/tasks.test.ts new file mode 100644 index 0000000..3803039 --- /dev/null +++ b/tests/wire/tasks.test.ts @@ -0,0 +1,269 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("TasksClient", () => { + test("getAllTasks (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + contactsIds: [1, 2, 3], + dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + id: "61a5cd07ca1347c82306ad06", + name: "Task: Connect with client_dev", + taskTypeId: "61a5cd07ca1347c82306ad09", + }, + ], + }; + server.mockEndpoint().get("/crm/tasks").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.tasks.getAllTasks({ + sortBy: "name", + }); + expect(response).toEqual({ + items: [ + { + companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + contactsIds: [1, 2, 3], + dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + id: "61a5cd07ca1347c82306ad06", + name: "Task: Connect with client_dev", + taskTypeId: "61a5cd07ca1347c82306ad09", + }, + ], + }); + }); + + test("getAllTasks (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/tasks").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.tasks.getAllTasks(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createATask (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + date: "2021-11-01T17:44:54Z", + name: "Task: Connect with client_dev", + taskTypeId: "61a5cd07ca1347c82306ad09", + }; + const rawResponseBody = { id: "61a5cd07ca1347c82306ad06" }; + server + .mockEndpoint() + .post("/crm/tasks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tasks.createATask({ + date: "2021-11-01T17:44:54Z", + name: "Task: Connect with client_dev", + taskTypeId: "61a5cd07ca1347c82306ad09", + }); + expect(response).toEqual({ + id: "61a5cd07ca1347c82306ad06", + }); + }); + + test("createATask (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { date: "2024-01-15T09:30:00Z", name: "name", taskTypeId: "taskTypeId" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/crm/tasks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tasks.createATask({ + date: "2024-01-15T09:30:00Z", + name: "name", + taskTypeId: "taskTypeId", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getATask (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + contactsIds: [1, 2, 3], + dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + id: "61a5cd07ca1347c82306ad06", + name: "Task: Connect with client_dev", + taskTypeId: "61a5cd07ca1347c82306ad09", + }; + server.mockEndpoint().get("/crm/tasks/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.tasks.getATask({ + id: "id", + }); + expect(response).toEqual({ + companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + contactsIds: [1, 2, 3], + dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + id: "61a5cd07ca1347c82306ad06", + name: "Task: Connect with client_dev", + taskTypeId: "61a5cd07ca1347c82306ad09", + }); + }); + + test("getATask (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/tasks/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.tasks.getATask({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getATask (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/tasks/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.tasks.getATask({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteATask (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/crm/tasks/id").respondWith().statusCode(200).build(); + + const response = await client.tasks.deleteATask({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteATask (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/tasks/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.tasks.deleteATask({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteATask (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/tasks/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.tasks.deleteATask({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateATask (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server.mockEndpoint().patch("/crm/tasks/id").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.tasks.updateATask({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("updateATask (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/tasks/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tasks.updateATask({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateATask (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/tasks/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tasks.updateATask({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getAllTaskTypes", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { id: "61a88a2eb7a574180261234", title: "Email" }; + server.mockEndpoint().get("/crm/tasktypes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.tasks.getAllTaskTypes(); + expect(response).toEqual({ + id: "61a88a2eb7a574180261234", + title: "Email", + }); + }); +}); diff --git a/tests/wire/tier.test.ts b/tests/wire/tier.test.ts new file mode 100644 index 0000000..61fe341 --- /dev/null +++ b/tests/wire/tier.test.ts @@ -0,0 +1,1656 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("TierClient", () => { + test("addSubscriptionToTier (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + contactId: 1, + createdAt: "2024-01-15T09:30:00Z", + groupId: "groupId", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { key: "value" }, + updatedAt: "2024-01-15T09:30:00Z", + }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid", + }); + expect(response).toEqual({ + contactId: 1, + createdAt: "2024-01-15T09:30:00Z", + groupId: "groupId", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + meta: { + key: "value", + }, + updatedAt: "2024-01-15T09:30:00Z", + }); + }); + + test("addSubscriptionToTier (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("addSubscriptionToTier (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("addSubscriptionToTier (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("addSubscriptionToTier (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.ConflictError); + }); + + test("addSubscriptionToTier (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("addSubscriptionToTier (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.FailedDependencyError); + }); + + test("addSubscriptionToTier (8)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.addSubscriptionToTier({ + pid: "pid", + cid: "cid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getListOfTierGroups (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + createdAt: "2024-01-15T09:30:00Z", + downgradeStrategy: "real_time", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierOrder: ["tierOrder"], + updatedAt: "2024-01-15T09:30:00Z", + upgradeStrategy: "real_time", + }, + ], + }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.getListOfTierGroups({ + pid: "pid", + }); + expect(response).toEqual({ + items: [ + { + createdAt: "2024-01-15T09:30:00Z", + downgradeStrategy: "real_time", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierOrder: ["tierOrder"], + updatedAt: "2024-01-15T09:30:00Z", + upgradeStrategy: "real_time", + }, + ], + }); + }); + + test("getListOfTierGroups (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getListOfTierGroups({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getListOfTierGroups (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getListOfTierGroups({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getListOfTierGroups (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getListOfTierGroups({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getListOfTierGroups (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getListOfTierGroups({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getListOfTierGroups (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getListOfTierGroups({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createTierGroup (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { + createdAt: "2024-01-15T09:30:00Z", + downgradeStrategy: "real_time", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierOrder: ["tierOrder"], + updatedAt: "2024-01-15T09:30:00Z", + upgradeStrategy: "real_time", + }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.createTierGroup({ + pid: "pid", + name: "name", + }); + expect(response).toEqual({ + createdAt: "2024-01-15T09:30:00Z", + downgradeStrategy: "real_time", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierOrder: ["tierOrder"], + updatedAt: "2024-01-15T09:30:00Z", + upgradeStrategy: "real_time", + }); + }); + + test("createTierGroup (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierGroup({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createTierGroup (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierGroup({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createTierGroup (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierGroup({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createTierGroup (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierGroup({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("createTierGroup (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierGroup({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.ConflictError); + }); + + test("createTierGroup (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierGroup({ + pid: "pid", + name: "name", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getTierGroup (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + createdAt: "2024-01-15T09:30:00Z", + downgradeStrategy: "real_time", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierOrder: ["tierOrder"], + updatedAt: "2024-01-15T09:30:00Z", + upgradeStrategy: "real_time", + }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.getTierGroup({ + pid: "pid", + gid: "gid", + }); + expect(response).toEqual({ + createdAt: "2024-01-15T09:30:00Z", + downgradeStrategy: "real_time", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierOrder: ["tierOrder"], + updatedAt: "2024-01-15T09:30:00Z", + upgradeStrategy: "real_time", + }); + }); + + test("getTierGroup (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getTierGroup (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getTierGroup (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getTierGroup (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getTierGroup (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("updateTierGroup (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder"], + upgradeStrategy: "real_time", + }; + const rawResponseBody = { + createdAt: "2024-01-15T09:30:00Z", + downgradeStrategy: "real_time", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierOrder: ["tierOrder"], + updatedAt: "2024-01-15T09:30:00Z", + upgradeStrategy: "real_time", + }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tier-groups/gid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.updateTierGroup({ + pid: "pid", + gid: "gid", + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder"], + upgradeStrategy: "real_time", + }); + expect(response).toEqual({ + createdAt: "2024-01-15T09:30:00Z", + downgradeStrategy: "real_time", + id: "id", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierOrder: ["tierOrder"], + updatedAt: "2024-01-15T09:30:00Z", + upgradeStrategy: "real_time", + }); + }); + + test("updateTierGroup (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tier-groups/gid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTierGroup({ + pid: "pid", + gid: "gid", + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("updateTierGroup (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tier-groups/gid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTierGroup({ + pid: "pid", + gid: "gid", + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("updateTierGroup (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tier-groups/gid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTierGroup({ + pid: "pid", + gid: "gid", + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateTierGroup (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tier-groups/gid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTierGroup({ + pid: "pid", + gid: "gid", + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("updateTierGroup (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tier-groups/gid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTierGroup({ + pid: "pid", + gid: "gid", + downgradeStrategy: "real_time", + name: "name", + tierOrder: ["tierOrder", "tierOrder"], + upgradeStrategy: "real_time", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("deleteTierGroup (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = "string"; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.deleteTierGroup({ + pid: "pid", + gid: "gid", + }); + expect(response).toEqual("string"); + }); + + test("deleteTierGroup (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deleteTierGroup (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteTierGroup (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteTierGroup (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.ConflictError); + }); + + test("deleteTierGroup (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("deleteTierGroup (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tier-groups/gid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTierGroup({ + pid: "pid", + gid: "gid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("createTierForTierGroup (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}], name: "name" }; + const rawResponseBody = { + accessConditions: [ + { + balanceDefinitionId: "balanceDefinitionId", + createdAt: "2024-01-15T09:30:00Z", + minimumValue: 1, + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + createdAt: "2024-01-15T09:30:00Z", + groupId: "groupId", + imageRef: "imageRef", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierId: "tierId", + tierRewards: [ + { createdAt: "2024-01-15T09:30:00Z", rewardId: "rewardId", updatedAt: "2024-01-15T09:30:00Z" }, + ], + updatedAt: "2024-01-15T09:30:00Z", + }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.createTierForTierGroup({ + pid: "pid", + gid: "gid", + accessConditions: [{}], + name: "name", + }); + expect(response).toEqual({ + accessConditions: [ + { + balanceDefinitionId: "balanceDefinitionId", + createdAt: "2024-01-15T09:30:00Z", + minimumValue: 1, + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + createdAt: "2024-01-15T09:30:00Z", + groupId: "groupId", + imageRef: "imageRef", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierId: "tierId", + tierRewards: [ + { + createdAt: "2024-01-15T09:30:00Z", + rewardId: "rewardId", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + updatedAt: "2024-01-15T09:30:00Z", + }); + }); + + test("createTierForTierGroup (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierForTierGroup({ + pid: "pid", + gid: "gid", + accessConditions: [{}, {}], + name: "name", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("createTierForTierGroup (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierForTierGroup({ + pid: "pid", + gid: "gid", + accessConditions: [{}, {}], + name: "name", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("createTierForTierGroup (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierForTierGroup({ + pid: "pid", + gid: "gid", + accessConditions: [{}, {}], + name: "name", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("createTierForTierGroup (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierForTierGroup({ + pid: "pid", + gid: "gid", + accessConditions: [{}, {}], + name: "name", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("createTierForTierGroup (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.createTierForTierGroup({ + pid: "pid", + gid: "gid", + accessConditions: [{}, {}], + name: "name", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("getLoyaltyProgramTier (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + items: [ + { + accessConditions: [{}], + createdAt: "2024-01-15T09:30:00Z", + groupId: "groupId", + imageRef: "imageRef", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierId: "tierId", + tierRewards: [{}], + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tiers") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.getLoyaltyProgramTier({ + pid: "pid", + }); + expect(response).toEqual({ + items: [ + { + accessConditions: [{}], + createdAt: "2024-01-15T09:30:00Z", + groupId: "groupId", + imageRef: "imageRef", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierId: "tierId", + tierRewards: [{}], + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + }); + }); + + test("getLoyaltyProgramTier (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tiers") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getLoyaltyProgramTier({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getLoyaltyProgramTier (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tiers") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getLoyaltyProgramTier({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("getLoyaltyProgramTier (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tiers") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getLoyaltyProgramTier({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getLoyaltyProgramTier (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tiers") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getLoyaltyProgramTier({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("getLoyaltyProgramTier (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/loyalty/tier/programs/pid/tiers") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.getLoyaltyProgramTier({ + pid: "pid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("updateTier (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}], name: "name", tierRewards: [{}] }; + const rawResponseBody = { + accessConditions: [ + { + balanceDefinitionId: "balanceDefinitionId", + createdAt: "2024-01-15T09:30:00Z", + minimumValue: 1, + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + createdAt: "2024-01-15T09:30:00Z", + groupId: "groupId", + imageRef: "imageRef", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierId: "tierId", + tierRewards: [ + { createdAt: "2024-01-15T09:30:00Z", rewardId: "rewardId", updatedAt: "2024-01-15T09:30:00Z" }, + ], + updatedAt: "2024-01-15T09:30:00Z", + }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tiers/tid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.updateTier({ + pid: "pid", + tid: "tid", + accessConditions: [{}], + name: "name", + tierRewards: [{}], + }); + expect(response).toEqual({ + accessConditions: [ + { + balanceDefinitionId: "balanceDefinitionId", + createdAt: "2024-01-15T09:30:00Z", + minimumValue: 1, + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + createdAt: "2024-01-15T09:30:00Z", + groupId: "groupId", + imageRef: "imageRef", + loyaltyProgramId: "loyaltyProgramId", + name: "name", + tierId: "tierId", + tierRewards: [ + { + createdAt: "2024-01-15T09:30:00Z", + rewardId: "rewardId", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + updatedAt: "2024-01-15T09:30:00Z", + }); + }); + + test("updateTier (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tiers/tid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTier({ + pid: "pid", + tid: "tid", + accessConditions: [{}, {}], + name: "name", + tierRewards: [{}, {}], + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("updateTier (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tiers/tid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTier({ + pid: "pid", + tid: "tid", + accessConditions: [{}, {}], + name: "name", + tierRewards: [{}, {}], + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("updateTier (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tiers/tid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTier({ + pid: "pid", + tid: "tid", + accessConditions: [{}, {}], + name: "name", + tierRewards: [{}, {}], + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateTier (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tiers/tid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTier({ + pid: "pid", + tid: "tid", + accessConditions: [{}, {}], + name: "name", + tierRewards: [{}, {}], + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("updateTier (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/loyalty/tier/programs/pid/tiers/tid") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.updateTier({ + pid: "pid", + tid: "tid", + accessConditions: [{}, {}], + name: "name", + tierRewards: [{}, {}], + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + + test("deleteTier (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = "string"; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tiers/tid") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.tier.deleteTier({ + pid: "pid", + tid: "tid", + }); + expect(response).toEqual("string"); + }); + + test("deleteTier (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tiers/tid") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTier({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deleteTier (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tiers/tid") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTier({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteTier (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tiers/tid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTier({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteTier (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tiers/tid") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTier({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("deleteTier (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/tier/programs/pid/tiers/tid") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.tier.deleteTier({ + pid: "pid", + tid: "tid", + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); +}); diff --git a/tests/wire/transactionalEmails.test.ts b/tests/wire/transactionalEmails.test.ts new file mode 100644 index 0000000..f09df6f --- /dev/null +++ b/tests/wire/transactionalEmails.test.ts @@ -0,0 +1,1442 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("TransactionalEmailsClient", () => { + test("getTransacBlockedContacts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + contacts: [ + { + blockedAt: "2017-05-01T12:30:00Z", + email: "abc@xyz.com", + reason: { code: "adminBlocked", message: "Admin blocked" }, + senderEmail: "ez312@gmal.com", + }, + ], + count: 1, + }; + server + .mockEndpoint() + .get("/smtp/blockedContacts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.getTransacBlockedContacts(); + expect(response).toEqual({ + contacts: [ + { + blockedAt: "2017-05-01T12:30:00Z", + email: "abc@xyz.com", + reason: { + code: "adminBlocked", + message: "Admin blocked", + }, + senderEmail: "ez312@gmal.com", + }, + ], + count: 1, + }); + }); + + test("getTransacBlockedContacts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smtp/blockedContacts") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getTransacBlockedContacts(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("unblockOrResubscribeATransactionalContact (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/smtp/blockedContacts/email").respondWith().statusCode(200).build(); + + const response = await client.transactionalEmails.unblockOrResubscribeATransactionalContact({ + email: "email", + }); + expect(response).toEqual(undefined); + }); + + test("unblockOrResubscribeATransactionalContact (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/blockedContacts/email") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.unblockOrResubscribeATransactionalContact({ + email: "email", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("unblockOrResubscribeATransactionalContact (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/blockedContacts/email") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.unblockOrResubscribeATransactionalContact({ + email: "email", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getBlockedDomains", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { domains: ["example.com", "testdomain.com"] }; + server + .mockEndpoint() + .get("/smtp/blockedDomains") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.getBlockedDomains(); + expect(response).toEqual({ + domains: ["example.com", "testdomain.com"], + }); + }); + + test("blockNewDomain (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { domain: "example.com" }; + + server + .mockEndpoint() + .post("/smtp/blockedDomains") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.transactionalEmails.blockNewDomain({ + domain: "example.com", + }); + expect(response).toEqual(undefined); + }); + + test("blockNewDomain (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { domain: "domain" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smtp/blockedDomains") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.blockNewDomain({ + domain: "domain", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteBlockedDomain (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/smtp/blockedDomains/domain").respondWith().statusCode(200).build(); + + const response = await client.transactionalEmails.deleteBlockedDomain({ + domain: "domain", + }); + expect(response).toEqual(undefined); + }); + + test("deleteBlockedDomain (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/blockedDomains/domain") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteBlockedDomain({ + domain: "domain", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteBlockedDomain (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/blockedDomains/domain") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteBlockedDomain({ + domain: "domain", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteHardbounces (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .post("/smtp/deleteHardbounces") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.transactionalEmails.deleteHardbounces(); + expect(response).toEqual(undefined); + }); + + test("deleteHardbounces (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smtp/deleteHardbounces") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteHardbounces(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendTransacEmail (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + htmlContent: + "

Hello,

This is my first transactional email sent from Brevo.

", + sender: { email: "hello@brevo.com", name: "Alex from Brevo" }, + subject: "Hello from Brevo!", + to: [{ email: "johndoe@example.com", name: "John Doe" }], + }; + const rawResponseBody = { messageId: "<201798300811.5787683@relay.domain.com>", messageIds: ["messageIds"] }; + server + .mockEndpoint() + .post("/smtp/email") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.sendTransacEmail({ + htmlContent: + "

Hello,

This is my first transactional email sent from Brevo.

", + sender: { + email: "hello@brevo.com", + name: "Alex from Brevo", + }, + subject: "Hello from Brevo!", + to: [ + { + email: "johndoe@example.com", + name: "John Doe", + }, + ], + }); + expect(response).toEqual({ + messageId: "<201798300811.5787683@relay.domain.com>", + messageIds: ["messageIds"], + }); + }); + + test("sendTransacEmail (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + htmlContent: + "Your delivery is expected {{params.estimatedArrival}}.Your tracking code: {{params.trackingCode}}

", + params: { trackingCode: "JD01460000300002350000", estimatedArrival: "Tomorrow" }, + sender: { email: "hello@brevo.com", name: "Alex from Brevo" }, + subject: "Hello from Brevo!", + to: [{ email: "johndoe@example.com", name: "John Doe" }], + }; + const rawResponseBody = { messageId: "<201798300811.5787683@relay.domain.com>", messageIds: ["messageIds"] }; + server + .mockEndpoint() + .post("/smtp/email") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.sendTransacEmail({ + htmlContent: + "Your delivery is expected {{params.estimatedArrival}}.Your tracking code: {{params.trackingCode}}

", + params: { + trackingCode: "JD01460000300002350000", + estimatedArrival: "Tomorrow", + }, + sender: { + email: "hello@brevo.com", + name: "Alex from Brevo", + }, + subject: "Hello from Brevo!", + to: [ + { + email: "johndoe@example.com", + name: "John Doe", + }, + ], + }); + expect(response).toEqual({ + messageId: "<201798300811.5787683@relay.domain.com>", + messageIds: ["messageIds"], + }); + }); + + test("sendTransacEmail (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smtp/email") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.sendTransacEmail(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteScheduledEmailById (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .delete("/smtp/email/4320f270-a4e3-4a2e-b591-edfe30a5e627") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.transactionalEmails.deleteScheduledEmailById({ + identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", + }); + expect(response).toEqual(undefined); + }); + + test("deleteScheduledEmailById (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/email/identifier") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteScheduledEmailById({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteScheduledEmailById (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/email/identifier") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteScheduledEmailById({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getScheduledEmailById (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + batches: [ + { createdAt: "2022-02-26T11:36:43Z", scheduledAt: "2022-02-28T11:36:43Z", status: "queued" }, + { createdAt: "2022-02-24T11:36:43Z", scheduledAt: "2022-02-25T11:36:43Z", status: "processed" }, + { createdAt: "2022-02-25T11:36:43Z", scheduledAt: "2022-02-26T11:36:43Z", status: "inProgress" }, + ], + count: 3, + }; + server + .mockEndpoint() + .get("/smtp/emailStatus/4320f270-a4e3-4a2e-b591-edfe30a5e627") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.getScheduledEmailById({ + identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", + startDate: "2022-02-02", + endDate: "2022-03-02", + }); + expect(response).toEqual({ + batches: [ + { + createdAt: "2022-02-26T11:36:43Z", + scheduledAt: "2022-02-28T11:36:43Z", + status: "queued", + }, + { + createdAt: "2022-02-24T11:36:43Z", + scheduledAt: "2022-02-25T11:36:43Z", + status: "processed", + }, + { + createdAt: "2022-02-25T11:36:43Z", + scheduledAt: "2022-02-26T11:36:43Z", + status: "inProgress", + }, + ], + count: 3, + }); + }); + + test("getScheduledEmailById (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + createdAt: "2022-02-26T11:36:43Z", + scheduledAt: "2022-02-28T11:36:43Z", + status: "queued", + }; + server + .mockEndpoint() + .get("/smtp/emailStatus/4320f270-a4e3-4a2e-b591-edfe30a5e627") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.getScheduledEmailById({ + identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", + startDate: "2022-02-02", + endDate: "2022-03-02", + }); + expect(response).toEqual({ + createdAt: "2022-02-26T11:36:43Z", + scheduledAt: "2022-02-28T11:36:43Z", + status: "queued", + }); + }); + + test("getScheduledEmailById (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smtp/emailStatus/identifier") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getScheduledEmailById({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getScheduledEmailById (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smtp/emailStatus/identifier") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getScheduledEmailById({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getTransacEmailsList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 120, + transactionalEmails: [ + { + date: "2019-05-25T11:53:26Z", + email: "abc@xyz.com", + from: "diana.doe@example.com", + messageId: "<201798300811.5787683@relay.domain.com>", + subject: "summer camp", + tags: ["tag1"], + templateId: 15, + uuid: "5a78c-209ok98262910-std2341", + }, + { + date: "2019-05-25T07:28:11Z", + email: "test@test.com", + from: "diana.doe@example.com", + messageId: "<201798300811.5700093@relay.domain.com>", + subject: "details verification", + tags: ["tag1"], + templateId: 15, + uuid: "5a78c-209ok98262910-s99a341", + }, + ], + }; + server.mockEndpoint().get("/smtp/emails").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.transactionalEmails.getTransacEmailsList(); + expect(response).toEqual({ + count: 120, + transactionalEmails: [ + { + date: "2019-05-25T11:53:26Z", + email: "abc@xyz.com", + from: "diana.doe@example.com", + messageId: "<201798300811.5787683@relay.domain.com>", + subject: "summer camp", + tags: ["tag1"], + templateId: 15, + uuid: "5a78c-209ok98262910-std2341", + }, + { + date: "2019-05-25T07:28:11Z", + email: "test@test.com", + from: "diana.doe@example.com", + messageId: "<201798300811.5700093@relay.domain.com>", + subject: "details verification", + tags: ["tag1"], + templateId: 15, + uuid: "5a78c-209ok98262910-s99a341", + }, + ], + }); + }); + + test("getTransacEmailsList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/smtp/emails").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.transactionalEmails.getTransacEmailsList(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getTransacEmailContent", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + attachmentCount: 2, + body: "

Greetings from the team

This is the actual html content sent

", + date: "2016-02-25T11:53:26Z", + email: "abc@example.com", + events: [ + { name: "sent", time: "2016-02-25T11:53:26Z" }, + { name: "delivered", time: "2016-02-25T11:55:26Z" }, + { name: "opened", time: "2016-02-26T09:53:26Z" }, + ], + subject: "Summer Camps", + templateId: 12, + }; + server.mockEndpoint().get("/smtp/emails/uuid").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.transactionalEmails.getTransacEmailContent({ + uuid: "uuid", + }); + expect(response).toEqual({ + attachmentCount: 2, + body: "

Greetings from the team

This is the actual html content sent

", + date: "2016-02-25T11:53:26Z", + email: "abc@example.com", + events: [ + { + name: "sent", + time: "2016-02-25T11:53:26Z", + }, + { + name: "delivered", + time: "2016-02-25T11:55:26Z", + }, + { + name: "opened", + time: "2016-02-26T09:53:26Z", + }, + ], + subject: "Summer Camps", + templateId: 12, + }); + }); + + test("deleteAnSmtpTransactionalLog (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/smtp/log/identifier").respondWith().statusCode(200).build(); + + const response = await client.transactionalEmails.deleteAnSmtpTransactionalLog({ + identifier: "identifier", + }); + expect(response).toEqual(undefined); + }); + + test("deleteAnSmtpTransactionalLog (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/log/identifier") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteAnSmtpTransactionalLog({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteAnSmtpTransactionalLog (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/log/identifier") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteAnSmtpTransactionalLog({ + identifier: "identifier", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("getAggregatedSmtpReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + blocked: 2, + clicks: 9987, + delivered: 18996, + hardBounces: 234, + invalid: 0, + opens: 17654, + range: "2016-09-08|2017-04-28", + requests: 19887, + softBounces: 1533, + spamReports: 1, + uniqueClicks: 8766, + uniqueOpens: 13688, + unsubscribed: 2, + }; + server + .mockEndpoint() + .get("/smtp/statistics/aggregatedReport") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.getAggregatedSmtpReport(); + expect(response).toEqual({ + blocked: 2, + clicks: 9987, + delivered: 18996, + hardBounces: 234, + invalid: 0, + opens: 17654, + range: "2016-09-08|2017-04-28", + requests: 19887, + softBounces: 1533, + spamReports: 1, + uniqueClicks: 8766, + uniqueOpens: 13688, + unsubscribed: 2, + }); + }); + + test("getAggregatedSmtpReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smtp/statistics/aggregatedReport") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getAggregatedSmtpReport(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getEmailEventReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + events: [ + { + date: "2017-03-12T12:30:00Z", + email: "john.smith@example.com", + event: "deferred", + from: "john@example.com", + ip: "165.87.3.15", + link: "https://www.someexamplelink.com", + messageId: "<201798300811.5787683@example.domain.com>", + reason: "Error connection timeout", + subject: "Sib client_dev test", + tag: "OrderConfirmation", + templateId: 4, + }, + { + date: "2017-03-13T16:30:00Z", + email: "john.smith@example.com", + event: "delivered", + from: "john@example.com", + ip: "165.87.3.15", + link: "https://www.someexamplelink.com", + messageId: "<201798300811.5787683@example.domain.com>", + reason: "Error connection timeout", + subject: "Sib client_dev test", + tag: "OrderConfirmation", + templateId: 5, + }, + ], + }; + server + .mockEndpoint() + .get("/smtp/statistics/events") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.getEmailEventReport(); + expect(response).toEqual({ + events: [ + { + date: "2017-03-12T12:30:00Z", + email: "john.smith@example.com", + event: "deferred", + from: "john@example.com", + ip: "165.87.3.15", + link: "https://www.someexamplelink.com", + messageId: "<201798300811.5787683@example.domain.com>", + reason: "Error connection timeout", + subject: "Sib client_dev test", + tag: "OrderConfirmation", + templateId: 4, + }, + { + date: "2017-03-13T16:30:00Z", + email: "john.smith@example.com", + event: "delivered", + from: "john@example.com", + ip: "165.87.3.15", + link: "https://www.someexamplelink.com", + messageId: "<201798300811.5787683@example.domain.com>", + reason: "Error connection timeout", + subject: "Sib client_dev test", + tag: "OrderConfirmation", + templateId: 5, + }, + ], + }); + }); + + test("getEmailEventReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smtp/statistics/events") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getEmailEventReport(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSmtpReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + reports: [ + { + blocked: 519, + clicks: 1026, + date: "2017-04-30", + delivered: 10103, + hardBounces: 21, + invalid: 1, + opens: 5091, + requests: 10756, + softBounces: 137, + spamReports: 0, + uniqueClicks: 720, + uniqueOpens: 2318, + unsubscribed: 0, + }, + { + blocked: 920, + clicks: 1514, + date: "2017-05-01", + delivered: 17499, + hardBounces: 34, + invalid: 2, + opens: 10089, + requests: 18812, + softBounces: 254, + spamReports: 0, + uniqueClicks: 1090, + uniqueOpens: 4393, + unsubscribed: 3, + }, + ], + }; + server + .mockEndpoint() + .get("/smtp/statistics/reports") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.getSmtpReport(); + expect(response).toEqual({ + reports: [ + { + blocked: 519, + clicks: 1026, + date: "2017-04-30", + delivered: 10103, + hardBounces: 21, + invalid: 1, + opens: 5091, + requests: 10756, + softBounces: 137, + spamReports: 0, + uniqueClicks: 720, + uniqueOpens: 2318, + unsubscribed: 0, + }, + { + blocked: 920, + clicks: 1514, + date: "2017-05-01", + delivered: 17499, + hardBounces: 34, + invalid: 2, + opens: 10089, + requests: 18812, + softBounces: 254, + spamReports: 0, + uniqueClicks: 1090, + uniqueOpens: 4393, + unsubscribed: 3, + }, + ], + }); + }); + + test("getSmtpReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smtp/statistics/reports") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getSmtpReport(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("postPreviewSmtpEmailTemplates (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { key: "value" }; + const rawResponseBody = { + fromEmail: "fromEmail", + fromName: "fromName", + html: "html", + previewText: "previewText", + subject: "subject", + usedFeedNames: ["usedFeedNames", "usedFeedNames"], + }; + server + .mockEndpoint() + .post("/smtp/template/preview") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.postPreviewSmtpEmailTemplates({ + key: "value", + }); + expect(response).toEqual({ + fromEmail: "fromEmail", + fromName: "fromName", + html: "html", + previewText: "previewText", + subject: "subject", + usedFeedNames: ["usedFeedNames", "usedFeedNames"], + }); + }); + + test("postPreviewSmtpEmailTemplates (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { key: "value" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smtp/template/preview") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.postPreviewSmtpEmailTemplates({ + key: "value", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSmtpTemplates (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 2, + templates: [ + { + createdAt: "2016-02-24T14:44:24Z", + doiTemplate: false, + htmlContent: "HTML CONTENT 1", + id: 5, + isActive: false, + modifiedAt: "2016-02-24T15:37:11Z", + name: "ChristomasTimeTemplate", + replyTo: "replyto@domain.com", + sender: { email: "john.smith@example.com", id: "43", name: "John" }, + subject: "Merry Christmas", + tag: "Festival", + testSent: false, + toField: "", + }, + { + createdAt: "2016-02-25T11:53:26Z", + doiTemplate: false, + htmlContent: "HTML CONTENT 2", + id: 12, + isActive: true, + modifiedAt: "2016-02-25T11:53:26Z", + name: "SummerSales2017Template", + replyTo: "replyto@domain.com", + sender: { email: "john.smith@example.com", id: "43", name: "John" }, + subject: "Enjoy our summer Sales !", + tag: "Summer", + testSent: false, + toField: "", + }, + ], + }; + server.mockEndpoint().get("/smtp/templates").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.transactionalEmails.getSmtpTemplates(); + expect(response).toEqual({ + count: 2, + templates: [ + { + createdAt: "2016-02-24T14:44:24Z", + doiTemplate: false, + htmlContent: "HTML CONTENT 1", + id: 5, + isActive: false, + modifiedAt: "2016-02-24T15:37:11Z", + name: "ChristomasTimeTemplate", + replyTo: "replyto@domain.com", + sender: { + email: "john.smith@example.com", + id: "43", + name: "John", + }, + subject: "Merry Christmas", + tag: "Festival", + testSent: false, + toField: "", + }, + { + createdAt: "2016-02-25T11:53:26Z", + doiTemplate: false, + htmlContent: "HTML CONTENT 2", + id: 12, + isActive: true, + modifiedAt: "2016-02-25T11:53:26Z", + name: "SummerSales2017Template", + replyTo: "replyto@domain.com", + sender: { + email: "john.smith@example.com", + id: "43", + name: "John", + }, + subject: "Enjoy our summer Sales !", + tag: "Summer", + testSent: false, + toField: "", + }, + ], + }); + }); + + test("getSmtpTemplates (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/smtp/templates").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.transactionalEmails.getSmtpTemplates(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createSmtpTemplate (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + sender: {}, + subject: "Thanks for your purchase !", + templateName: "Order Confirmation - EN", + }; + const rawResponseBody = { id: 5 }; + server + .mockEndpoint() + .post("/smtp/templates") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.createSmtpTemplate({ + sender: {}, + subject: "Thanks for your purchase !", + templateName: "Order Confirmation - EN", + }); + expect(response).toEqual({ + id: 5, + }); + }); + + test("createSmtpTemplate (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { sender: {}, subject: "subject", templateName: "templateName" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smtp/templates") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.createSmtpTemplate({ + sender: {}, + subject: "subject", + templateName: "templateName", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSmtpTemplate (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + createdAt: "2016-02-25T11:53:26Z", + doiTemplate: false, + htmlContent: "HTML CONTENT 4", + id: 33, + isActive: true, + modifiedAt: "2016-02-25T11:53:26Z", + name: "OrderConfirmation", + replyTo: "replyto@domain.com", + sender: { email: "john.smith@example.com", id: "43", name: "John" }, + subject: "Order Confirmation : Thanks for your Purchase !", + tag: "", + testSent: false, + toField: "", + }; + server + .mockEndpoint() + .get("/smtp/templates/1000000") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalEmails.getSmtpTemplate({ + templateId: 1000000, + }); + expect(response).toEqual({ + createdAt: "2016-02-25T11:53:26Z", + doiTemplate: false, + htmlContent: "HTML CONTENT 4", + id: 33, + isActive: true, + modifiedAt: "2016-02-25T11:53:26Z", + name: "OrderConfirmation", + replyTo: "replyto@domain.com", + sender: { + email: "john.smith@example.com", + id: "43", + name: "John", + }, + subject: "Order Confirmation : Thanks for your Purchase !", + tag: "", + testSent: false, + toField: "", + }); + }); + + test("getSmtpTemplate (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smtp/templates/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getSmtpTemplate({ + templateId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSmtpTemplate (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/smtp/templates/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getSmtpTemplate({ + templateId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateSmtpTemplate (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/smtp/templates/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.transactionalEmails.updateSmtpTemplate({ + templateId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("updateSmtpTemplate (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/smtp/templates/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.updateSmtpTemplate({ + templateId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateSmtpTemplate (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/smtp/templates/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.updateSmtpTemplate({ + templateId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteSmtpTemplate (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/smtp/templates/1000000").respondWith().statusCode(200).build(); + + const response = await client.transactionalEmails.deleteSmtpTemplate({ + templateId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteSmtpTemplate (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/templates/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteSmtpTemplate({ + templateId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteSmtpTemplate (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/smtp/templates/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.deleteSmtpTemplate({ + templateId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("sendTestTemplate (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .post("/smtp/templates/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.transactionalEmails.sendTestTemplate({ + templateId: 1000000, + body: {}, + }); + expect(response).toEqual(undefined); + }); + + test("sendTestTemplate (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smtp/templates/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.sendTestTemplate({ + templateId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendTestTemplate (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/smtp/templates/1000000/sendTest") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.sendTestTemplate({ + templateId: 1000000, + body: {}, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/transactionalSms.test.ts b/tests/wire/transactionalSms.test.ts new file mode 100644 index 0000000..2e36cb9 --- /dev/null +++ b/tests/wire/transactionalSms.test.ts @@ -0,0 +1,384 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("TransactionalSmsClient", () => { + test("sendAsyncTransactionalSms (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipient: "33689965433", sender: "MyShop" }; + const rawResponseBody = { messageId: 1511882900176220 }; + server + .mockEndpoint() + .post("/transactionalSMS/send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalSms.sendAsyncTransactionalSms({ + recipient: "33689965433", + sender: "MyShop", + }); + expect(response).toEqual({ + messageId: 1511882900176220, + }); + }); + + test("sendAsyncTransactionalSms (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipient: "recipient", sender: "sender" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/transactionalSMS/send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalSms.sendAsyncTransactionalSms({ + recipient: "recipient", + sender: "sender", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendTransacSms (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipient: "33689965433", sender: "MyShop" }; + const rawResponseBody = { + messageId: 1511882900176220, + reference: "ab1cde2fgh3i4jklmno", + remainingCredits: 82.85, + smsCount: 2, + usedCredits: 0.7, + }; + server + .mockEndpoint() + .post("/transactionalSMS/sms") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalSms.sendTransacSms({ + recipient: "33689965433", + sender: "MyShop", + }); + expect(response).toEqual({ + messageId: 1511882900176220, + reference: "ab1cde2fgh3i4jklmno", + remainingCredits: 82.85, + smsCount: 2, + usedCredits: 0.7, + }); + }); + + test("sendTransacSms (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipient: "recipient", sender: "sender" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/transactionalSMS/sms") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalSms.sendTransacSms({ + recipient: "recipient", + sender: "sender", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendTransacSms (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipient: "recipient", sender: "sender" }; + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .post("/transactionalSMS/sms") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(402) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalSms.sendTransacSms({ + recipient: "recipient", + sender: "sender", + }); + }).rejects.toThrow(Brevo.PaymentRequiredError); + }); + + test("getTransacAggregatedSmsReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + accepted: 6, + blocked: 4, + delivered: 16, + hardBounces: 5, + range: "2015-05-22|2017-11-29", + rejected: 14, + replied: 8, + requests: 54, + skipped: 1, + softBounces: 26, + unsubscribed: 10, + }; + server + .mockEndpoint() + .get("/transactionalSMS/statistics/aggregatedReport") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalSms.getTransacAggregatedSmsReport(); + expect(response).toEqual({ + accepted: 6, + blocked: 4, + delivered: 16, + hardBounces: 5, + range: "2015-05-22|2017-11-29", + rejected: 14, + replied: 8, + requests: 54, + skipped: 1, + softBounces: 26, + unsubscribed: 10, + }); + }); + + test("getTransacAggregatedSmsReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/transactionalSMS/statistics/aggregatedReport") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalSms.getTransacAggregatedSmsReport(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getSmsEvents (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + events: [ + { + date: "2015-05-20T12:30:00Z", + event: "sent", + messageId: "1473139351170140", + phoneNumber: "phoneNumber", + reason: "Recipient is currently unreachable", + reply: "reply", + tag: "cabWaiting", + }, + { + date: "2015-05-20T16:30:00Z", + event: "delivered", + messageId: "1473139351170140", + phoneNumber: "phoneNumber", + reason: "Recipient is currently unreachable", + reply: "reply", + tag: "cabRequest", + }, + ], + }; + server + .mockEndpoint() + .get("/transactionalSMS/statistics/events") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalSms.getSmsEvents(); + expect(response).toEqual({ + events: [ + { + date: "2015-05-20T12:30:00Z", + event: "sent", + messageId: "1473139351170140", + phoneNumber: "phoneNumber", + reason: "Recipient is currently unreachable", + reply: "reply", + tag: "cabWaiting", + }, + { + date: "2015-05-20T16:30:00Z", + event: "delivered", + messageId: "1473139351170140", + phoneNumber: "phoneNumber", + reason: "Recipient is currently unreachable", + reply: "reply", + tag: "cabRequest", + }, + ], + }); + }); + + test("getSmsEvents (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/transactionalSMS/statistics/events") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalSms.getSmsEvents(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getTransacSmsReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + reports: [ + { + accepted: 2318, + blocked: 1026, + date: "2017-04-30", + delivered: 10103, + hardBounces: 21, + rejected: 0, + replied: 5091, + requests: 10756, + skipped: 1, + softBounces: 137, + unsubscribed: 720, + }, + { + accepted: 4393, + blocked: 1514, + date: "2017-05-01", + delivered: 17499, + hardBounces: 34, + rejected: 0, + replied: 10089, + requests: 18812, + skipped: 0, + softBounces: 254, + unsubscribed: 1090, + }, + { + accepted: 4689, + blocked: 1646, + date: "2017-05-02", + delivered: 13427, + hardBounces: 16, + rejected: 0, + replied: 11563, + requests: 14321, + skipped: 1, + softBounces: 176, + unsubscribed: 1170, + }, + ], + }; + server + .mockEndpoint() + .get("/transactionalSMS/statistics/reports") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalSms.getTransacSmsReport(); + expect(response).toEqual({ + reports: [ + { + accepted: 2318, + blocked: 1026, + date: "2017-04-30", + delivered: 10103, + hardBounces: 21, + rejected: 0, + replied: 5091, + requests: 10756, + skipped: 1, + softBounces: 137, + unsubscribed: 720, + }, + { + accepted: 4393, + blocked: 1514, + date: "2017-05-01", + delivered: 17499, + hardBounces: 34, + rejected: 0, + replied: 10089, + requests: 18812, + skipped: 0, + softBounces: 254, + unsubscribed: 1090, + }, + { + accepted: 4689, + blocked: 1646, + date: "2017-05-02", + delivered: 13427, + hardBounces: 16, + rejected: 0, + replied: 11563, + requests: 14321, + skipped: 1, + softBounces: 176, + unsubscribed: 1170, + }, + ], + }); + }); + + test("getTransacSmsReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/transactionalSMS/statistics/reports") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalSms.getTransacSmsReport(); + }).rejects.toThrow(Brevo.BadRequestError); + }); +}); diff --git a/tests/wire/transactionalWhatsApp.test.ts b/tests/wire/transactionalWhatsApp.test.ts new file mode 100644 index 0000000..8c193c4 --- /dev/null +++ b/tests/wire/transactionalWhatsApp.test.ts @@ -0,0 +1,179 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("TransactionalWhatsAppClient", () => { + test("sendWhatsappMessage (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { contactNumbers: ["contactNumbers"], senderNumber: "senderNumber", templateId: 123 }; + const rawResponseBody = { messageId: "23befbae-1505-47a8-bd27-e30ef739f32c" }; + server + .mockEndpoint() + .post("/whatsapp/sendMessage") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalWhatsApp.sendWhatsappMessage({ + contactNumbers: ["contactNumbers"], + senderNumber: "senderNumber", + templateId: 123, + }); + expect(response).toEqual({ + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + }); + }); + + test("sendWhatsappMessage (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + contactNumbers: ["contactNumbers", "contactNumbers"], + senderNumber: "senderNumber", + templateId: 1, + }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/whatsapp/sendMessage") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalWhatsApp.sendWhatsappMessage({ + contactNumbers: ["contactNumbers", "contactNumbers"], + senderNumber: "senderNumber", + templateId: 1, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getWhatsappEventReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + events: [ + { + body: "Hi! I am a reply", + contactNumber: "contactNumber", + date: "2017-03-12T12:30:00Z", + event: "sent", + mediaUrl: "https://example.com/media.png", + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + reason: "23befbae-1505-47a8-bd27-e30ef739f32c", + senderNumber: "senderNumber", + }, + { + body: "Hi! I am a reply", + contactNumber: "contactNumber", + date: "2017-03-12T12:30:00Z", + event: "error", + mediaUrl: "https://example.com/media.png", + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + reason: "error reason", + senderNumber: "senderNumber", + }, + { + body: "Hi! I am a reply", + contactNumber: "contactNumber", + date: "2017-03-12T12:30:00Z", + event: "soft-bounce", + mediaUrl: "https://example.com/media.png", + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + reason: "invalid whatsapp contact", + senderNumber: "senderNumber", + }, + { + body: "body only in case of text reply & url will be empty", + contactNumber: "contactNumber", + date: "2017-03-12T12:30:00Z", + event: "reply", + mediaUrl: "media url only in case media reply & body will be empty", + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + reason: "23befbae-1505-47a8-bd27-e30ef739f32c", + senderNumber: "senderNumber", + }, + ], + }; + server + .mockEndpoint() + .get("/whatsapp/statistics/events") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transactionalWhatsApp.getWhatsappEventReport(); + expect(response).toEqual({ + events: [ + { + body: "Hi! I am a reply", + contactNumber: "contactNumber", + date: "2017-03-12T12:30:00Z", + event: "sent", + mediaUrl: "https://example.com/media.png", + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + reason: "23befbae-1505-47a8-bd27-e30ef739f32c", + senderNumber: "senderNumber", + }, + { + body: "Hi! I am a reply", + contactNumber: "contactNumber", + date: "2017-03-12T12:30:00Z", + event: "error", + mediaUrl: "https://example.com/media.png", + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + reason: "error reason", + senderNumber: "senderNumber", + }, + { + body: "Hi! I am a reply", + contactNumber: "contactNumber", + date: "2017-03-12T12:30:00Z", + event: "soft-bounce", + mediaUrl: "https://example.com/media.png", + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + reason: "invalid whatsapp contact", + senderNumber: "senderNumber", + }, + { + body: "body only in case of text reply & url will be empty", + contactNumber: "contactNumber", + date: "2017-03-12T12:30:00Z", + event: "reply", + mediaUrl: "media url only in case media reply & body will be empty", + messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", + reason: "23befbae-1505-47a8-bd27-e30ef739f32c", + senderNumber: "senderNumber", + }, + ], + }); + }); + + test("getWhatsappEventReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/whatsapp/statistics/events") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalWhatsApp.getWhatsappEventReport(); + }).rejects.toThrow(Brevo.BadRequestError); + }); +}); diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts new file mode 100644 index 0000000..5e4812d --- /dev/null +++ b/tests/wire/user.test.ts @@ -0,0 +1,425 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("UserClient", () => { + test("getInvitedUsersList (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + users: [ + { + email: "owner@company.com", + feature_access: { conversations: "owner", crm: "owner", marketing: "owner" }, + is_owner: "is_owner", + status: "active", + }, + { + email: "pendingInvitedUser@company.com", + feature_access: { conversations: "none", crm: "full", marketing: "custom" }, + is_owner: "is_owner", + status: "pending", + }, + { + email: "connectedInvitedUser@company.com", + feature_access: { conversations: "full", crm: "none", marketing: "none" }, + is_owner: "is_owner", + status: "active", + }, + ], + }; + server + .mockEndpoint() + .get("/organization/invited/users") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.getInvitedUsersList(); + expect(response).toEqual({ + users: [ + { + email: "owner@company.com", + feature_access: { + conversations: "owner", + crm: "owner", + marketing: "owner", + }, + is_owner: "is_owner", + status: "active", + }, + { + email: "pendingInvitedUser@company.com", + feature_access: { + conversations: "none", + crm: "full", + marketing: "custom", + }, + is_owner: "is_owner", + status: "pending", + }, + { + email: "connectedInvitedUser@company.com", + feature_access: { + conversations: "full", + crm: "none", + marketing: "none", + }, + is_owner: "is_owner", + status: "active", + }, + ], + }); + }); + + test("getInvitedUsersList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/organization/invited/users") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.user.getInvitedUsersList(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("putRevokeUserPermission (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { credit_notes: ["TEST-123"], status: "OK" }; + server + .mockEndpoint() + .put("/organization/user/invitation/revoke/email") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.putRevokeUserPermission({ + email: "email", + }); + expect(response).toEqual({ + credit_notes: ["TEST-123"], + status: "OK", + }); + }); + + test("putRevokeUserPermission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/organization/user/invitation/revoke/email") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.user.putRevokeUserPermission({ + email: "email", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("inviteuser (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all_features_access: true, email: "inviteuser@example.com", privileges: [{}] }; + const rawResponseBody = { invoice_id: "invoice_id", status: "OK" }; + server + .mockEndpoint() + .post("/organization/user/invitation/send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.inviteuser({ + all_features_access: true, + email: "inviteuser@example.com", + privileges: [{}], + }); + expect(response).toEqual({ + invoice_id: "invoice_id", + status: "OK", + }); + }); + + test("inviteuser (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all_features_access: true, email: "email", privileges: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/organization/user/invitation/send") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.user.inviteuser({ + all_features_access: true, + email: "email", + privileges: [{}, {}], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("putresendcancelinvitation (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { credit_notes: ["TEST-123"], status: "OK" }; + server + .mockEndpoint() + .put("/organization/user/invitation/resend/email") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.putresendcancelinvitation({ + action: "resend", + email: "email", + }); + expect(response).toEqual({ + credit_notes: ["TEST-123"], + status: "OK", + }); + }); + + test("putresendcancelinvitation (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/organization/user/invitation/resend/email") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.user.putresendcancelinvitation({ + action: "resend", + email: "email", + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("EditUserPermission (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all_features_access: true, email: "inviteuser@example.com", privileges: [{}] }; + const rawResponseBody = { credit_notes: ["TEST-123"], invoice_id: "invoice_id", status: "OK" }; + server + .mockEndpoint() + .post("/organization/user/update/permissions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.editUserPermission({ + all_features_access: true, + email: "inviteuser@example.com", + privileges: [{}], + }); + expect(response).toEqual({ + credit_notes: ["TEST-123"], + invoice_id: "invoice_id", + status: "OK", + }); + }); + + test("EditUserPermission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { all_features_access: true, email: "email", privileges: [{}, {}] }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/organization/user/update/permissions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.user.editUserPermission({ + all_features_access: true, + email: "email", + privileges: [{}, {}], + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getUserPermission (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + email: "invitedUser@company.com", + privileges: [ + { feature: "Email campaign", permissions: ["Create / edit / delete", "Send / schedule / suspend"] }, + { feature: "Templates", permissions: ["Create / edit / delete", "Activate / deactivate"] }, + { feature: "SMS campaign", permissions: ["Create / edit / delete", "Send / schedule / suspend"] }, + { feature: "Facebook Ads", permissions: ["Schedule / pause"] }, + { feature: "Landing pages", permissions: ["All"] }, + { feature: "Workflows", permissions: ["Create / edit / delete", "Activate / deactivate / Pause"] }, + { feature: "Contacts", permissions: ["View", "Contact forms"] }, + { feature: "SMTP & API", permissions: ["SMTP", "API Keys", "Authorized IPs"] }, + { feature: "User management", permissions: ["None"] }, + { + feature: "Sales Platform", + permissions: [ + "Create / edit / delete owned deals and tasks", + "Manage deals and tasks from other users", + "Reports", + "Settings", + ], + }, + { feature: "Conversations", permissions: ["None"] }, + { + feature: "Senders, Domains & Dedicated IPs", + permissions: ["Senders management", "Domains management", "Dedicated IPs management"], + }, + { feature: "Push", permissions: ["View", "Create / edit / delete", "Send", "Settings"] }, + { + feature: "Companies", + permissions: [ + "Create / edit / delete owned companies", + "Manage companies from other users", + "Settings", + ], + }, + ], + status: "active", + }; + server + .mockEndpoint() + .get("/organization/user/email/permissions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.user.getUserPermission({ + email: "email", + }); + expect(response).toEqual({ + email: "invitedUser@company.com", + privileges: [ + { + feature: "Email campaign", + permissions: ["Create / edit / delete", "Send / schedule / suspend"], + }, + { + feature: "Templates", + permissions: ["Create / edit / delete", "Activate / deactivate"], + }, + { + feature: "SMS campaign", + permissions: ["Create / edit / delete", "Send / schedule / suspend"], + }, + { + feature: "Facebook Ads", + permissions: ["Schedule / pause"], + }, + { + feature: "Landing pages", + permissions: ["All"], + }, + { + feature: "Workflows", + permissions: ["Create / edit / delete", "Activate / deactivate / Pause"], + }, + { + feature: "Contacts", + permissions: ["View", "Contact forms"], + }, + { + feature: "SMTP & API", + permissions: ["SMTP", "API Keys", "Authorized IPs"], + }, + { + feature: "User management", + permissions: ["None"], + }, + { + feature: "Sales Platform", + permissions: [ + "Create / edit / delete owned deals and tasks", + "Manage deals and tasks from other users", + "Reports", + "Settings", + ], + }, + { + feature: "Conversations", + permissions: ["None"], + }, + { + feature: "Senders, Domains & Dedicated IPs", + permissions: ["Senders management", "Domains management", "Dedicated IPs management"], + }, + { + feature: "Push", + permissions: ["View", "Create / edit / delete", "Send", "Settings"], + }, + { + feature: "Companies", + permissions: [ + "Create / edit / delete owned companies", + "Manage companies from other users", + "Settings", + ], + }, + ], + status: "active", + }); + }); + + test("getUserPermission (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/organization/user/email/permissions") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.user.getUserPermission({ + email: "email", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); +}); diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts new file mode 100644 index 0000000..f9ad007 --- /dev/null +++ b/tests/wire/webhooks.test.ts @@ -0,0 +1,376 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("WebhooksClient", () => { + test("getWebhooks (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + webhooks: [ + { + auth: { token: "test-auth-token1234", type: "bearer" }, + batched: true, + channel: "email", + createdAt: "2016-07-18T12:30:09Z", + description: "Webhook triggered on campaign openings", + events: ["opened"], + headers: [{ key: "cf-secret", value: "test-header-value" }], + id: 9864, + modifiedAt: "2016-07-18T16:00:50Z", + type: "transactional", + url: "https://example.domain.com/webhook/events/kzfxxxxxxxx0uyo1", + }, + { + auth: { token: "test-auth-token1234", type: "bearer" }, + batched: true, + channel: "sms", + createdAt: "2017-02-20T14:30:00Z", + description: "Webhook triggered on campaign hard bounces", + events: ["hardBounces"], + headers: [{ key: "cf-secret", value: "test-header-value" }], + id: 22770, + modifiedAt: "2017-02-20T19:00:00Z", + type: "marketing", + url: "http://exmaple.domain.com/15kxxxxxn1", + }, + ], + }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.webhooks.getWebhooks(); + expect(response).toEqual({ + webhooks: [ + { + auth: { + token: "test-auth-token1234", + type: "bearer", + }, + batched: true, + channel: "email", + createdAt: "2016-07-18T12:30:09Z", + description: "Webhook triggered on campaign openings", + events: ["opened"], + headers: [ + { + key: "cf-secret", + value: "test-header-value", + }, + ], + id: 9864, + modifiedAt: "2016-07-18T16:00:50Z", + type: "transactional", + url: "https://example.domain.com/webhook/events/kzfxxxxxxxx0uyo1", + }, + { + auth: { + token: "test-auth-token1234", + type: "bearer", + }, + batched: true, + channel: "sms", + createdAt: "2017-02-20T14:30:00Z", + description: "Webhook triggered on campaign hard bounces", + events: ["hardBounces"], + headers: [ + { + key: "cf-secret", + value: "test-header-value", + }, + ], + id: 22770, + modifiedAt: "2017-02-20T19:00:00Z", + type: "marketing", + url: "http://exmaple.domain.com/15kxxxxxn1", + }, + ], + }); + }); + + test("getWebhooks (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.webhooks.getWebhooks(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createWebhook (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { events: ["sent"], url: "http://requestb.in/173lyyx1" }; + const rawResponseBody = { id: 5 }; + server + .mockEndpoint() + .post("/webhooks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.webhooks.createWebhook({ + events: ["sent"], + url: "http://requestb.in/173lyyx1", + }); + expect(response).toEqual({ + id: 5, + }); + }); + + test("createWebhook (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { events: ["sent", "sent"], url: "url" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/webhooks") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.createWebhook({ + events: ["sent", "sent"], + url: "url", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("exportWebhooksHistory (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { event: "invalid_parameter", notifyURL: "https://brevo.com", type: "transactional" }; + const rawResponseBody = { processId: 78 }; + server + .mockEndpoint() + .post("/webhooks/export") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.webhooks.exportWebhooksHistory({ + event: "invalid_parameter", + notifyURL: "https://brevo.com", + type: "transactional", + }); + expect(response).toEqual({ + processId: 78, + }); + }); + + test("exportWebhooksHistory (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { event: "invalid_parameter", notifyURL: "notifyURL", type: "transactional" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/webhooks/export") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.exportWebhooksHistory({ + event: "invalid_parameter", + notifyURL: "notifyURL", + type: "transactional", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getWebhook (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + auth: { token: "test-auth-token1234", type: "bearer" }, + batched: true, + channel: "sms", + createdAt: "2016-06-07T09:10:10Z", + description: "Webhook triggered on campaign openings and addition of lists", + events: ["listAdditions", "opened"], + headers: [{ key: "cf-secret", value: "test-header-value" }], + id: 7287, + modifiedAt: "2016-06-08T11:30:00Z", + type: "marketing", + url: "http://example.domain.com/1brxxxxxx5p1", + }; + server.mockEndpoint().get("/webhooks/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.webhooks.getWebhook({ + webhookId: 1000000, + }); + expect(response).toEqual({ + auth: { + token: "test-auth-token1234", + type: "bearer", + }, + batched: true, + channel: "sms", + createdAt: "2016-06-07T09:10:10Z", + description: "Webhook triggered on campaign openings and addition of lists", + events: ["listAdditions", "opened"], + headers: [ + { + key: "cf-secret", + value: "test-header-value", + }, + ], + id: 7287, + modifiedAt: "2016-06-08T11:30:00Z", + type: "marketing", + url: "http://example.domain.com/1brxxxxxx5p1", + }); + }); + + test("getWebhook (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/webhooks/1000000").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.webhooks.getWebhook({ + webhookId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getWebhook (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/webhooks/1000000").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.webhooks.getWebhook({ + webhookId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateWebhook (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server.mockEndpoint().put("/webhooks/1000000").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.webhooks.updateWebhook({ + webhookId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("updateWebhook (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/webhooks/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.updateWebhook({ + webhookId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateWebhook (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/webhooks/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.updateWebhook({ + webhookId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteWebhook (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/webhooks/1000000").respondWith().statusCode(200).build(); + + const response = await client.webhooks.deleteWebhook({ + webhookId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteWebhook (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/webhooks/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.deleteWebhook({ + webhookId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteWebhook (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/webhooks/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.webhooks.deleteWebhook({ + webhookId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tests/wire/whatsAppCampaigns.test.ts b/tests/wire/whatsAppCampaigns.test.ts new file mode 100644 index 0000000..ede5fac --- /dev/null +++ b/tests/wire/whatsAppCampaigns.test.ts @@ -0,0 +1,572 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Brevo from "../../src/api/index"; +import { BrevoClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("WhatsAppCampaignsClient", () => { + test("getWhatsAppCampaigns (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + campaigns: [ + { + campaignName: "campaign_22", + campaignStatus: "sent", + createdAt: "2017-05-01T12:30:00Z", + errorReason: "NONE", + id: 1672035851100690, + invalidatedContacts: 0, + modifiedAt: "2017-05-01T12:30:00Z", + readPercentage: 28.57, + scheduledAt: "2022-12-27T09:50:00Z", + stats: { delivered: 3, notSent: 4, read: 2, sent: 3, unsubscribe: 0 }, + templateId: "templateId", + }, + ], + count: 23, + }; + server.mockEndpoint().get("/whatsappCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.whatsAppCampaigns.getWhatsAppCampaigns(); + expect(response).toEqual({ + campaigns: [ + { + campaignName: "campaign_22", + campaignStatus: "sent", + createdAt: "2017-05-01T12:30:00Z", + errorReason: "NONE", + id: 1672035851100690, + invalidatedContacts: 0, + modifiedAt: "2017-05-01T12:30:00Z", + readPercentage: 28.57, + scheduledAt: "2022-12-27T09:50:00Z", + stats: { + delivered: 3, + notSent: 4, + read: 2, + sent: 3, + unsubscribe: 0, + }, + templateId: "templateId", + }, + ], + count: 23, + }); + }); + + test("getWhatsAppCampaigns (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/whatsappCampaigns").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.whatsAppCampaigns.getWhatsAppCampaigns(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createWhatsAppCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + name: "Test Campaign", + recipients: {}, + scheduledAt: "2017-06-01T12:30:00+02:00", + templateId: 19, + }; + const rawResponseBody = { id: 5 }; + server + .mockEndpoint() + .post("/whatsappCampaigns") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.whatsAppCampaigns.createWhatsAppCampaign({ + name: "Test Campaign", + recipients: {}, + scheduledAt: "2017-06-01T12:30:00+02:00", + templateId: 19, + }); + expect(response).toEqual({ + id: 5, + }); + }); + + test("createWhatsAppCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", recipients: {}, scheduledAt: "scheduledAt", templateId: 1 }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/whatsappCampaigns") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.createWhatsAppCampaign({ + name: "name", + recipients: {}, + scheduledAt: "scheduledAt", + templateId: 1, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getWhatsAppConfig (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + businessStatus: "verified", + phoneNumberNameStatus: "APPROVED", + phoneNumberQuality: "GREEN", + sendingLimit: "TIER_1K", + whatsappBusinessAccountId: "whatsappBusinessAccountId", + whatsappBusinessAccountStatus: "APPROVED", + }; + server + .mockEndpoint() + .get("/whatsappCampaigns/config") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.whatsAppCampaigns.getWhatsAppConfig(); + expect(response).toEqual({ + businessStatus: "verified", + phoneNumberNameStatus: "APPROVED", + phoneNumberQuality: "GREEN", + sendingLimit: "TIER_1K", + whatsappBusinessAccountId: "whatsappBusinessAccountId", + whatsappBusinessAccountStatus: "APPROVED", + }); + }); + + test("getWhatsAppConfig (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/whatsappCampaigns/config") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.getWhatsAppConfig(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createWhatsAppTemplate (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + bodyText: "making it look like readable English", + category: "MARKETING", + language: "en", + name: "Test template", + }; + const rawResponseBody = { id: 5 }; + server + .mockEndpoint() + .post("/whatsappCampaigns/template") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.whatsAppCampaigns.createWhatsAppTemplate({ + bodyText: "making it look like readable English", + category: "MARKETING", + language: "en", + name: "Test template", + }); + expect(response).toEqual({ + id: 5, + }); + }); + + test("createWhatsAppTemplate (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { bodyText: "bodyText", category: "MARKETING", language: "language", name: "name" }; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/whatsappCampaigns/template") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.createWhatsAppTemplate({ + bodyText: "bodyText", + category: "MARKETING", + language: "language", + name: "name", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getWhatsAppTemplates (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + count: 2, + templates: [ + { + category: "MARKETING", + createdAt: "2017-05-01T12:30:00Z", + errorReason: "NONE", + id: 235, + language: "en", + modifiedAt: "2017-05-01T12:30:00Z", + name: "campaign_22", + status: "approved", + }, + { + category: "MARKETING", + createdAt: "2017-0", + errorReason: "NONE", + id: 124, + language: "", + modifiedAt: "2017-05-01T12:30:00Z", + name: "test-template", + status: "draft", + }, + ], + }; + server + .mockEndpoint() + .get("/whatsappCampaigns/template-list") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.whatsAppCampaigns.getWhatsAppTemplates(); + expect(response).toEqual({ + count: 2, + templates: [ + { + category: "MARKETING", + createdAt: "2017-05-01T12:30:00Z", + errorReason: "NONE", + id: 235, + language: "en", + modifiedAt: "2017-05-01T12:30:00Z", + name: "campaign_22", + status: "approved", + }, + { + category: "MARKETING", + createdAt: "2017-0", + errorReason: "NONE", + id: 124, + language: "", + modifiedAt: "2017-05-01T12:30:00Z", + name: "test-template", + status: "draft", + }, + ], + }); + }); + + test("getWhatsAppTemplates (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/whatsappCampaigns/template-list") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.getWhatsAppTemplates(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("sendWhatsAppTemplateApproval (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server + .mockEndpoint() + .post("/whatsappCampaigns/template/approval/1000000") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.whatsAppCampaigns.sendWhatsAppTemplateApproval({ + templateId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("sendWhatsAppTemplateApproval (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/whatsappCampaigns/template/approval/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.sendWhatsAppTemplateApproval({ + templateId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getWhatsAppCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + campaignName: "Test WhatsApp Campaign", + campaignStatus: "sent", + createdAt: "2022-12-26T06:50:00Z", + id: 1672035851100690, + modifiedAt: "2022-12-26T08:50:00Z", + scheduledAt: "2022-12-27T09:50:00Z", + senderNumber: "senderNumber", + stats: { delivered: 3, notSent: 4, read: 2, sent: 3, unsubscribe: 0 }, + template: { + body_variables: [{ datatype: "text", default: "INVALID_HEADER", name: "FIRSTNAME" }], + button_type: "CALL_TO_ACTION", + category: "MARKETING", + components: [ + { text: "making it look like readable English.", type: "BODY" }, + { text: "Life is a long lesson in humility", type: "BUTTONS" }, + ], + contains_button: true, + display_header: false, + header_type: "text", + header_variables: [{ datatype: "text", default: "INVALID HEADER", name: "FIRSTNAME" }], + hide_footer: true, + language: "en", + name: "official_campaign8", + }, + }; + server + .mockEndpoint() + .get("/whatsappCampaigns/1000000") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.whatsAppCampaigns.getWhatsAppCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual({ + campaignName: "Test WhatsApp Campaign", + campaignStatus: "sent", + createdAt: "2022-12-26T06:50:00Z", + id: 1672035851100690, + modifiedAt: "2022-12-26T08:50:00Z", + scheduledAt: "2022-12-27T09:50:00Z", + senderNumber: "senderNumber", + stats: { + delivered: 3, + notSent: 4, + read: 2, + sent: 3, + unsubscribe: 0, + }, + template: { + body_variables: [ + { + datatype: "text", + default: "INVALID_HEADER", + name: "FIRSTNAME", + }, + ], + button_type: "CALL_TO_ACTION", + category: "MARKETING", + components: [ + { + text: "making it look like readable English.", + type: "BODY", + }, + { + text: "Life is a long lesson in humility", + type: "BUTTONS", + }, + ], + contains_button: true, + display_header: false, + header_type: "text", + header_variables: [ + { + datatype: "text", + default: "INVALID HEADER", + name: "FIRSTNAME", + }, + ], + hide_footer: true, + language: "en", + name: "official_campaign8", + }, + }); + }); + + test("getWhatsAppCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/whatsappCampaigns/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.getWhatsAppCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getWhatsAppCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .get("/whatsappCampaigns/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.getWhatsAppCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateWhatsAppCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .put("/whatsappCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.whatsAppCampaigns.updateWhatsAppCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("updateWhatsAppCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .put("/whatsappCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.updateWhatsAppCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteWhatsAppCampaign (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/whatsappCampaigns/1000000").respondWith().statusCode(200).build(); + + const response = await client.whatsAppCampaigns.deleteWhatsAppCampaign({ + campaignId: 1000000, + }); + expect(response).toEqual(undefined); + }); + + test("deleteWhatsAppCampaign (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/whatsappCampaigns/1000000") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.deleteWhatsAppCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteWhatsAppCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/whatsappCampaigns/1000000") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.whatsAppCampaigns.deleteWhatsAppCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); +}); diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..d762767 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "extendedDiagnostics": true, + "strict": true, + "target": "ES6", + "moduleResolution": "node", + "esModuleInterop": true, + "skipLibCheck": true, + "declaration": true, + "outDir": "dist", + "rootDir": "src", + "baseUrl": "src", + "isolatedModules": true, + "isolatedDeclarations": true + }, + "include": ["src"], + "exclude": [] +} diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json new file mode 100644 index 0000000..5c11446 --- /dev/null +++ b/tsconfig.cjs.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist/cjs" + }, + "include": ["src"], + "exclude": [] +} diff --git a/tsconfig.esm.json b/tsconfig.esm.json new file mode 100644 index 0000000..6ce9097 --- /dev/null +++ b/tsconfig.esm.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm", + "verbatimModuleSyntax": true + }, + "include": ["src"], + "exclude": [] +} diff --git a/tsconfig.json b/tsconfig.json index 0ed6bd1..d77fdf0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,24 +1,3 @@ { - "compilerOptions": { - "module": "commonjs", - "noImplicitAny": false, - "target": "ES6", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "strict": true, - "moduleResolution": "node", - "removeComments": true, - "sourceMap": true, - "noLib": false, - "declaration": true, - "lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"], - "outDir": "dist", - "typeRoots": [ - "node_modules/@types" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] + "extends": "./tsconfig.cjs.json" } diff --git a/vitest.config.mts b/vitest.config.mts new file mode 100644 index 0000000..ba2ec4f --- /dev/null +++ b/vitest.config.mts @@ -0,0 +1,28 @@ +import { defineConfig } from "vitest/config"; +export default defineConfig({ + test: { + projects: [ + { + test: { + globals: true, + name: "unit", + environment: "node", + root: "./tests", + include: ["**/*.test.{js,ts,jsx,tsx}"], + exclude: ["wire/**"], + setupFiles: ["./setup.ts"], + }, + }, + { + test: { + globals: true, + name: "wire", + environment: "node", + root: "./tests/wire", + setupFiles: ["../setup.ts", "../mock-server/setup.ts"], + }, + }, + ], + passWithNoTests: true, + }, +}); diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index bce30fb..0000000 --- a/yarn.lock +++ /dev/null @@ -1,853 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@eslint-community/eslint-utils@^4.2.0": - "integrity" "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==" - "resolved" "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz" - "version" "4.4.0" - dependencies: - "eslint-visitor-keys" "^3.3.0" - -"@eslint-community/regexpp@^4.6.1": - "integrity" "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==" - "resolved" "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz" - "version" "4.10.1" - -"@eslint/eslintrc@^2.1.4": - "integrity" "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==" - "resolved" "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz" - "version" "2.1.4" - dependencies: - "ajv" "^6.12.4" - "debug" "^4.3.2" - "espree" "^9.6.0" - "globals" "^13.19.0" - "ignore" "^5.2.0" - "import-fresh" "^3.2.1" - "js-yaml" "^4.1.0" - "minimatch" "^3.1.2" - "strip-json-comments" "^3.1.1" - -"@eslint/js@8.57.0": - "integrity" "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==" - "resolved" "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz" - "version" "8.57.0" - -"@humanwhocodes/config-array@^0.11.14": - "integrity" "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==" - "resolved" "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz" - "version" "0.11.14" - dependencies: - "@humanwhocodes/object-schema" "^2.0.2" - "debug" "^4.3.1" - "minimatch" "^3.0.5" - -"@humanwhocodes/module-importer@^1.0.1": - "integrity" "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==" - "resolved" "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz" - "version" "1.0.1" - -"@humanwhocodes/object-schema@^2.0.2": - "integrity" "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==" - "resolved" "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz" - "version" "2.0.3" - -"@nodelib/fs.scandir@2.1.5": - "integrity" "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==" - "resolved" "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" - "version" "2.1.5" - dependencies: - "@nodelib/fs.stat" "2.0.5" - "run-parallel" "^1.1.9" - -"@nodelib/fs.stat@2.0.5": - "integrity" "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" - "resolved" "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" - "version" "2.0.5" - -"@nodelib/fs.walk@^1.2.8": - "integrity" "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==" - "resolved" "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" - "version" "1.2.8" - dependencies: - "@nodelib/fs.scandir" "2.1.5" - "fastq" "^1.6.0" - -"@types/bluebird@^3.5.33": - "integrity" "sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==" - "resolved" "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.42.tgz" - "version" "3.5.42" - -"@types/node@^12.20.55": - "integrity" "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" - "resolved" "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz" - "version" "12.20.55" - -"@ungap/structured-clone@^1.2.0": - "integrity" "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" - "resolved" "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz" - "version" "1.2.0" - -"acorn-jsx@^5.3.2": - "integrity" "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==" - "resolved" "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" - "version" "5.3.2" - -"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", "acorn@^8.9.0": - "integrity" "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==" - "resolved" "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz" - "version" "8.12.0" - -"ajv@^6.12.4": - "integrity" "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==" - "resolved" "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" - "version" "6.12.6" - dependencies: - "fast-deep-equal" "^3.1.1" - "fast-json-stable-stringify" "^2.0.0" - "json-schema-traverse" "^0.4.1" - "uri-js" "^4.2.2" - -"ansi-regex@^5.0.1": - "integrity" "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - "version" "5.0.1" - -"ansi-styles@^4.1.0": - "integrity" "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==" - "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - "version" "4.3.0" - dependencies: - "color-convert" "^2.0.1" - -"argparse@^2.0.1": - "integrity" "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - "resolved" "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" - "version" "2.0.1" - -"asynckit@^0.4.0": - "integrity" "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - "resolved" "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" - "version" "0.4.0" - -"axios@^1.6.8": - "integrity" "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==" - "resolved" "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz" - "version" "1.11.0" - dependencies: - "follow-redirects" "^1.15.6" - "form-data" "^4.0.4" - "proxy-from-env" "^1.1.0" - -"balanced-match@^1.0.0": - "integrity" "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - "resolved" "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - "version" "1.0.2" - -"bluebird@^3.5.0": - "integrity" "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" - "resolved" "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" - "version" "3.7.2" - -"brace-expansion@^1.1.7": - "integrity" "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==" - "resolved" "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - "version" "1.1.11" - dependencies: - "balanced-match" "^1.0.0" - "concat-map" "0.0.1" - -"call-bind-apply-helpers@^1.0.1", "call-bind-apply-helpers@^1.0.2": - "integrity" "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==" - "resolved" "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz" - "version" "1.0.2" - dependencies: - "es-errors" "^1.3.0" - "function-bind" "^1.1.2" - -"callsites@^3.0.0": - "integrity" "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" - "resolved" "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" - "version" "3.1.0" - -"chalk@^4.0.0": - "integrity" "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==" - "resolved" "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - "version" "4.1.2" - dependencies: - "ansi-styles" "^4.1.0" - "supports-color" "^7.1.0" - -"color-convert@^2.0.1": - "integrity" "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==" - "resolved" "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - "version" "2.0.1" - dependencies: - "color-name" "~1.1.4" - -"color-name@~1.1.4": - "integrity" "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - "resolved" "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - "version" "1.1.4" - -"combined-stream@^1.0.8": - "integrity" "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==" - "resolved" "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" - "version" "1.0.8" - dependencies: - "delayed-stream" "~1.0.0" - -"concat-map@0.0.1": - "integrity" "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - "resolved" "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - "version" "0.0.1" - -"cross-spawn@^7.0.2": - "integrity" "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==" - "resolved" "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - "version" "7.0.3" - dependencies: - "path-key" "^3.1.0" - "shebang-command" "^2.0.0" - "which" "^2.0.1" - -"debug@^4.3.1", "debug@^4.3.2": - "integrity" "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==" - "resolved" "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz" - "version" "4.3.5" - dependencies: - "ms" "2.1.2" - -"deep-is@^0.1.3": - "integrity" "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - "resolved" "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" - "version" "0.1.4" - -"delayed-stream@~1.0.0": - "integrity" "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" - "resolved" "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" - "version" "1.0.0" - -"doctrine@^3.0.0": - "integrity" "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==" - "resolved" "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" - "version" "3.0.0" - dependencies: - "esutils" "^2.0.2" - -"dunder-proto@^1.0.1": - "integrity" "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==" - "resolved" "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz" - "version" "1.0.1" - dependencies: - "call-bind-apply-helpers" "^1.0.1" - "es-errors" "^1.3.0" - "gopd" "^1.2.0" - -"es-define-property@^1.0.1": - "integrity" "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" - "resolved" "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz" - "version" "1.0.1" - -"es-errors@^1.3.0": - "integrity" "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" - "resolved" "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz" - "version" "1.3.0" - -"es-object-atoms@^1.0.0", "es-object-atoms@^1.1.1": - "integrity" "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==" - "resolved" "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz" - "version" "1.1.1" - dependencies: - "es-errors" "^1.3.0" - -"es-set-tostringtag@^2.1.0": - "integrity" "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==" - "resolved" "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz" - "version" "2.1.0" - dependencies: - "es-errors" "^1.3.0" - "get-intrinsic" "^1.2.6" - "has-tostringtag" "^1.0.2" - "hasown" "^2.0.2" - -"escape-string-regexp@^4.0.0": - "integrity" "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" - "resolved" "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" - "version" "4.0.0" - -"eslint-scope@^7.2.2": - "integrity" "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==" - "resolved" "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz" - "version" "7.2.2" - dependencies: - "esrecurse" "^4.3.0" - "estraverse" "^5.2.0" - -"eslint-visitor-keys@^3.3.0", "eslint-visitor-keys@^3.4.1", "eslint-visitor-keys@^3.4.3": - "integrity" "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==" - "resolved" "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" - "version" "3.4.3" - -"eslint@^6.0.0 || ^7.0.0 || >=8.0.0", "eslint@^8.47.0": - "integrity" "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==" - "resolved" "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz" - "version" "8.57.0" - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.0" - "@humanwhocodes/config-array" "^0.11.14" - "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" - "ajv" "^6.12.4" - "chalk" "^4.0.0" - "cross-spawn" "^7.0.2" - "debug" "^4.3.2" - "doctrine" "^3.0.0" - "escape-string-regexp" "^4.0.0" - "eslint-scope" "^7.2.2" - "eslint-visitor-keys" "^3.4.3" - "espree" "^9.6.1" - "esquery" "^1.4.2" - "esutils" "^2.0.2" - "fast-deep-equal" "^3.1.3" - "file-entry-cache" "^6.0.1" - "find-up" "^5.0.0" - "glob-parent" "^6.0.2" - "globals" "^13.19.0" - "graphemer" "^1.4.0" - "ignore" "^5.2.0" - "imurmurhash" "^0.1.4" - "is-glob" "^4.0.0" - "is-path-inside" "^3.0.3" - "js-yaml" "^4.1.0" - "json-stable-stringify-without-jsonify" "^1.0.1" - "levn" "^0.4.1" - "lodash.merge" "^4.6.2" - "minimatch" "^3.1.2" - "natural-compare" "^1.4.0" - "optionator" "^0.9.3" - "strip-ansi" "^6.0.1" - "text-table" "^0.2.0" - -"espree@^9.6.0", "espree@^9.6.1": - "integrity" "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==" - "resolved" "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz" - "version" "9.6.1" - dependencies: - "acorn" "^8.9.0" - "acorn-jsx" "^5.3.2" - "eslint-visitor-keys" "^3.4.1" - -"esquery@^1.4.2": - "integrity" "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==" - "resolved" "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz" - "version" "1.5.0" - dependencies: - "estraverse" "^5.1.0" - -"esrecurse@^4.3.0": - "integrity" "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==" - "resolved" "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" - "version" "4.3.0" - dependencies: - "estraverse" "^5.2.0" - -"estraverse@^5.1.0", "estraverse@^5.2.0": - "integrity" "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" - "resolved" "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" - "version" "5.3.0" - -"esutils@^2.0.2": - "integrity" "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" - "resolved" "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" - "version" "2.0.3" - -"fast-deep-equal@^3.1.1", "fast-deep-equal@^3.1.3": - "integrity" "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - "resolved" "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" - "version" "3.1.3" - -"fast-json-stable-stringify@^2.0.0": - "integrity" "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - "resolved" "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" - "version" "2.1.0" - -"fast-levenshtein@^2.0.6": - "integrity" "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - "resolved" "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" - "version" "2.0.6" - -"fastq@^1.6.0": - "integrity" "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==" - "resolved" "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz" - "version" "1.17.1" - dependencies: - "reusify" "^1.0.4" - -"file-entry-cache@^6.0.1": - "integrity" "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==" - "resolved" "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz" - "version" "6.0.1" - dependencies: - "flat-cache" "^3.0.4" - -"find-up@^5.0.0": - "integrity" "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==" - "resolved" "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" - "version" "5.0.0" - dependencies: - "locate-path" "^6.0.0" - "path-exists" "^4.0.0" - -"flat-cache@^3.0.4": - "integrity" "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==" - "resolved" "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz" - "version" "3.2.0" - dependencies: - "flatted" "^3.2.9" - "keyv" "^4.5.3" - "rimraf" "^3.0.2" - -"flatted@^3.2.9": - "integrity" "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" - "resolved" "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz" - "version" "3.3.1" - -"follow-redirects@^1.15.6": - "integrity" "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==" - "resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz" - "version" "1.15.9" - -"form-data@^4.0.4": - "integrity" "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==" - "resolved" "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz" - "version" "4.0.4" - dependencies: - "asynckit" "^0.4.0" - "combined-stream" "^1.0.8" - "es-set-tostringtag" "^2.1.0" - "hasown" "^2.0.2" - "mime-types" "^2.1.12" - -"fs.realpath@^1.0.0": - "integrity" "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - "version" "1.0.0" - -"function-bind@^1.1.2": - "integrity" "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" - "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" - "version" "1.1.2" - -"get-intrinsic@^1.2.6": - "integrity" "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==" - "resolved" "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz" - "version" "1.3.0" - dependencies: - "call-bind-apply-helpers" "^1.0.2" - "es-define-property" "^1.0.1" - "es-errors" "^1.3.0" - "es-object-atoms" "^1.1.1" - "function-bind" "^1.1.2" - "get-proto" "^1.0.1" - "gopd" "^1.2.0" - "has-symbols" "^1.1.0" - "hasown" "^2.0.2" - "math-intrinsics" "^1.1.0" - -"get-proto@^1.0.1": - "integrity" "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==" - "resolved" "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz" - "version" "1.0.1" - dependencies: - "dunder-proto" "^1.0.1" - "es-object-atoms" "^1.0.0" - -"glob-parent@^6.0.2": - "integrity" "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==" - "resolved" "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz" - "version" "6.0.2" - dependencies: - "is-glob" "^4.0.3" - -"glob@^7.1.3": - "integrity" "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==" - "resolved" "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" - "version" "7.2.3" - dependencies: - "fs.realpath" "^1.0.0" - "inflight" "^1.0.4" - "inherits" "2" - "minimatch" "^3.1.1" - "once" "^1.3.0" - "path-is-absolute" "^1.0.0" - -"globals@^13.19.0": - "integrity" "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==" - "resolved" "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz" - "version" "13.24.0" - dependencies: - "type-fest" "^0.20.2" - -"gopd@^1.2.0": - "integrity" "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" - "resolved" "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz" - "version" "1.2.0" - -"graphemer@^1.4.0": - "integrity" "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" - "resolved" "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" - "version" "1.4.0" - -"has-flag@^4.0.0": - "integrity" "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - "resolved" "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - "version" "4.0.0" - -"has-symbols@^1.0.3", "has-symbols@^1.1.0": - "integrity" "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" - "resolved" "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz" - "version" "1.1.0" - -"has-tostringtag@^1.0.2": - "integrity" "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==" - "resolved" "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz" - "version" "1.0.2" - dependencies: - "has-symbols" "^1.0.3" - -"hasown@^2.0.2": - "integrity" "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==" - "resolved" "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz" - "version" "2.0.2" - dependencies: - "function-bind" "^1.1.2" - -"ignore@^5.2.0": - "integrity" "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==" - "resolved" "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz" - "version" "5.3.1" - -"import-fresh@^3.2.1": - "integrity" "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==" - "resolved" "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" - "version" "3.3.0" - dependencies: - "parent-module" "^1.0.0" - "resolve-from" "^4.0.0" - -"imurmurhash@^0.1.4": - "integrity" "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" - "resolved" "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" - "version" "0.1.4" - -"inflight@^1.0.4": - "integrity" "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==" - "resolved" "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - "version" "1.0.6" - dependencies: - "once" "^1.3.0" - "wrappy" "1" - -"inherits@2": - "integrity" "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - "version" "2.0.4" - -"is-extglob@^2.1.1": - "integrity" "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - "resolved" "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - "version" "2.1.1" - -"is-glob@^4.0.0", "is-glob@^4.0.3": - "integrity" "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==" - "resolved" "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" - "version" "4.0.3" - dependencies: - "is-extglob" "^2.1.1" - -"is-path-inside@^3.0.3": - "integrity" "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" - "resolved" "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" - "version" "3.0.3" - -"isexe@^2.0.0": - "integrity" "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - "resolved" "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - "version" "2.0.0" - -"js-yaml@^4.1.0": - "integrity" "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==" - "resolved" "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" - "version" "4.1.0" - dependencies: - "argparse" "^2.0.1" - -"json-buffer@3.0.1": - "integrity" "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" - "resolved" "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" - "version" "3.0.1" - -"json-schema-traverse@^0.4.1": - "integrity" "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - "resolved" "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" - "version" "0.4.1" - -"json-stable-stringify-without-jsonify@^1.0.1": - "integrity" "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" - "resolved" "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" - "version" "1.0.1" - -"keyv@^4.5.3": - "integrity" "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==" - "resolved" "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz" - "version" "4.5.4" - dependencies: - "json-buffer" "3.0.1" - -"levn@^0.4.1": - "integrity" "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==" - "resolved" "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" - "version" "0.4.1" - dependencies: - "prelude-ls" "^1.2.1" - "type-check" "~0.4.0" - -"locate-path@^6.0.0": - "integrity" "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==" - "resolved" "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" - "version" "6.0.0" - dependencies: - "p-locate" "^5.0.0" - -"lodash.merge@^4.6.2": - "integrity" "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - "resolved" "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" - "version" "4.6.2" - -"math-intrinsics@^1.1.0": - "integrity" "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" - "resolved" "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz" - "version" "1.1.0" - -"mime-db@1.52.0": - "integrity" "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" - "resolved" "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" - "version" "1.52.0" - -"mime-types@^2.1.12": - "integrity" "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==" - "resolved" "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" - "version" "2.1.35" - dependencies: - "mime-db" "1.52.0" - -"minimatch@^3.0.5", "minimatch@^3.1.1", "minimatch@^3.1.2": - "integrity" "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==" - "resolved" "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - "version" "3.1.2" - dependencies: - "brace-expansion" "^1.1.7" - -"ms@2.1.2": - "integrity" "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - "resolved" "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - "version" "2.1.2" - -"natural-compare@^1.4.0": - "integrity" "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" - "resolved" "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" - "version" "1.4.0" - -"once@^1.3.0": - "integrity" "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==" - "resolved" "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - "version" "1.4.0" - dependencies: - "wrappy" "1" - -"optionator@^0.9.3": - "integrity" "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==" - "resolved" "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz" - "version" "0.9.4" - dependencies: - "deep-is" "^0.1.3" - "fast-levenshtein" "^2.0.6" - "levn" "^0.4.1" - "prelude-ls" "^1.2.1" - "type-check" "^0.4.0" - "word-wrap" "^1.2.5" - -"p-limit@^3.0.2": - "integrity" "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==" - "resolved" "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" - "version" "3.1.0" - dependencies: - "yocto-queue" "^0.1.0" - -"p-locate@^5.0.0": - "integrity" "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==" - "resolved" "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" - "version" "5.0.0" - dependencies: - "p-limit" "^3.0.2" - -"parent-module@^1.0.0": - "integrity" "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==" - "resolved" "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" - "version" "1.0.1" - dependencies: - "callsites" "^3.0.0" - -"path-exists@^4.0.0": - "integrity" "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - "resolved" "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - "version" "4.0.0" - -"path-is-absolute@^1.0.0": - "integrity" "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" - "resolved" "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - "version" "1.0.1" - -"path-key@^3.1.0": - "integrity" "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" - "resolved" "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - "version" "3.1.1" - -"prelude-ls@^1.2.1": - "integrity" "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" - "resolved" "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" - "version" "1.2.1" - -"proxy-from-env@^1.1.0": - "integrity" "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - "resolved" "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" - "version" "1.1.0" - -"punycode@^2.1.0": - "integrity" "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" - "resolved" "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" - "version" "2.3.1" - -"queue-microtask@^1.2.2": - "integrity" "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" - "resolved" "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" - "version" "1.2.3" - -"resolve-from@^4.0.0": - "integrity" "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" - "resolved" "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" - "version" "4.0.0" - -"reusify@^1.0.4": - "integrity" "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - "resolved" "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" - "version" "1.0.4" - -"rewire@^7.0.0": - "integrity" "sha512-DyyNyzwMtGYgu0Zl/ya0PR/oaunM+VuCuBxCuhYJHHaV0V+YvYa3bBGxb5OZ71vndgmp1pYY8F4YOwQo1siRGw==" - "resolved" "https://registry.npmjs.org/rewire/-/rewire-7.0.0.tgz" - "version" "7.0.0" - dependencies: - "eslint" "^8.47.0" - -"rimraf@^3.0.2": - "integrity" "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==" - "resolved" "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" - "version" "3.0.2" - dependencies: - "glob" "^7.1.3" - -"run-parallel@^1.1.9": - "integrity" "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==" - "resolved" "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" - "version" "1.2.0" - dependencies: - "queue-microtask" "^1.2.2" - -"shebang-command@^2.0.0": - "integrity" "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==" - "resolved" "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - "version" "2.0.0" - dependencies: - "shebang-regex" "^3.0.0" - -"shebang-regex@^3.0.0": - "integrity" "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" - "resolved" "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - "version" "3.0.0" - -"strip-ansi@^6.0.1": - "integrity" "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==" - "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - "version" "6.0.1" - dependencies: - "ansi-regex" "^5.0.1" - -"strip-json-comments@^3.1.1": - "integrity" "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" - "resolved" "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" - "version" "3.1.1" - -"supports-color@^7.1.0": - "integrity" "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==" - "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - "version" "7.2.0" - dependencies: - "has-flag" "^4.0.0" - -"text-table@^0.2.0": - "integrity" "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" - "resolved" "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" - "version" "0.2.0" - -"type-check@^0.4.0", "type-check@~0.4.0": - "integrity" "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==" - "resolved" "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" - "version" "0.4.0" - dependencies: - "prelude-ls" "^1.2.1" - -"type-fest@^0.20.2": - "integrity" "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" - "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" - "version" "0.20.2" - -"typescript@^4.0": - "integrity" "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==" - "resolved" "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz" - "version" "4.9.5" - -"uri-js@^4.2.2": - "integrity" "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==" - "resolved" "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" - "version" "4.4.1" - dependencies: - "punycode" "^2.1.0" - -"which@^2.0.1": - "integrity" "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==" - "resolved" "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - "version" "2.0.2" - dependencies: - "isexe" "^2.0.0" - -"word-wrap@^1.2.5": - "integrity" "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==" - "resolved" "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz" - "version" "1.2.5" - -"wrappy@1": - "integrity" "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - "resolved" "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - "version" "1.0.2" - -"yocto-queue@^0.1.0": - "integrity" "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" - "resolved" "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" - "version" "0.1.0" From 941c58ab35cc2e2a99a3e754d19654d0e0d842d8 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 17:05:50 +0000 Subject: [PATCH 02/33] SDK regeneration --- .fern/metadata.json | 2 +- README.md | 1052 ------------------------------------------- package.json | 2 +- src/BaseClient.ts | 4 +- src/version.ts | 2 +- 5 files changed, 5 insertions(+), 1057 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 415c736..3af2e8f 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "0.0.52" + "sdkVersion": "0.0.53" } diff --git a/README.md b/README.md index 1a50370..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,1052 +0,0 @@ -# Brevo TypeScript Library - -[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fgetbrevo%2Fbrevo-node) -[![npm shield](https://img.shields.io/npm/v/)](https://www.npmjs.com/package/) - -The Brevo TypeScript library provides convenient access to the Brevo APIs from TypeScript. - -## Table of Contents - -- [Overview](#overview) -- [Node Js Implementation](#node-js-implementation) -- [Type Script Implementation](#type-script-implementation) -- [Support](#support) -- [License](#license) -- [Installation](#installation) -- [Reference](#reference) -- [Usage](#usage) -- [Request and Response Types](#request-and-response-types) -- [Exception Handling](#exception-handling) -- [File Uploads](#file-uploads) -- [Binary Response](#binary-response) -- [Advanced](#advanced) - - [Additional Headers](#additional-headers) - - [Additional Query String Parameters](#additional-query-string-parameters) - - [Retries](#retries) - - [Timeouts](#timeouts) - - [Aborting Requests](#aborting-requests) - - [Access Raw Response Data](#access-raw-response-data) - - [Logging](#logging) - - [Runtime Compatibility](#runtime-compatibility) -- [Contributing](#contributing) - -## Overview - -Brevo's API exposes the entire Brevo features via a standardized programmatic interface. Please refer to the full [documentation](https://developers.brevo.com) to see all the supported operations. - -Brevo's API matches the [OpenAPI v2 definition](https://www.openapis.org/). The specification can be downloaded [here](https://api.brevo.com/v3/swagger_definition_v3.yml). - -Our current library is not fully compatible with all modern Node.js and TypeScript environments. To help you integrate Brevo into your applications, we're providing both plain Node.js and TypeScript-specific implementation approaches below while we work on the next generation of our SDK. - -## Node.js Implementation - -### Send Transactional Email - -#### Installation - -```bash -npm i @getbrevo/brevo --save -``` - -#### Import packages - -```javascript -import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; -``` - -#### Instantiate API with your credentials - -```javascript -let emailAPI = new TransactionalEmailsApi(); -emailAPI.authentications.apiKey.apiKey = "xkeysib-xxxxxxxxxxxxxxxxxxxxx" -``` - -#### Build your message - -```javascript -let message = new SendSmtpEmail(); -message.subject = "First email"; -message.textContent = "Hello world!"; -message.sender = { name: "John Doe", email: "john.doe@example.com" }; -message.to = [{ email: "jane.smith@example.com", name: "Jane Smith" }]; -``` - -#### Send the message - -```javascript -emailAPI.sendTransacEmail(message) -``` - -#### (Optional) Log the response - -```javascript -emailAPI.sendTransacEmail(message).then(res => { - console.log(JSON.stringify(res.body)); -}).catch(err => { - console.error("Error sending email:", err.body); -}); -``` - -### Create Contact - -#### Installation - -```bash -npm i @getbrevo/brevo --save -``` - -#### Import packages - -```javascript -import { CreateContact, ContactsApi } from "@getbrevo/brevo"; -``` - -#### Instantiate API with your credentials - -```javascript -let contactAPI = new ContactsApi(); -contactAPI.authentications.apiKey.apiKey = "xkeysib-xxxxxx" -``` - -#### Build your contact - -```javascript -let contact = new CreateContact(); -contact.email = "alice.johnson@example.com"; -contact.attributes = { - FIRSTNAME: "Alice", - LASTNAME: "Johnson", -}; -``` - -#### Create the contact - -```javascript -contactAPI.createContact(contact).then(res => { - console.log(JSON.stringify(res.body)); -}).catch(err => { - console.error("Error creating contact:", err.body); -}); -``` - -## TypeScript Implementation - -### Recommended tsconfig.json Settings - -We recommend using the following TypeScript configuration for optimal compatibility: - -```json -{ - "compilerOptions": { - "target": "es2020", - "module": "commonjs", - "outDir": "dist", - "rootDir": "src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true - }, - "include": ["src"] -} -``` - -### Send Transactional Email - -#### Installation - -```bash -npm i @getbrevo/brevo --save -``` - -#### Import packages - -```typescript -import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; -``` - -#### Instantiate API with your credentials - -```typescript -let emailAPI = new TransactionalEmailsApi(); -(emailAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxxxxxxxxxxxxxx"; -``` - -#### Build your message - -```typescript -let message = new SendSmtpEmail(); -message.subject = "First email"; -message.textContent = "Hello world!"; -message.sender = { name: "Bob Wilson", email: "bob.wilson@example.com" }; -message.to = [{ email: "sarah.davis@example.com", name: "Sarah Davis" }]; -``` - -#### Send the message - -```typescript -emailAPI.sendTransacEmail(message) -``` - -#### (Optional) Log the response - -```typescript -emailAPI - .sendTransacEmail(message) - .then((res) => { - console.log(JSON.stringify(res.body)); - }) - .catch((err) => { - console.error("Error sending email:", err.body); - }); -``` - -### Create Contact - -#### Installation - -```bash -npm i @getbrevo/brevo --save -``` - -#### Import packages - -```typescript -import { CreateContact, ContactsApi } from "@getbrevo/brevo"; -``` - -#### Instantiate API with your credentials - -```typescript -let contactAPI = new ContactsApi(); -(contactAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxx" -``` - -#### Build your contact - -```typescript -let contact = new CreateContact(); -contact.email = "michael.brown@example.com"; -contact.attributes = { - FIRSTNAME: { value: "Michael" }, - LASTNAME: { value: "Brown" }, -}; -``` - -#### Create the contact - -```typescript -contactAPI.createContact(contact).then(res => { - console.log(JSON.stringify(res.body)); -}).catch(err => { - console.error("Error creating contact:", err.body); -}); -``` - -# Concerning v3.0.0 and above: -> [!IMPORTANT] -> There has been a change in the usage of this library after v3.0.0 which is not backward compatible. - -### Installation - -```npm i @getbrevo/brevo --save``` - -### Import packages - -```import { CreateContact, ContactsApi } from "@getbrevo/brevo";``` - -### Instantiate API with your credentials - -``` -let contactAPI = new ContactsApi(); -(contactAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxx"; -``` - -### Build your contact - -```let contact = new CreateContact(); -contact.email = "michael.brown@example.com"; -contact.attributes = { - FIRSTNAME: { value: "Michael" }, - LASTNAME: { value: "Brown" } -}; -``` - -### Create the contact - -```contactAPI.createContact(contact).then(res => { - console.log(JSON.stringify(res.body)); -}).catch(err => { - console.error("Error creating contact:", err.body); -}); -``` - -### Similar other examples: - -```typescript - -import { TransactionalEmailsApi, TransactionalEmailsApiApiKeys } from '@getbrevo/brevo'; - -const transactionalEmailsApi = new TransactionalEmailsApi(); -transactionalEmailsApi.setApiKey(TransactionalEmailsApiApiKeys.apiKey, 'xkeysib-API_KEY'); - -async function sendTransactionalEmail() { - try { - const result = await transactionalEmailsApi.sendTransacEmail({ - to: [ - { email: 'sampleemail@gmail.com', name: 'John doe' }, - ], - subject: 'Hello from Brevo SDK!', - htmlContent: '

This is a transactional email sent using the Brevo SDK.

', - textContent: 'This is a transactional email sent using the Brevo SDK.', - sender: { email: 'sampleemail@gmail.com', name: 'John doe' }, - }); - console.log('Email sent! Message ID:', result.body.messageId); - } catch (error) { - console.error('Failed to send email:', error); - } -} - -sendTransactionalEmail(); -``` - -```typescript - -import { DealsApi, DealsApiApiKeys } from '@getbrevo/brevo'; - -const dealsApi = new DealsApi(); -dealsApi.setApiKey(DealsApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); - -async function getDeals() { - try { - const response = await dealsApi.crmDealsGet() - console.log('Deals info:', response.body); - } catch (error) { - console.error('Failed to get account info:', error); - } -} - -getDeals(); -``` - -```typescript - -import { AccountApi, AccountApiApiKeys } from '@getbrevo/brevo'; - -const accountApi = new AccountApi(); -accountApi.setApiKey(AccountApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); - -async function getAccount() { - try { - const response = await accountApi.getAccount(); - console.log('Account info:', response.body); - } catch (error) { - console.error('Failed to get account info:', error); - } -} - -getAccount(); -``` - -```typescript - -import { ContactsApi, ContactsApiApiKeys } from '@getbrevo/brevo'; - -const contactsApi = new ContactsApi(); -contactsApi.setApiKey(ContactsApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); - -async function getContacts(limit: number, offset: number) { - try { - const result = await contactsApi.getContacts(limit, offset); - console.log('Contacts:', result.body); - } catch (error) { - console.error('Failed to get contacts:', error); - } -} - -getContacts(10, 0); // Example: get first 10 contacts -``` - - -## Support - -For questions and support, please refer to our [documentation](https://developers.brevo.com) or contact our support team. - -## License - -This SDK is distributed under the MIT License. - -## Installation - -```sh -npm i -s -``` - -## Reference - -A full reference for this library is available [here](https://github.com/getbrevo/brevo-node/blob/HEAD/./reference.md). - -## Usage - -Instantiate and use the client with the following: - -```typescript -import { BrevoClient } from ""; - -const client = new BrevoClient({ apiKey: "YOUR_API_KEY" }); -await client.masterAccount.createANewGroupOfSubAccounts({ - groupName: "My group" -}); -``` - -## Request and Response Types - -The SDK exports all request and response types as TypeScript interfaces. Simply import them with the -following namespace: - -```typescript -import { Brevo } from "Brevo"; - -const request: Brevo.GetAccountActivityRequest = { - ... -}; -``` - -## Exception Handling - -When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error -will be thrown. - -```typescript -import { BrevoError } from "Brevo"; - -try { - await client.masterAccount.createANewGroupOfSubAccounts(...); -} catch (err) { - if (err instanceof BrevoError) { - console.log(err.statusCode); - console.log(err.message); - console.log(err.body); - console.log(err.rawResponse); - } -} -``` - -## File Uploads - -You can upload files using the client: - -```typescript -import { createReadStream } from "fs"; -import { BrevoClient } from ""; - -const client = new BrevoClient({ apiKey: "YOUR_API_KEY" }); -await client.companies.importCompaniesCreationAndUpdation({}); -``` -The client accepts a variety of types for file upload parameters: -* Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream` -* Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array` - -### Metadata - -You can configure metadata when uploading a file: -```typescript -const file: Uploadable.WithMetadata = { - data: createReadStream("path/to/file"), - filename: "my-file", // optional - contentType: "audio/mpeg", // optional - contentLength: 1949, // optional -}; -``` - -Alternatively, you can upload a file directly from a file path: -```typescript -const file : Uploadable.FromPath = { - path: "path/to/file", - filename: "my-file", // optional - contentType: "audio/mpeg", // optional - contentLength: 1949, // optional -}; -``` - -The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically. -For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory. - - -## Binary Response - -You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data: - -```typescript -const response = await client.inboundParsing.getInboundEmailAttachment(...); -const stream: ReadableStream = response.stream(); -// const arrayBuffer: ArrayBuffer = await response.arrayBuffer(); -// const blob: Blob = response.blob(); -// const bytes: Uint8Array = response.bytes(); -// You can only use the response body once, so you must choose one of the above methods. -// If you want to check if the response body has been used, you can use the following property. -const bodyUsed = response.bodyUsed; -``` -
-Save binary response to a file - -
-
-Node.js - -
-
-ReadableStream (most-efficient) - -```ts -import { createWriteStream } from 'fs'; -import { Readable } from 'stream'; -import { pipeline } from 'stream/promises'; - -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const stream = response.stream(); -const nodeStream = Readable.fromWeb(stream); -const writeStream = createWriteStream('path/to/file'); - -await pipeline(nodeStream, writeStream); -``` - -
-
- -
-
-ArrayBuffer - -```ts -import { writeFile } from 'fs/promises'; - -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const arrayBuffer = await response.arrayBuffer(); -await writeFile('path/to/file', Buffer.from(arrayBuffer)); -``` - -
-
- -
-
-Blob - -```ts -import { writeFile } from 'fs/promises'; - -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -const arrayBuffer = await blob.arrayBuffer(); -await writeFile('output.bin', Buffer.from(arrayBuffer)); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -import { writeFile } from 'fs/promises'; - -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -await writeFile('path/to/file', bytes); -``` - -
-
- -
-
- -
-
-Bun - -
-
-ReadableStream (most-efficient) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const stream = response.stream(); -await Bun.write('path/to/file', stream); -``` - -
-
- -
-
-ArrayBuffer - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const arrayBuffer = await response.arrayBuffer(); -await Bun.write('path/to/file', arrayBuffer); -``` - -
-
- -
-
-Blob - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -await Bun.write('path/to/file', blob); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -await Bun.write('path/to/file', bytes); -``` - -
-
- -
-
- -
-
-Deno - -
-
-ReadableStream (most-efficient) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const stream = response.stream(); -const file = await Deno.open('path/to/file', { write: true, create: true }); -await stream.pipeTo(file.writable); -``` - -
-
- -
-
-ArrayBuffer - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const arrayBuffer = await response.arrayBuffer(); -await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); -``` - -
-
- -
-
-Blob - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -const arrayBuffer = await blob.arrayBuffer(); -await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -await Deno.writeFile('path/to/file', bytes); -``` - -
-
- -
-
- -
-
-Browser - -
-
-Blob (most-efficient) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -const url = URL.createObjectURL(blob); - -// trigger download -const a = document.createElement('a'); -a.href = url; -a.download = 'filename'; -a.click(); -URL.revokeObjectURL(url); -``` - -
-
- -
-
-ReadableStream - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const stream = response.stream(); -const reader = stream.getReader(); -const chunks = []; - -while (true) { - const { done, value } = await reader.read(); - if (done) break; - chunks.push(value); -} - -const blob = new Blob(chunks); -const url = URL.createObjectURL(blob); - -// trigger download -const a = document.createElement('a'); -a.href = url; -a.download = 'filename'; -a.click(); -URL.revokeObjectURL(url); -``` - -
-
- -
-
-ArrayBuffer - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const arrayBuffer = await response.arrayBuffer(); -const blob = new Blob([arrayBuffer]); -const url = URL.createObjectURL(blob); - -// trigger download -const a = document.createElement('a'); -a.href = url; -a.download = 'filename'; -a.click(); -URL.revokeObjectURL(url); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -const blob = new Blob([bytes]); -const url = URL.createObjectURL(blob); - -// trigger download -const a = document.createElement('a'); -a.href = url; -a.download = 'filename'; -a.click(); -URL.revokeObjectURL(url); -``` - -
-
- -
-
- -
- - -
-Convert binary response to text - -
-
-ReadableStream - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const stream = response.stream(); -const text = await new Response(stream).text(); -``` - -
-
- -
-
-ArrayBuffer - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const arrayBuffer = await response.arrayBuffer(); -const text = new TextDecoder().decode(arrayBuffer); -``` - -
-
- -
-
-Blob - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -const text = await blob.text(); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -const text = new TextDecoder().decode(bytes); -``` - -
-
- -
- -## Advanced - -### Additional Headers - -If you would like to send additional headers as part of the request, use the `headers` request option. - -```typescript -import { BrevoClient } from "Brevo"; - -const client = new BrevoClient({ - ... - headers: { - 'X-Custom-Header': 'custom value' - } -}); - -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - headers: { - 'X-Custom-Header': 'custom value' - } -}); -``` - -### Additional Query String Parameters - -If you would like to send additional query string parameters as part of the request, use the `queryParams` request option. - -```typescript -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - queryParams: { - 'customQueryParamKey': 'custom query param value' - } -}); -``` - -### Retries - -The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long -as the request is deemed retryable and the number of retry attempts has not grown larger than the configured -retry limit (default: 2). - -A request is deemed retryable when any of the following HTTP status codes is returned: - -- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) -- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) -- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) - -Use the `maxRetries` request option to configure this behavior. - -```typescript -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - maxRetries: 0 // override maxRetries at the request level -}); -``` - -### Timeouts - -The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior. - -```typescript -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - timeoutInSeconds: 30 // override timeout to 30s -}); -``` - -### Aborting Requests - -The SDK allows users to abort requests at any point by passing in an abort signal. - -```typescript -const controller = new AbortController(); -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - abortSignal: controller.signal -}); -controller.abort(); // aborts the request -``` - -### Access Raw Response Data - -The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method. -The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property. - -```typescript -const { data, rawResponse } = await client.masterAccount.createANewGroupOfSubAccounts(...).withRawResponse(); - -console.log(data); -console.log(rawResponse.headers['X-My-Header']); -``` - -### Logging - -The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options. - -```typescript -import { BrevoClient, logging } from "Brevo"; - -const client = new BrevoClient({ - ... - logging: { - level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info - logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger - silent: false, // defaults to true, set to false to enable logging - } -}); -``` -The `logging` object can have the following properties: -- `level`: The log level to use. Defaults to `logging.LogLevel.Info`. -- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`. -- `silent`: Whether to silence the logger. Defaults to `true`. - -The `level` property can be one of the following values: -- `logging.LogLevel.Debug` -- `logging.LogLevel.Info` -- `logging.LogLevel.Warn` -- `logging.LogLevel.Error` - -To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface. - -
-Custom logger examples - -Here's an example using the popular `winston` logging library. -```ts -import winston from 'winston'; - -const winstonLogger = winston.createLogger({...}); - -const logger: logging.ILogger = { - debug: (msg, ...args) => winstonLogger.debug(msg, ...args), - info: (msg, ...args) => winstonLogger.info(msg, ...args), - warn: (msg, ...args) => winstonLogger.warn(msg, ...args), - error: (msg, ...args) => winstonLogger.error(msg, ...args), -}; -``` - -Here's an example using the popular `pino` logging library. - -```ts -import pino from 'pino'; - -const pinoLogger = pino({...}); - -const logger: logging.ILogger = { - debug: (msg, ...args) => pinoLogger.debug(args, msg), - info: (msg, ...args) => pinoLogger.info(args, msg), - warn: (msg, ...args) => pinoLogger.warn(args, msg), - error: (msg, ...args) => pinoLogger.error(args, msg), -}; -``` -
- - -### Runtime Compatibility - - -The SDK works in the following runtimes: - - - -- Node.js 18+ -- Vercel -- Cloudflare Workers -- Deno v1.25+ -- Bun 1.0+ -- React Native - -### Customizing Fetch Client - -The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an -unsupported environment, this provides a way for you to break glass and ensure the SDK works. - -```typescript -import { BrevoClient } from "Brevo"; - -const client = new BrevoClient({ - ... - fetcher: // provide your implementation here -}); -``` - -## Contributing - -While we value open-source contributions to this SDK, this library is generated programmatically. -Additions made directly to this library would have to be moved over to our generation code, -otherwise they would be overwritten upon the next generated release. Feel free to open a PR as -a proof of concept, but know that we will not be able to merge it as-is. We suggest opening -an issue first to discuss with us! - -On the other hand, contributions to the README are always very welcome! \ No newline at end of file diff --git a/package.json b/package.json index f6eda55..02bce50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "", - "version": "0.0.52", + "version": "0.0.53", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 7f18c42..ec31580 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions Date: Wed, 4 Feb 2026 18:52:23 +0100 Subject: [PATCH 03/33] Add README for Brevo Node.js SDK Add comprehensive documentation for Brevo Node.js SDK including installation, quick start, configuration, error handling, retries, timeouts, request options, TypeScript types, logging, custom fetch client, runtime compatibility, migration guide, contributing, and support. --- README.md | 426 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 426 insertions(+) diff --git a/README.md b/README.md index e69de29..f990b22 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,426 @@ +# Brevo Node.js SDK + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fmourraille%2Fdemo-ts) +![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) +[![npm version](https://img.shields.io/npm/v/@getbrevo/brevo)](https://www.npmjs.com/package/@getbrevo/brevo) +[![npm downloads](https://img.shields.io/npm/dm/@getbrevo/brevo)](https://www.npmjs.com/package/@getbrevo/brevo) + +[Website](https://brevo.com) • [API Reference](https://developers.brevo.com) • [Support](mailto:support@brevo.com) + +--- + +## Installation + +```bash +npm install getbrevo/brevo@^4.0.0 +``` + +## Quick Start + +```typescript +import { BrevoClient } from 'getbrevo/brevo@^4.0.0'; + +const brevo = new BrevoClient({ + apiKey: 'your-api-key', +}); + +const result = await brevo.transactionalEmails.sendTransacEmail({ + subject: "Hello", + textContent: "Hello world!", + sender: { name: "Sender", email: "sender@example.com" }, + to: [{ email: "recipient@example.com" }] +}); + +console.log('Email sent:', result); +``` + +--- + +## Configuration + +```typescript +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + timeout: 30000, // 30 seconds + maxRetries: 3 // Default: 2 +}); +``` + +--- + +## Error Handling + +The SDK throws specific error types based on HTTP status codes. + +```typescript +import { BrevoError, UnauthorizedError, TooManyRequestsError } from 'getbrevo/brevo@^4.0.0'; + +try { + await brevo.transactionalEmails.sendTransacEmail({...}); +} catch (err) { + if (err instanceof UnauthorizedError) { + console.error('Invalid API key'); + } else if (err instanceof TooManyRequestsError) { + const retryAfter = err.rawResponse.headers['retry-after']; + console.error(`Rate limited. Retry after ${retryAfter} seconds`); + } else if (err instanceof BrevoError) { + console.error(`API Error ${err.statusCode}:`, err.message); + } +} +``` + +**Error Types:** +- `400` - `BadRequestError` +- `401` - `UnauthorizedError` +- `403` - `ForbiddenError` +- `404` - `NotFoundError` +- `422` - `UnprocessableEntityError` +- `429` - `TooManyRequestsError` +- `500+` - `InternalServerError` + +
+Error properties + +All `BrevoError` instances provide: +- `statusCode`: HTTP status code +- `message`: Error message +- `body`: Parsed error response body +- `rawResponse`: Raw response with headers + +
+ +--- + +## Retries + +Automatic retries with exponential backoff are enabled by default (2 retries). + +```typescript +// Client-level +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + maxRetries: 3 +}); + +// Request-level +await brevo.transactionalEmails.sendTransacEmail({...}, { + maxRetries: 5 +}); +``` + +**Retryable status codes:** `408`, `429`, `500`, `502`, `503`, `504` + +
+How retries work + +- Exponential backoff: ~1s, ~2s, ~4s (with jitter) +- Respects `Retry-After` header for rate limits +- Can be disabled per request with `maxRetries: 0` + +
+ +--- + +## Timeouts + +Default timeout is 60 seconds. Configure at client or request level. + +```typescript +// Client-level +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + timeoutInSeconds: 30 +}); + +// Request-level +await brevo.transactionalEmails.sendTransacEmail({...}, { + timeoutInSeconds: 10 +}); +``` + +**Recommended values:** +- Standard API calls: `30-60s` (default) +- Quick operations: `10-15s` +- Bulk operations: `120-300s` +- Real-time: `5-10s` + +--- + +## Request Options + +### Additional Headers + +```typescript +await brevo.transactionalEmails.sendTransacEmail({...}, { + headers: { + 'X-Custom-Header': 'custom-value' + } +}); +``` + +### Query Parameters + +```typescript +await brevo.transactionalEmails.sendTransacEmail({...}, { + queryParams: { + 'customParam': 'value' + } +}); +``` + +### Abort Signal + +```typescript +const controller = new AbortController(); +await brevo.transactionalEmails.sendTransacEmail({...}, { + abortSignal: controller.signal +}); +controller.abort(); +``` + +### Raw Response + +```typescript +const { data, rawResponse } = await brevo.transactionalEmails.sendTransacEmail({...}) + .withRawResponse(); + +console.log(rawResponse.headers['X-My-Header']); +``` + +--- + +## Binary Responses + +```typescript +const response = await brevo.inboundParsing.getInboundEmailAttachment(...); + +// Choose one: +const stream = response.stream(); +// const arrayBuffer = await response.arrayBuffer(); +// const blob = await response.blob(); +// const bytes = await response.bytes(); +``` + +
+Save to file examples + +**Node.js (ReadableStream):** +```typescript +import { createWriteStream } from 'fs'; +import { Readable } from 'stream'; +import { pipeline } from 'stream/promises'; + +const stream = response.stream(); +const nodeStream = Readable.fromWeb(stream); +await pipeline(nodeStream, createWriteStream('path/to/file')); +``` + +**Bun:** +```typescript +await Bun.write('path/to/file', response.stream()); +``` + +**Browser:** +```typescript +const blob = await response.blob(); +const url = URL.createObjectURL(blob); +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+ +--- + +## TypeScript Types + +All request and response types are exported. + +```typescript +import { Brevo } from 'getbrevo/brevo@^4.0.0'; + +const request: Brevo.SendTransacEmailRequest = { + subject: "First email", + textContent: "Hello world!", + sender: { name: "Bob Wilson", email: "bob.wilson@example.com" }, + to: [{ email: "sarah.davis@example.com", name: "Sarah Davis" }] +}; +``` + +--- + +## Logging + +```typescript +import { BrevoClient, logging } from 'getbrevo/brevo@^4.0.0'; + +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + logging: { + level: logging.LogLevel.Debug, + logger: new logging.ConsoleLogger(), + silent: false + } +}); +``` + +
+Custom logger example + +```typescript +import winston from 'winston'; + +const winstonLogger = winston.createLogger({...}); + +const logger: logging.ILogger = { + debug: (msg, ...args) => winstonLogger.debug(msg, ...args), + info: (msg, ...args) => winstonLogger.info(msg, ...args), + warn: (msg, ...args) => winstonLogger.warn(msg, ...args), + error: (msg, ...args) => winstonLogger.error(msg, ...args), +}; +``` + +
+ +--- + +## Custom Fetch Client + +Override the default fetch implementation for advanced use cases. + +```typescript +const customFetcher = async (url: string, options?: RequestInit): Promise => { + // Your custom implementation + return fetch(url, options); +}; + +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + fetcher: customFetcher +}); +``` + +
+Common use cases + +**Using node-fetch:** +```typescript +import fetch from 'node-fetch'; +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + fetcher: fetch as any +}); +``` + +**Using undici:** +```typescript +import { fetch } from 'undici'; +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + fetcher: fetch as any +}); +``` + +**With interceptors:** +```typescript +const createFetcherWithInterceptors = () => { + return async (url: string, options?: RequestInit): Promise => { + const modifiedOptions = { + ...options, + headers: { + ...options?.headers, + 'X-Request-ID': generateRequestId() + } + }; + const response = await fetch(url, modifiedOptions); + console.log('Response:', response.status); + return response; + }; +}; +``` + +
+ +--- + +## Runtime Compatibility + +- Node.js 18+ +- Vercel +- Cloudflare Workers +- Deno v1.25+ +- Bun 1.0+ +- React Native + +--- + +## Migration from v3.x + +
+View migration guide + +This version includes breaking changes: + +**Key Changes:** +- New client initialization +- Promise-based API +- Improved TypeScript support +- Standardized error handling + +**Example:** + +**v3.x:** +```typescript +import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; + +let emailAPI = new TransactionalEmailsApi(); +(emailAPI as any).authentications.apiKey.apiKey = "xkeysib-xxx"; + +let message = new SendSmtpEmail(); +message.subject = "First email"; +message.textContent = "Hello world!"; +message.sender = { name: "Bob Wilson", email: "bob.wilson@example.com" }; +message.to = [{ email: "sarah.davis@example.com", name: "Sarah Davis" }]; + +emailAPI.sendTransacEmail(message); +``` + +**v4.x:** +```typescript +import { BrevoClient } from 'getbrevo/brevo@^4.0.0'; + +const brevo = new BrevoClient({ + apiKey: 'xkeysib-xxx' +}); + +await brevo.transactionalEmails.sendTransacEmail({ + subject: "First email", + textContent: "Hello world!", + sender: { name: "Bob Wilson", email: "bob.wilson@example.com" }, + to: [{ email: "sarah.davis@example.com", name: "Sarah Davis" }] +}); +``` + +
+ +> [!WARNING] +> The legacy v3.x SDK (`@getbrevo/brevo@^3.0.1`) will continue to receive critical security updates but no new features. We recommend migrating to v4.x. + +--- + +## Contributing + +This library is generated programmatically. Changes made directly to the library would be overwritten. Please open an issue first to discuss changes. + +Contributions to this README are always welcome! + +--- + +## Support + +- [API Reference](https://developers.brevo.com) +- [GitHub Issues](https://github.com/getbrevo/brevo-node/tree/main) +- [Email Support](mailto:support@brevo.com) From 3ff88d3f4fb2da5f6f0fa8e1bbc647fb4a4f9466 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 17:57:32 +0000 Subject: [PATCH 04/33] SDK regeneration --- .fern/metadata.json | 2 +- README.md | 1478 ++++++++++++++++++++++++++++++------------- package.json | 2 +- src/BaseClient.ts | 4 +- src/version.ts | 2 +- 5 files changed, 1057 insertions(+), 431 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 3af2e8f..63bcc60 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "0.0.53" + "sdkVersion": "0.0.54" } diff --git a/README.md b/README.md index f990b22..1a50370 100644 --- a/README.md +++ b/README.md @@ -1,426 +1,1052 @@ -# Brevo Node.js SDK - -[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fmourraille%2Fdemo-ts) -![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) -[![npm version](https://img.shields.io/npm/v/@getbrevo/brevo)](https://www.npmjs.com/package/@getbrevo/brevo) -[![npm downloads](https://img.shields.io/npm/dm/@getbrevo/brevo)](https://www.npmjs.com/package/@getbrevo/brevo) - -[Website](https://brevo.com) • [API Reference](https://developers.brevo.com) • [Support](mailto:support@brevo.com) - ---- - -## Installation - -```bash -npm install getbrevo/brevo@^4.0.0 -``` - -## Quick Start - -```typescript -import { BrevoClient } from 'getbrevo/brevo@^4.0.0'; - -const brevo = new BrevoClient({ - apiKey: 'your-api-key', -}); - -const result = await brevo.transactionalEmails.sendTransacEmail({ - subject: "Hello", - textContent: "Hello world!", - sender: { name: "Sender", email: "sender@example.com" }, - to: [{ email: "recipient@example.com" }] -}); - -console.log('Email sent:', result); -``` - ---- - -## Configuration - -```typescript -const brevo = new BrevoClient({ - apiKey: 'your-api-key', - timeout: 30000, // 30 seconds - maxRetries: 3 // Default: 2 -}); -``` - ---- - -## Error Handling - -The SDK throws specific error types based on HTTP status codes. - -```typescript -import { BrevoError, UnauthorizedError, TooManyRequestsError } from 'getbrevo/brevo@^4.0.0'; - -try { - await brevo.transactionalEmails.sendTransacEmail({...}); -} catch (err) { - if (err instanceof UnauthorizedError) { - console.error('Invalid API key'); - } else if (err instanceof TooManyRequestsError) { - const retryAfter = err.rawResponse.headers['retry-after']; - console.error(`Rate limited. Retry after ${retryAfter} seconds`); - } else if (err instanceof BrevoError) { - console.error(`API Error ${err.statusCode}:`, err.message); - } -} -``` - -**Error Types:** -- `400` - `BadRequestError` -- `401` - `UnauthorizedError` -- `403` - `ForbiddenError` -- `404` - `NotFoundError` -- `422` - `UnprocessableEntityError` -- `429` - `TooManyRequestsError` -- `500+` - `InternalServerError` - -
-Error properties - -All `BrevoError` instances provide: -- `statusCode`: HTTP status code -- `message`: Error message -- `body`: Parsed error response body -- `rawResponse`: Raw response with headers - -
- ---- - -## Retries - -Automatic retries with exponential backoff are enabled by default (2 retries). - -```typescript -// Client-level -const brevo = new BrevoClient({ - apiKey: 'your-api-key', - maxRetries: 3 -}); - -// Request-level -await brevo.transactionalEmails.sendTransacEmail({...}, { - maxRetries: 5 -}); -``` - -**Retryable status codes:** `408`, `429`, `500`, `502`, `503`, `504` - -
-How retries work - -- Exponential backoff: ~1s, ~2s, ~4s (with jitter) -- Respects `Retry-After` header for rate limits -- Can be disabled per request with `maxRetries: 0` - -
- ---- - -## Timeouts - -Default timeout is 60 seconds. Configure at client or request level. - -```typescript -// Client-level -const brevo = new BrevoClient({ - apiKey: 'your-api-key', - timeoutInSeconds: 30 -}); - -// Request-level -await brevo.transactionalEmails.sendTransacEmail({...}, { - timeoutInSeconds: 10 -}); -``` - -**Recommended values:** -- Standard API calls: `30-60s` (default) -- Quick operations: `10-15s` -- Bulk operations: `120-300s` -- Real-time: `5-10s` - ---- - -## Request Options - -### Additional Headers - -```typescript -await brevo.transactionalEmails.sendTransacEmail({...}, { - headers: { - 'X-Custom-Header': 'custom-value' - } -}); -``` - -### Query Parameters - -```typescript -await brevo.transactionalEmails.sendTransacEmail({...}, { - queryParams: { - 'customParam': 'value' - } -}); -``` - -### Abort Signal - -```typescript -const controller = new AbortController(); -await brevo.transactionalEmails.sendTransacEmail({...}, { - abortSignal: controller.signal -}); -controller.abort(); -``` - -### Raw Response - -```typescript -const { data, rawResponse } = await brevo.transactionalEmails.sendTransacEmail({...}) - .withRawResponse(); - -console.log(rawResponse.headers['X-My-Header']); -``` - ---- - -## Binary Responses - -```typescript -const response = await brevo.inboundParsing.getInboundEmailAttachment(...); - -// Choose one: -const stream = response.stream(); -// const arrayBuffer = await response.arrayBuffer(); -// const blob = await response.blob(); -// const bytes = await response.bytes(); -``` - -
-Save to file examples - -**Node.js (ReadableStream):** -```typescript -import { createWriteStream } from 'fs'; -import { Readable } from 'stream'; -import { pipeline } from 'stream/promises'; - -const stream = response.stream(); -const nodeStream = Readable.fromWeb(stream); -await pipeline(nodeStream, createWriteStream('path/to/file')); -``` - -**Bun:** -```typescript -await Bun.write('path/to/file', response.stream()); -``` - -**Browser:** -```typescript -const blob = await response.blob(); -const url = URL.createObjectURL(blob); -const a = document.createElement('a'); -a.href = url; -a.download = 'filename'; -a.click(); -URL.revokeObjectURL(url); -``` - -
- ---- - -## TypeScript Types - -All request and response types are exported. - -```typescript -import { Brevo } from 'getbrevo/brevo@^4.0.0'; - -const request: Brevo.SendTransacEmailRequest = { - subject: "First email", - textContent: "Hello world!", - sender: { name: "Bob Wilson", email: "bob.wilson@example.com" }, - to: [{ email: "sarah.davis@example.com", name: "Sarah Davis" }] -}; -``` - ---- - -## Logging - -```typescript -import { BrevoClient, logging } from 'getbrevo/brevo@^4.0.0'; - -const brevo = new BrevoClient({ - apiKey: 'your-api-key', - logging: { - level: logging.LogLevel.Debug, - logger: new logging.ConsoleLogger(), - silent: false - } -}); -``` - -
-Custom logger example - -```typescript -import winston from 'winston'; - -const winstonLogger = winston.createLogger({...}); - -const logger: logging.ILogger = { - debug: (msg, ...args) => winstonLogger.debug(msg, ...args), - info: (msg, ...args) => winstonLogger.info(msg, ...args), - warn: (msg, ...args) => winstonLogger.warn(msg, ...args), - error: (msg, ...args) => winstonLogger.error(msg, ...args), -}; -``` - -
- ---- - -## Custom Fetch Client - -Override the default fetch implementation for advanced use cases. - -```typescript -const customFetcher = async (url: string, options?: RequestInit): Promise => { - // Your custom implementation - return fetch(url, options); -}; - -const brevo = new BrevoClient({ - apiKey: 'your-api-key', - fetcher: customFetcher -}); -``` - -
-Common use cases - -**Using node-fetch:** -```typescript -import fetch from 'node-fetch'; -const brevo = new BrevoClient({ - apiKey: 'your-api-key', - fetcher: fetch as any -}); -``` - -**Using undici:** -```typescript -import { fetch } from 'undici'; -const brevo = new BrevoClient({ - apiKey: 'your-api-key', - fetcher: fetch as any -}); -``` - -**With interceptors:** -```typescript -const createFetcherWithInterceptors = () => { - return async (url: string, options?: RequestInit): Promise => { - const modifiedOptions = { - ...options, - headers: { - ...options?.headers, - 'X-Request-ID': generateRequestId() - } - }; - const response = await fetch(url, modifiedOptions); - console.log('Response:', response.status); - return response; - }; -}; -``` - -
- ---- - -## Runtime Compatibility - -- Node.js 18+ -- Vercel -- Cloudflare Workers -- Deno v1.25+ -- Bun 1.0+ -- React Native - ---- - -## Migration from v3.x - -
-View migration guide - -This version includes breaking changes: - -**Key Changes:** -- New client initialization -- Promise-based API -- Improved TypeScript support -- Standardized error handling - -**Example:** - -**v3.x:** -```typescript -import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; - -let emailAPI = new TransactionalEmailsApi(); -(emailAPI as any).authentications.apiKey.apiKey = "xkeysib-xxx"; - -let message = new SendSmtpEmail(); -message.subject = "First email"; -message.textContent = "Hello world!"; -message.sender = { name: "Bob Wilson", email: "bob.wilson@example.com" }; -message.to = [{ email: "sarah.davis@example.com", name: "Sarah Davis" }]; - -emailAPI.sendTransacEmail(message); -``` - -**v4.x:** -```typescript -import { BrevoClient } from 'getbrevo/brevo@^4.0.0'; - -const brevo = new BrevoClient({ - apiKey: 'xkeysib-xxx' -}); - -await brevo.transactionalEmails.sendTransacEmail({ - subject: "First email", - textContent: "Hello world!", - sender: { name: "Bob Wilson", email: "bob.wilson@example.com" }, - to: [{ email: "sarah.davis@example.com", name: "Sarah Davis" }] -}); -``` - -
- -> [!WARNING] -> The legacy v3.x SDK (`@getbrevo/brevo@^3.0.1`) will continue to receive critical security updates but no new features. We recommend migrating to v4.x. - ---- - -## Contributing - -This library is generated programmatically. Changes made directly to the library would be overwritten. Please open an issue first to discuss changes. - -Contributions to this README are always welcome! - ---- - -## Support - -- [API Reference](https://developers.brevo.com) -- [GitHub Issues](https://github.com/getbrevo/brevo-node/tree/main) -- [Email Support](mailto:support@brevo.com) +# Brevo TypeScript Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fgetbrevo%2Fbrevo-node) +[![npm shield](https://img.shields.io/npm/v/)](https://www.npmjs.com/package/) + +The Brevo TypeScript library provides convenient access to the Brevo APIs from TypeScript. + +## Table of Contents + +- [Overview](#overview) +- [Node Js Implementation](#node-js-implementation) +- [Type Script Implementation](#type-script-implementation) +- [Support](#support) +- [License](#license) +- [Installation](#installation) +- [Reference](#reference) +- [Usage](#usage) +- [Request and Response Types](#request-and-response-types) +- [Exception Handling](#exception-handling) +- [File Uploads](#file-uploads) +- [Binary Response](#binary-response) +- [Advanced](#advanced) + - [Additional Headers](#additional-headers) + - [Additional Query String Parameters](#additional-query-string-parameters) + - [Retries](#retries) + - [Timeouts](#timeouts) + - [Aborting Requests](#aborting-requests) + - [Access Raw Response Data](#access-raw-response-data) + - [Logging](#logging) + - [Runtime Compatibility](#runtime-compatibility) +- [Contributing](#contributing) + +## Overview + +Brevo's API exposes the entire Brevo features via a standardized programmatic interface. Please refer to the full [documentation](https://developers.brevo.com) to see all the supported operations. + +Brevo's API matches the [OpenAPI v2 definition](https://www.openapis.org/). The specification can be downloaded [here](https://api.brevo.com/v3/swagger_definition_v3.yml). + +Our current library is not fully compatible with all modern Node.js and TypeScript environments. To help you integrate Brevo into your applications, we're providing both plain Node.js and TypeScript-specific implementation approaches below while we work on the next generation of our SDK. + +## Node.js Implementation + +### Send Transactional Email + +#### Installation + +```bash +npm i @getbrevo/brevo --save +``` + +#### Import packages + +```javascript +import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; +``` + +#### Instantiate API with your credentials + +```javascript +let emailAPI = new TransactionalEmailsApi(); +emailAPI.authentications.apiKey.apiKey = "xkeysib-xxxxxxxxxxxxxxxxxxxxx" +``` + +#### Build your message + +```javascript +let message = new SendSmtpEmail(); +message.subject = "First email"; +message.textContent = "Hello world!"; +message.sender = { name: "John Doe", email: "john.doe@example.com" }; +message.to = [{ email: "jane.smith@example.com", name: "Jane Smith" }]; +``` + +#### Send the message + +```javascript +emailAPI.sendTransacEmail(message) +``` + +#### (Optional) Log the response + +```javascript +emailAPI.sendTransacEmail(message).then(res => { + console.log(JSON.stringify(res.body)); +}).catch(err => { + console.error("Error sending email:", err.body); +}); +``` + +### Create Contact + +#### Installation + +```bash +npm i @getbrevo/brevo --save +``` + +#### Import packages + +```javascript +import { CreateContact, ContactsApi } from "@getbrevo/brevo"; +``` + +#### Instantiate API with your credentials + +```javascript +let contactAPI = new ContactsApi(); +contactAPI.authentications.apiKey.apiKey = "xkeysib-xxxxxx" +``` + +#### Build your contact + +```javascript +let contact = new CreateContact(); +contact.email = "alice.johnson@example.com"; +contact.attributes = { + FIRSTNAME: "Alice", + LASTNAME: "Johnson", +}; +``` + +#### Create the contact + +```javascript +contactAPI.createContact(contact).then(res => { + console.log(JSON.stringify(res.body)); +}).catch(err => { + console.error("Error creating contact:", err.body); +}); +``` + +## TypeScript Implementation + +### Recommended tsconfig.json Settings + +We recommend using the following TypeScript configuration for optimal compatibility: + +```json +{ + "compilerOptions": { + "target": "es2020", + "module": "commonjs", + "outDir": "dist", + "rootDir": "src", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true + }, + "include": ["src"] +} +``` + +### Send Transactional Email + +#### Installation + +```bash +npm i @getbrevo/brevo --save +``` + +#### Import packages + +```typescript +import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; +``` + +#### Instantiate API with your credentials + +```typescript +let emailAPI = new TransactionalEmailsApi(); +(emailAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxxxxxxxxxxxxxx"; +``` + +#### Build your message + +```typescript +let message = new SendSmtpEmail(); +message.subject = "First email"; +message.textContent = "Hello world!"; +message.sender = { name: "Bob Wilson", email: "bob.wilson@example.com" }; +message.to = [{ email: "sarah.davis@example.com", name: "Sarah Davis" }]; +``` + +#### Send the message + +```typescript +emailAPI.sendTransacEmail(message) +``` + +#### (Optional) Log the response + +```typescript +emailAPI + .sendTransacEmail(message) + .then((res) => { + console.log(JSON.stringify(res.body)); + }) + .catch((err) => { + console.error("Error sending email:", err.body); + }); +``` + +### Create Contact + +#### Installation + +```bash +npm i @getbrevo/brevo --save +``` + +#### Import packages + +```typescript +import { CreateContact, ContactsApi } from "@getbrevo/brevo"; +``` + +#### Instantiate API with your credentials + +```typescript +let contactAPI = new ContactsApi(); +(contactAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxx" +``` + +#### Build your contact + +```typescript +let contact = new CreateContact(); +contact.email = "michael.brown@example.com"; +contact.attributes = { + FIRSTNAME: { value: "Michael" }, + LASTNAME: { value: "Brown" }, +}; +``` + +#### Create the contact + +```typescript +contactAPI.createContact(contact).then(res => { + console.log(JSON.stringify(res.body)); +}).catch(err => { + console.error("Error creating contact:", err.body); +}); +``` + +# Concerning v3.0.0 and above: +> [!IMPORTANT] +> There has been a change in the usage of this library after v3.0.0 which is not backward compatible. + +### Installation + +```npm i @getbrevo/brevo --save``` + +### Import packages + +```import { CreateContact, ContactsApi } from "@getbrevo/brevo";``` + +### Instantiate API with your credentials + +``` +let contactAPI = new ContactsApi(); +(contactAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxx"; +``` + +### Build your contact + +```let contact = new CreateContact(); +contact.email = "michael.brown@example.com"; +contact.attributes = { + FIRSTNAME: { value: "Michael" }, + LASTNAME: { value: "Brown" } +}; +``` + +### Create the contact + +```contactAPI.createContact(contact).then(res => { + console.log(JSON.stringify(res.body)); +}).catch(err => { + console.error("Error creating contact:", err.body); +}); +``` + +### Similar other examples: + +```typescript + +import { TransactionalEmailsApi, TransactionalEmailsApiApiKeys } from '@getbrevo/brevo'; + +const transactionalEmailsApi = new TransactionalEmailsApi(); +transactionalEmailsApi.setApiKey(TransactionalEmailsApiApiKeys.apiKey, 'xkeysib-API_KEY'); + +async function sendTransactionalEmail() { + try { + const result = await transactionalEmailsApi.sendTransacEmail({ + to: [ + { email: 'sampleemail@gmail.com', name: 'John doe' }, + ], + subject: 'Hello from Brevo SDK!', + htmlContent: '

This is a transactional email sent using the Brevo SDK.

', + textContent: 'This is a transactional email sent using the Brevo SDK.', + sender: { email: 'sampleemail@gmail.com', name: 'John doe' }, + }); + console.log('Email sent! Message ID:', result.body.messageId); + } catch (error) { + console.error('Failed to send email:', error); + } +} + +sendTransactionalEmail(); +``` + +```typescript + +import { DealsApi, DealsApiApiKeys } from '@getbrevo/brevo'; + +const dealsApi = new DealsApi(); +dealsApi.setApiKey(DealsApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); + +async function getDeals() { + try { + const response = await dealsApi.crmDealsGet() + console.log('Deals info:', response.body); + } catch (error) { + console.error('Failed to get account info:', error); + } +} + +getDeals(); +``` + +```typescript + +import { AccountApi, AccountApiApiKeys } from '@getbrevo/brevo'; + +const accountApi = new AccountApi(); +accountApi.setApiKey(AccountApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); + +async function getAccount() { + try { + const response = await accountApi.getAccount(); + console.log('Account info:', response.body); + } catch (error) { + console.error('Failed to get account info:', error); + } +} + +getAccount(); +``` + +```typescript + +import { ContactsApi, ContactsApiApiKeys } from '@getbrevo/brevo'; + +const contactsApi = new ContactsApi(); +contactsApi.setApiKey(ContactsApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); + +async function getContacts(limit: number, offset: number) { + try { + const result = await contactsApi.getContacts(limit, offset); + console.log('Contacts:', result.body); + } catch (error) { + console.error('Failed to get contacts:', error); + } +} + +getContacts(10, 0); // Example: get first 10 contacts +``` + + +## Support + +For questions and support, please refer to our [documentation](https://developers.brevo.com) or contact our support team. + +## License + +This SDK is distributed under the MIT License. + +## Installation + +```sh +npm i -s +``` + +## Reference + +A full reference for this library is available [here](https://github.com/getbrevo/brevo-node/blob/HEAD/./reference.md). + +## Usage + +Instantiate and use the client with the following: + +```typescript +import { BrevoClient } from ""; + +const client = new BrevoClient({ apiKey: "YOUR_API_KEY" }); +await client.masterAccount.createANewGroupOfSubAccounts({ + groupName: "My group" +}); +``` + +## Request and Response Types + +The SDK exports all request and response types as TypeScript interfaces. Simply import them with the +following namespace: + +```typescript +import { Brevo } from "Brevo"; + +const request: Brevo.GetAccountActivityRequest = { + ... +}; +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error +will be thrown. + +```typescript +import { BrevoError } from "Brevo"; + +try { + await client.masterAccount.createANewGroupOfSubAccounts(...); +} catch (err) { + if (err instanceof BrevoError) { + console.log(err.statusCode); + console.log(err.message); + console.log(err.body); + console.log(err.rawResponse); + } +} +``` + +## File Uploads + +You can upload files using the client: + +```typescript +import { createReadStream } from "fs"; +import { BrevoClient } from ""; + +const client = new BrevoClient({ apiKey: "YOUR_API_KEY" }); +await client.companies.importCompaniesCreationAndUpdation({}); +``` +The client accepts a variety of types for file upload parameters: +* Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream` +* Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array` + +### Metadata + +You can configure metadata when uploading a file: +```typescript +const file: Uploadable.WithMetadata = { + data: createReadStream("path/to/file"), + filename: "my-file", // optional + contentType: "audio/mpeg", // optional + contentLength: 1949, // optional +}; +``` + +Alternatively, you can upload a file directly from a file path: +```typescript +const file : Uploadable.FromPath = { + path: "path/to/file", + filename: "my-file", // optional + contentType: "audio/mpeg", // optional + contentLength: 1949, // optional +}; +``` + +The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically. +For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory. + + +## Binary Response + +You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data: + +```typescript +const response = await client.inboundParsing.getInboundEmailAttachment(...); +const stream: ReadableStream = response.stream(); +// const arrayBuffer: ArrayBuffer = await response.arrayBuffer(); +// const blob: Blob = response.blob(); +// const bytes: Uint8Array = response.bytes(); +// You can only use the response body once, so you must choose one of the above methods. +// If you want to check if the response body has been used, you can use the following property. +const bodyUsed = response.bodyUsed; +``` +
+Save binary response to a file + +
+
+Node.js + +
+
+ReadableStream (most-efficient) + +```ts +import { createWriteStream } from 'fs'; +import { Readable } from 'stream'; +import { pipeline } from 'stream/promises'; + +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +const nodeStream = Readable.fromWeb(stream); +const writeStream = createWriteStream('path/to/file'); + +await pipeline(nodeStream, writeStream); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +await writeFile('path/to/file', Buffer.from(arrayBuffer)); +``` + +
+
+ +
+
+Blob + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +const arrayBuffer = await blob.arrayBuffer(); +await writeFile('output.bin', Buffer.from(arrayBuffer)); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +await writeFile('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Bun + +
+
+ReadableStream (most-efficient) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +await Bun.write('path/to/file', stream); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +await Bun.write('path/to/file', arrayBuffer); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +await Bun.write('path/to/file', blob); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +await Bun.write('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Deno + +
+
+ReadableStream (most-efficient) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +const file = await Deno.open('path/to/file', { write: true, create: true }); +await stream.pipeTo(file.writable); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +const arrayBuffer = await blob.arrayBuffer(); +await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +await Deno.writeFile('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Browser + +
+
+Blob (most-efficient) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ReadableStream + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +const reader = stream.getReader(); +const chunks = []; + +while (true) { + const { done, value } = await reader.read(); + if (done) break; + chunks.push(value); +} + +const blob = new Blob(chunks); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +const blob = new Blob([arrayBuffer]); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +const blob = new Blob([bytes]); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ +
+ + +
+Convert binary response to text + +
+
+ReadableStream + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const stream = response.stream(); +const text = await new Response(stream).text(); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const arrayBuffer = await response.arrayBuffer(); +const text = new TextDecoder().decode(arrayBuffer); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const blob = await response.blob(); +const text = await blob.text(); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.inboundParsing.getInboundEmailAttachment(...); + +const bytes = await response.bytes(); +const text = new TextDecoder().decode(bytes); +``` + +
+
+ +
+ +## Advanced + +### Additional Headers + +If you would like to send additional headers as part of the request, use the `headers` request option. + +```typescript +import { BrevoClient } from "Brevo"; + +const client = new BrevoClient({ + ... + headers: { + 'X-Custom-Header': 'custom value' + } +}); + +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + headers: { + 'X-Custom-Header': 'custom value' + } +}); +``` + +### Additional Query String Parameters + +If you would like to send additional query string parameters as part of the request, use the `queryParams` request option. + +```typescript +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + queryParams: { + 'customQueryParamKey': 'custom query param value' + } +}); +``` + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retryable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retryable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `maxRetries` request option to configure this behavior. + +```typescript +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + maxRetries: 0 // override maxRetries at the request level +}); +``` + +### Timeouts + +The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior. + +```typescript +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + timeoutInSeconds: 30 // override timeout to 30s +}); +``` + +### Aborting Requests + +The SDK allows users to abort requests at any point by passing in an abort signal. + +```typescript +const controller = new AbortController(); +const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { + abortSignal: controller.signal +}); +controller.abort(); // aborts the request +``` + +### Access Raw Response Data + +The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method. +The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property. + +```typescript +const { data, rawResponse } = await client.masterAccount.createANewGroupOfSubAccounts(...).withRawResponse(); + +console.log(data); +console.log(rawResponse.headers['X-My-Header']); +``` + +### Logging + +The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options. + +```typescript +import { BrevoClient, logging } from "Brevo"; + +const client = new BrevoClient({ + ... + logging: { + level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info + logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger + silent: false, // defaults to true, set to false to enable logging + } +}); +``` +The `logging` object can have the following properties: +- `level`: The log level to use. Defaults to `logging.LogLevel.Info`. +- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`. +- `silent`: Whether to silence the logger. Defaults to `true`. + +The `level` property can be one of the following values: +- `logging.LogLevel.Debug` +- `logging.LogLevel.Info` +- `logging.LogLevel.Warn` +- `logging.LogLevel.Error` + +To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface. + +
+Custom logger examples + +Here's an example using the popular `winston` logging library. +```ts +import winston from 'winston'; + +const winstonLogger = winston.createLogger({...}); + +const logger: logging.ILogger = { + debug: (msg, ...args) => winstonLogger.debug(msg, ...args), + info: (msg, ...args) => winstonLogger.info(msg, ...args), + warn: (msg, ...args) => winstonLogger.warn(msg, ...args), + error: (msg, ...args) => winstonLogger.error(msg, ...args), +}; +``` + +Here's an example using the popular `pino` logging library. + +```ts +import pino from 'pino'; + +const pinoLogger = pino({...}); + +const logger: logging.ILogger = { + debug: (msg, ...args) => pinoLogger.debug(args, msg), + info: (msg, ...args) => pinoLogger.info(args, msg), + warn: (msg, ...args) => pinoLogger.warn(args, msg), + error: (msg, ...args) => pinoLogger.error(args, msg), +}; +``` +
+ + +### Runtime Compatibility + + +The SDK works in the following runtimes: + + + +- Node.js 18+ +- Vercel +- Cloudflare Workers +- Deno v1.25+ +- Bun 1.0+ +- React Native + +### Customizing Fetch Client + +The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an +unsupported environment, this provides a way for you to break glass and ensure the SDK works. + +```typescript +import { BrevoClient } from "Brevo"; + +const client = new BrevoClient({ + ... + fetcher: // provide your implementation here +}); +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! \ No newline at end of file diff --git a/package.json b/package.json index 02bce50..b8f0a16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "", - "version": "0.0.53", + "version": "0.0.54", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index ec31580..88ff548 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions Date: Wed, 4 Feb 2026 19:05:25 +0100 Subject: [PATCH 05/33] Add README.md to .fernignore --- .fernignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.fernignore b/.fernignore index 084a8eb..4d230f9 100644 --- a/.fernignore +++ b/.fernignore @@ -1 +1,2 @@ -# Specify files that shouldn't be modified by Fern +# Custom README +README.md From ce148fa8dd8a448fdf2ed1d5c6577e6e4e9cedaf Mon Sep 17 00:00:00 2001 From: Mauricio Mourraille Date: Wed, 4 Feb 2026 19:07:07 +0100 Subject: [PATCH 06/33] Revise README for Brevo Node.js SDK Updated README to reflect the new Node.js SDK branding and structure, including installation instructions and API usage examples. --- README.md | 1142 ++++++++++++----------------------------------------- 1 file changed, 258 insertions(+), 884 deletions(-) diff --git a/README.md b/README.md index 1a50370..69fdcc8 100644 --- a/README.md +++ b/README.md @@ -1,714 +1,229 @@ -# Brevo TypeScript Library +# Brevo Node.js SDK -[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fgetbrevo%2Fbrevo-node) -[![npm shield](https://img.shields.io/npm/v/)](https://www.npmjs.com/package/) +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fmourraille%2Fdemo-ts) +![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) +[![npm version](https://img.shields.io/npm/v/@getbrevo/brevo)](https://www.npmjs.com/package/@getbrevo/brevo) +[![npm downloads](https://img.shields.io/npm/dm/@getbrevo/brevo)](https://www.npmjs.com/package/@getbrevo/brevo) -The Brevo TypeScript library provides convenient access to the Brevo APIs from TypeScript. +[Website](https://brevo.com) • [API Reference](https://developers.brevo.com) • [Support](mailto:support@brevo.com) -## Table of Contents +--- -- [Overview](#overview) -- [Node Js Implementation](#node-js-implementation) -- [Type Script Implementation](#type-script-implementation) -- [Support](#support) -- [License](#license) -- [Installation](#installation) -- [Reference](#reference) -- [Usage](#usage) -- [Request and Response Types](#request-and-response-types) -- [Exception Handling](#exception-handling) -- [File Uploads](#file-uploads) -- [Binary Response](#binary-response) -- [Advanced](#advanced) - - [Additional Headers](#additional-headers) - - [Additional Query String Parameters](#additional-query-string-parameters) - - [Retries](#retries) - - [Timeouts](#timeouts) - - [Aborting Requests](#aborting-requests) - - [Access Raw Response Data](#access-raw-response-data) - - [Logging](#logging) - - [Runtime Compatibility](#runtime-compatibility) -- [Contributing](#contributing) - -## Overview - -Brevo's API exposes the entire Brevo features via a standardized programmatic interface. Please refer to the full [documentation](https://developers.brevo.com) to see all the supported operations. - -Brevo's API matches the [OpenAPI v2 definition](https://www.openapis.org/). The specification can be downloaded [here](https://api.brevo.com/v3/swagger_definition_v3.yml). - -Our current library is not fully compatible with all modern Node.js and TypeScript environments. To help you integrate Brevo into your applications, we're providing both plain Node.js and TypeScript-specific implementation approaches below while we work on the next generation of our SDK. - -## Node.js Implementation - -### Send Transactional Email - -#### Installation +## Installation ```bash -npm i @getbrevo/brevo --save +npm install getbrevo/brevo@^4.0.0 ``` -#### Import packages - -```javascript -import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; -``` +## Quick Start -#### Instantiate API with your credentials - -```javascript -let emailAPI = new TransactionalEmailsApi(); -emailAPI.authentications.apiKey.apiKey = "xkeysib-xxxxxxxxxxxxxxxxxxxxx" -``` - -#### Build your message - -```javascript -let message = new SendSmtpEmail(); -message.subject = "First email"; -message.textContent = "Hello world!"; -message.sender = { name: "John Doe", email: "john.doe@example.com" }; -message.to = [{ email: "jane.smith@example.com", name: "Jane Smith" }]; -``` - -#### Send the message - -```javascript -emailAPI.sendTransacEmail(message) -``` - -#### (Optional) Log the response +```typescript +import { BrevoClient } from 'getbrevo/brevo@^4.0.0'; -```javascript -emailAPI.sendTransacEmail(message).then(res => { - console.log(JSON.stringify(res.body)); -}).catch(err => { - console.error("Error sending email:", err.body); +const brevo = new BrevoClient({ + apiKey: 'your-api-key', }); -``` - -### Create Contact -#### Installation - -```bash -npm i @getbrevo/brevo --save -``` - -#### Import packages - -```javascript -import { CreateContact, ContactsApi } from "@getbrevo/brevo"; -``` - -#### Instantiate API with your credentials - -```javascript -let contactAPI = new ContactsApi(); -contactAPI.authentications.apiKey.apiKey = "xkeysib-xxxxxx" -``` - -#### Build your contact - -```javascript -let contact = new CreateContact(); -contact.email = "alice.johnson@example.com"; -contact.attributes = { - FIRSTNAME: "Alice", - LASTNAME: "Johnson", -}; -``` - -#### Create the contact - -```javascript -contactAPI.createContact(contact).then(res => { - console.log(JSON.stringify(res.body)); -}).catch(err => { - console.error("Error creating contact:", err.body); +const result = await brevo.transactionalEmails.sendTransacEmail({ + subject: "Hello", + textContent: "Hello world!", + sender: { name: "Sender", email: "sender@example.com" }, + to: [{ email: "recipient@example.com" }] }); -``` - -## TypeScript Implementation -### Recommended tsconfig.json Settings - -We recommend using the following TypeScript configuration for optimal compatibility: - -```json -{ - "compilerOptions": { - "target": "es2020", - "module": "commonjs", - "outDir": "dist", - "rootDir": "src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true - }, - "include": ["src"] -} +console.log('Email sent:', result); ``` -### Send Transactional Email - -#### Installation - -```bash -npm i @getbrevo/brevo --save -``` - -#### Import packages - -```typescript -import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; -``` +--- -#### Instantiate API with your credentials +## Configuration ```typescript -let emailAPI = new TransactionalEmailsApi(); -(emailAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxxxxxxxxxxxxxx"; +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + timeout: 30000, // 30 seconds + maxRetries: 3 // Default: 2 +}); ``` -#### Build your message +--- -```typescript -let message = new SendSmtpEmail(); -message.subject = "First email"; -message.textContent = "Hello world!"; -message.sender = { name: "Bob Wilson", email: "bob.wilson@example.com" }; -message.to = [{ email: "sarah.davis@example.com", name: "Sarah Davis" }]; -``` +## Error Handling -#### Send the message +The SDK throws specific error types based on HTTP status codes. ```typescript -emailAPI.sendTransacEmail(message) -``` - -#### (Optional) Log the response +import { BrevoError, UnauthorizedError, TooManyRequestsError } from 'getbrevo/brevo@^4.0.0'; -```typescript -emailAPI - .sendTransacEmail(message) - .then((res) => { - console.log(JSON.stringify(res.body)); - }) - .catch((err) => { - console.error("Error sending email:", err.body); - }); +try { + await brevo.transactionalEmails.sendTransacEmail({...}); +} catch (err) { + if (err instanceof UnauthorizedError) { + console.error('Invalid API key'); + } else if (err instanceof TooManyRequestsError) { + const retryAfter = err.rawResponse.headers['retry-after']; + console.error(`Rate limited. Retry after ${retryAfter} seconds`); + } else if (err instanceof BrevoError) { + console.error(`API Error ${err.statusCode}:`, err.message); + } +} ``` -### Create Contact +**Error Types:** +- `400` - `BadRequestError` +- `401` - `UnauthorizedError` +- `403` - `ForbiddenError` +- `404` - `NotFoundError` +- `422` - `UnprocessableEntityError` +- `429` - `TooManyRequestsError` +- `500+` - `InternalServerError` -#### Installation +
+Error properties -```bash -npm i @getbrevo/brevo --save -``` +All `BrevoError` instances provide: +- `statusCode`: HTTP status code +- `message`: Error message +- `body`: Parsed error response body +- `rawResponse`: Raw response with headers -#### Import packages +
-```typescript -import { CreateContact, ContactsApi } from "@getbrevo/brevo"; -``` +--- -#### Instantiate API with your credentials +## Retries -```typescript -let contactAPI = new ContactsApi(); -(contactAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxx" -``` - -#### Build your contact +Automatic retries with exponential backoff are enabled by default (2 retries). ```typescript -let contact = new CreateContact(); -contact.email = "michael.brown@example.com"; -contact.attributes = { - FIRSTNAME: { value: "Michael" }, - LASTNAME: { value: "Brown" }, -}; -``` - -#### Create the contact +// Client-level +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + maxRetries: 3 +}); -```typescript -contactAPI.createContact(contact).then(res => { - console.log(JSON.stringify(res.body)); -}).catch(err => { - console.error("Error creating contact:", err.body); +// Request-level +await brevo.transactionalEmails.sendTransacEmail({...}, { + maxRetries: 5 }); ``` -# Concerning v3.0.0 and above: -> [!IMPORTANT] -> There has been a change in the usage of this library after v3.0.0 which is not backward compatible. - -### Installation +**Retryable status codes:** `408`, `429`, `500`, `502`, `503`, `504` -```npm i @getbrevo/brevo --save``` - -### Import packages +
+How retries work -```import { CreateContact, ContactsApi } from "@getbrevo/brevo";``` +- Exponential backoff: ~1s, ~2s, ~4s (with jitter) +- Respects `Retry-After` header for rate limits +- Can be disabled per request with `maxRetries: 0` -### Instantiate API with your credentials +
-``` -let contactAPI = new ContactsApi(); -(contactAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxx"; -``` +--- -### Build your contact +## Timeouts -```let contact = new CreateContact(); -contact.email = "michael.brown@example.com"; -contact.attributes = { - FIRSTNAME: { value: "Michael" }, - LASTNAME: { value: "Brown" } -}; -``` +Default timeout is 60 seconds. Configure at client or request level. -### Create the contact +```typescript +// Client-level +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + timeoutInSeconds: 30 +}); -```contactAPI.createContact(contact).then(res => { - console.log(JSON.stringify(res.body)); -}).catch(err => { - console.error("Error creating contact:", err.body); +// Request-level +await brevo.transactionalEmails.sendTransacEmail({...}, { + timeoutInSeconds: 10 }); ``` -### Similar other examples: +**Recommended values:** +- Standard API calls: `30-60s` (default) +- Quick operations: `10-15s` +- Bulk operations: `120-300s` +- Real-time: `5-10s` -```typescript +--- -import { TransactionalEmailsApi, TransactionalEmailsApiApiKeys } from '@getbrevo/brevo'; - -const transactionalEmailsApi = new TransactionalEmailsApi(); -transactionalEmailsApi.setApiKey(TransactionalEmailsApiApiKeys.apiKey, 'xkeysib-API_KEY'); - -async function sendTransactionalEmail() { - try { - const result = await transactionalEmailsApi.sendTransacEmail({ - to: [ - { email: 'sampleemail@gmail.com', name: 'John doe' }, - ], - subject: 'Hello from Brevo SDK!', - htmlContent: '

This is a transactional email sent using the Brevo SDK.

', - textContent: 'This is a transactional email sent using the Brevo SDK.', - sender: { email: 'sampleemail@gmail.com', name: 'John doe' }, - }); - console.log('Email sent! Message ID:', result.body.messageId); - } catch (error) { - console.error('Failed to send email:', error); - } -} +## Request Options -sendTransactionalEmail(); -``` +### Additional Headers ```typescript - -import { DealsApi, DealsApiApiKeys } from '@getbrevo/brevo'; - -const dealsApi = new DealsApi(); -dealsApi.setApiKey(DealsApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); - -async function getDeals() { - try { - const response = await dealsApi.crmDealsGet() - console.log('Deals info:', response.body); - } catch (error) { - console.error('Failed to get account info:', error); +await brevo.transactionalEmails.sendTransacEmail({...}, { + headers: { + 'X-Custom-Header': 'custom-value' } -} - -getDeals(); +}); ``` -```typescript - -import { AccountApi, AccountApiApiKeys } from '@getbrevo/brevo'; - -const accountApi = new AccountApi(); -accountApi.setApiKey(AccountApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); - -async function getAccount() { - try { - const response = await accountApi.getAccount(); - console.log('Account info:', response.body); - } catch (error) { - console.error('Failed to get account info:', error); - } -} - -getAccount(); -``` +### Query Parameters ```typescript - -import { ContactsApi, ContactsApiApiKeys } from '@getbrevo/brevo'; - -const contactsApi = new ContactsApi(); -contactsApi.setApiKey(ContactsApiApiKeys.apiKey, 'xkeysib-YOUR_API_KEY'); - -async function getContacts(limit: number, offset: number) { - try { - const result = await contactsApi.getContacts(limit, offset); - console.log('Contacts:', result.body); - } catch (error) { - console.error('Failed to get contacts:', error); +await brevo.transactionalEmails.sendTransacEmail({...}, { + queryParams: { + 'customParam': 'value' } -} - -getContacts(10, 0); // Example: get first 10 contacts -``` - - -## Support - -For questions and support, please refer to our [documentation](https://developers.brevo.com) or contact our support team. - -## License - -This SDK is distributed under the MIT License. - -## Installation - -```sh -npm i -s -``` - -## Reference - -A full reference for this library is available [here](https://github.com/getbrevo/brevo-node/blob/HEAD/./reference.md). - -## Usage - -Instantiate and use the client with the following: - -```typescript -import { BrevoClient } from ""; - -const client = new BrevoClient({ apiKey: "YOUR_API_KEY" }); -await client.masterAccount.createANewGroupOfSubAccounts({ - groupName: "My group" }); ``` -## Request and Response Types - -The SDK exports all request and response types as TypeScript interfaces. Simply import them with the -following namespace: - -```typescript -import { Brevo } from "Brevo"; - -const request: Brevo.GetAccountActivityRequest = { - ... -}; -``` - -## Exception Handling - -When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error -will be thrown. +### Abort Signal ```typescript -import { BrevoError } from "Brevo"; - -try { - await client.masterAccount.createANewGroupOfSubAccounts(...); -} catch (err) { - if (err instanceof BrevoError) { - console.log(err.statusCode); - console.log(err.message); - console.log(err.body); - console.log(err.rawResponse); - } -} +const controller = new AbortController(); +await brevo.transactionalEmails.sendTransacEmail({...}, { + abortSignal: controller.signal +}); +controller.abort(); ``` -## File Uploads - -You can upload files using the client: +### Raw Response ```typescript -import { createReadStream } from "fs"; -import { BrevoClient } from ""; +const { data, rawResponse } = await brevo.transactionalEmails.sendTransacEmail({...}) + .withRawResponse(); -const client = new BrevoClient({ apiKey: "YOUR_API_KEY" }); -await client.companies.importCompaniesCreationAndUpdation({}); +console.log(rawResponse.headers['X-My-Header']); ``` -The client accepts a variety of types for file upload parameters: -* Stream types: `fs.ReadStream`, `stream.Readable`, and `ReadableStream` -* Buffered types: `Buffer`, `Blob`, `File`, `ArrayBuffer`, `ArrayBufferView`, and `Uint8Array` -### Metadata +--- -You can configure metadata when uploading a file: -```typescript -const file: Uploadable.WithMetadata = { - data: createReadStream("path/to/file"), - filename: "my-file", // optional - contentType: "audio/mpeg", // optional - contentLength: 1949, // optional -}; -``` +## Binary Responses -Alternatively, you can upload a file directly from a file path: ```typescript -const file : Uploadable.FromPath = { - path: "path/to/file", - filename: "my-file", // optional - contentType: "audio/mpeg", // optional - contentLength: 1949, // optional -}; -``` +const response = await brevo.inboundParsing.getInboundEmailAttachment(...); -The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-Disposition` headers. If not provided, the client will attempt to determine them automatically. -For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory. - - -## Binary Response - -You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data: - -```typescript -const response = await client.inboundParsing.getInboundEmailAttachment(...); -const stream: ReadableStream = response.stream(); -// const arrayBuffer: ArrayBuffer = await response.arrayBuffer(); -// const blob: Blob = response.blob(); -// const bytes: Uint8Array = response.bytes(); -// You can only use the response body once, so you must choose one of the above methods. -// If you want to check if the response body has been used, you can use the following property. -const bodyUsed = response.bodyUsed; +// Choose one: +const stream = response.stream(); +// const arrayBuffer = await response.arrayBuffer(); +// const blob = await response.blob(); +// const bytes = await response.bytes(); ``` -
-Save binary response to a file -
-Node.js +Save to file examples -
-
-ReadableStream (most-efficient) - -```ts +**Node.js (ReadableStream):** +```typescript import { createWriteStream } from 'fs'; import { Readable } from 'stream'; import { pipeline } from 'stream/promises'; -const response = await client.inboundParsing.getInboundEmailAttachment(...); - const stream = response.stream(); const nodeStream = Readable.fromWeb(stream); -const writeStream = createWriteStream('path/to/file'); - -await pipeline(nodeStream, writeStream); +await pipeline(nodeStream, createWriteStream('path/to/file')); ``` -
-
- -
-
-ArrayBuffer - -```ts -import { writeFile } from 'fs/promises'; - -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const arrayBuffer = await response.arrayBuffer(); -await writeFile('path/to/file', Buffer.from(arrayBuffer)); -``` - -
-
- -
-
-Blob - -```ts -import { writeFile } from 'fs/promises'; - -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -const arrayBuffer = await blob.arrayBuffer(); -await writeFile('output.bin', Buffer.from(arrayBuffer)); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -import { writeFile } from 'fs/promises'; - -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -await writeFile('path/to/file', bytes); -``` - -
-
- -
-
- -
-
-Bun - -
-
-ReadableStream (most-efficient) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const stream = response.stream(); -await Bun.write('path/to/file', stream); -``` - -
-
- -
-
-ArrayBuffer - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const arrayBuffer = await response.arrayBuffer(); -await Bun.write('path/to/file', arrayBuffer); -``` - -
-
- -
-
-Blob - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -await Bun.write('path/to/file', blob); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -await Bun.write('path/to/file', bytes); -``` - -
-
- -
-
- -
-
-Deno - -
-
-ReadableStream (most-efficient) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const stream = response.stream(); -const file = await Deno.open('path/to/file', { write: true, create: true }); -await stream.pipeTo(file.writable); -``` - -
-
- -
-
-ArrayBuffer - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const arrayBuffer = await response.arrayBuffer(); -await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); -``` - -
-
- -
-
-Blob - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -const arrayBuffer = await blob.arrayBuffer(); -await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -await Deno.writeFile('path/to/file', bytes); +**Bun:** +```typescript +await Bun.write('path/to/file', response.stream()); ``` -
-
- -
-
- -
-
-Browser - -
-
-Blob (most-efficient) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - +**Browser:** +```typescript const blob = await response.blob(); const url = URL.createObjectURL(blob); - -// trigger download const a = document.createElement('a'); a.href = url; a.download = 'filename'; @@ -717,336 +232,195 @@ URL.revokeObjectURL(url); ```
-
- -
-
-ReadableStream -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); +--- -const stream = response.stream(); -const reader = stream.getReader(); -const chunks = []; - -while (true) { - const { done, value } = await reader.read(); - if (done) break; - chunks.push(value); -} - -const blob = new Blob(chunks); -const url = URL.createObjectURL(blob); - -// trigger download -const a = document.createElement('a'); -a.href = url; -a.download = 'filename'; -a.click(); -URL.revokeObjectURL(url); -``` - -
-
- -
-
-ArrayBuffer +## TypeScript Types -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); +All request and response types are exported. -const arrayBuffer = await response.arrayBuffer(); -const blob = new Blob([arrayBuffer]); -const url = URL.createObjectURL(blob); - -// trigger download -const a = document.createElement('a'); -a.href = url; -a.download = 'filename'; -a.click(); -URL.revokeObjectURL(url); -``` - -
-
- -
-
-Bytes (UIntArray8) - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const bytes = await response.bytes(); -const blob = new Blob([bytes]); -const url = URL.createObjectURL(blob); - -// trigger download -const a = document.createElement('a'); -a.href = url; -a.download = 'filename'; -a.click(); -URL.revokeObjectURL(url); -``` - -
-
- -
-
- -
- - -
-Convert binary response to text - -
-
-ReadableStream - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); +```typescript +import { Brevo } from 'getbrevo/brevo@^4.0.0'; -const stream = response.stream(); -const text = await new Response(stream).text(); +const request: Brevo.SendTransacEmailRequest = { + subject: "First email", + textContent: "Hello world!", + sender: { name: "Bob Wilson", email: "bob.wilson@example.com" }, + to: [{ email: "sarah.davis@example.com", name: "Sarah Davis" }] +}; ``` -
-
+--- -
-
-ArrayBuffer - -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); +## Logging -const arrayBuffer = await response.arrayBuffer(); -const text = new TextDecoder().decode(arrayBuffer); +```typescript +import { BrevoClient, logging } from 'getbrevo/brevo@^4.0.0'; + +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + logging: { + level: logging.LogLevel.Debug, + logger: new logging.ConsoleLogger(), + silent: false + } +}); ``` -
-
- -
-Blob +Custom logger example -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); - -const blob = await response.blob(); -const text = await blob.text(); -``` - -
-
- -
-
-Bytes (UIntArray8) +```typescript +import winston from 'winston'; -```ts -const response = await client.inboundParsing.getInboundEmailAttachment(...); +const winstonLogger = winston.createLogger({...}); -const bytes = await response.bytes(); -const text = new TextDecoder().decode(bytes); +const logger: logging.ILogger = { + debug: (msg, ...args) => winstonLogger.debug(msg, ...args), + info: (msg, ...args) => winstonLogger.info(msg, ...args), + warn: (msg, ...args) => winstonLogger.warn(msg, ...args), + error: (msg, ...args) => winstonLogger.error(msg, ...args), +}; ```
-
-
+--- -## Advanced +## Custom Fetch Client -### Additional Headers - -If you would like to send additional headers as part of the request, use the `headers` request option. +Override the default fetch implementation for advanced use cases. ```typescript -import { BrevoClient } from "Brevo"; - -const client = new BrevoClient({ - ... - headers: { - 'X-Custom-Header': 'custom value' - } -}); - -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - headers: { - 'X-Custom-Header': 'custom value' - } -}); -``` - -### Additional Query String Parameters - -If you would like to send additional query string parameters as part of the request, use the `queryParams` request option. +const customFetcher = async (url: string, options?: RequestInit): Promise => { + // Your custom implementation + return fetch(url, options); +}; -```typescript -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - queryParams: { - 'customQueryParamKey': 'custom query param value' - } +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + fetcher: customFetcher }); ``` -### Retries - -The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long -as the request is deemed retryable and the number of retry attempts has not grown larger than the configured -retry limit (default: 2). - -A request is deemed retryable when any of the following HTTP status codes is returned: - -- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) -- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) -- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) - -Use the `maxRetries` request option to configure this behavior. +
+Common use cases +**Using node-fetch:** ```typescript -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - maxRetries: 0 // override maxRetries at the request level +import fetch from 'node-fetch'; +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + fetcher: fetch as any }); ``` -### Timeouts - -The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior. - +**Using undici:** ```typescript -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - timeoutInSeconds: 30 // override timeout to 30s +import { fetch } from 'undici'; +const brevo = new BrevoClient({ + apiKey: 'your-api-key', + fetcher: fetch as any }); ``` -### Aborting Requests - -The SDK allows users to abort requests at any point by passing in an abort signal. - +**With interceptors:** ```typescript -const controller = new AbortController(); -const response = await client.masterAccount.createANewGroupOfSubAccounts(..., { - abortSignal: controller.signal -}); -controller.abort(); // aborts the request +const createFetcherWithInterceptors = () => { + return async (url: string, options?: RequestInit): Promise => { + const modifiedOptions = { + ...options, + headers: { + ...options?.headers, + 'X-Request-ID': generateRequestId() + } + }; + const response = await fetch(url, modifiedOptions); + console.log('Response:', response.status); + return response; + }; +}; ``` -### Access Raw Response Data - -The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method. -The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property. - -```typescript -const { data, rawResponse } = await client.masterAccount.createANewGroupOfSubAccounts(...).withRawResponse(); - -console.log(data); -console.log(rawResponse.headers['X-My-Header']); -``` +
-### Logging +--- -The SDK supports logging. You can configure the logger by passing in a `logging` object to the client options. +## Runtime Compatibility -```typescript -import { BrevoClient, logging } from "Brevo"; - -const client = new BrevoClient({ - ... - logging: { - level: logging.LogLevel.Debug, // defaults to logging.LogLevel.Info - logger: new logging.ConsoleLogger(), // defaults to ConsoleLogger - silent: false, // defaults to true, set to false to enable logging - } -}); -``` -The `logging` object can have the following properties: -- `level`: The log level to use. Defaults to `logging.LogLevel.Info`. -- `logger`: The logger to use. Defaults to a `logging.ConsoleLogger`. -- `silent`: Whether to silence the logger. Defaults to `true`. +- Node.js 18+ +- Vercel +- Cloudflare Workers +- Deno v1.25+ +- Bun 1.0+ +- React Native -The `level` property can be one of the following values: -- `logging.LogLevel.Debug` -- `logging.LogLevel.Info` -- `logging.LogLevel.Warn` -- `logging.LogLevel.Error` +--- -To provide a custom logger, you can pass in an object that implements the `logging.ILogger` interface. +## Migration from v3.x
-Custom logger examples +View migration guide -Here's an example using the popular `winston` logging library. -```ts -import winston from 'winston'; +This version includes breaking changes: -const winstonLogger = winston.createLogger({...}); +**Key Changes:** +- New client initialization +- Promise-based API +- Improved TypeScript support +- Standardized error handling -const logger: logging.ILogger = { - debug: (msg, ...args) => winstonLogger.debug(msg, ...args), - info: (msg, ...args) => winstonLogger.info(msg, ...args), - warn: (msg, ...args) => winstonLogger.warn(msg, ...args), - error: (msg, ...args) => winstonLogger.error(msg, ...args), -}; -``` +**Example:** -Here's an example using the popular `pino` logging library. +**v3.x:** +```typescript +import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo"; -```ts -import pino from 'pino'; +let emailAPI = new TransactionalEmailsApi(); +(emailAPI as any).authentications.apiKey.apiKey = "xkeysib-xxx"; -const pinoLogger = pino({...}); +let message = new SendSmtpEmail(); +message.subject = "First email"; +message.textContent = "Hello world!"; +message.sender = { name: "Bob Wilson", email: "bob.wilson@example.com" }; +message.to = [{ email: "sarah.davis@example.com", name: "Sarah Davis" }]; -const logger: logging.ILogger = { - debug: (msg, ...args) => pinoLogger.debug(args, msg), - info: (msg, ...args) => pinoLogger.info(args, msg), - warn: (msg, ...args) => pinoLogger.warn(args, msg), - error: (msg, ...args) => pinoLogger.error(args, msg), -}; +emailAPI.sendTransacEmail(message); ``` -
- - -### Runtime Compatibility +**v4.x:** +```typescript +import { BrevoClient } from 'getbrevo/brevo@^4.0.0'; -The SDK works in the following runtimes: +const brevo = new BrevoClient({ + apiKey: 'xkeysib-xxx' +}); +await brevo.transactionalEmails.sendTransacEmail({ + subject: "First email", + textContent: "Hello world!", + sender: { name: "Bob Wilson", email: "bob.wilson@example.com" }, + to: [{ email: "sarah.davis@example.com", name: "Sarah Davis" }] +}); +``` + -- Node.js 18+ -- Vercel -- Cloudflare Workers -- Deno v1.25+ -- Bun 1.0+ -- React Native +> [!WARNING] +> The legacy v3.x SDK (`@getbrevo/brevo@^3.0.1`) will continue to receive critical security updates but no new features. We recommend migrating to v4.x. -### Customizing Fetch Client +--- -The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an -unsupported environment, this provides a way for you to break glass and ensure the SDK works. +## Contributing -```typescript -import { BrevoClient } from "Brevo"; +This library is generated programmatically. Changes made directly to the library would be overwritten. Please open an issue first to discuss changes. -const client = new BrevoClient({ - ... - fetcher: // provide your implementation here -}); -``` +Contributions to this README are always welcome! -## Contributing +--- -While we value open-source contributions to this SDK, this library is generated programmatically. -Additions made directly to this library would have to be moved over to our generation code, -otherwise they would be overwritten upon the next generated release. Feel free to open a PR as -a proof of concept, but know that we will not be able to merge it as-is. We suggest opening -an issue first to discuss with us! +## Support -On the other hand, contributions to the README are always very welcome! \ No newline at end of file +- [API Reference](https://developers.brevo.com) +- [GitHub Issues](https://github.com/getbrevo/brevo-node/tree/main) +- [Email Support](mailto:support@brevo.com) From 68e0cfada6b111fa00494f1ff03ebd3a15f6af5d Mon Sep 17 00:00:00 2001 From: Mauricio Mourraille Date: Mon, 9 Feb 2026 20:59:22 +0100 Subject: [PATCH 07/33] Add banner image to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 69fdcc8..c1d98b1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Brevo Node.js SDK +![](banner.jpg) [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fmourraille%2Fdemo-ts) ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) From 3a2baa1e9641300c6f88bd94f9259987b2198b23 Mon Sep 17 00:00:00 2001 From: Mauricio Mourraille Date: Mon, 9 Feb 2026 21:00:12 +0100 Subject: [PATCH 08/33] Add files via upload --- banner.jpg | Bin 0 -> 186794 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 banner.jpg diff --git a/banner.jpg b/banner.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dfd2c6f79b80ce392d7febba14ccbb030263d99c GIT binary patch literal 186794 zcmdqJ2~<;Aw=Nn>5fK3a>4lWigMiXVPf8JxAVm6}6e40kdXNAisgk~vD%z4Rg%BWg zktQHrB7~;sM0x>fLIk8w6k>o7Uh1BE|98e2cZ_?^fA4$ae=ix3k-ayYJ@;CB&ToG6 zo9p!B=`!Fl*wow;B+2f3^?<@`TF}L|C^^cbLR9Nfd9gowDUL5p5X`l zz<=f}|C!Ss01yB;!|`wD2K@KenIF!c<2cWGf$JhS`vCl9zz=86p8et6Sq_eK=h#Qb zu=fMb@pA}VyLIQhptUFG_24V&zy4lwLHcfemypdERYv1c$P2EE!Xlz#;<9q`3W`da zTDP@zboGqynV6d0HwW9=**iEoIlFj0_I~2?6y_Tm7XCZ}9vKxI7oU)rl$?^8m7SBD z_s6UJ*QI5c@`_4qRYPMFzPaUXYg;#|r?;>FuYtkwiOH$ynUAw`^Jbtn4HEgItk3z;S3d?AcWodt#_TMb~&l&dOpR(*9hW+1m%>gc* zJ;NTnv-|)MfVHMfYy9@ppFjL^5ugD0*ZCNj@|hKQ$2X#;vYiro3dp$mj_!by(CrDa zekrB4SXzMOT-`cY+ zIHJ+pfBMh=pBd5f?KMx|uV4J7-iUN`#Jir7pOvlvE?X$Q&}x3D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z0Q;UPPL_&7UPOUD*picZF`n5!1(LfwbK;F%v)ozEYjntE=c^Za^f3e3W-UDvgJ-7skDjEYwOuw%JV}TWhb(*l!C~AZ*%ys z3*P@7%7=flE&{1CCqR5*h7|BW+=uuJ-+tJ{R6nu0??smM(%vzAc3(JhFxGHqOG7EZ4m}H|A$DCoNd4OuOF1rX+6_H~N01Xp#aq*vWW`KTVZn zUI2>f-ybvHHd^<6YW-HmZYo165cP+hX?yfiOBq{#9C!|l8du=r4ql0m} z{q@wFsYfZb)FF+x}^)DM^-)nmo@su5~@kijsm_ zDmcB~7-GJSA?10wr5lXPC>a_Nt;X2D%Nd?(N?0(iZD>*%{b*|!>|prC^v~S~z-=4d zP4+b}j_b6@yGSuj^5~o$F-?rBoPOc0;Bis`BqGlouJ5j=L)BjjeZxy~1tf8L1lx?2_P=*+z< zv#Ry1fA?yTQ+HmxJYTDYOc)Kwm49@AtC%dafSgQ?XJqf+v*m(u$%N^6)GyN~JdBEe zsyB@M;2CoICvSoOFL(MWdMWcOm|`NETu=kZCb>a}lc}Vm$OukaqY06&Lun)ol0or8 zAZkQS6qXufNFh9CP5;dp=$Ru5=vI4 zgEI0w61GZPgxfCLiae{PA&<6Ff3Z9u9=ZW*D^+sVFBUDE1N?^%1$%qIFz4myFP3G| z(Qt3fE@2z^oUk8I4*f1h>pk&~7+LtR^D07yu133#7LCL|^LaThL0OG&W&cP1UWD|R zj4L%T<<0vwUyp3S&@X#sMkcy)#^Jt9b!oDu^wvsxkv%R^CF|M1;9Hk*-(X#T4RcAY zu!`%~be~5?I&^y7(anV^cwbRUwf6|SjusEOn-r Date: Mon, 9 Feb 2026 21:06:03 +0100 Subject: [PATCH 09/33] Add files via upload --- banner.jpg | Bin 186794 -> 153089 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/banner.jpg b/banner.jpg index dfd2c6f79b80ce392d7febba14ccbb030263d99c..d89826070d14fcbed78cd7c6f505e6f70488b5f5 100644 GIT binary patch literal 153089 zcmeF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kRO-4xm zINx5!OdrOToZe%$vLR;Thlz@jcK-ooI7&+EkA*o}RyY4ptXFAr zNT-@;ThpY}=6A-GC^^Gr>rCmPJf66&ubrVbqkajP*u*X~r&PZ?`SF zmip~Ts;4z0Q;UPPL_&7UPOUD*picZF`n5!1(LfwbK;F%v)ozEYjntE=c^Za^f3e3W-UDvgJ-7skDjEYwOuw%JV}TWhb(*l!C~AZ*%ys z3*P@7%7=flE&{1CCqR5*h7|BW+=uuJ-+tJ{R6nu0??smM(%vzAc3(JhFxGHqOG7EZ4m}H|A$DCoNd4OuOF1rX+6_H~N01Xp#aq*vWW`KTVZn zUI2>f-ybvHHd^<6YW-HmZYo165cP+hX?yfiOBq{#9C!|l8du=r4ql0m} z{q@wFsYfZb)FF+x}^)DM^-)nmo@su5~@kijsm_ zDmcB~7-GJSA?10wr5lXPC>a_Nt;X2D%Nd?(N?0(iZD>*%{b*|!>|prC^v~S~z-=4d zP4+b}j_b6@yGSuj^5~o$F-?rBoPOc0;Bis`BqGlouJ5j=L)BjjeZxy~1tf8L1lx?2_P=*+z< zv#Ry1fA?yTQ+HmxJYTDYOc)Kwm49@AtC%dafSgQ?XJqf+v*m(u$%N^6)GyN~JdBEe zsyB@M;2CoICvSoOFL(MWdMWcOm|`NETu=kZCb>a}lc}Vm$OukaqY06&Lun)ol0or8 zAZkQS6qXufNFh9CP5;dp=$Ru5=vI4 zgEI0w61GZPgxfCLiae{PA&<6Ff3Z9u9=ZW*D^+sVFBUDE1N?^%1$%qIFz4myFP3G| z(Qt3fE@2z^oUk8I4*f1h>pk&~7+LtR^D07yu133#7LCL|^LaThL0OG&W&cP1UWD|R zj4L%T<<0vwUyp3S&@X#sMkcy)#^Jt9b!oDu^wvsxkv%R^CF|M1;9Hk*-(X#T4RcAY zu!`%~be~5?I&^y7(anV^cwbRUwf6|SjusEOn-r Date: Mon, 9 Feb 2026 21:06:50 +0100 Subject: [PATCH 10/33] Change banner image format in README Updated banner image from 'banner.jpg' to 'banner.png'. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c1d98b1..b214fd9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Brevo Node.js SDK -![](banner.jpg) +![](banner.png) [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fmourraille%2Fdemo-ts) ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) From 45411a68eef61a67b1630aaba9a3765d0e992ec3 Mon Sep 17 00:00:00 2001 From: Mauricio Mourraille Date: Mon, 9 Feb 2026 21:07:43 +0100 Subject: [PATCH 11/33] Add files via upload --- banner.png | Bin 0 -> 153089 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 banner.png diff --git a/banner.png b/banner.png new file mode 100644 index 0000000000000000000000000000000000000000..d89826070d14fcbed78cd7c6f505e6f70488b5f5 GIT binary patch literal 153089 zcmeFa2V4`~x-T3+Iuejxqkw>*A}U2%R9-+tMMSAeM4E_zAPQ*6C`d065fBtY5s_x- zpp-~QiZrE#5}I^LC?Sx-H|}=Nx6j$9?7Q#1=j@l!8It^_to6*Z{_E*$XK-f%$}sSA zb%sDLUW6z?AP^1+8`C}r3;2l%{0CtYhp_(PGX!G6B=MKec1((YI)@noVHWsb=ZCsN z_WbF5@ScCz&i(28AOEsHhd|iDU-le3eq1${>5re8m{}lcfBs$d*s(OG|8>VS=0D$& z=VltqpFgvRzGeHd{T?*_{V3z{B6xgM}E(LZeuuFlz zO@SRe}-G7*#ER~{9)t#wQ>JtWBPR!3kxgw zpPPe?<1fGer$6kBf_i=P&SwZe2a71rO%^5@2s1wu3qR9NBU1)wgkb$+3;)~=u$_BY z+1NQaxw!ct%uFmS%zIc^S@(d32d02uri4BGtoshAo?#O(vuBs_5s8^!9!m^|3^X3fX!XsY9y^K#te3g`(k@+_3UH1E&+~Shbv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igPm;U|Izkgo+8~(Fd0l)O`U#M^M jKdYSnzj|NLulV2p$zJ-~==`tv-> Date: Mon, 9 Feb 2026 21:08:21 +0100 Subject: [PATCH 12/33] Delete banner.jpg --- banner.jpg | Bin 153089 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 banner.jpg diff --git a/banner.jpg b/banner.jpg deleted file mode 100644 index d89826070d14fcbed78cd7c6f505e6f70488b5f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 153089 zcmeFa2V4`~x-T3+Iuejxqkw>*A}U2%R9-+tMMSAeM4E_zAPQ*6C`d065fBtY5s_x- zpp-~QiZrE#5}I^LC?Sx-H|}=Nx6j$9?7Q#1=j@l!8It^_to6*Z{_E*$XK-f%$}sSA zb%sDLUW6z?AP^1+8`C}r3;2l%{0CtYhp_(PGX!G6B=MKec1((YI)@noVHWsb=ZCsN z_WbF5@ScCz&i(28AOEsHhd|iDU-le3eq1${>5re8m{}lcfBs$d*s(OG|8>VS=0D$& z=VltqpFgvRzGeHd{T?*_{V3z{B6xgM}E(LZeuuFlz zO@SRe}-G7*#ER~{9)t#wQ>JtWBPR!3kxgw zpPPe?<1fGer$6kBf_i=P&SwZe2a71rO%^5@2s1wu3qR9NBU1)wgkb$+3;)~=u$_BY z+1NQaxw!ct%uFmS%zIc^S@(d32d02uri4BGtoshAo?#O(vuBs_5s8^!9!m^|3^X3fX!XsY9y^K#te3g`(k@+_3UH1E&+~Shbvhs?`kDuxr8k?G1 zTEDdQ_I>-_KQK5nJTW;nJ@aFBZhnEZy0*SS-lS}8gSL%7b_YEEu}A-+Km1^SnD^{q z*~9*;KTOQN;LgIohxLFe+rBeq?Dk#)GRL2C2%e2iFRJ5|J#mF7bj!PkOIYsY#6i-p zF8!fL|G5qY{#`x#ONai_pPgX{4+|6c!dUnra0p{iF(ZOjO*xhkp$OUC|44%mo=pr@ zBBo)5d)#ll#U{QSojHH6tZ8(4I+BO)w-oEq!d%w-2oc6HD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Q24$ZncFU&6`gOa!yota!J~4N)& zy$$hx-I)gf^09&O`OIzgfLC|#E@JE;daXd+{ktES4l!`*?M-JG()9aq)a2NNEEHWi z-r%*VTbJn{{Z(w|8U1jX(g|~CC6#?CuiaN6D}O83tBSjHztK{+^RLg@I{(ayt$%ys z&kDNzPr|^!ho(5JNYUeH)hryF2i-~#zPi&qd!b?fld>z(>%JnY+;R8sSF3eY25*^A zVW8n{Wv(z1cPSAoqJ&cCXmq2d7BV8&#C~Eh;vLM zOH2ojo$(cPM0{DOxVaoXU#BweUo}_IkD)*0^ZXroHJruTN(d{&yUArB<69-Ecb454A?TpgclO@);^K{p-$VB5cb)Ou3IBKcvrcu~w?hup1_jT>u?G zDmbKnMD3bMkOA81{DHJp$VAtCh_Ssu(-M z4KXtJxA^E<1!kiz1jO!o-a!){tIS@OC@3-Aq#^tOK9vdM_Wym?18 z^|0M1n{T+~;QRzd+9|qI9!Jh{^NwEG)-?&$=dK2Ixa^|HO1wGzNJVm$Y}3y=kLk~T zA(6k3$Uh(hoPV$w_Ft`Of6w**2ij?k?uM^kM{I|d?RtN3tR*XN#8RM9PxiSuQV%P3 z6V6UHaiuzo8t%ViOaj4{i@X0S>+08a|1~Xe=nodb`+Ma7uRi9N{{3sp=Kl|C3iS8Y zHu=jf&Of5lzx3~y{{6G+GW3VbR{XV|-XGDs|Je7J{{7Owe_s9jV|g+EA=Cd#zrXbF zm;U|p>faw@g8eJ$-GAKcFa7(afB(Gt_oqiC|8igPm;U|Izkgo+8~(Fd0l)O`U#M^M jKdYSnzj|NLulV2p$zJ-~==`tv-> Date: Mon, 9 Feb 2026 21:08:50 +0100 Subject: [PATCH 13/33] Add banner.png to .fernignore --- .fernignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.fernignore b/.fernignore index 4d230f9..e22fca4 100644 --- a/.fernignore +++ b/.fernignore @@ -1,2 +1,3 @@ # Custom README README.md +banner.png From fa69f6720d8941cc14c63350e59f2286cdd86481 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:27:11 +0000 Subject: [PATCH 14/33] SDK regeneration --- .fern/metadata.json | 4 ++-- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ package.json | 9 +++------ src/BaseClient.ts | 6 +++--- src/version.ts | 2 +- 5 files changed, 45 insertions(+), 12 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 63bcc60..35d6aa9 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "3.57.1", + "cliVersion": "3.63.0", "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "3.46.3", "generatorConfig": { @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "0.0.54" + "sdkVersion": "0.0.56" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a98d4d0..1c70c5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,3 +40,39 @@ jobs: - name: Test run: pnpm test + + publish: + needs: [ compile, test ] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + permissions: + contents: read # Required for checkout + id-token: write # Required for OIDC + steps: + - name: Checkout repo + uses: actions/checkout@v6 + + - name: Set up node + uses: actions/setup-node@v6 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build + + - name: Publish to npm + run: | + publish() { # use latest npm to ensure OIDC support + npx -y npm@latest publish "$@" + } + if [[ ${GITHUB_REF} == *alpha* ]]; then + publish --access public --tag alpha + elif [[ ${GITHUB_REF} == *beta* ]]; then + publish --access public --tag beta + else + publish --access public + fi \ No newline at end of file diff --git a/package.json b/package.json index b8f0a16..e326d43 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,8 @@ { - "name": "", - "version": "0.0.54", + "name": "getbrevo/brevo", + "version": "0.0.56", "private": false, - "repository": { - "type": "git", - "url": "git+https://github.com/getbrevo/brevo-node.git" - }, + "repository": "git+https://github.com/getbrevo/brevo-node", "type": "commonjs", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.mjs", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 88ff548..1e2ff34 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -50,9 +50,9 @@ export function normalizeClientOptions Date: Wed, 11 Feb 2026 13:30:14 +0000 Subject: [PATCH 15/33] SDK regeneration --- .fern/metadata.json | 2 +- package.json | 9 ++++++--- src/BaseClient.ts | 6 +++--- src/version.ts | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 35d6aa9..730fee7 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "0.0.56" + "sdkVersion": "3.0.2" } diff --git a/package.json b/package.json index e326d43..2035161 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,11 @@ { - "name": "getbrevo/brevo", - "version": "0.0.56", + "name": "@getbrevo/brevo", + "version": "3.0.2", "private": false, - "repository": "git+https://github.com/getbrevo/brevo-node", + "repository": { + "type": "git", + "url": "git+https://github.com/getbrevo/brevo-node.git" + }, "type": "commonjs", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.mjs", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 1e2ff34..0888a71 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -50,9 +50,9 @@ export function normalizeClientOptions Date: Wed, 11 Feb 2026 14:46:41 +0000 Subject: [PATCH 16/33] chore: remove package name and publishing configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove package name from configuration and eliminate automated publishing infrastructure. This change removes the npm package name from package.json and BaseClient.ts headers, and removes the entire publishing workflow from GitHub Actions. Key changes: - Remove package name from package.json and SDK headers - Delete publish job from GitHub Actions CI workflow - Remove User-Agent header from BaseClient - Eliminate automated npm publishing on tag creation 🌿 Generated with Fern --- .fern/metadata.json | 2 +- .fernignore | 1 + .github/workflows/ci.yml | 36 ------------------------------------ changelog.md | 13 +++++++++++++ package.json | 4 ++-- src/BaseClient.ts | 6 +++--- src/version.ts | 2 +- 7 files changed, 21 insertions(+), 43 deletions(-) create mode 100644 changelog.md diff --git a/.fern/metadata.json b/.fern/metadata.json index 730fee7..2a7691e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "3.0.2" + "sdkVersion": "4.0.0" } diff --git a/.fernignore b/.fernignore index e22fca4..8692c48 100644 --- a/.fernignore +++ b/.fernignore @@ -1,3 +1,4 @@ # Custom README README.md banner.png +changelog.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c70c5b..a98d4d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,39 +40,3 @@ jobs: - name: Test run: pnpm test - - publish: - needs: [ compile, test ] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - permissions: - contents: read # Required for checkout - id-token: write # Required for OIDC - steps: - - name: Checkout repo - uses: actions/checkout@v6 - - - name: Set up node - uses: actions/setup-node@v6 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build - run: pnpm build - - - name: Publish to npm - run: | - publish() { # use latest npm to ensure OIDC support - npx -y npm@latest publish "$@" - } - if [[ ${GITHUB_REF} == *alpha* ]]; then - publish --access public --tag alpha - elif [[ ${GITHUB_REF} == *beta* ]]; then - publish --access public --tag beta - else - publish --access public - fi \ No newline at end of file diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..5e3e5bf --- /dev/null +++ b/changelog.md @@ -0,0 +1,13 @@ +## 4.0.0 - 2026-02-11 +* chore: remove package name and publishing configuration +* Remove package name from configuration and eliminate automated publishing +* infrastructure. This change removes the npm package name from package.json +* and BaseClient.ts headers, and removes the entire publishing workflow +* from GitHub Actions. +* Key changes: +* Remove package name from package.json and SDK headers +* Delete publish job from GitHub Actions CI workflow +* Remove User-Agent header from BaseClient +* Eliminate automated npm publishing on tag creation +* 🌿 Generated with Fern + diff --git a/package.json b/package.json index 2035161..5f82cdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@getbrevo/brevo", - "version": "3.0.2", + "name": "", + "version": "4.0.0", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 0888a71..d7cae5f 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -50,9 +50,9 @@ export function normalizeClientOptions Date: Wed, 11 Feb 2026 14:53:38 +0000 Subject: [PATCH 17/33] feat: add npm publish workflow and configure package metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add automated publishing workflow with tag-based deployment that publishes to npm with proper versioning support for alpha, beta, and stable releases. Configure package name and SDK metadata headers for proper identification. Key changes: - Add GitHub Actions publish workflow triggered on tag pushes - Support alpha/beta/stable release channels with appropriate npm tags - Set package name to "@getbrevo/brevo" in package.json - Configure SDK name header for API request identification - Remove placeholder User-Agent header from base client 🌿 Generated with Fern --- .fern/metadata.json | 2 +- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ changelog.md | 11 +++++++++++ package.json | 4 ++-- src/BaseClient.ts | 6 +++--- src/version.ts | 2 +- 6 files changed, 54 insertions(+), 7 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 2a7691e..f6bfe8a 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "4.0.0" + "sdkVersion": "4.1.0" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a98d4d0..1c70c5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,3 +40,39 @@ jobs: - name: Test run: pnpm test + + publish: + needs: [ compile, test ] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + permissions: + contents: read # Required for checkout + id-token: write # Required for OIDC + steps: + - name: Checkout repo + uses: actions/checkout@v6 + + - name: Set up node + uses: actions/setup-node@v6 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm build + + - name: Publish to npm + run: | + publish() { # use latest npm to ensure OIDC support + npx -y npm@latest publish "$@" + } + if [[ ${GITHUB_REF} == *alpha* ]]; then + publish --access public --tag alpha + elif [[ ${GITHUB_REF} == *beta* ]]; then + publish --access public --tag beta + else + publish --access public + fi \ No newline at end of file diff --git a/changelog.md b/changelog.md index 5e3e5bf..d5724a5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,14 @@ +## 4.1.0 - 2026-02-11 +* feat: add npm publish workflow and configure package metadata +* Add automated publishing workflow with tag-based deployment that publishes to npm with proper versioning support for alpha, beta, and stable releases. Configure package name and SDK metadata headers for proper identification. +* Key changes: +* Add GitHub Actions publish workflow triggered on tag pushes +* Support alpha/beta/stable release channels with appropriate npm tags +* Set package name to "@getbrevo/brevo" in package.json +* Configure SDK name header for API request identification +* Remove placeholder User-Agent header from base client +* 🌿 Generated with Fern + ## 4.0.0 - 2026-02-11 * chore: remove package name and publishing configuration * Remove package name from configuration and eliminate automated publishing diff --git a/package.json b/package.json index 5f82cdd..1963204 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "", - "version": "4.0.0", + "name": "@getbrevo/brevo", + "version": "4.1.0", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index d7cae5f..4ebc026 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -50,9 +50,9 @@ export function normalizeClientOptions Date: Wed, 11 Feb 2026 15:13:54 +0000 Subject: [PATCH 18/33] SDK regeneration --- .fern/metadata.json | 2 +- package.json | 2 +- src/BaseClient.ts | 4 ++-- src/version.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index f6bfe8a..2a7691e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "4.1.0" + "sdkVersion": "4.0.0" } diff --git a/package.json b/package.json index 1963204..666db80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "4.1.0", + "version": "4.0.0", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 4ebc026..7bd0219 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions Date: Wed, 11 Feb 2026 15:27:14 +0000 Subject: [PATCH 19/33] SDK regeneration --- .fern/metadata.json | 2 +- package.json | 2 +- src/BaseClient.ts | 4 ++-- src/version.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 2a7691e..66ce690 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "4.0.0" + "sdkVersion": "4.0.1" } diff --git a/package.json b/package.json index 666db80..5c57ded 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "4.0.0", + "version": "4.0.1", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 7bd0219..ee746f1 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions Date: Wed, 11 Feb 2026 17:36:13 +0100 Subject: [PATCH 20/33] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b214fd9..5a45e19 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,13 @@ ## Installation ```bash -npm install getbrevo/brevo@^4.0.0 +npm install getbrevo/brevo@^4.0.1 ``` ## Quick Start ```typescript -import { BrevoClient } from 'getbrevo/brevo@^4.0.0'; +import { BrevoClient } from 'getbrevo/brevo'; const brevo = new BrevoClient({ apiKey: 'your-api-key', @@ -54,7 +54,7 @@ const brevo = new BrevoClient({ The SDK throws specific error types based on HTTP status codes. ```typescript -import { BrevoError, UnauthorizedError, TooManyRequestsError } from 'getbrevo/brevo@^4.0.0'; +import { BrevoError, UnauthorizedError, TooManyRequestsError } from 'getbrevo/brevo'; try { await brevo.transactionalEmails.sendTransacEmail({...}); @@ -241,7 +241,7 @@ URL.revokeObjectURL(url); All request and response types are exported. ```typescript -import { Brevo } from 'getbrevo/brevo@^4.0.0'; +import { Brevo } from 'getbrevo/brevo'; const request: Brevo.SendTransacEmailRequest = { subject: "First email", @@ -256,7 +256,7 @@ const request: Brevo.SendTransacEmailRequest = { ## Logging ```typescript -import { BrevoClient, logging } from 'getbrevo/brevo@^4.0.0'; +import { BrevoClient, logging } from 'getbrevo/brevo'; const brevo = new BrevoClient({ apiKey: 'your-api-key', @@ -391,7 +391,7 @@ emailAPI.sendTransacEmail(message); **v4.x:** ```typescript -import { BrevoClient } from 'getbrevo/brevo@^4.0.0'; +import { BrevoClient } from 'getbrevo/brevo'; const brevo = new BrevoClient({ apiKey: 'xkeysib-xxx' From 53350960f91c4779f7f82c5b24d99f571a86f3c4 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:23:39 +0000 Subject: [PATCH 21/33] fix: update delete tier operations to return void instead of string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change deleteTierGroup and deleteTier methods to return void instead of string, which better reflects the actual API behavior for delete operations. This aligns the return types with the expected void response when deletion operations complete successfully. Key changes: - Update deleteTierGroup return type from HttpResponsePromise to HttpResponsePromise - Update deleteTier return type from HttpResponsePromise to HttpResponsePromise - Modify internal implementation to return undefined data instead of response body - Update test expectations to assert undefined response instead of string - Remove unnecessary mock response bodies in test setup 🌿 Generated with Fern --- .fern/metadata.json | 2 +- changelog.md | 11 +++++++++++ package.json | 2 +- reference.md | 4 ++-- src/BaseClient.ts | 4 ++-- src/api/resources/tier/client/Client.ts | 12 ++++++------ src/version.ts | 2 +- tests/wire/tier.test.ts | 15 +++------------ 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 66ce690..c63f3e8 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "4.0.1" + "sdkVersion": "5.0.0" } diff --git a/changelog.md b/changelog.md index d5724a5..9c639c8 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,14 @@ +## 5.0.0 - 2026-02-18 +* fix: update delete tier operations to return void instead of string +* Change deleteTierGroup and deleteTier methods to return void instead of string, which better reflects the actual API behavior for delete operations. This aligns the return types with the expected void response when deletion operations complete successfully. +* Key changes: +* Update deleteTierGroup return type from HttpResponsePromise to HttpResponsePromise +* Update deleteTier return type from HttpResponsePromise to HttpResponsePromise +* Modify internal implementation to return undefined data instead of response body +* Update test expectations to assert undefined response instead of string +* Remove unnecessary mock response bodies in test setup +* 🌿 Generated with Fern + ## 4.1.0 - 2026-02-11 * feat: add npm publish workflow and configure package metadata * Add automated publishing workflow with tag-based deployment that publishes to npm with proper versioning support for alpha, beta, and stable releases. Configure package name and SDK metadata headers for proper identification. diff --git a/package.json b/package.json index 5c57ded..91924f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "4.0.1", + "version": "5.0.0", "private": false, "repository": { "type": "git", diff --git a/reference.md b/reference.md index 76d621f..6309719 100644 --- a/reference.md +++ b/reference.md @@ -11497,7 +11497,7 @@ await client.tier.updateTierGroup({ -
client.tier.deleteTierGroup({ ...params }) -> string +
client.tier.deleteTierGroup({ ...params }) -> void
@@ -11765,7 +11765,7 @@ await client.tier.updateTier({
-
client.tier.deleteTier({ ...params }) -> string +
client.tier.deleteTier({ ...params }) -> void
diff --git a/src/BaseClient.ts b/src/BaseClient.ts index ee746f1..1f2d22c 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteTierGroup(request, requestOptions)); } private async __deleteTierGroup( request: Brevo.DeleteTierGroupRequest, requestOptions?: TierClient.RequestOptions, - ): Promise> { + ): Promise> { const { pid, gid } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -541,7 +541,7 @@ export class TierClient { logging: this._options.logging, }); if (_response.ok) { - return { data: _response.body as string, rawResponse: _response.rawResponse }; + return { data: undefined, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -876,14 +876,14 @@ export class TierClient { public deleteTier( request: Brevo.DeleteTierRequest, requestOptions?: TierClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteTier(request, requestOptions)); } private async __deleteTier( request: Brevo.DeleteTierRequest, requestOptions?: TierClient.RequestOptions, - ): Promise> { + ): Promise> { const { pid, tid } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -908,7 +908,7 @@ export class TierClient { logging: this._options.logging, }); if (_response.ok) { - return { data: _response.body as string, rawResponse: _response.rawResponse }; + return { data: undefined, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/version.ts b/src/version.ts index 45528ca..c0103fd 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "4.0.1"; +export const SDK_VERSION = "5.0.0"; diff --git a/tests/wire/tier.test.ts b/tests/wire/tier.test.ts index 61fe341..a182bcd 100644 --- a/tests/wire/tier.test.ts +++ b/tests/wire/tier.test.ts @@ -864,20 +864,18 @@ describe("TierClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = "string"; server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tier-groups/gid") .respondWith() .statusCode(200) - .jsonBody(rawResponseBody) .build(); const response = await client.tier.deleteTierGroup({ pid: "pid", gid: "gid", }); - expect(response).toEqual("string"); + expect(response).toEqual(undefined); }); test("deleteTierGroup (2)", async () => { @@ -1533,20 +1531,13 @@ describe("TierClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = "string"; - server - .mockEndpoint() - .delete("/loyalty/tier/programs/pid/tiers/tid") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().delete("/loyalty/tier/programs/pid/tiers/tid").respondWith().statusCode(200).build(); const response = await client.tier.deleteTier({ pid: "pid", tid: "tid", }); - expect(response).toEqual("string"); + expect(response).toEqual(undefined); }); test("deleteTier (2)", async () => { From 97b88d4d0ee858f766725c73a5e94810aa5731a1 Mon Sep 17 00:00:00 2001 From: Mauricio Mourraille Date: Thu, 19 Feb 2026 17:46:04 +0100 Subject: [PATCH 22/33] Update installation command for Brevo package --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a45e19..7843b98 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ## Installation ```bash -npm install getbrevo/brevo@^4.0.1 +npm install getbrevo/brevo ``` ## Quick Start From 0344145aee9753b442e32e3e31e2cb938af49b51 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 16:45:06 +0000 Subject: [PATCH 23/33] SDK regeneration --- .fern/metadata.json | 6 +- package.json | 2 +- pnpm-lock.yaml | 286 +++++++++--------- src/BaseClient.ts | 4 +- .../types/GetAccountActivityResponse.ts | 2 +- .../account/types/GetAccountResponse.ts | 12 +- .../types/CreateBalanceOrderResponse.ts | 12 +- .../types/GetBalanceDefinitionListResponse.ts | 2 +- .../types/GetContactBalancesResponse.ts | 16 +- ...ceProgramsPidTransactionHistoryResponse.ts | 30 +- .../types/GetSubscriptionBalancesResponse.ts | 6 +- ...ramsPidSubscriptionsCidBalancesResponse.ts | 18 +- .../companies/types/GetCompaniesResponse.ts | 2 +- .../GetCrmAttributesCompaniesResponseItem.ts | 10 +- .../types/PostCompaniesImportResponse.ts | 2 +- .../client/requests/ImportContactsRequest.ts | 8 +- .../requests/RequestContactExportRequest.ts | 14 +- .../requests/UpdateBatchContactsRequest.ts | 20 +- .../contacts/types/CreateContactResponse.ts | 2 +- .../contacts/types/GetAttributesResponse.ts | 8 +- .../contacts/types/GetContactInfoResponse.ts | 26 +- .../contacts/types/GetContactStatsResponse.ts | 22 +- .../contacts/types/GetFolderListsResponse.ts | 4 +- .../contacts/types/GetFoldersResponse.ts | 4 +- .../contacts/types/GetListResponse.ts | 4 +- .../contacts/types/GetListsResponse.ts | 4 +- .../contacts/types/GetSegmentsResponse.ts | 6 +- .../PutConversationsVisitorGroupResponse.ts | 4 +- .../client/requests/UpsertrecordsRequest.ts | 10 +- .../types/BatchDeleteObjectRecordsResponse.ts | 4 +- .../customObjects/types/GetrecordsResponse.ts | 18 +- .../types/UpsertrecordsResponse.ts | 4 +- .../GetCrmAttributesDealsResponseItem.ts | 10 +- .../deals/types/GetCrmDealsResponse.ts | 2 +- .../deals/types/PostCrmDealsImportResponse.ts | 2 +- .../domains/types/CreateDomainResponse.ts | 4 +- .../domains/types/GetDomainsResponse.ts | 2 +- .../requests/CreateProductAlertRequest.ts | 6 +- .../CreateUpdateBatchCategoryRequest.ts | 8 +- .../CreateUpdateBatchProductsRequest.ts | 20 +- .../types/CreateBatchOrderResponse.ts | 2 +- .../CreateUpdateBatchCategoryResponse.ts | 4 +- .../CreateUpdateBatchProductsResponse.ts | 4 +- .../types/CreateUpdateCategoryResponse.ts | 2 +- .../types/CreateUpdateProductResponse.ts | 2 +- ...versionSourceConversionSourceIdResponse.ts | 14 +- .../requests/CreateEmailCampaignRequest.ts | 18 +- .../requests/UpdateEmailCampaignRequest.ts | 18 +- .../types/GetAbTestCampaignResultResponse.ts | 16 +- .../types/GetEmailCampaignResponse.ts | 50 +-- .../types/GetEmailCampaignsResponse.ts | 54 ++-- .../types/UploadImageToGalleryResponse.ts | 2 +- .../client/requests/CreateEventRequest.ts | 20 +- .../types/GetAllExternalFeedsResponse.ts | 8 +- .../types/GetExternalFeedByUuidResponse.ts | 8 +- .../files/types/GetCrmFilesIdResponse.ts | 2 +- .../GetInboundEmailEventsByUuidResponse.ts | 28 +- .../types/GetInboundEmailEventsResponse.ts | 2 +- .../client/requests/InviteAdminUserRequest.ts | 4 +- .../PutCorporateSubAccountIdPlanRequest.ts | 18 +- .../PutCorporateSubAccountsPlanRequest.ts | 16 +- ...PutCorporateUserEmailPermissionsRequest.ts | 4 +- .../types/GetCorporateGroupIdResponse.ts | 24 +- .../GetCorporateInvitedUsersListResponse.ts | 22 +- .../types/GetCorporateIpResponseItem.ts | 6 +- .../GetCorporateMasterAccountResponse.ts | 62 ++-- .../types/GetCorporateSubAccountIdResponse.ts | 74 ++--- .../types/GetCorporateSubAccountResponse.ts | 8 +- .../GetCorporateUserPermissionResponse.ts | 20 +- .../types/GetSubAccountGroupsResponseItem.ts | 4 +- .../types/InviteAdminUserResponse.ts | 2 +- .../types/PostCorporateGroupResponse.ts | 2 +- ...porateUserInvitationActionEmailResponse.ts | 2 +- .../notes/types/PostCrmNotesResponse.ts | 2 +- .../types/CreatePaymentRequestResponse.ts | 2 +- .../types/GetPaymentRequestResponse.ts | 6 +- .../process/types/GetProcessResponse.ts | 32 +- .../process/types/GetProcessesResponse.ts | 32 +- .../program/types/GetLpListResponse.ts | 2 +- .../GetParameterSubscriptionInfoResponse.ts | 56 ++-- .../SubscribeMemberToASubscriptionResponse.ts | 10 +- .../SubscribeToLoyaltyProgramResponse.ts | 14 +- .../client/requests/RedeemVoucherRequest.ts | 52 ++-- .../reward/types/CreateRewardResponse.ts | 16 +- .../reward/types/CreateVoucherResponse.ts | 22 +- .../reward/types/GetCodeCountResponse.ts | 2 +- ...etLoyaltyOfferProgramsPidOffersResponse.ts | 22 +- ...yaltyOfferProgramsPidRewardsRidResponse.ts | 162 +++++----- ...LoyaltyOfferProgramsPidVouchersResponse.ts | 30 +- .../reward/types/ValidateRewardResponse.ts | 2 +- .../client/requests/CreateSenderRequest.ts | 2 +- .../client/requests/UpdateSenderRequest.ts | 2 +- .../senders/types/CreateSenderResponse.ts | 4 +- .../senders/types/GetSendersResponse.ts | 2 +- .../requests/CreateSmsCampaignRequest.ts | 2 +- .../requests/UpdateSmsCampaignRequest.ts | 2 +- .../types/GetSmsCampaignResponse.ts | 2 +- .../types/GetSmsCampaignsResponse.ts | 6 +- .../types/GetSmsTemplatesResponse.ts | 34 +-- .../tasks/types/GetCrmTasksResponse.ts | 2 +- .../tasks/types/GetCrmTasktypesResponse.ts | 4 +- .../requests/CreateTierForTierGroupRequest.ts | 6 +- .../tier/client/requests/UpdateTierRequest.ts | 6 +- .../types/AddSubscriptionToTierResponse.ts | 14 +- .../tier/types/GetListOfTierGroupsResponse.ts | 2 +- .../types/GetLoyaltyProgramTierResponse.ts | 2 +- .../requests/CreateSmtpTemplateRequest.ts | 6 +- .../requests/SendTransacEmailRequest.ts | 42 +-- .../requests/UpdateSmtpTemplateRequest.ts | 6 +- .../types/GetAggregatedSmtpReportResponse.ts | 26 +- .../types/GetEmailEventReportResponse.ts | 16 +- .../types/GetSmtpReportResponse.ts | 2 +- .../types/GetSmtpTemplatesResponse.ts | 4 +- .../GetTransacBlockedContactsResponse.ts | 8 +- .../types/GetTransacEmailContentResponse.ts | 2 +- .../types/GetTransacEmailsListResponse.ts | 10 +- .../PostPreviewSmtpEmailTemplatesResponse.ts | 12 +- .../types/SendTransacEmailResponse.ts | 4 +- .../types/GetSmsEventsResponse.ts | 16 +- .../GetTransacAggregatedSmsReportResponse.ts | 22 +- .../types/GetTransacSmsReportResponse.ts | 24 +- .../types/SendTransacSmsResponse.ts | 6 +- .../types/GetWhatsappEventReportResponse.ts | 8 +- .../user/types/EditUserPermissionResponse.ts | 4 +- .../user/types/GetInvitedUsersListResponse.ts | 8 +- .../user/types/InviteuserResponse.ts | 2 +- .../types/PutRevokeUserPermissionResponse.ts | 2 +- .../PutresendcancelinvitationResponse.ts | 2 +- .../client/requests/CreateWebhookRequest.ts | 8 +- .../client/requests/UpdateWebhookRequest.ts | 8 +- .../requests/CreateWhatsAppCampaignRequest.ts | 6 +- .../requests/UpdateWhatsAppCampaignRequest.ts | 6 +- .../types/GetWhatsAppCampaignResponse.ts | 30 +- .../types/GetWhatsAppCampaignsResponse.ts | 12 +- .../types/GetWhatsAppConfigResponse.ts | 12 +- .../types/GetWhatsAppTemplatesResponse.ts | 6 +- src/api/types/BalanceDefinition.ts | 40 +-- src/api/types/BalanceLimit.ts | 16 +- src/api/types/Company.ts | 8 +- src/api/types/ContactErrorModel.ts | 2 +- src/api/types/ConversationsMessage.ts | 106 +++---- src/api/types/CreateUpdateFolder.ts | 2 +- src/api/types/Deal.ts | 8 +- src/api/types/ErrorModel.ts | 2 +- src/api/types/FileData.ts | 14 +- src/api/types/GetCampaignStats.ts | 10 +- src/api/types/GetCategoryDetails.ts | 2 +- src/api/types/GetContactDetails.ts | 4 +- src/api/types/GetCouponCollection.ts | 6 +- src/api/types/GetExtendedCampaignOverview.ts | 50 +-- src/api/types/GetExtendedCampaignStats.ts | 8 +- src/api/types/GetProductDetails.ts | 20 +- src/api/types/GetSmsCampaignOverview.ts | 2 +- src/api/types/GetSmtpTemplateOverview.ts | 8 +- src/api/types/GetWebhook.ts | 8 +- src/api/types/Inviteuser.ts | 4 +- src/api/types/LoyaltyProgram.ts | 24 +- src/api/types/NodeResponse.ts | 16 +- src/api/types/Note.ts | 12 +- src/api/types/NoteData.ts | 6 +- src/api/types/Order.ts | 36 +-- src/api/types/Pipeline.ts | 10 +- src/api/types/PostContactInfo.ts | 8 +- src/api/types/PostSendFailed.ts | 6 +- src/api/types/Redeem.ts | 28 +- src/api/types/RuleConditionResponse.ts | 10 +- src/api/types/SendReport.ts | 2 +- src/api/types/SendTestEmail.ts | 2 +- src/api/types/SendTransacSms.ts | 12 +- src/api/types/Task.ts | 8 +- src/api/types/Tier.ts | 32 +- src/api/types/TierGroup.ts | 16 +- src/api/types/Transaction.ts | 30 +- src/api/types/UpdateCampaignStatus.ts | 2 +- src/api/types/ValueResponse.ts | 16 +- src/api/types/VariablesItems.ts | 6 +- src/core/fetcher/Fetcher.ts | 8 +- src/version.ts | 2 +- tests/unit/file/file.test.ts | 5 +- tests/wire/customObjects.test.ts | 9 +- 180 files changed, 1332 insertions(+), 1318 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index c63f3e8..8fe5699 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "3.63.0", + "cliVersion": "3.79.2", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.46.3", + "generatorVersion": "3.48.2", "generatorConfig": { "generateWireTests": true, "namespaceExport": "Brevo", @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "5.0.0" + "sdkVersion": "4.0.3" } diff --git a/package.json b/package.json index 91924f6..88a9aea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "5.0.0", + "version": "4.0.3", "private": false, "repository": { "type": "git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71751e3..08ec090 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,7 +19,7 @@ importers: version: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) ts-loader: specifier: ^9.5.1 - version: 9.5.4(typescript@5.7.3)(webpack@5.104.1) + version: 9.5.4(typescript@5.7.3)(webpack@5.105.2) typescript: specifier: ~5.7.2 version: 5.7.3 @@ -28,7 +28,7 @@ importers: version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0) webpack: specifier: ^5.97.1 - version: 5.104.1 + version: 5.105.2 packages: @@ -91,158 +91,158 @@ packages: '@bundled-es-modules/statuses@1.0.1': resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} - '@esbuild/aix-ppc64@0.27.2': - resolution: {integrity: sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==} + '@esbuild/aix-ppc64@0.27.3': + resolution: {integrity: sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.27.2': - resolution: {integrity: sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==} + '@esbuild/android-arm64@0.27.3': + resolution: {integrity: sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.27.2': - resolution: {integrity: sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==} + '@esbuild/android-arm@0.27.3': + resolution: {integrity: sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.27.2': - resolution: {integrity: sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==} + '@esbuild/android-x64@0.27.3': + resolution: {integrity: sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.27.2': - resolution: {integrity: sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==} + '@esbuild/darwin-arm64@0.27.3': + resolution: {integrity: sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.27.2': - resolution: {integrity: sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==} + '@esbuild/darwin-x64@0.27.3': + resolution: {integrity: sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.27.2': - resolution: {integrity: sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==} + '@esbuild/freebsd-arm64@0.27.3': + resolution: {integrity: sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.27.2': - resolution: {integrity: sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==} + '@esbuild/freebsd-x64@0.27.3': + resolution: {integrity: sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.27.2': - resolution: {integrity: sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==} + '@esbuild/linux-arm64@0.27.3': + resolution: {integrity: sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.27.2': - resolution: {integrity: sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==} + '@esbuild/linux-arm@0.27.3': + resolution: {integrity: sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.27.2': - resolution: {integrity: sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==} + '@esbuild/linux-ia32@0.27.3': + resolution: {integrity: sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.27.2': - resolution: {integrity: sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==} + '@esbuild/linux-loong64@0.27.3': + resolution: {integrity: sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.27.2': - resolution: {integrity: sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==} + '@esbuild/linux-mips64el@0.27.3': + resolution: {integrity: sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.27.2': - resolution: {integrity: sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==} + '@esbuild/linux-ppc64@0.27.3': + resolution: {integrity: sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.27.2': - resolution: {integrity: sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==} + '@esbuild/linux-riscv64@0.27.3': + resolution: {integrity: sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.27.2': - resolution: {integrity: sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==} + '@esbuild/linux-s390x@0.27.3': + resolution: {integrity: sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.27.2': - resolution: {integrity: sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==} + '@esbuild/linux-x64@0.27.3': + resolution: {integrity: sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.27.2': - resolution: {integrity: sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==} + '@esbuild/netbsd-arm64@0.27.3': + resolution: {integrity: sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.27.2': - resolution: {integrity: sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==} + '@esbuild/netbsd-x64@0.27.3': + resolution: {integrity: sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.27.2': - resolution: {integrity: sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==} + '@esbuild/openbsd-arm64@0.27.3': + resolution: {integrity: sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.27.2': - resolution: {integrity: sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==} + '@esbuild/openbsd-x64@0.27.3': + resolution: {integrity: sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/openharmony-arm64@0.27.2': - resolution: {integrity: sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==} + '@esbuild/openharmony-arm64@0.27.3': + resolution: {integrity: sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] - '@esbuild/sunos-x64@0.27.2': - resolution: {integrity: sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==} + '@esbuild/sunos-x64@0.27.3': + resolution: {integrity: sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.27.2': - resolution: {integrity: sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==} + '@esbuild/win32-arm64@0.27.3': + resolution: {integrity: sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.27.2': - resolution: {integrity: sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==} + '@esbuild/win32-ia32@0.27.3': + resolution: {integrity: sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.27.2': - resolution: {integrity: sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==} + '@esbuild/win32-x64@0.27.3': + resolution: {integrity: sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -602,8 +602,8 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - caniuse-lite@1.0.30001766: - resolution: {integrity: sha512-4C0lfJ0/YPjJQHagaE9x2Elb69CIqEPZeG0anQt9SIvIoOH4a4uaRl73IavyO+0qZh6MDLH//DrXThEYKHkmYA==} + caniuse-lite@1.0.30001769: + resolution: {integrity: sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==} chai@5.3.3: resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} @@ -656,14 +656,14 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} - electron-to-chromium@1.5.283: - resolution: {integrity: sha512-3vifjt1HgrGW/h76UEeny+adYApveS9dH2h3p57JYzBSXJIKUJAvtmIytDKjcSCt9xHfrNCFJ7gts6vkhuq++w==} + electron-to-chromium@1.5.286: + resolution: {integrity: sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enhanced-resolve@5.18.4: - resolution: {integrity: sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==} + enhanced-resolve@5.19.0: + resolution: {integrity: sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==} engines: {node: '>=10.13.0'} es-module-lexer@1.7.0: @@ -672,8 +672,8 @@ packages: es-module-lexer@2.0.0: resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} - esbuild@0.27.2: - resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==} + esbuild@0.27.3: + resolution: {integrity: sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==} engines: {node: '>=18'} hasBin: true @@ -884,8 +884,8 @@ packages: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} - semver@7.7.3: - resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} + semver@7.7.4: + resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} engines: {node: '>=10'} hasBin: true @@ -993,11 +993,11 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} - tldts-core@7.0.19: - resolution: {integrity: sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A==} + tldts-core@7.0.23: + resolution: {integrity: sha512-0g9vrtDQLrNIiCj22HSe9d4mLVG3g5ph5DZ8zCKBr4OtrspmNB6ss7hVyzArAeE88ceZocIEGkyW1Ime7fxPtQ==} - tldts@7.0.19: - resolution: {integrity: sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA==} + tldts@7.0.23: + resolution: {integrity: sha512-ASdhgQIBSay0R/eXggAkQ53G4nTJqTXqC2kbaBbdDwM7SkjyZyO0OaaN1/FH7U/yCeqOHDwFO5j8+Os/IS1dXw==} hasBin: true to-regex-range@5.0.1: @@ -1114,8 +1114,8 @@ packages: resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} engines: {node: '>=10.13.0'} - webpack@5.104.1: - resolution: {integrity: sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA==} + webpack@5.105.2: + resolution: {integrity: sha512-dRXm0a2qcHPUBEzVk8uph0xWSjV/xZxenQQbLwnwP7caQCYpqG1qddwlyEkIDkYn0K8tvmcrZ+bOrzoQ3HxCDw==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -1198,82 +1198,82 @@ snapshots: dependencies: statuses: 2.0.2 - '@esbuild/aix-ppc64@0.27.2': + '@esbuild/aix-ppc64@0.27.3': optional: true - '@esbuild/android-arm64@0.27.2': + '@esbuild/android-arm64@0.27.3': optional: true - '@esbuild/android-arm@0.27.2': + '@esbuild/android-arm@0.27.3': optional: true - '@esbuild/android-x64@0.27.2': + '@esbuild/android-x64@0.27.3': optional: true - '@esbuild/darwin-arm64@0.27.2': + '@esbuild/darwin-arm64@0.27.3': optional: true - '@esbuild/darwin-x64@0.27.2': + '@esbuild/darwin-x64@0.27.3': optional: true - '@esbuild/freebsd-arm64@0.27.2': + '@esbuild/freebsd-arm64@0.27.3': optional: true - '@esbuild/freebsd-x64@0.27.2': + '@esbuild/freebsd-x64@0.27.3': optional: true - '@esbuild/linux-arm64@0.27.2': + '@esbuild/linux-arm64@0.27.3': optional: true - '@esbuild/linux-arm@0.27.2': + '@esbuild/linux-arm@0.27.3': optional: true - '@esbuild/linux-ia32@0.27.2': + '@esbuild/linux-ia32@0.27.3': optional: true - '@esbuild/linux-loong64@0.27.2': + '@esbuild/linux-loong64@0.27.3': optional: true - '@esbuild/linux-mips64el@0.27.2': + '@esbuild/linux-mips64el@0.27.3': optional: true - '@esbuild/linux-ppc64@0.27.2': + '@esbuild/linux-ppc64@0.27.3': optional: true - '@esbuild/linux-riscv64@0.27.2': + '@esbuild/linux-riscv64@0.27.3': optional: true - '@esbuild/linux-s390x@0.27.2': + '@esbuild/linux-s390x@0.27.3': optional: true - '@esbuild/linux-x64@0.27.2': + '@esbuild/linux-x64@0.27.3': optional: true - '@esbuild/netbsd-arm64@0.27.2': + '@esbuild/netbsd-arm64@0.27.3': optional: true - '@esbuild/netbsd-x64@0.27.2': + '@esbuild/netbsd-x64@0.27.3': optional: true - '@esbuild/openbsd-arm64@0.27.2': + '@esbuild/openbsd-arm64@0.27.3': optional: true - '@esbuild/openbsd-x64@0.27.2': + '@esbuild/openbsd-x64@0.27.3': optional: true - '@esbuild/openharmony-arm64@0.27.2': + '@esbuild/openharmony-arm64@0.27.3': optional: true - '@esbuild/sunos-x64@0.27.2': + '@esbuild/sunos-x64@0.27.3': optional: true - '@esbuild/win32-arm64@0.27.2': + '@esbuild/win32-arm64@0.27.3': optional: true - '@esbuild/win32-ia32@0.27.2': + '@esbuild/win32-ia32@0.27.3': optional: true - '@esbuild/win32-x64@0.27.2': + '@esbuild/win32-x64@0.27.3': optional: true '@inquirer/ansi@1.0.2': {} @@ -1607,8 +1607,8 @@ snapshots: browserslist@4.28.1: dependencies: baseline-browser-mapping: 2.9.19 - caniuse-lite: 1.0.30001766 - electron-to-chromium: 1.5.283 + caniuse-lite: 1.0.30001769 + electron-to-chromium: 1.5.286 node-releases: 2.0.27 update-browserslist-db: 1.2.3(browserslist@4.28.1) @@ -1616,7 +1616,7 @@ snapshots: cac@6.7.14: {} - caniuse-lite@1.0.30001766: {} + caniuse-lite@1.0.30001769: {} chai@5.3.3: dependencies: @@ -1659,11 +1659,11 @@ snapshots: deep-eql@5.0.2: {} - electron-to-chromium@1.5.283: {} + electron-to-chromium@1.5.286: {} emoji-regex@8.0.0: {} - enhanced-resolve@5.18.4: + enhanced-resolve@5.19.0: dependencies: graceful-fs: 4.2.11 tapable: 2.3.0 @@ -1672,34 +1672,34 @@ snapshots: es-module-lexer@2.0.0: {} - esbuild@0.27.2: + esbuild@0.27.3: optionalDependencies: - '@esbuild/aix-ppc64': 0.27.2 - '@esbuild/android-arm': 0.27.2 - '@esbuild/android-arm64': 0.27.2 - '@esbuild/android-x64': 0.27.2 - '@esbuild/darwin-arm64': 0.27.2 - '@esbuild/darwin-x64': 0.27.2 - '@esbuild/freebsd-arm64': 0.27.2 - '@esbuild/freebsd-x64': 0.27.2 - '@esbuild/linux-arm': 0.27.2 - '@esbuild/linux-arm64': 0.27.2 - '@esbuild/linux-ia32': 0.27.2 - '@esbuild/linux-loong64': 0.27.2 - '@esbuild/linux-mips64el': 0.27.2 - '@esbuild/linux-ppc64': 0.27.2 - '@esbuild/linux-riscv64': 0.27.2 - '@esbuild/linux-s390x': 0.27.2 - '@esbuild/linux-x64': 0.27.2 - '@esbuild/netbsd-arm64': 0.27.2 - '@esbuild/netbsd-x64': 0.27.2 - '@esbuild/openbsd-arm64': 0.27.2 - '@esbuild/openbsd-x64': 0.27.2 - '@esbuild/openharmony-arm64': 0.27.2 - '@esbuild/sunos-x64': 0.27.2 - '@esbuild/win32-arm64': 0.27.2 - '@esbuild/win32-ia32': 0.27.2 - '@esbuild/win32-x64': 0.27.2 + '@esbuild/aix-ppc64': 0.27.3 + '@esbuild/android-arm': 0.27.3 + '@esbuild/android-arm64': 0.27.3 + '@esbuild/android-x64': 0.27.3 + '@esbuild/darwin-arm64': 0.27.3 + '@esbuild/darwin-x64': 0.27.3 + '@esbuild/freebsd-arm64': 0.27.3 + '@esbuild/freebsd-x64': 0.27.3 + '@esbuild/linux-arm': 0.27.3 + '@esbuild/linux-arm64': 0.27.3 + '@esbuild/linux-ia32': 0.27.3 + '@esbuild/linux-loong64': 0.27.3 + '@esbuild/linux-mips64el': 0.27.3 + '@esbuild/linux-ppc64': 0.27.3 + '@esbuild/linux-riscv64': 0.27.3 + '@esbuild/linux-s390x': 0.27.3 + '@esbuild/linux-x64': 0.27.3 + '@esbuild/netbsd-arm64': 0.27.3 + '@esbuild/netbsd-x64': 0.27.3 + '@esbuild/openbsd-arm64': 0.27.3 + '@esbuild/openbsd-x64': 0.27.3 + '@esbuild/openharmony-arm64': 0.27.3 + '@esbuild/sunos-x64': 0.27.3 + '@esbuild/win32-arm64': 0.27.3 + '@esbuild/win32-ia32': 0.27.3 + '@esbuild/win32-x64': 0.27.3 escalade@3.2.0: {} @@ -1896,7 +1896,7 @@ snapshots: ajv-formats: 2.1.1(ajv@8.17.1) ajv-keywords: 5.1.0(ajv@8.17.1) - semver@7.7.3: {} + semver@7.7.4: {} serialize-javascript@6.0.2: dependencies: @@ -1949,14 +1949,14 @@ snapshots: tapable@2.3.0: {} - terser-webpack-plugin@5.3.16(webpack@5.104.1): + terser-webpack-plugin@5.3.16(webpack@5.105.2): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 serialize-javascript: 6.0.2 terser: 5.46.0 - webpack: 5.104.1 + webpack: 5.105.2 terser@5.46.0: dependencies: @@ -1980,11 +1980,11 @@ snapshots: tinyspy@4.0.4: {} - tldts-core@7.0.19: {} + tldts-core@7.0.23: {} - tldts@7.0.19: + tldts@7.0.23: dependencies: - tldts-core: 7.0.19 + tldts-core: 7.0.23 to-regex-range@5.0.1: dependencies: @@ -1992,17 +1992,17 @@ snapshots: tough-cookie@6.0.0: dependencies: - tldts: 7.0.19 + tldts: 7.0.23 - ts-loader@9.5.4(typescript@5.7.3)(webpack@5.104.1): + ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.2): dependencies: chalk: 4.1.2 - enhanced-resolve: 5.18.4 + enhanced-resolve: 5.19.0 micromatch: 4.0.8 - semver: 7.7.3 + semver: 7.7.4 source-map: 0.7.6 typescript: 5.7.3 - webpack: 5.104.1 + webpack: 5.105.2 type-fest@4.41.0: {} @@ -2039,7 +2039,7 @@ snapshots: vite@7.3.1(@types/node@18.19.130)(terser@5.46.0): dependencies: - esbuild: 0.27.2 + esbuild: 0.27.3 fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 @@ -2098,7 +2098,7 @@ snapshots: webpack-sources@3.3.3: {} - webpack@5.104.1: + webpack@5.105.2: dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.8 @@ -2110,7 +2110,7 @@ snapshots: acorn-import-phases: 1.0.4(acorn@8.15.0) browserslist: 4.28.1 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.18.4 + enhanced-resolve: 5.19.0 es-module-lexer: 2.0.0 eslint-scope: 5.1.1 events: 3.3.0 @@ -2122,7 +2122,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 4.3.3 tapable: 2.3.0 - terser-webpack-plugin: 5.3.16(webpack@5.104.1) + terser-webpack-plugin: 5.3.16(webpack@5.105.2) watchpack: 2.5.1 webpack-sources: 3.3.3 transitivePeerDependencies: diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 1f2d22c..87ddfe0 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions; + meta?: Record | undefined; /** Optional RFC3339 timestamp indicating when the order was processed. */ - processedAt?: string; + processedAt?: string | undefined; /** Optional reference to the associated transaction ID. */ - transactionid?: string; + transactionid?: string | undefined; /** RFC3339 timestamp indicating the last update to the order. */ updatedAt: string; } diff --git a/src/api/resources/balance/types/GetBalanceDefinitionListResponse.ts b/src/api/resources/balance/types/GetBalanceDefinitionListResponse.ts index 3ec0a7c..2ea18a7 100644 --- a/src/api/resources/balance/types/GetBalanceDefinitionListResponse.ts +++ b/src/api/resources/balance/types/GetBalanceDefinitionListResponse.ts @@ -4,5 +4,5 @@ import type * as Brevo from "../../../index.js"; export interface GetBalanceDefinitionListResponse { /** list of balance definitions */ - items?: Brevo.BalanceDefinition[]; + items?: Brevo.BalanceDefinition[] | undefined; } diff --git a/src/api/resources/balance/types/GetContactBalancesResponse.ts b/src/api/resources/balance/types/GetContactBalancesResponse.ts index 111c129..0133f95 100644 --- a/src/api/resources/balance/types/GetContactBalancesResponse.ts +++ b/src/api/resources/balance/types/GetContactBalancesResponse.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. export interface GetContactBalancesResponse { - balanceDefinitionId?: string; - balances?: GetContactBalancesResponse.Balances.Item[]; - count?: number; - loyaltyProgramId?: string; + balanceDefinitionId?: string | undefined; + balances?: GetContactBalancesResponse.Balances.Item[] | undefined; + count?: number | undefined; + loyaltyProgramId?: string | undefined; } export namespace GetContactBalancesResponse { @@ -12,10 +12,10 @@ export namespace GetContactBalancesResponse { export namespace Balances { export interface Item { - contactId?: number; - loyaltySubscriptionId?: string; - updatedAt?: string; - value?: number; + contactId?: number | undefined; + loyaltySubscriptionId?: string | undefined; + updatedAt?: string | undefined; + value?: number | undefined; } } } diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts index 3ed6fcc..741d358 100644 --- a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts @@ -5,15 +5,15 @@ */ export interface GetLoyaltyBalanceProgramsPidTransactionHistoryResponse { /** Unique identifier of the associated balance definition. */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** Unique identifier of the contact related to the transactions. */ - contactId?: number; + contactId?: number | undefined; /** Total number of transactions in the history. */ - count?: number; + count?: number | undefined; /** Unique identifier of the associated loyalty program. */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** List of past transactions associated with the balance. */ - transactionHistory?: GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.TransactionHistory.Item[]; + transactionHistory?: GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.TransactionHistory.Item[] | undefined; } export namespace GetLoyaltyBalanceProgramsPidTransactionHistoryResponse { @@ -25,25 +25,25 @@ export namespace GetLoyaltyBalanceProgramsPidTransactionHistoryResponse { */ export interface Item { /** The transaction amount. */ - amount?: number; + amount?: number | undefined; /** Expiration date of the balance associated with this transaction. */ - balanceExpirationDate?: string; + balanceExpirationDate?: string | undefined; /** Timestamp when the transaction was canceled, if applicable. */ - cancelledAt?: string; + cancelledAt?: string | undefined; /** Timestamp when the transaction was successfully completed. */ - completedAt?: string; + completedAt?: string | undefined; /** Timestamp when the transaction was initiated. */ - createdAt?: string; + createdAt?: string | undefined; /** Unique identifier of the transaction. */ - id?: string; + id?: string | undefined; /** Optional metadata associated with the transaction. */ - meta?: Record; + meta?: Record | undefined; /** Reason for rejection, if the transaction was declined. */ - rejectReason?: string; + rejectReason?: string | undefined; /** Timestamp when the transaction was rejected. */ - rejectedAt?: string; + rejectedAt?: string | undefined; /** Current status of the transaction (e.g., pending, completed, rejected). */ - status?: string; + status?: string | undefined; } } } diff --git a/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts b/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts index 9291437..01c0686 100644 --- a/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts +++ b/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface GetSubscriptionBalancesResponse { - balance?: GetSubscriptionBalancesResponse.Balance.Item[]; + balance?: GetSubscriptionBalancesResponse.Balance.Item[] | undefined; } export namespace GetSubscriptionBalancesResponse { @@ -10,9 +10,9 @@ export namespace GetSubscriptionBalancesResponse { export namespace Balance { export interface Item { /** balance definition ID */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** Unique identifier for the balance definition associated with this aggregate balance */ - value?: number; + value?: number | undefined; } } } diff --git a/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts b/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts index b32ae22..97d48f7 100644 --- a/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts +++ b/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts @@ -2,21 +2,21 @@ export interface PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse { /** The current amount available in the balance */ - amount?: number; + amount?: number | undefined; /** balance definition ID */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** Timestamp of when the balance was last consumed */ - consumedAt?: string; + consumedAt?: string | undefined; /** contact ID */ - contactId?: number; + contactId?: number | undefined; /** Timestamp of when the balance was created */ - createdAt?: string; + createdAt?: string | undefined; /** Expiration timestamp of the balance */ - expiresAt?: string; + expiresAt?: string | undefined; /** Unique identifier for the balance */ - id?: string; + id?: string | undefined; /** loyalty program ID */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** organization ID */ - organizationId?: number; + organizationId?: number | undefined; } diff --git a/src/api/resources/companies/types/GetCompaniesResponse.ts b/src/api/resources/companies/types/GetCompaniesResponse.ts index f96461e..1a70a50 100644 --- a/src/api/resources/companies/types/GetCompaniesResponse.ts +++ b/src/api/resources/companies/types/GetCompaniesResponse.ts @@ -7,5 +7,5 @@ import type * as Brevo from "../../../index.js"; */ export interface GetCompaniesResponse { /** List of companies */ - items?: Brevo.Company[]; + items?: Brevo.Company[] | undefined; } diff --git a/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts b/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts index 409194b..7ddbd7d 100644 --- a/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts +++ b/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts @@ -4,9 +4,9 @@ * List of attributes */ export interface GetCrmAttributesCompaniesResponseItem { - attributeOptions?: Record[]; - attributeTypeName?: string; - internalName?: string; - isRequired?: boolean; - label?: string; + attributeOptions?: Record[] | undefined; + attributeTypeName?: string | undefined; + internalName?: string | undefined; + isRequired?: boolean | undefined; + label?: string | undefined; } diff --git a/src/api/resources/companies/types/PostCompaniesImportResponse.ts b/src/api/resources/companies/types/PostCompaniesImportResponse.ts index 4722463..3ed0fbe 100644 --- a/src/api/resources/companies/types/PostCompaniesImportResponse.ts +++ b/src/api/resources/companies/types/PostCompaniesImportResponse.ts @@ -2,5 +2,5 @@ export interface PostCompaniesImportResponse { /** The ID of the import process */ - processId?: number; + processId?: number | undefined; } diff --git a/src/api/resources/contacts/client/requests/ImportContactsRequest.ts b/src/api/resources/contacts/client/requests/ImportContactsRequest.ts index bad0dd7..3334fd3 100644 --- a/src/api/resources/contacts/client/requests/ImportContactsRequest.ts +++ b/src/api/resources/contacts/client/requests/ImportContactsRequest.ts @@ -35,8 +35,8 @@ export namespace ImportContactsRequest { export namespace JsonBody { export interface Item { /** List of attributes to be imported */ - attributes?: Record; - email?: string; + attributes?: Record | undefined; + email?: string | undefined; } } @@ -45,8 +45,8 @@ export namespace ImportContactsRequest { */ export interface NewList { /** Id of the folder where this new list shall be created. **Mandatory if listName is not empty** */ - folderId?: number; + folderId?: number | undefined; /** List with listName will be created first and users will be imported in it. **Mandatory if listIds is empty**. */ - listName?: string; + listName?: string | undefined; } } diff --git a/src/api/resources/contacts/client/requests/RequestContactExportRequest.ts b/src/api/resources/contacts/client/requests/RequestContactExportRequest.ts index 0e45977..bfe3da6 100644 --- a/src/api/resources/contacts/client/requests/RequestContactExportRequest.ts +++ b/src/api/resources/contacts/client/requests/RequestContactExportRequest.ts @@ -31,19 +31,19 @@ export namespace RequestContactExportRequest { */ export interface CustomContactFilter { /** **Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on contacts as per the list id. * **allContacts** - Fetch the list of all contacts for a particular list. * **subscribed & unsubscribed** - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * **unsubscribedPerList** - Fetch the list of contacts that are unsubscribed from a particular list only. */ - actionForContacts?: CustomContactFilter.ActionForContacts; + actionForContacts?: CustomContactFilter.ActionForContacts | undefined; /** **Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed.** This will export the contacts on the basis of provided action applied on email campaigns. * **openers & nonOpeners** - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * **clickers & nonClickers** - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * **unsubscribed** - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * **hardBounces & softBounces** - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). */ - actionForEmailCampaigns?: CustomContactFilter.ActionForEmailCampaigns; + actionForEmailCampaigns?: CustomContactFilter.ActionForEmailCampaigns | undefined; /** **Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed.** This will export the contacts on the basis of provided action applied on sms campaigns. * **unsubscribed** - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * **hardBounces & softBounces** - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. */ - actionForSmsCampaigns?: CustomContactFilter.ActionForSmsCampaigns; + actionForSmsCampaigns?: CustomContactFilter.ActionForSmsCampaigns | undefined; /** Considered only if **actionForEmailCampaigns** is passed, ignored otherwise. **Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed.** The id of the email campaign for which the corresponding action shall be applied in the filter. */ - emailCampaignId?: number; + emailCampaignId?: number | undefined; /** ID of the list. This is mandatory if actionForContacts is specified and segmentId is not provided. Either segmentId or listId must be included. */ - listId?: number; + listId?: number | undefined; /** ID of the segment. This is mandatory if actionForContacts is specified and listId is not provided. Either segmentId or listId must be included. */ - segmentId?: number; + segmentId?: number | undefined; /** Considered only if **actionForSmsCampaigns** is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. */ - smsCampaignId?: number; + smsCampaignId?: number | undefined; } export namespace CustomContactFilter { diff --git a/src/api/resources/contacts/client/requests/UpdateBatchContactsRequest.ts b/src/api/resources/contacts/client/requests/UpdateBatchContactsRequest.ts index 6ae4575..6f5efe7 100644 --- a/src/api/resources/contacts/client/requests/UpdateBatchContactsRequest.ts +++ b/src/api/resources/contacts/client/requests/UpdateBatchContactsRequest.ts @@ -15,25 +15,25 @@ export namespace UpdateBatchContactsRequest { export namespace Contacts { export interface Item { /** Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, **{ "EMAIL":"newemail@domain.com", "FNAME":"Ellie", "LNAME":"Roger"}**. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}** */ - attributes?: Record; + attributes?: Record | undefined; /** Email address of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) */ - email?: string; + email?: string | undefined; /** Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) */ - emailBlacklisted?: boolean; + emailBlacklisted?: boolean | undefined; /** Pass your own Id to update ext_id of a contact. */ - ext_id?: string; + ext_id?: string | undefined; /** id of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) */ - id?: number; + id?: number | undefined; /** Ids of the lists to add the contact to */ - listIds?: number[]; + listIds?: number[] | undefined; /** SMS of the user to be updated (For each operation only pass one of the supported contact identifiers. Email, id or sms) */ - sms?: string; + sms?: string | undefined; /** Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) */ - smsBlacklisted?: boolean; + smsBlacklisted?: boolean | undefined; /** transactional email forbidden sender for contact. Use only for email Contact */ - smtpBlacklistSender?: string[]; + smtpBlacklistSender?: string[] | undefined; /** Ids of the lists to remove the contact from */ - unlinkListIds?: number[]; + unlinkListIds?: number[] | undefined; } } } diff --git a/src/api/resources/contacts/types/CreateContactResponse.ts b/src/api/resources/contacts/types/CreateContactResponse.ts index a783fdd..2b18162 100644 --- a/src/api/resources/contacts/types/CreateContactResponse.ts +++ b/src/api/resources/contacts/types/CreateContactResponse.ts @@ -2,5 +2,5 @@ export interface CreateContactResponse { /** ID of the contact when a new contact is created */ - id?: number; + id?: number | undefined; } diff --git a/src/api/resources/contacts/types/GetAttributesResponse.ts b/src/api/resources/contacts/types/GetAttributesResponse.ts index 0db90c5..3480d56 100644 --- a/src/api/resources/contacts/types/GetAttributesResponse.ts +++ b/src/api/resources/contacts/types/GetAttributesResponse.ts @@ -11,17 +11,17 @@ export namespace GetAttributesResponse { export namespace Attributes { export interface Item { /** Calculated value formula */ - calculatedValue?: string; + calculatedValue?: string | undefined; /** Category of the attribute */ category: Item.Category; /** Parameter only available for "category" type attributes. */ - enumeration?: Item.Enumeration.Item[]; + enumeration?: Item.Enumeration.Item[] | undefined; /** Parameter only available for "multiple-choice" type attributes. */ - multiCategoryOptions?: string[]; + multiCategoryOptions?: string[] | undefined; /** Name of the attribute */ name: string; /** Type of the attribute */ - type?: Item.Type; + type?: Item.Type | undefined; } export namespace Item { diff --git a/src/api/resources/contacts/types/GetContactInfoResponse.ts b/src/api/resources/contacts/types/GetContactInfoResponse.ts index 3091f0c..3123d63 100644 --- a/src/api/resources/contacts/types/GetContactInfoResponse.ts +++ b/src/api/resources/contacts/types/GetContactInfoResponse.ts @@ -6,13 +6,13 @@ export interface GetContactInfoResponse { /** Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Email address of the contact for which you requested the details */ - email?: string; + email?: string | undefined; /** Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) */ emailBlacklisted: boolean; /** ID of the contact for which you requested the details */ id: number; listIds: number[]; - listUnsubscribed?: number[]; + listUnsubscribed?: number[] | undefined; /** Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; /** Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) */ @@ -32,23 +32,23 @@ export namespace GetContactInfoResponse { */ export interface Statistics { /** Listing of the clicks generated by the contact */ - clicked?: Statistics.Clicked.Item[]; + clicked?: Statistics.Clicked.Item[] | undefined; /** Listing of the complaints generated by the contact */ - complaints?: Statistics.Complaints.Item[]; + complaints?: Statistics.Complaints.Item[] | undefined; /** Listing of the delivered campaign for the contact */ - delivered?: Statistics.Delivered.Item[]; + delivered?: Statistics.Delivered.Item[] | undefined; /** Listing of the hardbounes generated by the contact */ - hardBounces?: Statistics.HardBounces.Item[]; + hardBounces?: Statistics.HardBounces.Item[] | undefined; /** Listing of the sent campaign for the contact */ - messagesSent?: Statistics.MessagesSent.Item[]; + messagesSent?: Statistics.MessagesSent.Item[] | undefined; /** Listing of the openings generated by the contact */ - opened?: Statistics.Opened.Item[]; + opened?: Statistics.Opened.Item[] | undefined; /** Listing of the softbounes generated by the contact */ - softBounces?: Statistics.SoftBounces.Item[]; + softBounces?: Statistics.SoftBounces.Item[] | undefined; /** Listing of the transactional attributes for the contact */ - transacAttributes?: Statistics.TransacAttributes.Item[]; + transacAttributes?: Statistics.TransacAttributes.Item[] | undefined; /** Listing of the unsubscription for the contact */ - unsubscriptions?: Statistics.Unsubscriptions; + unsubscriptions?: Statistics.Unsubscriptions | undefined; } export namespace Statistics { @@ -174,7 +174,7 @@ export namespace GetContactInfoResponse { /** UTC date-time of the event */ eventTime: string; /** IP from which the user has been unsubscribed */ - ip?: string; + ip?: string | undefined; } } @@ -187,7 +187,7 @@ export namespace GetContactInfoResponse { /** UTC date-time of the event */ eventTime: string; /** IP from which the user has unsubscribed */ - ip?: string; + ip?: string | undefined; } } } diff --git a/src/api/resources/contacts/types/GetContactStatsResponse.ts b/src/api/resources/contacts/types/GetContactStatsResponse.ts index 43c6723..27dcc12 100644 --- a/src/api/resources/contacts/types/GetContactStatsResponse.ts +++ b/src/api/resources/contacts/types/GetContactStatsResponse.ts @@ -4,15 +4,15 @@ * Campaign Statistics for the contact */ export interface GetContactStatsResponse { - clicked?: GetContactStatsResponse.Clicked.Item[]; - complaints?: GetContactStatsResponse.Complaints.Item[]; - delivered?: GetContactStatsResponse.Delivered.Item[]; - hardBounces?: GetContactStatsResponse.HardBounces.Item[]; - messagesSent?: GetContactStatsResponse.MessagesSent.Item[]; - opened?: GetContactStatsResponse.Opened.Item[]; - softBounces?: GetContactStatsResponse.SoftBounces.Item[]; - transacAttributes?: GetContactStatsResponse.TransacAttributes.Item[]; - unsubscriptions?: GetContactStatsResponse.Unsubscriptions; + clicked?: GetContactStatsResponse.Clicked.Item[] | undefined; + complaints?: GetContactStatsResponse.Complaints.Item[] | undefined; + delivered?: GetContactStatsResponse.Delivered.Item[] | undefined; + hardBounces?: GetContactStatsResponse.HardBounces.Item[] | undefined; + messagesSent?: GetContactStatsResponse.MessagesSent.Item[] | undefined; + opened?: GetContactStatsResponse.Opened.Item[] | undefined; + softBounces?: GetContactStatsResponse.SoftBounces.Item[] | undefined; + transacAttributes?: GetContactStatsResponse.TransacAttributes.Item[] | undefined; + unsubscriptions?: GetContactStatsResponse.Unsubscriptions | undefined; } export namespace GetContactStatsResponse { @@ -141,7 +141,7 @@ export namespace GetContactStatsResponse { /** UTC date-time of the event */ eventTime: string; /** IP from which the user has been unsubscribed */ - ip?: string; + ip?: string | undefined; } } @@ -154,7 +154,7 @@ export namespace GetContactStatsResponse { /** UTC date-time of the event */ eventTime: string; /** IP from which the user has unsubscribed */ - ip?: string; + ip?: string | undefined; } } } diff --git a/src/api/resources/contacts/types/GetFolderListsResponse.ts b/src/api/resources/contacts/types/GetFolderListsResponse.ts index 230d223..c55db77 100644 --- a/src/api/resources/contacts/types/GetFolderListsResponse.ts +++ b/src/api/resources/contacts/types/GetFolderListsResponse.ts @@ -4,6 +4,6 @@ import type * as Brevo from "../../../index.js"; export interface GetFolderListsResponse { /** Number of lists in the folder */ - count?: number; - lists?: Brevo.GetList[]; + count?: number | undefined; + lists?: Brevo.GetList[] | undefined; } diff --git a/src/api/resources/contacts/types/GetFoldersResponse.ts b/src/api/resources/contacts/types/GetFoldersResponse.ts index 205ce9d..43534ac 100644 --- a/src/api/resources/contacts/types/GetFoldersResponse.ts +++ b/src/api/resources/contacts/types/GetFoldersResponse.ts @@ -4,6 +4,6 @@ import type * as Brevo from "../../../index.js"; export interface GetFoldersResponse { /** Number of folders available in your account */ - count?: number; - folders?: Brevo.GetFolder[]; + count?: number | undefined; + folders?: Brevo.GetFolder[] | undefined; } diff --git a/src/api/resources/contacts/types/GetListResponse.ts b/src/api/resources/contacts/types/GetListResponse.ts index 76c80a2..65b8523 100644 --- a/src/api/resources/contacts/types/GetListResponse.ts +++ b/src/api/resources/contacts/types/GetListResponse.ts @@ -13,11 +13,11 @@ export interface GetListResponse { totalSubscribers: number; /** Number of unique contacts in the list */ uniqueSubscribers: number; - campaignStats?: GetListResponse.CampaignStats.Item[]; + campaignStats?: GetListResponse.CampaignStats.Item[] | undefined; /** Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) */ - dynamicList?: boolean; + dynamicList?: boolean | undefined; /** ID of the folder */ folderId: number; } diff --git a/src/api/resources/contacts/types/GetListsResponse.ts b/src/api/resources/contacts/types/GetListsResponse.ts index ced961c..441c48a 100644 --- a/src/api/resources/contacts/types/GetListsResponse.ts +++ b/src/api/resources/contacts/types/GetListsResponse.ts @@ -2,9 +2,9 @@ export interface GetListsResponse { /** Number of lists in your account */ - count?: number; + count?: number | undefined; /** Listing of all the lists available in your account */ - lists?: GetListsResponse.Lists.Item[]; + lists?: GetListsResponse.Lists.Item[] | undefined; } export namespace GetListsResponse { diff --git a/src/api/resources/contacts/types/GetSegmentsResponse.ts b/src/api/resources/contacts/types/GetSegmentsResponse.ts index e851c8c..0171aea 100644 --- a/src/api/resources/contacts/types/GetSegmentsResponse.ts +++ b/src/api/resources/contacts/types/GetSegmentsResponse.ts @@ -2,9 +2,9 @@ export interface GetSegmentsResponse { /** Number of Segments in your account */ - count?: number; + count?: number | undefined; /** Listing of all the segments available in your account */ - segments?: GetSegmentsResponse.Segments.Item[]; + segments?: GetSegmentsResponse.Segments.Item[] | undefined; } export namespace GetSegmentsResponse { @@ -19,7 +19,7 @@ export namespace GetSegmentsResponse { /** Name of the Segment */ segmentName: string; /** Updation UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ) */ - updatedAt?: string; + updatedAt?: string | undefined; } } } diff --git a/src/api/resources/conversations/types/PutConversationsVisitorGroupResponse.ts b/src/api/resources/conversations/types/PutConversationsVisitorGroupResponse.ts index e27638a..aae138f 100644 --- a/src/api/resources/conversations/types/PutConversationsVisitorGroupResponse.ts +++ b/src/api/resources/conversations/types/PutConversationsVisitorGroupResponse.ts @@ -2,7 +2,7 @@ export interface PutConversationsVisitorGroupResponse { /** group ID the visitor was assigned to */ - groupId?: unknown; + groupId?: unknown | undefined; /** visitor ID */ - visitorId?: unknown; + visitorId?: unknown | undefined; } diff --git a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts index 9cc6f47..faf7fb5 100644 --- a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts +++ b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts @@ -19,11 +19,11 @@ export namespace UpsertrecordsRequest { export namespace Records { export interface Item { - associations?: Item.Associations.Item[]; + associations?: Item.Associations.Item[] | undefined; /** Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required. */ - attributes?: Record; + attributes?: Record | undefined; /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request. */ - identifiers?: Item.Identifiers; + identifiers?: Item.Identifiers | undefined; } export namespace Item { @@ -69,9 +69,9 @@ export namespace UpsertrecordsRequest { */ export interface Identifiers { /** ext_id is ID of record in the external system that client_dev want to store in the object system. */ - ext_id?: string; + ext_id?: string | undefined; /** Internal ID of the object record generated by Brevo */ - id?: number; + id?: number | undefined; } } } diff --git a/src/api/resources/customObjects/types/BatchDeleteObjectRecordsResponse.ts b/src/api/resources/customObjects/types/BatchDeleteObjectRecordsResponse.ts index 32e287c..5c1bf10 100644 --- a/src/api/resources/customObjects/types/BatchDeleteObjectRecordsResponse.ts +++ b/src/api/resources/customObjects/types/BatchDeleteObjectRecordsResponse.ts @@ -2,6 +2,6 @@ export interface BatchDeleteObjectRecordsResponse { /** Identifier for batch process tracking */ - processId?: number; - message?: string; + processId?: number | undefined; + message?: string | undefined; } diff --git a/src/api/resources/customObjects/types/GetrecordsResponse.ts b/src/api/resources/customObjects/types/GetrecordsResponse.ts index f841060..0b688dc 100644 --- a/src/api/resources/customObjects/types/GetrecordsResponse.ts +++ b/src/api/resources/customObjects/types/GetrecordsResponse.ts @@ -2,8 +2,8 @@ export interface GetrecordsResponse { /** Total number of object records for an object type. */ - count?: number; - records?: GetrecordsResponse.Records.Item[]; + count?: number | undefined; + records?: GetrecordsResponse.Records.Item[] | undefined; } export namespace GetrecordsResponse { @@ -12,15 +12,15 @@ export namespace GetrecordsResponse { export namespace Records { export interface Item { /** List of associations for the object record. If association query param is true it will return 5 associated records per association. */ - associations?: Item.Associations.Item[]; + associations?: Item.Associations.Item[] | undefined; /** Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required. */ - attributes?: Record; + attributes?: Record | undefined; /** Timestamp when the object record was created */ - createdAt?: string; + createdAt?: string | undefined; /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. */ - identifiers?: Item.Identifiers; + identifiers?: Item.Identifiers | undefined; /** Timestamp when the object record was last updated */ - updatedAt?: string; + updatedAt?: string | undefined; } export namespace Item { @@ -77,9 +77,9 @@ export namespace GetrecordsResponse { */ export interface Identifiers { /** ext_id is ID of record in the external system that client_dev want to store in the object system. */ - ext_id?: string; + ext_id?: string | undefined; /** Internal ID of the object record generated by Brevo */ - id?: number; + id?: number | undefined; } } } diff --git a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts index dff7dba..bc889e6 100644 --- a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts +++ b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface UpsertrecordsResponse { - message?: string; + message?: string | undefined; /** Unique Id for the batch process used to track the status of the batch. */ - processId?: number; + processId?: number | undefined; } diff --git a/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts b/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts index f1c5309..3fadd07 100644 --- a/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts +++ b/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts @@ -4,9 +4,9 @@ * List of attributes */ export interface GetCrmAttributesDealsResponseItem { - attributeOptions?: Record[]; - attributeTypeName?: string; - internalName?: string; - isRequired?: boolean; - label?: string; + attributeOptions?: Record[] | undefined; + attributeTypeName?: string | undefined; + internalName?: string | undefined; + isRequired?: boolean | undefined; + label?: string | undefined; } diff --git a/src/api/resources/deals/types/GetCrmDealsResponse.ts b/src/api/resources/deals/types/GetCrmDealsResponse.ts index 932cbc0..a0ea11d 100644 --- a/src/api/resources/deals/types/GetCrmDealsResponse.ts +++ b/src/api/resources/deals/types/GetCrmDealsResponse.ts @@ -7,5 +7,5 @@ import type * as Brevo from "../../../index.js"; */ export interface GetCrmDealsResponse { /** List of deals */ - items?: Brevo.Deal[]; + items?: Brevo.Deal[] | undefined; } diff --git a/src/api/resources/deals/types/PostCrmDealsImportResponse.ts b/src/api/resources/deals/types/PostCrmDealsImportResponse.ts index 1a46d86..eb288db 100644 --- a/src/api/resources/deals/types/PostCrmDealsImportResponse.ts +++ b/src/api/resources/deals/types/PostCrmDealsImportResponse.ts @@ -2,5 +2,5 @@ export interface PostCrmDealsImportResponse { /** The ID of the import process */ - processId?: number; + processId?: number | undefined; } diff --git a/src/api/resources/domains/types/CreateDomainResponse.ts b/src/api/resources/domains/types/CreateDomainResponse.ts index da67de7..88ec3d9 100644 --- a/src/api/resources/domains/types/CreateDomainResponse.ts +++ b/src/api/resources/domains/types/CreateDomainResponse.ts @@ -6,11 +6,11 @@ export interface CreateDomainResponse { /** Domain name */ domain_name: string; /** Detected domain provider */ - domain_provider?: string; + domain_provider?: string | undefined; /** Success message with next steps */ message: string; /** DNS records required for domain authentication */ - dns_records?: CreateDomainResponse.DnsRecords; + dns_records?: CreateDomainResponse.DnsRecords | undefined; } export namespace CreateDomainResponse { diff --git a/src/api/resources/domains/types/GetDomainsResponse.ts b/src/api/resources/domains/types/GetDomainsResponse.ts index f992a3d..8163a71 100644 --- a/src/api/resources/domains/types/GetDomainsResponse.ts +++ b/src/api/resources/domains/types/GetDomainsResponse.ts @@ -31,7 +31,7 @@ export namespace GetDomainsResponse { */ verified: boolean; /** Dedicated IP associated with domain (null if none) */ - ip?: string | null; + ip?: (string | null) | undefined; /** DNS provider for the domain */ provider: string; /** Information about who created the domain */ diff --git a/src/api/resources/ecommerce/client/requests/CreateProductAlertRequest.ts b/src/api/resources/ecommerce/client/requests/CreateProductAlertRequest.ts index 0193678..4b98f6b 100644 --- a/src/api/resources/ecommerce/client/requests/CreateProductAlertRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateProductAlertRequest.ts @@ -18,10 +18,10 @@ export interface CreateProductAlertRequest { export namespace CreateProductAlertRequest { export interface ContactIdentifiers { /** Email address of the contact */ - email?: string; + email?: string | undefined; /** Contact ID in your system */ - ext_id?: string; + ext_id?: string | undefined; /** Sms of the contact */ - sms?: string; + sms?: string | undefined; } } diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchCategoryRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchCategoryRequest.ts index 8859c35..a946253 100644 --- a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchCategoryRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchCategoryRequest.ts @@ -21,15 +21,15 @@ export namespace CreateUpdateBatchCategoryRequest { export namespace Categories { export interface Item { /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database */ - deletedAt?: string; + deletedAt?: string | undefined; /** Unique Category ID as saved in the shop */ id: string; /** category deleted from the shop's database */ - isDeleted?: boolean; + isDeleted?: boolean | undefined; /** **Mandatory in case of creation**. Name of the Category, as displayed in the shop */ - name?: string; + name?: string | undefined; /** URL to the category */ - url?: string; + url?: string | undefined; } } } diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts index 57589a7..003168d 100644 --- a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts @@ -22,29 +22,29 @@ export namespace CreateUpdateBatchProductsRequest { export namespace Products { export interface Item { /** Category ID-s of the product */ - categories?: string[]; + categories?: string[] | undefined; /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database */ - deletedAt?: string; + deletedAt?: string | undefined; /** Product ID for which you requested the details */ id: string; /** Absolute URL to the cover image of the product */ - imageUrl?: string; + imageUrl?: string | undefined; /** product deleted from the shop's database */ - isDeleted?: boolean; + isDeleted?: boolean | undefined; /** Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20. */ - metaInfo?: Record; + metaInfo?: Record | undefined; /** Mandatory in case of creation**. Name of the product for which you requested the details */ name: string; /** Parent product id of the product */ - parentId?: string; + parentId?: string | undefined; /** Price of the product */ - price?: number; + price?: number | undefined; /** Product identifier from the shop */ - sku?: string; + sku?: string | undefined; /** Current stock value of the product from the shop's database */ - stock?: number; + stock?: number | undefined; /** URL to the product */ - url?: string; + url?: string | undefined; } export namespace Item { diff --git a/src/api/resources/ecommerce/types/CreateBatchOrderResponse.ts b/src/api/resources/ecommerce/types/CreateBatchOrderResponse.ts index 2845f76..093bedd 100644 --- a/src/api/resources/ecommerce/types/CreateBatchOrderResponse.ts +++ b/src/api/resources/ecommerce/types/CreateBatchOrderResponse.ts @@ -4,5 +4,5 @@ export interface CreateBatchOrderResponse { /** Batch ID of the request */ batchId: number; /** Number of orders */ - count?: number; + count?: number | undefined; } diff --git a/src/api/resources/ecommerce/types/CreateUpdateBatchCategoryResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateBatchCategoryResponse.ts index 452f5a3..d732e1a 100644 --- a/src/api/resources/ecommerce/types/CreateUpdateBatchCategoryResponse.ts +++ b/src/api/resources/ecommerce/types/CreateUpdateBatchCategoryResponse.ts @@ -2,7 +2,7 @@ export interface CreateUpdateBatchCategoryResponse { /** Number of the new created categories */ - createdCount?: number; + createdCount?: number | undefined; /** Number of the existing categories updated */ - updatedCount?: number; + updatedCount?: number | undefined; } diff --git a/src/api/resources/ecommerce/types/CreateUpdateBatchProductsResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateBatchProductsResponse.ts index 0c96f06..cfa671e 100644 --- a/src/api/resources/ecommerce/types/CreateUpdateBatchProductsResponse.ts +++ b/src/api/resources/ecommerce/types/CreateUpdateBatchProductsResponse.ts @@ -2,7 +2,7 @@ export interface CreateUpdateBatchProductsResponse { /** Number of the new created products */ - createdCount?: number; + createdCount?: number | undefined; /** Number of the existing products updated */ - updatedCount?: number; + updatedCount?: number | undefined; } diff --git a/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts index fbd1718..2901a3c 100644 --- a/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts +++ b/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts @@ -2,5 +2,5 @@ export interface CreateUpdateCategoryResponse { /** ID of the category when a new category is created */ - id?: number; + id?: number | undefined; } diff --git a/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts index 8610341..edeab69 100644 --- a/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts +++ b/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts @@ -2,5 +2,5 @@ export interface CreateUpdateProductResponse { /** ID of the Product when a new product is created */ - id?: number; + id?: number | undefined; } diff --git a/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.ts b/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.ts index 60f1c1e..5c437ba 100644 --- a/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.ts +++ b/src/api/resources/ecommerce/types/GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse.ts @@ -11,13 +11,13 @@ export namespace GetEcommerceAttributionProductsConversionSourceConversionSource export namespace Products { export interface Item { id: string; - imageUrl?: string; - name?: string; - ordersCount?: number; - price?: number; - revenue?: number; - sku?: string; - url?: string; + imageUrl?: string | undefined; + name?: string | undefined; + ordersCount?: number | undefined; + price?: number | undefined; + revenue?: number | undefined; + sku?: string | undefined; + url?: string | undefined; } } } diff --git a/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts index 72b2e74..883f201 100644 --- a/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts +++ b/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts @@ -80,9 +80,9 @@ export namespace CreateEmailCampaignRequest { */ export interface EmailExpirationDate { /** Duration of the email expiry. maximum duration can be 3600 days or 480 weeks or 120 months. */ - duration?: number; + duration?: number | undefined; /** unit of the duration */ - unit?: EmailExpirationDate.Unit; + unit?: EmailExpirationDate.Unit | undefined; } export namespace EmailExpirationDate { @@ -100,13 +100,13 @@ export namespace CreateEmailCampaignRequest { */ export interface Recipients { /** List ids to exclude from the campaign */ - exclusionListIds?: number[]; + exclusionListIds?: number[] | undefined; /** Segment ids which have to be excluded from a campaign. */ - exclusionSegmentIds?: number[]; + exclusionSegmentIds?: number[] | undefined; /** **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to */ - listIds?: number[]; + listIds?: number[] | undefined; /** **Mandatory if listIds are not used**. Segment ids to send the campaign to. */ - segmentIds?: number[]; + segmentIds?: number[] | undefined; } /** @@ -114,11 +114,11 @@ export namespace CreateEmailCampaignRequest { */ export interface Sender { /** Sender email */ - email?: string; + email?: string | undefined; /** Select the sender for the campaign on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. */ - id?: number; + id?: number | undefined; /** Sender Name */ - name?: string; + name?: string | undefined; } /** Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed */ diff --git a/src/api/resources/emailCampaigns/client/requests/UpdateEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/UpdateEmailCampaignRequest.ts index c8d98d6..4e18276 100644 --- a/src/api/resources/emailCampaigns/client/requests/UpdateEmailCampaignRequest.ts +++ b/src/api/resources/emailCampaigns/client/requests/UpdateEmailCampaignRequest.ts @@ -81,9 +81,9 @@ export namespace UpdateEmailCampaignRequest { */ export interface EmailExpirationDate { /** Duration of the email expiry. maximum duration can be 3600 days or 480 weeks or 120 months. */ - duration?: number; + duration?: number | undefined; /** unit of the duration */ - unit?: EmailExpirationDate.Unit; + unit?: EmailExpirationDate.Unit | undefined; } export namespace EmailExpirationDate { @@ -101,13 +101,13 @@ export namespace UpdateEmailCampaignRequest { */ export interface Recipients { /** List ids which have to be excluded from a campaign */ - exclusionListIds?: number[]; + exclusionListIds?: number[] | undefined; /** Segment ids which have to be excluded from a campaign. */ - exclusionSegmentIds?: number[]; + exclusionSegmentIds?: number[] | undefined; /** Lists Ids to send the campaign to. **Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty** */ - listIds?: number[]; + listIds?: number[] | undefined; /** **Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it.** Segment ids to send the campaign to. */ - segmentIds?: number[]; + segmentIds?: number[] | undefined; } /** @@ -115,11 +115,11 @@ export namespace UpdateEmailCampaignRequest { */ export interface Sender { /** Sender email from which the campaign emails are sent */ - email?: string; + email?: string | undefined; /** Select the sender for the campaign on the basis of sender id. **In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)**. */ - id?: number; + id?: number | undefined; /** Sender Name from which the campaign emails are sent */ - name?: string; + name?: string | undefined; } /** Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed */ diff --git a/src/api/resources/emailCampaigns/types/GetAbTestCampaignResultResponse.ts b/src/api/resources/emailCampaigns/types/GetAbTestCampaignResultResponse.ts index 42b523b..502c5d1 100644 --- a/src/api/resources/emailCampaigns/types/GetAbTestCampaignResultResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetAbTestCampaignResultResponse.ts @@ -4,19 +4,19 @@ import type * as Brevo from "../../../index.js"; export interface GetAbTestCampaignResultResponse { /** Click rate for current winning version */ - clickRate?: string; - clickedLinks?: GetAbTestCampaignResultResponse.ClickedLinks; + clickRate?: string | undefined; + clickedLinks?: GetAbTestCampaignResultResponse.ClickedLinks | undefined; /** Open rate for current winning version */ - openRate?: string; - statistics?: GetAbTestCampaignResultResponse.Statistics; + openRate?: string | undefined; + statistics?: GetAbTestCampaignResultResponse.Statistics | undefined; /** Criteria chosen for winning version (Open/Click) */ - winningCriteria?: GetAbTestCampaignResultResponse.WinningCriteria; + winningCriteria?: GetAbTestCampaignResultResponse.WinningCriteria | undefined; /** Subject Line of current winning version */ - winningSubjectLine?: string; + winningSubjectLine?: string | undefined; /** Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. */ - winningVersion?: GetAbTestCampaignResultResponse.WinningVersion; + winningVersion?: GetAbTestCampaignResultResponse.WinningVersion | undefined; /** Open/Click rate for the winner version */ - winningVersionRate?: string; + winningVersionRate?: string | undefined; } export namespace GetAbTestCampaignResultResponse { diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts index 71a7e33..990d630 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts @@ -4,33 +4,33 @@ import type * as Brevo from "../../../index.js"; export interface GetEmailCampaignResponse { /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ - abTesting?: boolean; + abTesting?: boolean | undefined; /** ID of the campaign */ id: number; /** Name of the campaign */ name: string; /** Preview text or preheader of the email campaign */ - previewText?: string; + previewText?: string | undefined; /** UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) */ - scheduledAt?: string; + scheduledAt?: string | undefined; /** It is true if you have chosen to send your campaign at best time, otherwise it is false */ - sendAtBestTime?: boolean; + sendAtBestTime?: boolean | undefined; /** The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` */ - splitRule?: number; + splitRule?: number | undefined; /** Status of the campaign */ status: GetEmailCampaignResponse.Status; /** Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` */ - subject?: string; + subject?: string | undefined; /** Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ - subjectA?: string; + subjectA?: string | undefined; /** Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ - subjectB?: string; + subjectB?: string | undefined; /** Type of campaign */ type: GetEmailCampaignResponse.Type; /** Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` */ - winnerCriteria?: string; + winnerCriteria?: string | undefined; /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ - winnerDelay?: number; + winnerDelay?: number | undefined; /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Footer of the campaign */ @@ -40,35 +40,35 @@ export interface GetEmailCampaignResponse { /** HTML content of the campaign */ htmlContent: string; /** Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. */ - inlineImageActivation?: boolean; + inlineImageActivation?: boolean | undefined; /** Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign */ - mirrorActive?: boolean; + mirrorActive?: boolean | undefined; /** UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; /** FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times */ - recurring?: boolean; + recurring?: boolean | undefined; /** Email defined as the "Reply to" of the campaign */ replyTo: string; /** Total number of non-delivered campaigns for a particular campaign id. */ - returnBounce?: number; + returnBounce?: number | undefined; sender: GetEmailCampaignResponse.Sender; /** Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' */ - sentDate?: string; + sentDate?: string | undefined; /** Link to share the campaign on social medias */ - shareLink?: string; + shareLink?: string | undefined; /** Tag of the campaign */ - tag?: string; + tag?: string | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ - toField?: string; + toField?: string | undefined; /** utm parameter associated with campaign */ - utmCampaignValue?: string; + utmCampaignValue?: string | undefined; /** utm id active */ - utmIDActive?: boolean; - utmMedium?: string; + utmIDActive?: boolean | undefined; + utmMedium?: string | undefined; /** source of utm */ - utmSource?: string; + utmSource?: string | undefined; recipients: Brevo.GetCampaignRecipients; statistics: Brevo.GetExtendedCampaignStats; } @@ -93,10 +93,10 @@ export namespace GetEmailCampaignResponse { export interface Sender { /** Sender email of the campaign */ - email?: string; + email?: string | undefined; /** Sender id of the campaign */ - id?: number; + id?: number | undefined; /** Sender name of the campaign */ - name?: string; + name?: string | undefined; } } diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts index a1a9012..4811eba 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts @@ -3,9 +3,9 @@ import type * as Brevo from "../../../index.js"; export interface GetEmailCampaignsResponse { - campaigns?: GetEmailCampaignsResponse.Campaigns.Item[]; + campaigns?: GetEmailCampaignsResponse.Campaigns.Item[] | undefined; /** Number of Email campaigns retrieved */ - count?: number; + count?: number | undefined; } export namespace GetEmailCampaignsResponse { @@ -14,33 +14,33 @@ export namespace GetEmailCampaignsResponse { export namespace Campaigns { export interface Item { /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ - abTesting?: boolean; + abTesting?: boolean | undefined; /** ID of the campaign */ id: number; /** Name of the campaign */ name: string; /** Preview text or preheader of the email campaign */ - previewText?: string; + previewText?: string | undefined; /** UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) */ - scheduledAt?: string; + scheduledAt?: string | undefined; /** It is true if you have chosen to send your campaign at best time, otherwise it is false */ - sendAtBestTime?: boolean; + sendAtBestTime?: boolean | undefined; /** The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` */ - splitRule?: number; + splitRule?: number | undefined; /** Status of the campaign */ status: Item.Status; /** Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` */ - subject?: string; + subject?: string | undefined; /** Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ - subjectA?: string; + subjectA?: string | undefined; /** Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ - subjectB?: string; + subjectB?: string | undefined; /** Type of campaign */ type: Item.Type; /** Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` */ - winnerCriteria?: string; + winnerCriteria?: string | undefined; /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ - winnerDelay?: number; + winnerDelay?: number | undefined; /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Footer of the campaign */ @@ -50,35 +50,35 @@ export namespace GetEmailCampaignsResponse { /** HTML content of the campaign */ htmlContent: string; /** Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. */ - inlineImageActivation?: boolean; + inlineImageActivation?: boolean | undefined; /** Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign */ - mirrorActive?: boolean; + mirrorActive?: boolean | undefined; /** UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; /** FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times */ - recurring?: boolean; + recurring?: boolean | undefined; /** Email defined as the "Reply to" of the campaign */ replyTo: string; /** Total number of non-delivered campaigns for a particular campaign id. */ - returnBounce?: number; + returnBounce?: number | undefined; sender: Item.Sender; /** Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' */ - sentDate?: string; + sentDate?: string | undefined; /** Link to share the campaign on social medias */ - shareLink?: string; + shareLink?: string | undefined; /** Tag of the campaign */ - tag?: string; + tag?: string | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ - toField?: string; + toField?: string | undefined; /** utm parameter associated with campaign */ - utmCampaignValue?: string; + utmCampaignValue?: string | undefined; /** utm id active */ - utmIDActive?: boolean; - utmMedium?: string; + utmIDActive?: boolean | undefined; + utmMedium?: string | undefined; /** source of utm */ - utmSource?: string; + utmSource?: string | undefined; recipients: Brevo.GetCampaignRecipients; statistics: Brevo.GetExtendedCampaignStats; } @@ -103,11 +103,11 @@ export namespace GetEmailCampaignsResponse { export interface Sender { /** Sender email of the campaign */ - email?: string; + email?: string | undefined; /** Sender id of the campaign */ - id?: number; + id?: number | undefined; /** Sender name of the campaign */ - name?: string; + name?: string | undefined; } } } diff --git a/src/api/resources/emailCampaigns/types/UploadImageToGalleryResponse.ts b/src/api/resources/emailCampaigns/types/UploadImageToGalleryResponse.ts index 7cd4abb..6966835 100644 --- a/src/api/resources/emailCampaigns/types/UploadImageToGalleryResponse.ts +++ b/src/api/resources/emailCampaigns/types/UploadImageToGalleryResponse.ts @@ -2,5 +2,5 @@ export interface UploadImageToGalleryResponse { /** URL of the image uploaded */ - url?: string; + url?: string | undefined; } diff --git a/src/api/resources/event/client/requests/CreateEventRequest.ts b/src/api/resources/event/client/requests/CreateEventRequest.ts index b43998e..78a6315 100644 --- a/src/api/resources/event/client/requests/CreateEventRequest.ts +++ b/src/api/resources/event/client/requests/CreateEventRequest.ts @@ -36,17 +36,17 @@ export namespace CreateEventRequest { */ export interface Identifiers { /** Internal unique contact ID. When present, this takes priority over all other identifiers for event attribution and contact resolution. */ - contact_id?: number; + contact_id?: number | undefined; /** Email Id associated with the event */ - email_id?: string; + email_id?: string | undefined; /** ext_id associated with the event */ - ext_id?: string; + ext_id?: string | undefined; /** landline_number associated with the event */ - landline_number_id?: string; + landline_number_id?: string | undefined; /** SMS associated with the event */ - phone_id?: string; + phone_id?: string | undefined; /** whatsapp associated with the event */ - whatsapp_id?: string; + whatsapp_id?: string | undefined; } /** @@ -54,9 +54,9 @@ export namespace CreateEventRequest { */ export interface Object_ { /** Identifiers for the object. */ - identifiers?: Object_.Identifiers; + identifiers?: Object_.Identifiers | undefined; /** Type of object (e.g., subscription, vehicle, etc.) */ - type?: string; + type?: string | undefined; } export namespace Object_ { @@ -65,9 +65,9 @@ export namespace CreateEventRequest { */ export interface Identifiers { /** External object ID */ - ext_id?: string; + ext_id?: string | undefined; /** Internal object ID */ - id?: string; + id?: string | undefined; } } } diff --git a/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts b/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts index 867ac44..84a4a05 100644 --- a/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts +++ b/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts @@ -23,11 +23,11 @@ export namespace GetAllExternalFeedsResponse { /** Authentication type for accessing the feed */ authType: Item.AuthType; /** Username for basic authentication */ - username?: string; + username?: string | undefined; /** Password for basic authentication */ - password?: string; + password?: string | undefined; /** Token for token-based authentication */ - token?: string; + token?: string | undefined; /** Maximum number of retry attempts for failed requests */ maxRetries: number; /** Whether to cache the feed response */ @@ -35,7 +35,7 @@ export namespace GetAllExternalFeedsResponse { /** Whether this is an internal Brevo system feed */ isInternal: boolean; /** Custom HTTP headers for the feed request */ - headers?: Item.Headers.Item[] | null; + headers?: (Item.Headers.Item[] | null) | undefined; /** Feed creation timestamp */ createdAt: string; /** Feed last modification timestamp */ diff --git a/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts b/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts index f80bd2b..f685018 100644 --- a/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts +++ b/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts @@ -10,11 +10,11 @@ export interface GetExternalFeedByUuidResponse { /** Authentication type for accessing the feed */ authType: GetExternalFeedByUuidResponse.AuthType; /** Username for basic authentication (null if not using basic auth) */ - username?: string | null; + username?: (string | null) | undefined; /** Password for basic authentication (null if not using basic auth) */ - password?: string | null; + password?: (string | null) | undefined; /** Token for token-based authentication (null if not using token auth) */ - token?: string | null; + token?: (string | null) | undefined; /** Whether personalization is enabled for this feed */ personalization: boolean; /** Default attribute name for personalization fallback (empty string if not set) */ @@ -22,7 +22,7 @@ export interface GetExternalFeedByUuidResponse { /** Default contact email for personalization fallback (empty string if not set) */ defaultContact: string; /** Custom HTTP headers for the feed request */ - headers?: GetExternalFeedByUuidResponse.Headers.Item[] | null; + headers?: (GetExternalFeedByUuidResponse.Headers.Item[] | null) | undefined; /** Maximum number of retry attempts for failed requests */ maxRetries: number; /** Whether to cache the feed response */ diff --git a/src/api/resources/files/types/GetCrmFilesIdResponse.ts b/src/api/resources/files/types/GetCrmFilesIdResponse.ts index 32a2123..026680e 100644 --- a/src/api/resources/files/types/GetCrmFilesIdResponse.ts +++ b/src/api/resources/files/types/GetCrmFilesIdResponse.ts @@ -5,5 +5,5 @@ */ export interface GetCrmFilesIdResponse { /** A unique link to download the requested file. */ - fileUrl?: string; + fileUrl?: string | undefined; } diff --git a/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts b/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts index e2bfecc..29c4ef8 100644 --- a/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts +++ b/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts @@ -2,21 +2,21 @@ export interface GetInboundEmailEventsByUuidResponse { /** List of attachments of the email. This will be present only after the processing is done. */ - attachments?: GetInboundEmailEventsByUuidResponse.Attachments.Item[]; + attachments?: GetInboundEmailEventsByUuidResponse.Attachments.Item[] | undefined; /** Date when email was delivered successfully to client_dev’s webhook */ - deliveredAt?: string | null; + deliveredAt?: (string | null) | undefined; /** List of events/logs that describe the lifecycle of the email on SIB platform */ - logs?: GetInboundEmailEventsByUuidResponse.Logs.Item[]; + logs?: GetInboundEmailEventsByUuidResponse.Logs.Item[] | undefined; /** Value of the Message-ID header. This will be present only after the processing is done. */ - messageId?: string; + messageId?: string | undefined; /** Date when email was received on SMTP relay */ - receivedAt?: string; + receivedAt?: string | undefined; /** Recipient’s email address */ - recipient?: string; + recipient?: string | undefined; /** Sender’s email address */ - sender?: string; + sender?: string | undefined; /** Value of the Subject header. This will be present only after the processing is done. */ - subject?: string; + subject?: string | undefined; } export namespace GetInboundEmailEventsByUuidResponse { @@ -25,13 +25,13 @@ export namespace GetInboundEmailEventsByUuidResponse { export namespace Attachments { export interface Item { /** value of the Content-ID header of the attachment. */ - contentId?: string; + contentId?: string | undefined; /** size of the attachment in bytes */ - contentLength?: number; + contentLength?: number | undefined; /** value of the Content-Type header of the attachment */ - contentType?: string; + contentType?: string | undefined; /** filename specified in the Content-Disposition header of the attachment */ - name?: string; + name?: string | undefined; } } @@ -40,9 +40,9 @@ export namespace GetInboundEmailEventsByUuidResponse { export namespace Logs { export interface Item { /** Date of the event */ - date?: string; + date?: string | undefined; /** Type of the event */ - type?: Item.Type; + type?: Item.Type | undefined; } export namespace Item { diff --git a/src/api/resources/inboundParsing/types/GetInboundEmailEventsResponse.ts b/src/api/resources/inboundParsing/types/GetInboundEmailEventsResponse.ts index 5cabadc..543ef50 100644 --- a/src/api/resources/inboundParsing/types/GetInboundEmailEventsResponse.ts +++ b/src/api/resources/inboundParsing/types/GetInboundEmailEventsResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface GetInboundEmailEventsResponse { - events?: GetInboundEmailEventsResponse.Events.Item[]; + events?: GetInboundEmailEventsResponse.Events.Item[] | undefined; } export namespace GetInboundEmailEventsResponse { diff --git a/src/api/resources/masterAccount/client/requests/InviteAdminUserRequest.ts b/src/api/resources/masterAccount/client/requests/InviteAdminUserRequest.ts index c1b7258..2979b41 100644 --- a/src/api/resources/masterAccount/client/requests/InviteAdminUserRequest.ts +++ b/src/api/resources/masterAccount/client/requests/InviteAdminUserRequest.ts @@ -27,9 +27,9 @@ export namespace InviteAdminUserRequest { */ export interface Item { /** Feature name */ - feature?: Item.Feature; + feature?: Item.Feature | undefined; /** Permissions for a given feature */ - permissions?: Item.Permissions.Item[]; + permissions?: Item.Permissions.Item[] | undefined; } export namespace Item { diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdPlanRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdPlanRequest.ts index dd3e46b..56fd701 100644 --- a/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdPlanRequest.ts +++ b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountIdPlanRequest.ts @@ -37,27 +37,27 @@ export namespace PutCorporateSubAccountIdPlanRequest { * Number of email credits | Pass the value -1 for unlimited * emails in ENTv2 only */ - email?: number; + email?: number | undefined; /** * Number of externalFeeds credits, possible values are 0 or 1 * |available in ENTv2 only */ - externalFeeds?: number; + externalFeeds?: number | undefined; /** * Number of SMS credits | Pass the value -1 for unlimited SMS * in ENTv2 only */ - sms?: number; + sms?: number | undefined; /** * Number of whatsapp credits | Pass the value -1 for unlimited * whatsapp in ENTv2 only */ - whatsapp?: number; + whatsapp?: number | undefined; /** * Number of Push credits, possible value is 0 and -1 | * available in ENT-v2 only */ - wpSubscribers?: number; + wpSubscribers?: number | undefined; } /** @@ -65,12 +65,12 @@ export namespace PutCorporateSubAccountIdPlanRequest { */ export interface Features { /** Number of inboxes / Not required on ENTv2 */ - inbox?: number; + inbox?: number | undefined; /** Number of landing pages */ - landingPage?: number; + landingPage?: number | undefined; /** Number of sales and service users | only available in ENT-V2 */ - salesUsers?: number; + salesUsers?: number | undefined; /** Number of multi-users */ - users?: number; + users?: number | undefined; } } diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountsPlanRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountsPlanRequest.ts index 6edfc55..90ecd52 100644 --- a/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountsPlanRequest.ts +++ b/src/api/resources/masterAccount/client/requests/PutCorporateSubAccountsPlanRequest.ts @@ -36,27 +36,27 @@ export namespace PutCorporateSubAccountsPlanRequest { * Number of email credits | Pass the value -1 for unlimited * emails in ENTv2 only */ - email?: number; + email?: number | undefined; /** * Number of externalFeeds credits, possible values are 0 or 1 * |available in ENTv2 only */ - externalFeeds?: number; + externalFeeds?: number | undefined; /** * Number of SMS credits | Pass the value -1 for unlimited SMS * in ENTv2 only */ - sms?: number; + sms?: number | undefined; /** * Number of whatsapp credits | Pass the value -1 for unlimited * whatsapp in ENTv2 only */ - whatsapp?: number; + whatsapp?: number | undefined; /** * Number of Push credits, possible value is 0 and -1 | * available in ENT-v2 only */ - wpSubscribers?: number; + wpSubscribers?: number | undefined; } /** @@ -64,10 +64,10 @@ export namespace PutCorporateSubAccountsPlanRequest { */ export interface Features { /** Number of landing pages */ - landingPage?: number; + landingPage?: number | undefined; /** Number of sales and service users | only available in ENT-V2 */ - salesUsers?: number; + salesUsers?: number | undefined; /** Number of multi-users */ - users?: number; + users?: number | undefined; } } diff --git a/src/api/resources/masterAccount/client/requests/PutCorporateUserEmailPermissionsRequest.ts b/src/api/resources/masterAccount/client/requests/PutCorporateUserEmailPermissionsRequest.ts index a3f34f1..3f23bac 100644 --- a/src/api/resources/masterAccount/client/requests/PutCorporateUserEmailPermissionsRequest.ts +++ b/src/api/resources/masterAccount/client/requests/PutCorporateUserEmailPermissionsRequest.ts @@ -52,9 +52,9 @@ export namespace PutCorporateUserEmailPermissionsRequest { */ export interface Item { /** feature name */ - feature?: Item.Feature; + feature?: Item.Feature | undefined; /** Permission for the feature */ - permissions?: Item.Permissions.Item[]; + permissions?: Item.Permissions.Item[] | undefined; } export namespace Item { diff --git a/src/api/resources/masterAccount/types/GetCorporateGroupIdResponse.ts b/src/api/resources/masterAccount/types/GetCorporateGroupIdResponse.ts index 1f35421..a3fd869 100644 --- a/src/api/resources/masterAccount/types/GetCorporateGroupIdResponse.ts +++ b/src/api/resources/masterAccount/types/GetCorporateGroupIdResponse.ts @@ -1,19 +1,19 @@ // This file was auto-generated by Fern from our API Definition. export interface GetCorporateGroupIdResponse { - group?: GetCorporateGroupIdResponse.Group; - "sub-accounts"?: GetCorporateGroupIdResponse.SubAccounts.Item[]; - users?: GetCorporateGroupIdResponse.Users.Item[]; + group?: GetCorporateGroupIdResponse.Group | undefined; + "sub-accounts"?: GetCorporateGroupIdResponse.SubAccounts.Item[] | undefined; + users?: GetCorporateGroupIdResponse.Users.Item[] | undefined; } export namespace GetCorporateGroupIdResponse { export interface Group { /** Group creation date */ - createdAt?: string; + createdAt?: string | undefined; /** Name of the group */ - groupName?: string; + groupName?: string | undefined; /** Group id */ - id?: string; + id?: string | undefined; } export type SubAccounts = SubAccounts.Item[]; @@ -21,11 +21,11 @@ export namespace GetCorporateGroupIdResponse { export namespace SubAccounts { export interface Item { /** Name of the sub-account organzation */ - companyName?: string; + companyName?: string | undefined; /** Creation date of the sub-account organzation */ - createdAt?: string; + createdAt?: string | undefined; /** Id of the sub-account organzation */ - id?: number; + id?: number | undefined; } } @@ -34,11 +34,11 @@ export namespace GetCorporateGroupIdResponse { export namespace Users { export interface Item { /** Email address of the user */ - email?: string; + email?: string | undefined; /** First name of the user */ - firstName?: string; + firstName?: string | undefined; /** Last name of the user */ - lastName?: string; + lastName?: string | undefined; } } } diff --git a/src/api/resources/masterAccount/types/GetCorporateInvitedUsersListResponse.ts b/src/api/resources/masterAccount/types/GetCorporateInvitedUsersListResponse.ts index 2032284..e800a90 100644 --- a/src/api/resources/masterAccount/types/GetCorporateInvitedUsersListResponse.ts +++ b/src/api/resources/masterAccount/types/GetCorporateInvitedUsersListResponse.ts @@ -2,7 +2,7 @@ export interface GetCorporateInvitedUsersListResponse { /** Get invited users list */ - users?: GetCorporateInvitedUsersListResponse.Users.Item[]; + users?: GetCorporateInvitedUsersListResponse.Users.Item[] | undefined; } export namespace GetCorporateInvitedUsersListResponse { @@ -32,35 +32,35 @@ export namespace GetCorporateInvitedUsersListResponse { */ export interface FeatureAccess { /** Analytics dashboard accessibility */ - analytics?: string[]; + analytics?: string[] | undefined; /** Api keys accessiblity. */ - api_keys?: string[]; + api_keys?: string[] | undefined; /** * Apps management accessiblity | Not available in * ENTv2 */ - apps_management?: string[]; + apps_management?: string[] | undefined; /** * Authorization to create sub-organization in the * admin account. If the user creating the * sub-organization, belongs to a group, the user must * choose a group at the sub-organization creation. */ - create_sub_organizations?: string[]; + create_sub_organizations?: string[] | undefined; /** * Authorization to manage and access sub-organizations * in the admin account. */ - manage_sub_organizations?: string[]; + manage_sub_organizations?: string[] | undefined; /** My plan accessiblity. */ - my_plan?: string[]; + my_plan?: string[] | undefined; /** * Group creation, modification or deletion * accessibility */ - sub_organization_groups?: string[]; + sub_organization_groups?: string[] | undefined; /** User management accessiblity. */ - user_management?: string[]; + user_management?: string[] | undefined; } /** @@ -68,9 +68,9 @@ export namespace GetCorporateInvitedUsersListResponse { */ export interface Groups { /** group id */ - id?: string; + id?: string | undefined; /** group name */ - name?: string; + name?: string | undefined; } } } diff --git a/src/api/resources/masterAccount/types/GetCorporateIpResponseItem.ts b/src/api/resources/masterAccount/types/GetCorporateIpResponseItem.ts index 379af18..432676d 100644 --- a/src/api/resources/masterAccount/types/GetCorporateIpResponseItem.ts +++ b/src/api/resources/masterAccount/types/GetCorporateIpResponseItem.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface GetCorporateIpResponseItem { - domain?: string; - ip?: string; - transactional?: boolean; + domain?: string | undefined; + ip?: string | undefined; + transactional?: boolean | undefined; } diff --git a/src/api/resources/masterAccount/types/GetCorporateMasterAccountResponse.ts b/src/api/resources/masterAccount/types/GetCorporateMasterAccountResponse.ts index 3e1755c..169fb97 100644 --- a/src/api/resources/masterAccount/types/GetCorporateMasterAccountResponse.ts +++ b/src/api/resources/masterAccount/types/GetCorporateMasterAccountResponse.ts @@ -2,19 +2,19 @@ export interface GetCorporateMasterAccountResponse { /** Billing details of the master account organization */ - billingInfo?: GetCorporateMasterAccountResponse.BillingInfo; + billingInfo?: GetCorporateMasterAccountResponse.BillingInfo | undefined; /** Company name of master account organization */ - companyName?: string; + companyName?: string | undefined; /** Currency code of the master account organization */ - currencyCode?: string; + currencyCode?: string | undefined; /** Email id of master account */ - email?: string; + email?: string | undefined; /** Unique identifier of the master account organization */ - id?: number; + id?: number | undefined; /** Plan details */ - planInfo?: GetCorporateMasterAccountResponse.PlanInfo; + planInfo?: GetCorporateMasterAccountResponse.PlanInfo | undefined; /** Timezone of the master account organization */ - timezone?: string; + timezone?: string | undefined; } export namespace GetCorporateMasterAccountResponse { @@ -23,13 +23,13 @@ export namespace GetCorporateMasterAccountResponse { */ export interface BillingInfo { /** Billing address of master account */ - address?: BillingInfo.Address; + address?: BillingInfo.Address | undefined; /** Company name of master account */ - companyName?: string; + companyName?: string | undefined; /** Billing email id of master account */ - email?: string; + email?: string | undefined; /** Billing name of master account holder */ - name?: BillingInfo.Name; + name?: BillingInfo.Name | undefined; } export namespace BillingInfo { @@ -38,15 +38,15 @@ export namespace GetCorporateMasterAccountResponse { */ export interface Address { /** Country code */ - countryCode?: string; + countryCode?: string | undefined; /** Locality */ - locality?: string; + locality?: string | undefined; /** Postal code */ - postalCode?: string; + postalCode?: string | undefined; /** State code */ - stateCode?: string; + stateCode?: string | undefined; /** Street address */ - streetAddress?: string; + streetAddress?: string | undefined; } /** @@ -54,9 +54,9 @@ export namespace GetCorporateMasterAccountResponse { */ export interface Name { /** Last name for billing */ - familyName?: string; + familyName?: string | undefined; /** First name for billing */ - givenName?: string; + givenName?: string | undefined; } } @@ -65,17 +65,17 @@ export namespace GetCorporateMasterAccountResponse { */ export interface PlanInfo { /** Plan currency */ - currencyCode?: string; + currencyCode?: string | undefined; /** List of provided features in the plan */ - features?: PlanInfo.Features.Item[]; + features?: PlanInfo.Features.Item[] | undefined; /** Timestamp of next billing date */ - nextBillingAt?: number; + nextBillingAt?: number | undefined; /** Plan period type */ - planPeriod?: PlanInfo.PlanPeriod; + planPeriod?: PlanInfo.PlanPeriod | undefined; /** Plan amount */ - price?: number; + price?: number | undefined; /** Number of sub-accounts */ - subAccounts?: number; + subAccounts?: number | undefined; } export namespace PlanInfo { @@ -84,25 +84,25 @@ export namespace GetCorporateMasterAccountResponse { export namespace Features { export interface Item { /** Name of the feature */ - name?: string; + name?: string | undefined; /** Quantity provided in the plan */ - quantity?: number; + quantity?: number | undefined; /** * Quantity with overages provided in the plan (only * applicable on ENTv2) */ - quantityWithOverages?: number; + quantityWithOverages?: number | undefined; /** Quantity remaining in the plan */ - remaining?: number; + remaining?: number | undefined; /** Unit value of the feature */ - unitValue?: string; + unitValue?: string | undefined; /** Quantity consumed by master */ - used?: number; + used?: number | undefined; /** * Quantity consumed by sub-organizations over the * admin plan limit (only applicable on ENTv2) */ - usedOverages?: number; + usedOverages?: number | undefined; } } diff --git a/src/api/resources/masterAccount/types/GetCorporateSubAccountIdResponse.ts b/src/api/resources/masterAccount/types/GetCorporateSubAccountIdResponse.ts index 98cd3e5..5bd6679 100644 --- a/src/api/resources/masterAccount/types/GetCorporateSubAccountIdResponse.ts +++ b/src/api/resources/masterAccount/types/GetCorporateSubAccountIdResponse.ts @@ -2,15 +2,15 @@ export interface GetCorporateSubAccountIdResponse { /** Sub-account company name */ - companyName?: string; + companyName?: string | undefined; /** Email id of the sub-account organization */ - email?: string; + email?: string | undefined; /** List of groups associated with the sub-account */ - groups?: GetCorporateSubAccountIdResponse.Groups.Item[]; + groups?: GetCorporateSubAccountIdResponse.Groups.Item[] | undefined; /** Name of the sub-account user */ - name?: string; + name?: string | undefined; /** Sub-account plan details */ - planInfo?: GetCorporateSubAccountIdResponse.PlanInfo; + planInfo?: GetCorporateSubAccountIdResponse.PlanInfo | undefined; } export namespace GetCorporateSubAccountIdResponse { @@ -19,9 +19,9 @@ export namespace GetCorporateSubAccountIdResponse { export namespace Groups { export interface Item { /** Group id */ - id?: string; + id?: string | undefined; /** Name of the group */ - name?: string; + name?: string | undefined; } } @@ -30,11 +30,11 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface PlanInfo { /** Credits quota and remaining credits on the sub-account */ - credits?: PlanInfo.Credits; + credits?: PlanInfo.Credits | undefined; /** Features available on the sub-account */ - features?: PlanInfo.Features; + features?: PlanInfo.Features | undefined; /** type of the plan */ - planType?: string; + planType?: string | undefined; } export namespace PlanInfo { @@ -43,15 +43,15 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface Credits { /** Email credits remaining on the sub-account */ - emails?: Credits.Emails; + emails?: Credits.Emails | undefined; /** externalFeeds credits remaining on the sub-account */ - externalFeeds?: Credits.ExternalFeeds; + externalFeeds?: Credits.ExternalFeeds | undefined; /** SMS credits remaining on the sub-account */ - sms?: Credits.Sms; + sms?: Credits.Sms | undefined; /** Whatsapp credits remaining on the sub-account */ - whatsapp?: Credits.Whatsapp; + whatsapp?: Credits.Whatsapp | undefined; /** Push credits remaining on the sub-account */ - wpSubscribers?: Credits.WpSubscribers; + wpSubscribers?: Credits.WpSubscribers | undefined; } export namespace Credits { @@ -60,9 +60,9 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface Emails { /** Quantity of email messaging limits provided */ - quantity?: number; + quantity?: number | undefined; /** Available email messaging limits for use */ - remaining?: number; + remaining?: number | undefined; } /** @@ -73,9 +73,9 @@ export namespace GetCorporateSubAccountIdResponse { * Quantity of externalFeeds messaging limits * provided */ - quantity?: number; + quantity?: number | undefined; /** Available externalFeeds messaging limits for use */ - remaining?: number; + remaining?: number | undefined; } /** @@ -83,9 +83,9 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface Sms { /** Quantity of SMS messaging limits provided */ - quantity?: number; + quantity?: number | undefined; /** Available SMS messaging limits for use */ - remaining?: number; + remaining?: number | undefined; } /** @@ -93,9 +93,9 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface Whatsapp { /** Quantity of whatsapp messaging limits provided */ - quantity?: number; + quantity?: number | undefined; /** Available whatsapp messaging limits for use */ - remaining?: number; + remaining?: number | undefined; } /** @@ -103,9 +103,9 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface WpSubscribers { /** Quantity of Push sending limits provided */ - quantity?: number; + quantity?: number | undefined; /** Available Push sending limits for use */ - remaining?: number; + remaining?: number | undefined; } } @@ -114,16 +114,16 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface Features { /** Inbox details / Not applicable on ENTv2 */ - inbox?: Features.Inbox; + inbox?: Features.Inbox | undefined; /** Landing page details / Not applicable on ENTv2 */ - landingPage?: Features.LandingPage; + landingPage?: Features.LandingPage | undefined; /** * Sales and service users to use phone, sales and * conversations */ - salesUsers?: Features.SalesUsers; + salesUsers?: Features.SalesUsers | undefined; /** Marketing users to manage the marketing channels */ - users?: Features.Users; + users?: Features.Users | undefined; } export namespace Features { @@ -132,9 +132,9 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface Inbox { /** Quantity of inbox provided */ - quantity?: number; + quantity?: number | undefined; /** Available inboxes for use */ - remaining?: number; + remaining?: number | undefined; } /** @@ -142,9 +142,9 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface LandingPage { /** Quantity of landing pages provided */ - quantity?: number; + quantity?: number | undefined; /** Available landing pages for use */ - remaining?: number; + remaining?: number | undefined; } /** @@ -153,9 +153,9 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface SalesUsers { /** Quantity of sales users provided */ - quantity?: number; + quantity?: number | undefined; /** Available sales users for use */ - remaining?: number; + remaining?: number | undefined; } /** @@ -163,9 +163,9 @@ export namespace GetCorporateSubAccountIdResponse { */ export interface Users { /** Quantity of marketing users provided */ - quantity?: number; + quantity?: number | undefined; /** Available marketing users for use */ - remaining?: number; + remaining?: number | undefined; } } } diff --git a/src/api/resources/masterAccount/types/GetCorporateSubAccountResponse.ts b/src/api/resources/masterAccount/types/GetCorporateSubAccountResponse.ts index 36ccd8e..db4a758 100644 --- a/src/api/resources/masterAccount/types/GetCorporateSubAccountResponse.ts +++ b/src/api/resources/masterAccount/types/GetCorporateSubAccountResponse.ts @@ -2,8 +2,8 @@ export interface GetCorporateSubAccountResponse { /** Total number of subaccounts */ - count?: number; - subAccounts?: GetCorporateSubAccountResponse.SubAccounts.Item[]; + count?: number | undefined; + subAccounts?: GetCorporateSubAccountResponse.SubAccounts.Item[] | undefined; } export namespace GetCorporateSubAccountResponse { @@ -29,9 +29,9 @@ export namespace GetCorporateSubAccountResponse { export namespace Groups { export interface Item { /** Group identifier */ - id?: string; + id?: string | undefined; /** Name of the group */ - name?: string; + name?: string | undefined; } } } diff --git a/src/api/resources/masterAccount/types/GetCorporateUserPermissionResponse.ts b/src/api/resources/masterAccount/types/GetCorporateUserPermissionResponse.ts index 6f01227..4feb3e2 100644 --- a/src/api/resources/masterAccount/types/GetCorporateUserPermissionResponse.ts +++ b/src/api/resources/masterAccount/types/GetCorporateUserPermissionResponse.ts @@ -19,21 +19,21 @@ export namespace GetCorporateUserPermissionResponse { */ export interface FeatureAccess { /** Permission on analytics */ - analytics?: string[]; + analytics?: string[] | undefined; /** Permission on api keys */ - api_keys?: string[]; + api_keys?: string[] | undefined; /** Permission on apps management */ - apps_management?: string[]; + apps_management?: string[] | undefined; /** Permission on create sub-accounts */ - create_sub_organizations?: string[]; + create_sub_organizations?: string[] | undefined; /** Permission on manage sub-accounts */ - manage_sub_organizations?: string[]; + manage_sub_organizations?: string[] | undefined; /** Permission on my plan */ - my_plan?: string[]; + my_plan?: string[] | undefined; /** Permission on groups */ - sub_organization_groups?: string[]; + sub_organization_groups?: string[] | undefined; /** Permission on user management */ - user_management?: string[]; + user_management?: string[] | undefined; } export type Groups = Groups.Item[]; @@ -44,9 +44,9 @@ export namespace GetCorporateUserPermissionResponse { */ export interface Item { /** group identifier */ - id?: string; + id?: string | undefined; /** Group name */ - name?: string; + name?: string | undefined; } } } diff --git a/src/api/resources/masterAccount/types/GetSubAccountGroupsResponseItem.ts b/src/api/resources/masterAccount/types/GetSubAccountGroupsResponseItem.ts index 565b10f..811a108 100644 --- a/src/api/resources/masterAccount/types/GetSubAccountGroupsResponseItem.ts +++ b/src/api/resources/masterAccount/types/GetSubAccountGroupsResponseItem.ts @@ -2,7 +2,7 @@ export interface GetSubAccountGroupsResponseItem { /** The name of the group of sub-accounts */ - groupName?: string; + groupName?: string | undefined; /** Unique id of the group */ - id?: string; + id?: string | undefined; } diff --git a/src/api/resources/masterAccount/types/InviteAdminUserResponse.ts b/src/api/resources/masterAccount/types/InviteAdminUserResponse.ts index c55abbc..be05060 100644 --- a/src/api/resources/masterAccount/types/InviteAdminUserResponse.ts +++ b/src/api/resources/masterAccount/types/InviteAdminUserResponse.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. export interface InviteAdminUserResponse { - id?: string; + id?: string | undefined; } diff --git a/src/api/resources/masterAccount/types/PostCorporateGroupResponse.ts b/src/api/resources/masterAccount/types/PostCorporateGroupResponse.ts index b0cfbf7..205acf8 100644 --- a/src/api/resources/masterAccount/types/PostCorporateGroupResponse.ts +++ b/src/api/resources/masterAccount/types/PostCorporateGroupResponse.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. export interface PostCorporateGroupResponse { - id?: string; + id?: string | undefined; } diff --git a/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailResponse.ts b/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailResponse.ts index d2033a0..d0ec273 100644 --- a/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailResponse.ts +++ b/src/api/resources/masterAccount/types/PutCorporateUserInvitationActionEmailResponse.ts @@ -2,5 +2,5 @@ export interface PutCorporateUserInvitationActionEmailResponse { /** Action success message */ - message?: string; + message?: string | undefined; } diff --git a/src/api/resources/notes/types/PostCrmNotesResponse.ts b/src/api/resources/notes/types/PostCrmNotesResponse.ts index ae1760f..2d0e24a 100644 --- a/src/api/resources/notes/types/PostCrmNotesResponse.ts +++ b/src/api/resources/notes/types/PostCrmNotesResponse.ts @@ -5,5 +5,5 @@ */ export interface PostCrmNotesResponse { /** Unique note Id */ - id?: string; + id?: string | undefined; } diff --git a/src/api/resources/payments/types/CreatePaymentRequestResponse.ts b/src/api/resources/payments/types/CreatePaymentRequestResponse.ts index e59a851..9b3d012 100644 --- a/src/api/resources/payments/types/CreatePaymentRequestResponse.ts +++ b/src/api/resources/payments/types/CreatePaymentRequestResponse.ts @@ -4,5 +4,5 @@ export interface CreatePaymentRequestResponse { /** ID of the object created */ id: number; /** URL of the payment request created */ - url?: string; + url?: string | undefined; } diff --git a/src/api/resources/payments/types/GetPaymentRequestResponse.ts b/src/api/resources/payments/types/GetPaymentRequestResponse.ts index a02d924..13a5a10 100644 --- a/src/api/resources/payments/types/GetPaymentRequestResponse.ts +++ b/src/api/resources/payments/types/GetPaymentRequestResponse.ts @@ -4,12 +4,12 @@ import type * as Brevo from "../../../index.js"; export interface GetPaymentRequestResponse { cart: Brevo.Cart; - configuration?: Brevo.Configuration; + configuration?: Brevo.Configuration | undefined; /** Brevo ID of the contact requested to pay. */ - contactId?: number; + contactId?: number | undefined; notification: Brevo.Notification; /** number of reminders sent. */ - numberOfRemindersSent?: number; + numberOfRemindersSent?: number | undefined; /** Reference of the payment request, it will appear on the payment page. */ reference: string; /** Status of the payment request. */ diff --git a/src/api/resources/process/types/GetProcessResponse.ts b/src/api/resources/process/types/GetProcessResponse.ts index 7b283c8..75de873 100644 --- a/src/api/resources/process/types/GetProcessResponse.ts +++ b/src/api/resources/process/types/GetProcessResponse.ts @@ -8,15 +8,15 @@ export interface GetProcessResponse { /** Current status of the process */ status: GetProcessResponse.Status; /** Additional process information (for completed processes) */ - info?: GetProcessResponse.Info | null; + info?: (GetProcessResponse.Info | null) | undefined; /** Download URL for completed export processes */ - export_url?: string | null; + export_url?: (string | null) | undefined; /** Error message for failed processes */ - error?: string | null; + error?: (string | null) | undefined; /** Process creation timestamp */ - created_at?: string | null; + created_at?: (string | null) | undefined; /** Process completion timestamp */ - completed_at?: string | null; + completed_at?: (string | null) | undefined; } export namespace GetProcessResponse { @@ -46,9 +46,9 @@ export namespace GetProcessResponse { */ export interface Info { /** Import process details */ - import?: Info.Import; + import?: Info.Import | undefined; /** Export process details */ - export?: Info.Export; + export?: Info.Export | undefined; } export namespace Info { @@ -57,19 +57,19 @@ export namespace GetProcessResponse { */ export interface Import { /** Number of invalid email addresses */ - invalid_emails?: number | null; + invalid_emails?: (number | null) | undefined; /** Number of duplicate contact IDs */ - duplicate_contact_id?: number | null; + duplicate_contact_id?: (number | null) | undefined; /** Number of duplicate external IDs */ - duplicate_ext_id?: number | null; + duplicate_ext_id?: (number | null) | undefined; /** Number of duplicate email IDs */ - duplicate_email_id?: number | null; + duplicate_email_id?: (number | null) | undefined; /** Number of duplicate phone numbers */ - duplicate_phone_id?: number | null; + duplicate_phone_id?: (number | null) | undefined; /** Number of duplicate WhatsApp numbers */ - duplicate_whatsapp_id?: number | null; + duplicate_whatsapp_id?: (number | null) | undefined; /** Number of duplicate landline numbers */ - duplicate_landline_number_id?: number | null; + duplicate_landline_number_id?: (number | null) | undefined; } /** @@ -77,9 +77,9 @@ export namespace GetProcessResponse { */ export interface Export { /** Total number of exported records */ - total_records?: number; + total_records?: number | undefined; /** Size of exported file in bytes */ - file_size?: number; + file_size?: number | undefined; } } } diff --git a/src/api/resources/process/types/GetProcessesResponse.ts b/src/api/resources/process/types/GetProcessesResponse.ts index ada1b5e..b034580 100644 --- a/src/api/resources/process/types/GetProcessesResponse.ts +++ b/src/api/resources/process/types/GetProcessesResponse.ts @@ -19,15 +19,15 @@ export namespace GetProcessesResponse { /** Current status of the process */ status: Item.Status; /** Additional process information (for completed processes) */ - info?: Item.Info | null; + info?: (Item.Info | null) | undefined; /** Download URL for completed export processes */ - export_url?: string | null; + export_url?: (string | null) | undefined; /** Error message for failed processes */ - error?: string | null; + error?: (string | null) | undefined; /** Process creation timestamp */ - created_at?: string | null; + created_at?: (string | null) | undefined; /** Process completion timestamp */ - completed_at?: string | null; + completed_at?: (string | null) | undefined; } export namespace Item { @@ -57,9 +57,9 @@ export namespace GetProcessesResponse { */ export interface Info { /** Import process details */ - import?: Info.Import; + import?: Info.Import | undefined; /** Export process details */ - export?: Info.Export; + export?: Info.Export | undefined; } export namespace Info { @@ -68,19 +68,19 @@ export namespace GetProcessesResponse { */ export interface Import { /** Number of invalid email addresses */ - invalid_emails?: number | null; + invalid_emails?: (number | null) | undefined; /** Number of duplicate contact IDs */ - duplicate_contact_id?: number | null; + duplicate_contact_id?: (number | null) | undefined; /** Number of duplicate external IDs */ - duplicate_ext_id?: number | null; + duplicate_ext_id?: (number | null) | undefined; /** Number of duplicate email IDs */ - duplicate_email_id?: number | null; + duplicate_email_id?: (number | null) | undefined; /** Number of duplicate phone numbers */ - duplicate_phone_id?: number | null; + duplicate_phone_id?: (number | null) | undefined; /** Number of duplicate WhatsApp numbers */ - duplicate_whatsapp_id?: number | null; + duplicate_whatsapp_id?: (number | null) | undefined; /** Number of duplicate landline numbers */ - duplicate_landline_number_id?: number | null; + duplicate_landline_number_id?: (number | null) | undefined; } /** @@ -88,9 +88,9 @@ export namespace GetProcessesResponse { */ export interface Export { /** Total number of exported records */ - total_records?: number; + total_records?: number | undefined; /** Size of exported file in bytes */ - file_size?: number; + file_size?: number | undefined; } } } diff --git a/src/api/resources/program/types/GetLpListResponse.ts b/src/api/resources/program/types/GetLpListResponse.ts index edbf37f..0061370 100644 --- a/src/api/resources/program/types/GetLpListResponse.ts +++ b/src/api/resources/program/types/GetLpListResponse.ts @@ -4,5 +4,5 @@ import type * as Brevo from "../../../index.js"; export interface GetLpListResponse { /** Loyalty Program list */ - items?: Brevo.LoyaltyProgram[]; + items?: Brevo.LoyaltyProgram[] | undefined; } diff --git a/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts b/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts index c31882e..e9942bc 100644 --- a/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts +++ b/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts @@ -2,23 +2,23 @@ export interface GetParameterSubscriptionInfoResponse { /** Balance details for the subscription. */ - balance?: GetParameterSubscriptionInfoResponse.Balance; + balance?: GetParameterSubscriptionInfoResponse.Balance | undefined; /** List of members associated with the subscription. */ - members?: GetParameterSubscriptionInfoResponse.Members.Item[]; + members?: GetParameterSubscriptionInfoResponse.Members.Item[] | undefined; /** List of rewards associated with the subscription. */ - reward?: GetParameterSubscriptionInfoResponse.Reward.Item[]; + reward?: GetParameterSubscriptionInfoResponse.Reward.Item[] | undefined; /** List of tier assignments for the subscription. */ - tier?: GetParameterSubscriptionInfoResponse.Tier.Item[]; + tier?: GetParameterSubscriptionInfoResponse.Tier.Item[] | undefined; } export namespace GetParameterSubscriptionInfoResponse { export interface Balance { /** List of balance details associated with the contact. */ - balances?: Balance.Balances.Item[]; + balances?: Balance.Balances.Item[] | undefined; /** Unique identifier of the contact. */ - contactId?: number; + contactId?: number | undefined; /** Unique identifier of the loyalty program. */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; } export namespace Balance { @@ -27,9 +27,9 @@ export namespace GetParameterSubscriptionInfoResponse { export namespace Balances { export interface Item { /** Unique identifier for the balance definition). */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** The amount of the balance. */ - value?: number; + value?: number | undefined; } } } @@ -39,11 +39,11 @@ export namespace GetParameterSubscriptionInfoResponse { export namespace Members { export interface Item { /** Timestamp when the member was created. */ - createdAt?: string; + createdAt?: string | undefined; /** Unique identifier of the member. */ - memberContactId?: number; + memberContactId?: number | undefined; /** Timestamp when the member was last updated. */ - updatedAt?: string; + updatedAt?: string | undefined; } } @@ -52,23 +52,23 @@ export namespace GetParameterSubscriptionInfoResponse { export namespace Reward { export interface Item { /** Reward code assigned to the contact. */ - code?: string; + code?: string | undefined; /** Unique identifier of the contact. */ - contactId?: number; + contactId?: number | undefined; /** Timestamp when the reward was created. */ - createdAt?: string; + createdAt?: string | undefined; /** Expiration date of the reward. */ - expirationDate?: string; + expirationDate?: string | undefined; /** Unique identifier of the reward. */ - id?: string; + id?: string | undefined; /** Unique identifier of the loyalty program. */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Additional metadata related to the reward. */ - meta?: Record; + meta?: Record | undefined; /** Unique identifier of the reward definition. */ - rewardId?: string; + rewardId?: string | undefined; /** Timestamp when the reward was last updated. */ - updatedAt?: string; + updatedAt?: string | undefined; } } @@ -77,19 +77,19 @@ export namespace GetParameterSubscriptionInfoResponse { export namespace Tier { export interface Item { /** Unique identifier of the contact. */ - contactId?: number; + contactId?: number | undefined; /** Timestamp when the tier was assigned. */ - createdAt?: string; + createdAt?: string | undefined; /** Unique identifier of the group associated with the tier. */ - groupId?: string; + groupId?: string | undefined; /** Unique identifier of the loyalty program. */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Additional metadata related to the tier. */ - meta?: Record; + meta?: Record | undefined; /** Unique identifier of the tier. */ - tierId?: string; + tierId?: string | undefined; /** Timestamp when the tier was last updated */ - updatedAt?: string; + updatedAt?: string | undefined; } } } diff --git a/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts b/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts index d37d3f7..775a80a 100644 --- a/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts +++ b/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts @@ -2,13 +2,13 @@ export interface SubscribeMemberToASubscriptionResponse { /** Timestamp when the subscription member was created. */ - createdAt?: string; + createdAt?: string | undefined; /** List of unique member contact IDs. */ - memberContactIds?: number[]; + memberContactIds?: number[] | undefined; /** Unique identifier of the organization. */ - organizationId?: number; + organizationId?: number | undefined; /** Unique identifier of the subscription owner. */ - ownerContactId?: number; + ownerContactId?: number | undefined; /** Timestamp when the subscription member was last updated. */ - updatedAt?: string; + updatedAt?: string | undefined; } diff --git a/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts b/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts index 1226368..9030768 100644 --- a/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts +++ b/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts @@ -2,17 +2,17 @@ export interface SubscribeToLoyaltyProgramResponse { /** Unique identifier of the contact. */ - contactId?: number; + contactId?: number | undefined; /** Timestamp when the subscription was created. */ - createdAt?: string; + createdAt?: string | undefined; /** Unique identifier of the loyalty program. */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Unique identifier of the subscription. */ - loyaltySubscriptionId?: string; + loyaltySubscriptionId?: string | undefined; /** Unique identifier of the organization. */ - organizationId?: number; + organizationId?: number | undefined; /** Timestamp when the subscription was last updated. */ - updatedAt?: string; + updatedAt?: string | undefined; /** Version number of the subscription. */ - versionId?: number; + versionId?: number | undefined; } diff --git a/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts b/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts index b2b6e02..d7c38b1 100644 --- a/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts +++ b/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts @@ -30,54 +30,54 @@ export interface RedeemVoucherRequest { export namespace RedeemVoucherRequest { export interface Order { /** Total amount of the order */ - amount?: number; + amount?: number | undefined; /** Billing information for the order */ - billing?: Order.Billing; + billing?: Order.Billing | undefined; /** Unique identifier for the contact */ - contact_id?: number; + contact_id?: number | undefined; /** List of coupon codes applied to the order */ - coupons?: string[]; + coupons?: string[] | undefined; /** Timestamp when the order was created */ - createdAt?: string; + createdAt?: string | undefined; /** Email address associated with the order */ - email?: string; + email?: string | undefined; /** Unique identifier for the order */ - id?: string; + id?: string | undefined; /** Additional identifiers for the order */ - identifiers?: Order.Identifiers; + identifiers?: Order.Identifiers | undefined; /** List of products in the order */ - products?: Order.Products.Item[]; + products?: Order.Products.Item[] | undefined; /** Current status of the order */ - status?: string; + status?: string | undefined; /** Identifier for the store where the order was placed */ - storeId?: string; + storeId?: string | undefined; /** Timestamp when the order was last updated */ - updatedAt?: string; + updatedAt?: string | undefined; } export namespace Order { export interface Billing { /** Address of the user */ - address?: string; + address?: string | undefined; /** City of the user */ - city?: string; + city?: string | undefined; /** Country code of the user */ - countryCode?: string; + countryCode?: string | undefined; /** Payment method opted by the user */ - paymentMethod?: string; + paymentMethod?: string | undefined; /** Phone number of the user */ - phone?: number; + phone?: number | undefined; /** Postal Code of user's location */ - postCode?: number; + postCode?: number | undefined; /** Region where user resides */ - region?: string; + region?: string | undefined; } export interface Identifiers { /** External identifier for the order */ - ext_id?: string; + ext_id?: string | undefined; /** Identifier for the loyalty subscription */ - loyalty_subscription_id?: string; + loyalty_subscription_id?: string | undefined; } export type Products = Products.Item[]; @@ -85,15 +85,15 @@ export namespace RedeemVoucherRequest { export namespace Products { export interface Item { /** List of categories the product belongs to */ - category?: string[]; + category?: string[] | undefined; /** Price of the product */ - price?: number; + price?: number | undefined; /** Unique identifier for the product */ - productId?: string; + productId?: string | undefined; /** Quantity of the product */ - quantity?: number; + quantity?: number | undefined; /** Identifier for the product variant */ - variantId?: string; + variantId?: string | undefined; } } } diff --git a/src/api/resources/reward/types/CreateRewardResponse.ts b/src/api/resources/reward/types/CreateRewardResponse.ts index e23edf3..f65d5f0 100644 --- a/src/api/resources/reward/types/CreateRewardResponse.ts +++ b/src/api/resources/reward/types/CreateRewardResponse.ts @@ -2,19 +2,19 @@ export interface CreateRewardResponse { /** Timestamp when the reward was created */ - createdAt?: string; + createdAt?: string | undefined; /** Unique identifier for the reward */ - id?: string; + id?: string | undefined; /** Id of the loyalty program to which the current reward belongs to */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Name of the reward */ - name?: string; + name?: string | undefined; /** Public description for the reward */ - publicDescription?: string; + publicDescription?: string | undefined; /** Public Image for the reward */ - publicImage?: string; + publicImage?: string | undefined; /** Public name for the reward */ - publicName?: string; + publicName?: string | undefined; /** Timestamp for when this reward was last updated. */ - updatedAt?: string; + updatedAt?: string | undefined; } diff --git a/src/api/resources/reward/types/CreateVoucherResponse.ts b/src/api/resources/reward/types/CreateVoucherResponse.ts index cc7dabd..56901dd 100644 --- a/src/api/resources/reward/types/CreateVoucherResponse.ts +++ b/src/api/resources/reward/types/CreateVoucherResponse.ts @@ -2,25 +2,25 @@ export interface CreateVoucherResponse { /** Generated code */ - code?: string; + code?: string | undefined; /** Timestamp for when this reward was consumed */ - consumedAt?: string; + consumedAt?: string | undefined; /** Id of the contact that attributed the reward */ - contactId?: number; + contactId?: number | undefined; /** Timestamp for when this reward was created */ - createdAt?: string; + createdAt?: string | undefined; /** Expiration date of the reward */ - expirationDate?: string; + expirationDate?: string | undefined; /** Unique identifier */ - id?: string; + id?: string | undefined; /** Loyalty Program Id to which attributed reward belongs */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Additional data to define the reward */ - meta?: Record; + meta?: Record | undefined; /** Unique identifier for the reward */ - rewardId?: string; + rewardId?: string | undefined; /** Timestamp for when this reward was updated */ - updatedAt?: string; + updatedAt?: string | undefined; /** Value of the selected reward config */ - value?: number; + value?: number | undefined; } diff --git a/src/api/resources/reward/types/GetCodeCountResponse.ts b/src/api/resources/reward/types/GetCodeCountResponse.ts index a226524..5905ee9 100644 --- a/src/api/resources/reward/types/GetCodeCountResponse.ts +++ b/src/api/resources/reward/types/GetCodeCountResponse.ts @@ -2,5 +2,5 @@ export interface GetCodeCountResponse { /** Number of codes */ - count?: number; + count?: number | undefined; } diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersResponse.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersResponse.ts index 1442ec9..8f59cd9 100644 --- a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersResponse.ts +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidOffersResponse.ts @@ -2,9 +2,9 @@ export interface GetLoyaltyOfferProgramsPidOffersResponse { /** Items for the current reward */ - items?: GetLoyaltyOfferProgramsPidOffersResponse.Items.Item[]; + items?: GetLoyaltyOfferProgramsPidOffersResponse.Items.Item[] | undefined; /** Count of the associated parameter in current reward */ - totalCount?: number; + totalCount?: number | undefined; } export namespace GetLoyaltyOfferProgramsPidOffersResponse { @@ -13,23 +13,23 @@ export namespace GetLoyaltyOfferProgramsPidOffersResponse { export namespace Items { export interface Item { /** Timestamp for when this reward was created */ - createdAt?: string; + createdAt?: string | undefined; /** Timestamp for when this reward attribution ended */ - endDate?: string; + endDate?: string | undefined; /** Unique identifier for the reward */ - id?: string; + id?: string | undefined; /** Loyalty Program to which current reward is associated */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Name of the reward */ - name?: string; + name?: string | undefined; /** Public image of the reward */ - publicImage?: string; + publicImage?: string | undefined; /** Timestamp for when this reward attribution started */ - startDate?: string; + startDate?: string | undefined; /** State of the reward */ - state?: string; + state?: string | undefined; /** Timestamp for when this reward attribution was updated */ - updatedAt?: string; + updatedAt?: string | undefined; } } } diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidResponse.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidResponse.ts index e822f8d..de83564 100644 --- a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidResponse.ts +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidRewardsRidResponse.ts @@ -4,85 +4,85 @@ import type * as Brevo from "../../../index.js"; export interface GetLoyaltyOfferProgramsPidRewardsRidResponse { /** Maximum number of times a consumer can be attributed this reward */ - attributionPerConsumer?: number; + attributionPerConsumer?: number | undefined; /** Unique identifier for the balance definition */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** Unique code for the reward */ - code?: string; + code?: string | undefined; /** Total number of codes generated */ - codeCount?: number; + codeCount?: number | undefined; /** Unique identifier for the code generator */ - codeGeneratorId?: string; + codeGeneratorId?: string | undefined; /** Unique identifier for the code pool */ - codePoolId?: string; + codePoolId?: string | undefined; /** Configuration settings for the reward */ - config?: string; + config?: string | undefined; /** Timestamp when the reward was created */ - createdAt?: string; + createdAt?: string | undefined; /** Disabled date of the reward */ - disabledAt?: string; + disabledAt?: string | undefined; /** End date of the reward validity */ - endDate?: string; + endDate?: string | undefined; /** Expiration date of the reward */ - expirationDate?: string; + expirationDate?: string | undefined; /** Select startOfPeriod to configure rewards expiry on start of day/week/month/year. Select endOfPeriod to configure reward expiry on end of day/week/month/year, else select noModification */ - expirationModifier?: GetLoyaltyOfferProgramsPidRewardsRidResponse.ExpirationModifier; + expirationModifier?: GetLoyaltyOfferProgramsPidRewardsRidResponse.ExpirationModifier | undefined; /** Unit of time for the rewards's availability (e.g., day/week/month/year). */ - expirationUnit?: string; + expirationUnit?: string | undefined; /** Number of days/weeks/month/year for reward expiry */ - expirationValue?: number; + expirationValue?: number | undefined; /** object */ - generator?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Generator; + generator?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Generator | undefined; /** Unique identifier for the reward */ - id?: string; + id?: string | undefined; /** Attribution / Redeem Limits for the reward */ - limits?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Limits.Item[]; + limits?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Limits.Item[] | undefined; /** Id of the loyalty program to which the current reward belongs to */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Additional data for reward definition */ - meta?: Record; + meta?: Record | undefined; /** Name of the reward */ - name?: string; + name?: string | undefined; /** Selected products for reward definition */ - products?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Products.Item[]; + products?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Products.Item[] | undefined; /** Public description for the reward */ - publicDescription?: string; + publicDescription?: string | undefined; /** Public Image for the reward */ - publicImage?: string; + publicImage?: string | undefined; /** Public name for the reward */ - publicName?: string; + publicName?: string | undefined; /** Defines the redeem limit for the consumer */ - redeemPerConsumer?: number; + redeemPerConsumer?: number | undefined; /** Rules defined to redeem a reward */ - redeemRules?: string[]; + redeemRules?: string[] | undefined; /** object */ - rewardConfigs?: GetLoyaltyOfferProgramsPidRewardsRidResponse.RewardConfigs; + rewardConfigs?: GetLoyaltyOfferProgramsPidRewardsRidResponse.RewardConfigs | undefined; /** Rule to define the reward */ - rule?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Rule; + rule?: GetLoyaltyOfferProgramsPidRewardsRidResponse.Rule | undefined; /** Start date of attribution of the reward */ - startDate?: string; + startDate?: string | undefined; /** Id of the selected balance while redeeming / attributing a reward */ - subtractBalanceDefinitionId?: string; + subtractBalanceDefinitionId?: string | undefined; /** Strategy of the Balance while redeeming / attributing a reward */ - subtractBalanceStrategy?: string; + subtractBalanceStrategy?: string | undefined; /** Amount of balance to be selected while redeeming / attributing a reward */ - subtractBalanceValue?: number; + subtractBalanceValue?: number | undefined; /** Value to indicate to subtract full balance or not */ - subtractTotalBalance?: boolean; + subtractTotalBalance?: boolean | undefined; /** Defines the limit to which a consumer can attribute a reward */ - totalAttribution?: number; + totalAttribution?: number | undefined; /** Defines the limit to which a consumer can redeem a reward */ - totalRedeem?: number; + totalRedeem?: number | undefined; /** Id of the Rule to be updated for that reward */ - triggerId?: string; + triggerId?: string | undefined; /** Selected unit of the balance */ - unit?: string; + unit?: string | undefined; /** Timestamp for when this reward was last updated. */ - updatedAt?: string; + updatedAt?: string | undefined; /** Value of metric in selected config for reward definition */ - value?: number; + value?: number | undefined; /** Type of config selected for reward definition */ - valueType?: string; + valueType?: string | undefined; } export namespace GetLoyaltyOfferProgramsPidRewardsRidResponse { @@ -96,17 +96,17 @@ export namespace GetLoyaltyOfferProgramsPidRewardsRidResponse { export interface Generator { /** Timestamp when the reward was created */ - createdAt?: string; + createdAt?: string | undefined; /** Public facing description of the reward */ - description?: string; + description?: string | undefined; /** Unique identifier for the reward */ - id?: string; + id?: string | undefined; /** Name of the reward */ - name?: string; + name?: string | undefined; /** Generated pattern */ - pattern?: string; + pattern?: string | undefined; /** Timestamp when the reward was created */ - updatedAt?: string; + updatedAt?: string | undefined; } export type Limits = Limits.Item[]; @@ -114,21 +114,21 @@ export namespace GetLoyaltyOfferProgramsPidRewardsRidResponse { export namespace Limits { export interface Item { /** Timestamp when the reward limit was created */ - createdAt?: string; + createdAt?: string | undefined; /** Unit of time for the reward limit's availability (e.g., day/week/month/year). */ - durationUnit?: string; + durationUnit?: string | undefined; /** Number of days/weeks/month/year for reward limit */ - durationValue?: number; + durationValue?: number | undefined; /** Value of the limit */ - limitValue?: number; + limitValue?: number | undefined; /** Unique identifier for the reward limit */ - rewardLimitId?: string; + rewardLimitId?: string | undefined; /** Select true to calculate all redeems/attributions from the previous value of selected durationUnit to the current time */ - slidingSchedule?: boolean; + slidingSchedule?: boolean | undefined; /** Type of reward */ - type?: string; + type?: string | undefined; /** Timestamp when the reward limit was created */ - updatedAt?: string; + updatedAt?: string | undefined; } } @@ -137,60 +137,60 @@ export namespace GetLoyaltyOfferProgramsPidRewardsRidResponse { export namespace Products { export interface Item { /** Timestamp when the product was created */ - createdAt?: string; + createdAt?: string | undefined; /** URL of the product image */ - imageRef?: string; + imageRef?: string | undefined; /** Unique identifier for the product */ - productId?: string; + productId?: string | undefined; /** string */ - value?: string; + value?: string | undefined; } } export interface RewardConfigs { /** Attribution config of the reward */ - attribution?: string; + attribution?: string | undefined; /** Code config of the reward */ - code?: string; + code?: string | undefined; /** Value config of the reward */ - value?: string; + value?: string | undefined; } export interface Rule { /** Selected rule condition */ - condition?: Brevo.RuleConditionResponse; + condition?: Brevo.RuleConditionResponse | undefined; /** Timestamp when the rule was created */ - createdAt?: string; + createdAt?: string | undefined; /** Description of the rule */ - description?: string; + description?: string | undefined; /** Selected event in the rule */ - event?: Rule.Event; + event?: Rule.Event | undefined; /** Metric to identify if it's an internal rule or not */ - isInternal?: boolean; + isInternal?: boolean | undefined; /** Loyalty Program id to which current rule is associated */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Loyalty Version id to which current rule is associated */ - loyaltyVersionId?: number; + loyaltyVersionId?: number | undefined; /** Additional data to define the rule */ - meta?: Record; + meta?: Record | undefined; /** Rule name */ - name?: string; + name?: string | undefined; /** Results of the rule definition */ - results?: Rule.Results.Item[]; + results?: Rule.Results.Item[] | undefined; /** Unique identifier for the rule */ - ruleId?: string; + ruleId?: string | undefined; /** Type of the rule */ - ruleType?: string; + ruleType?: string | undefined; /** Timestamp when the rule was updated */ - updatedAt?: string; + updatedAt?: string | undefined; } export namespace Rule { export interface Event { /** Name of the event */ - name?: string; + name?: string | undefined; /** Source of the event */ - source?: string; + source?: string | undefined; } export type Results = Results.Item[]; @@ -198,11 +198,11 @@ export namespace GetLoyaltyOfferProgramsPidRewardsRidResponse { export namespace Results { export interface Item { /** Action for the defined rule */ - action?: string; + action?: string | undefined; /** Parameters to define the reward */ - parameters?: Item.Parameters.Item[]; + parameters?: Item.Parameters.Item[] | undefined; /** Selected service to define the reward */ - service?: string; + service?: string | undefined; } export namespace Item { @@ -211,9 +211,9 @@ export namespace GetLoyaltyOfferProgramsPidRewardsRidResponse { export namespace Parameters { export interface Item { /** Name of the rule */ - name?: string; + name?: string | undefined; /** Selected value of the parameter to define the rule */ - value?: Brevo.ValueResponse; + value?: Brevo.ValueResponse | undefined; } } } diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts index 824d73b..1e72ee3 100644 --- a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts @@ -2,15 +2,15 @@ export interface GetLoyaltyOfferProgramsPidVouchersResponse { /** Contact id associated with the current reward */ - contactId?: number; + contactId?: number | undefined; /** List of all the rewards for current contact */ - contactRewards?: GetLoyaltyOfferProgramsPidVouchersResponse.ContactRewards.Item[]; + contactRewards?: GetLoyaltyOfferProgramsPidVouchersResponse.ContactRewards.Item[] | undefined; /** Count of the rewards associated with the current contact */ - count?: number; + count?: number | undefined; /** Loyalty Program Id for the contact */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Loyalty Subscription Id for the contact */ - loyaltySubscriptionId?: string; + loyaltySubscriptionId?: string | undefined; } export namespace GetLoyaltyOfferProgramsPidVouchersResponse { @@ -19,25 +19,25 @@ export namespace GetLoyaltyOfferProgramsPidVouchersResponse { export namespace ContactRewards { export interface Item { /** Generated code */ - code?: string; + code?: string | undefined; /** Timestamp when the reward limit was consumed */ - consumedAt?: string; + consumedAt?: string | undefined; /** Timestamp when the reward limit was created */ - createdAt?: string; + createdAt?: string | undefined; /** Reward expiration date */ - expirationDate?: string; + expirationDate?: string | undefined; /** Unique identifier for the contact */ - id?: string; + id?: string | undefined; /** Additional data for the reward */ - meta?: Record; + meta?: Record | undefined; /** Unique identifier for the reward */ - rewardId?: string; + rewardId?: string | undefined; /** Unit of the balance selected in the reward definition */ - unit?: string; + unit?: string | undefined; /** Timestamp when the reward limit was updated */ - updatedAt?: string; + updatedAt?: string | undefined; /** Value of the selected reward config */ - value?: number; + value?: number | undefined; } } } diff --git a/src/api/resources/reward/types/ValidateRewardResponse.ts b/src/api/resources/reward/types/ValidateRewardResponse.ts index 26100c9..7c6b2c9 100644 --- a/src/api/resources/reward/types/ValidateRewardResponse.ts +++ b/src/api/resources/reward/types/ValidateRewardResponse.ts @@ -2,5 +2,5 @@ export interface ValidateRewardResponse { /** Boolean value to authorize a reward or not */ - authorize?: boolean; + authorize?: boolean | undefined; } diff --git a/src/api/resources/senders/client/requests/CreateSenderRequest.ts b/src/api/resources/senders/client/requests/CreateSenderRequest.ts index 364ae95..9fc4ae9 100644 --- a/src/api/resources/senders/client/requests/CreateSenderRequest.ts +++ b/src/api/resources/senders/client/requests/CreateSenderRequest.ts @@ -75,7 +75,7 @@ export namespace CreateSenderRequest { * If it's not passed, the sending will be equally balanced * on all IPs. */ - weight?: number; + weight?: number | undefined; } } } diff --git a/src/api/resources/senders/client/requests/UpdateSenderRequest.ts b/src/api/resources/senders/client/requests/UpdateSenderRequest.ts index 3460946..73ba1ab 100644 --- a/src/api/resources/senders/client/requests/UpdateSenderRequest.ts +++ b/src/api/resources/senders/client/requests/UpdateSenderRequest.ts @@ -77,7 +77,7 @@ export namespace UpdateSenderRequest { * If it's not passed, the sending will be equally balanced * on all IPs. */ - weight?: number; + weight?: number | undefined; } } } diff --git a/src/api/resources/senders/types/CreateSenderResponse.ts b/src/api/resources/senders/types/CreateSenderResponse.ts index 3aebcbd..aa6d68e 100644 --- a/src/api/resources/senders/types/CreateSenderResponse.ts +++ b/src/api/resources/senders/types/CreateSenderResponse.ts @@ -5,12 +5,12 @@ export interface CreateSenderResponse { * Status of DKIM configuration for the sender (true = DKIM not * well configured, false = DKIM well configured) */ - dkimError?: boolean; + dkimError?: boolean | undefined; /** ID of the Sender created */ id: number; /** * Status of SPF configuration for the sender (true = SPF not * well configured, false = SPF well configured) */ - spfError?: boolean; + spfError?: boolean | undefined; } diff --git a/src/api/resources/senders/types/GetSendersResponse.ts b/src/api/resources/senders/types/GetSendersResponse.ts index 0ad9003..97e0c32 100644 --- a/src/api/resources/senders/types/GetSendersResponse.ts +++ b/src/api/resources/senders/types/GetSendersResponse.ts @@ -2,7 +2,7 @@ export interface GetSendersResponse { /** List of the senders available in your account */ - senders?: GetSendersResponse.Senders.Item[]; + senders?: GetSendersResponse.Senders.Item[] | undefined; } export namespace GetSendersResponse { diff --git a/src/api/resources/smsCampaigns/client/requests/CreateSmsCampaignRequest.ts b/src/api/resources/smsCampaigns/client/requests/CreateSmsCampaignRequest.ts index a9d5af0..44de4a6 100644 --- a/src/api/resources/smsCampaigns/client/requests/CreateSmsCampaignRequest.ts +++ b/src/api/resources/smsCampaigns/client/requests/CreateSmsCampaignRequest.ts @@ -29,7 +29,7 @@ export interface CreateSmsCampaignRequest { export namespace CreateSmsCampaignRequest { export interface Recipients { /** List ids which have to be excluded from a campaign */ - exclusionListIds?: number[]; + exclusionListIds?: number[] | undefined; /** Lists Ids to send the campaign to. **REQUIRED if scheduledAt is not empty** */ listIds: number[]; } diff --git a/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignRequest.ts b/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignRequest.ts index 994dedd..9e00eb9 100644 --- a/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignRequest.ts +++ b/src/api/resources/smsCampaigns/client/requests/UpdateSmsCampaignRequest.ts @@ -29,7 +29,7 @@ export interface UpdateSmsCampaignRequest { export namespace UpdateSmsCampaignRequest { export interface Recipients { /** List ids which have to be excluded from a campaign */ - exclusionListIds?: number[]; + exclusionListIds?: number[] | undefined; /** Lists Ids to send the campaign to. **REQUIRED if scheduledAt is not empty** */ listIds: number[]; } diff --git a/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts b/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts index 116a2f9..e58d7f3 100644 --- a/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts +++ b/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts @@ -14,7 +14,7 @@ export interface GetSmsCampaignResponse { /** Name of the SMS Campaign */ name: string; /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ - scheduledAt?: string; + scheduledAt?: string | undefined; /** Sender of the SMS Campaign */ sender: string; /** Status of the SMS Campaign */ diff --git a/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts b/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts index 33c029a..2e07b14 100644 --- a/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts +++ b/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts @@ -3,9 +3,9 @@ import type * as Brevo from "../../../index.js"; export interface GetSmsCampaignsResponse { - campaigns?: GetSmsCampaignsResponse.Campaigns.Item[]; + campaigns?: GetSmsCampaignsResponse.Campaigns.Item[] | undefined; /** Number of SMS campaigns retrieved */ - count?: number; + count?: number | undefined; } export namespace GetSmsCampaignsResponse { @@ -24,7 +24,7 @@ export namespace GetSmsCampaignsResponse { /** Name of the SMS Campaign */ name: string; /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ - scheduledAt?: string; + scheduledAt?: string | undefined; /** Sender of the SMS Campaign */ sender: string; /** Status of the SMS Campaign */ diff --git a/src/api/resources/smsTemplates/types/GetSmsTemplatesResponse.ts b/src/api/resources/smsTemplates/types/GetSmsTemplatesResponse.ts index 7b3e21b..526804f 100644 --- a/src/api/resources/smsTemplates/types/GetSmsTemplatesResponse.ts +++ b/src/api/resources/smsTemplates/types/GetSmsTemplatesResponse.ts @@ -2,8 +2,8 @@ export interface GetSmsTemplatesResponse { /** Count of transactional sms templates */ - count?: number; - templates?: GetSmsTemplatesResponse.Templates.Item[]; + count?: number | undefined; + templates?: GetSmsTemplatesResponse.Templates.Item[] | undefined; } export namespace GetSmsTemplatesResponse { @@ -12,29 +12,29 @@ export namespace GetSmsTemplatesResponse { export namespace Templates { export interface Item { /** ID of the template */ - id?: number; + id?: number | undefined; /** Name of the template */ - name?: string; + name?: string | undefined; /** URL shortening is enabled */ - short_url_enabled?: boolean; + short_url_enabled?: boolean | undefined; /** message content for the sms */ - message?: string; + message?: string | undefined; /** Manage US compliance */ - compliance?: Item.Compliance; + compliance?: Item.Compliance | undefined; /** Enable Unicode encryption. */ - encryption?: boolean; + encryption?: boolean | undefined; /** Support unicode characters in the sms. */ - unicode_sms?: boolean; + unicode_sms?: boolean | undefined; /** file name of the media. */ - media_file?: string; + media_file?: string | undefined; /** file size in bytes. */ - media_file_size?: string; + media_file_size?: string | undefined; /** URL of the image. */ - media_url?: string; + media_url?: string | undefined; /** Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ - createdAt?: string; + createdAt?: string | undefined; /** Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ - updatedAt?: string; + updatedAt?: string | undefined; } export namespace Item { @@ -43,11 +43,11 @@ export namespace GetSmsTemplatesResponse { */ export interface Compliance { /** US compliance is enabled. */ - compliance_toggle?: boolean; + compliance_toggle?: boolean | undefined; /** A recognizable prefix will ensure your audience knows who you are. Recommended by the U.S. carriers. */ - organisation_prefix?: string; + organisation_prefix?: string | undefined; /** Instructions to unsubscribe from future communications. Must include STOP keyword. */ - stop_keyword?: string; + stop_keyword?: string | undefined; } } } diff --git a/src/api/resources/tasks/types/GetCrmTasksResponse.ts b/src/api/resources/tasks/types/GetCrmTasksResponse.ts index 835857f..3e25fcc 100644 --- a/src/api/resources/tasks/types/GetCrmTasksResponse.ts +++ b/src/api/resources/tasks/types/GetCrmTasksResponse.ts @@ -7,5 +7,5 @@ import type * as Brevo from "../../../index.js"; */ export interface GetCrmTasksResponse { /** List of tasks */ - items?: Brevo.Task[]; + items?: Brevo.Task[] | undefined; } diff --git a/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts b/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts index 5aa2e7b..b9317e3 100644 --- a/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts +++ b/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts @@ -5,7 +5,7 @@ */ export interface GetCrmTasktypesResponse { /** Id of task type */ - id?: string; + id?: string | undefined; /** Title of task type */ - title?: string; + title?: string | undefined; } diff --git a/src/api/resources/tier/client/requests/CreateTierForTierGroupRequest.ts b/src/api/resources/tier/client/requests/CreateTierForTierGroupRequest.ts index 5f700ca..77640db 100644 --- a/src/api/resources/tier/client/requests/CreateTierForTierGroupRequest.ts +++ b/src/api/resources/tier/client/requests/CreateTierForTierGroupRequest.ts @@ -28,9 +28,9 @@ export namespace CreateTierForTierGroupRequest { export namespace AccessConditions { export interface Item { /** Balance definition identifier for accessing the tier */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** Minimum value required to access the tier */ - minimumValue?: number; + minimumValue?: number | undefined; } } @@ -39,7 +39,7 @@ export namespace CreateTierForTierGroupRequest { export namespace TierRewards { export interface Item { /** Reward unique identifier */ - rewardId?: string; + rewardId?: string | undefined; } } } diff --git a/src/api/resources/tier/client/requests/UpdateTierRequest.ts b/src/api/resources/tier/client/requests/UpdateTierRequest.ts index 0f33b96..86d21cb 100644 --- a/src/api/resources/tier/client/requests/UpdateTierRequest.ts +++ b/src/api/resources/tier/client/requests/UpdateTierRequest.ts @@ -29,9 +29,9 @@ export namespace UpdateTierRequest { export namespace AccessConditions { export interface Item { /** Balance definition identifier for accessing the tier */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** Minimum value required to access the tier */ - minimumValue?: number; + minimumValue?: number | undefined; } } @@ -40,7 +40,7 @@ export namespace UpdateTierRequest { export namespace TierRewards { export interface Item { /** Reward unique identifier */ - rewardId?: string; + rewardId?: string | undefined; } } } diff --git a/src/api/resources/tier/types/AddSubscriptionToTierResponse.ts b/src/api/resources/tier/types/AddSubscriptionToTierResponse.ts index 9dfdfa2..dc1bff4 100644 --- a/src/api/resources/tier/types/AddSubscriptionToTierResponse.ts +++ b/src/api/resources/tier/types/AddSubscriptionToTierResponse.ts @@ -2,15 +2,15 @@ export interface AddSubscriptionToTierResponse { /** Contact to which the tier is assigned */ - contactId?: number; - createdAt?: string; + contactId?: number | undefined; + createdAt?: string | undefined; /** Group Id to which the tier is associated */ - groupId?: string; + groupId?: string | undefined; /** Unique identifier for the assigned tier */ - id?: string; + id?: string | undefined; /** Associated loyalty program Id */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** object */ - meta?: Record; - updatedAt?: string; + meta?: Record | undefined; + updatedAt?: string | undefined; } diff --git a/src/api/resources/tier/types/GetListOfTierGroupsResponse.ts b/src/api/resources/tier/types/GetListOfTierGroupsResponse.ts index 36f325e..6d41f59 100644 --- a/src/api/resources/tier/types/GetListOfTierGroupsResponse.ts +++ b/src/api/resources/tier/types/GetListOfTierGroupsResponse.ts @@ -3,5 +3,5 @@ import type * as Brevo from "../../../index.js"; export interface GetListOfTierGroupsResponse { - items?: Brevo.TierGroup[]; + items?: Brevo.TierGroup[] | undefined; } diff --git a/src/api/resources/tier/types/GetLoyaltyProgramTierResponse.ts b/src/api/resources/tier/types/GetLoyaltyProgramTierResponse.ts index d3e5605..38c35b4 100644 --- a/src/api/resources/tier/types/GetLoyaltyProgramTierResponse.ts +++ b/src/api/resources/tier/types/GetLoyaltyProgramTierResponse.ts @@ -3,5 +3,5 @@ import type * as Brevo from "../../../index.js"; export interface GetLoyaltyProgramTierResponse { - items?: Brevo.Tier[]; + items?: Brevo.Tier[] | undefined; } diff --git a/src/api/resources/transactionalEmails/client/requests/CreateSmtpTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/CreateSmtpTemplateRequest.ts index f76e126..43ec006 100644 --- a/src/api/resources/transactionalEmails/client/requests/CreateSmtpTemplateRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/CreateSmtpTemplateRequest.ts @@ -37,10 +37,10 @@ export namespace CreateSmtpTemplateRequest { */ export interface Sender { /** Email of the sender */ - email?: string; + email?: string | undefined; /** Select the sender for the template on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. */ - id?: number; + id?: number | undefined; /** Name of the sender. **If not passed, will be set to default** */ - name?: string; + name?: string | undefined; } } diff --git a/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts b/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts index 915aafa..2cbac68 100644 --- a/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts @@ -74,11 +74,11 @@ export namespace SendTransacEmailRequest { export namespace Attachment { export interface Item { /** Base64-encoded attachment data */ - content?: string; + content?: string | undefined; /** Attachment filename. Required when `content` is provided. */ - name?: string; + name?: string | undefined; /** Absolute URL of the attachment. Local file paths are not supported. */ - url?: string; + url?: string | undefined; } } @@ -89,7 +89,7 @@ export namespace SendTransacEmailRequest { /** BCC recipient email address */ email: string; /** Display name of the BCC recipient. Maximum length is 70 characters. */ - name?: string; + name?: string | undefined; } } @@ -100,7 +100,7 @@ export namespace SendTransacEmailRequest { /** CC recipient email address */ email: string; /** Display name of the CC recipient. Maximum length is 70 characters. */ - name?: string; + name?: string | undefined; } } @@ -109,19 +109,19 @@ export namespace SendTransacEmailRequest { export namespace MessageVersions { export interface Item { /** Array of BCC recipient objects. Each object contains an email address and an optional name. */ - bcc?: Item.Bcc.Item[]; + bcc?: Item.Bcc.Item[] | undefined; /** Array of CC recipient objects. Each object contains an email address and an optional name. */ - cc?: Item.Cc.Item[]; + cc?: Item.Cc.Item[] | undefined; /** HTML body content of the email. Required when `templateId` is not provided. Ignored when `templateId` is provided. */ - htmlContent?: string; + htmlContent?: string | undefined; /** Key-value pairs for template variable substitution. Only applicable when the template uses the New Template Language format. */ - params?: Record; + params?: Record | undefined; /** Reply-to email address (required) and optional display name. Recipients will use this address when replying to the email. */ - replyTo?: Item.ReplyTo; + replyTo?: Item.ReplyTo | undefined; /** Email subject line for this message version */ - subject?: string; + subject?: string | undefined; /** Plain text body content of the email. Ignored when `templateId` is provided. */ - textContent?: string; + textContent?: string | undefined; /** Array of recipient objects. Each object contains an email address and an optional display name. */ to: Item.To.Item[]; } @@ -134,7 +134,7 @@ export namespace SendTransacEmailRequest { /** BCC recipient email address */ email: string; /** Display name of the BCC recipient. Maximum length is 70 characters. */ - name?: string; + name?: string | undefined; } } @@ -145,7 +145,7 @@ export namespace SendTransacEmailRequest { /** CC recipient email address */ email: string; /** Display name of the CC recipient. Maximum length is 70 characters. */ - name?: string; + name?: string | undefined; } } @@ -156,7 +156,7 @@ export namespace SendTransacEmailRequest { /** Email address in reply to */ email: string; /** Display name for the reply-to address. Maximum length is 70 characters. */ - name?: string; + name?: string | undefined; } export type To = To.Item[]; @@ -166,7 +166,7 @@ export namespace SendTransacEmailRequest { /** Email address of the recipient */ email: string; /** Display name of the recipient. Maximum length is 70 characters. */ - name?: string; + name?: string | undefined; } } } @@ -179,7 +179,7 @@ export namespace SendTransacEmailRequest { /** Email address in reply to */ email: string; /** Display name for the reply-to address. Maximum length is 70 characters. */ - name?: string; + name?: string | undefined; } /** @@ -187,11 +187,11 @@ export namespace SendTransacEmailRequest { */ export interface Sender { /** Sender email address. Required when `id` is not provided. */ - email?: string; + email?: string | undefined; /** Sender identifier. Required when `email` is not provided. Use this field to select a sender with a specific IP pool (dedicated IP users only). */ - id?: number; + id?: number | undefined; /** Display name of the sender. Maximum length is 70 characters. Only applicable when `email` is provided. */ - name?: string; + name?: string | undefined; } export type To = To.Item[]; @@ -201,7 +201,7 @@ export namespace SendTransacEmailRequest { /** Email address of the recipient */ email: string; /** Display name of the recipient. Maximum length is 70 characters. */ - name?: string; + name?: string | undefined; } } } diff --git a/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts index a91899a..ef44548 100644 --- a/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts @@ -37,10 +37,10 @@ export namespace UpdateSmtpTemplateRequest { */ export interface Sender { /** Email of the sender */ - email?: string; + email?: string | undefined; /** Select the sender for the template on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. */ - id?: number; + id?: number | undefined; /** Name of the sender */ - name?: string; + name?: string | undefined; } } diff --git a/src/api/resources/transactionalEmails/types/GetAggregatedSmtpReportResponse.ts b/src/api/resources/transactionalEmails/types/GetAggregatedSmtpReportResponse.ts index 66581ca..8cc30f6 100644 --- a/src/api/resources/transactionalEmails/types/GetAggregatedSmtpReportResponse.ts +++ b/src/api/resources/transactionalEmails/types/GetAggregatedSmtpReportResponse.ts @@ -2,29 +2,29 @@ export interface GetAggregatedSmtpReportResponse { /** Number of blocked contact emails for the timeframe */ - blocked?: number; + blocked?: number | undefined; /** Number of clicks for the timeframe */ - clicks?: number; + clicks?: number | undefined; /** Number of delivered emails for the timeframe */ - delivered?: number; + delivered?: number | undefined; /** Number of hardbounces for the timeframe */ - hardBounces?: number; + hardBounces?: number | undefined; /** Number of invalid emails for the timeframe */ - invalid?: number; + invalid?: number | undefined; /** Number of openings for the timeframe */ - opens?: number; + opens?: number | undefined; /** Time frame of the report */ - range?: string; + range?: string | undefined; /** Number of requests for the timeframe */ - requests?: number; + requests?: number | undefined; /** Number of softbounces for the timeframe */ - softBounces?: number; + softBounces?: number | undefined; /** Number of complaint (spam report) for the timeframe */ - spamReports?: number; + spamReports?: number | undefined; /** Number of unique clicks for the timeframe */ - uniqueClicks?: number; + uniqueClicks?: number | undefined; /** Number of unique openings for the timeframe */ - uniqueOpens?: number; + uniqueOpens?: number | undefined; /** Number of unsubscribed emails for the timeframe */ - unsubscribed?: number; + unsubscribed?: number | undefined; } diff --git a/src/api/resources/transactionalEmails/types/GetEmailEventReportResponse.ts b/src/api/resources/transactionalEmails/types/GetEmailEventReportResponse.ts index cc0b6c5..d8d534e 100644 --- a/src/api/resources/transactionalEmails/types/GetEmailEventReportResponse.ts +++ b/src/api/resources/transactionalEmails/types/GetEmailEventReportResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface GetEmailEventReportResponse { - events?: GetEmailEventReportResponse.Events.Item[]; + events?: GetEmailEventReportResponse.Events.Item[] | undefined; } export namespace GetEmailEventReportResponse { @@ -16,21 +16,21 @@ export namespace GetEmailEventReportResponse { /** Event which occurred */ event: Item.Event; /** Sender email from which the emails are sent */ - from?: string; + from?: string | undefined; /** IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) */ - ip?: string; + ip?: string | undefined; /** The link which is sent to the user (only available if the event is requests or opened or clicks) */ - link?: string; + link?: string | undefined; /** Message ID which generated the event */ messageId: string; /** Reason of bounce (only available if the event is hardbounce or softbounce) */ - reason?: string; + reason?: string | undefined; /** Subject of the event */ - subject?: string; + subject?: string | undefined; /** Tag of the email which generated the event */ - tag?: string; + tag?: string | undefined; /** ID of the template (only available if the email is template based) */ - templateId?: number; + templateId?: number | undefined; } export namespace Item { diff --git a/src/api/resources/transactionalEmails/types/GetSmtpReportResponse.ts b/src/api/resources/transactionalEmails/types/GetSmtpReportResponse.ts index 3dad4ce..6aec14c 100644 --- a/src/api/resources/transactionalEmails/types/GetSmtpReportResponse.ts +++ b/src/api/resources/transactionalEmails/types/GetSmtpReportResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface GetSmtpReportResponse { - reports?: GetSmtpReportResponse.Reports.Item[]; + reports?: GetSmtpReportResponse.Reports.Item[] | undefined; } export namespace GetSmtpReportResponse { diff --git a/src/api/resources/transactionalEmails/types/GetSmtpTemplatesResponse.ts b/src/api/resources/transactionalEmails/types/GetSmtpTemplatesResponse.ts index 232e4b8..eeee3b7 100644 --- a/src/api/resources/transactionalEmails/types/GetSmtpTemplatesResponse.ts +++ b/src/api/resources/transactionalEmails/types/GetSmtpTemplatesResponse.ts @@ -4,6 +4,6 @@ import type * as Brevo from "../../../index.js"; export interface GetSmtpTemplatesResponse { /** Count of transactional email templates */ - count?: number; - templates?: Brevo.GetSmtpTemplateOverview[]; + count?: number | undefined; + templates?: Brevo.GetSmtpTemplateOverview[] | undefined; } diff --git a/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.ts b/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.ts index e8491d6..849a017 100644 --- a/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.ts +++ b/src/api/resources/transactionalEmails/types/GetTransacBlockedContactsResponse.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. export interface GetTransacBlockedContactsResponse { - contacts?: GetTransacBlockedContactsResponse.Contacts.Item[]; + contacts?: GetTransacBlockedContactsResponse.Contacts.Item[] | undefined; /** Count of blocked or unsubscribed contact */ - count?: number; + count?: number | undefined; } export namespace GetTransacBlockedContactsResponse { @@ -27,9 +27,9 @@ export namespace GetTransacBlockedContactsResponse { */ export interface Reason { /** Reason code for blocking / unsubscribing (This code is safe for comparison) */ - code?: Reason.Code; + code?: Reason.Code | undefined; /** Reason for blocking / unsubscribing (This string is not safe for comparison) */ - message?: string; + message?: string | undefined; } export namespace Reason { diff --git a/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts b/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts index 2dd44a8..810cecd 100644 --- a/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts +++ b/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts @@ -14,7 +14,7 @@ export interface GetTransacEmailContentResponse { /** Subject of the sent email */ subject: string; /** Id of the template */ - templateId?: number; + templateId?: number | undefined; } export namespace GetTransacEmailContentResponse { diff --git a/src/api/resources/transactionalEmails/types/GetTransacEmailsListResponse.ts b/src/api/resources/transactionalEmails/types/GetTransacEmailsListResponse.ts index cde220b..a423e28 100644 --- a/src/api/resources/transactionalEmails/types/GetTransacEmailsListResponse.ts +++ b/src/api/resources/transactionalEmails/types/GetTransacEmailsListResponse.ts @@ -2,8 +2,8 @@ export interface GetTransacEmailsListResponse { /** Total number of transactional emails available on your account according to the passed filter */ - count?: number; - transactionalEmails?: GetTransacEmailsListResponse.TransactionalEmails.Item[]; + count?: number | undefined; + transactionalEmails?: GetTransacEmailsListResponse.TransactionalEmails.Item[] | undefined; } export namespace GetTransacEmailsListResponse { @@ -16,15 +16,15 @@ export namespace GetTransacEmailsListResponse { /** Email address to which transactional email has been sent */ email: string; /** Email address of the sender from which the email was sent */ - from?: string; + from?: string | undefined; /** Message Id of the sent email */ messageId: string; /** Subject of the sent email */ subject: string; /** Tags used for your email */ - tags?: string[]; + tags?: string[] | undefined; /** Id of the template */ - templateId?: number; + templateId?: number | undefined; /** Unique id of the email sent to a particular contact */ uuid: string; } diff --git a/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesResponse.ts b/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesResponse.ts index 9c6f68d..3dcf817 100644 --- a/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesResponse.ts +++ b/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesResponse.ts @@ -2,14 +2,14 @@ export interface PostPreviewSmtpEmailTemplatesResponse { /** Sender email address */ - fromEmail?: string; + fromEmail?: string | undefined; /** Sender Name */ - fromName?: string; + fromName?: string | undefined; /** Html content of the template */ - html?: string; + html?: string | undefined; /** Preview text of the template */ - previewText?: string; + previewText?: string | undefined; /** subject of the template */ - subject?: string; - usedFeedNames?: string[]; + subject?: string | undefined; + usedFeedNames?: string[] | undefined; } diff --git a/src/api/resources/transactionalEmails/types/SendTransacEmailResponse.ts b/src/api/resources/transactionalEmails/types/SendTransacEmailResponse.ts index 62fcb65..631871c 100644 --- a/src/api/resources/transactionalEmails/types/SendTransacEmailResponse.ts +++ b/src/api/resources/transactionalEmails/types/SendTransacEmailResponse.ts @@ -2,6 +2,6 @@ export interface SendTransacEmailResponse { /** Message ID of the transactional email sent */ - messageId?: string; - messageIds?: string[]; + messageId?: string | undefined; + messageIds?: string[] | undefined; } diff --git a/src/api/resources/transactionalSms/types/GetSmsEventsResponse.ts b/src/api/resources/transactionalSms/types/GetSmsEventsResponse.ts index 79298c3..965a95e 100644 --- a/src/api/resources/transactionalSms/types/GetSmsEventsResponse.ts +++ b/src/api/resources/transactionalSms/types/GetSmsEventsResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface GetSmsEventsResponse { - events?: GetSmsEventsResponse.Events.Item[]; + events?: GetSmsEventsResponse.Events.Item[] | undefined; } export namespace GetSmsEventsResponse { @@ -10,18 +10,18 @@ export namespace GetSmsEventsResponse { export namespace Events { export interface Item { /** UTC date-time on which the event has been generated */ - date?: string; + date?: string | undefined; /** Event which occurred */ - event?: Item.Event; + event?: Item.Event | undefined; /** Message ID which generated the event */ - messageId?: string; + messageId?: string | undefined; /** Phone number which has generated the event */ - phoneNumber?: string; + phoneNumber?: string | undefined; /** Reason of bounce (only available if the event is hardbounce or softbounce) */ - reason?: string; - reply?: string; + reason?: string | undefined; + reply?: string | undefined; /** Tag of the SMS which generated the event */ - tag?: string; + tag?: string | undefined; } export namespace Item { diff --git a/src/api/resources/transactionalSms/types/GetTransacAggregatedSmsReportResponse.ts b/src/api/resources/transactionalSms/types/GetTransacAggregatedSmsReportResponse.ts index 875abfb..6f1e1bf 100644 --- a/src/api/resources/transactionalSms/types/GetTransacAggregatedSmsReportResponse.ts +++ b/src/api/resources/transactionalSms/types/GetTransacAggregatedSmsReportResponse.ts @@ -2,25 +2,25 @@ export interface GetTransacAggregatedSmsReportResponse { /** Number of accepted SMS for the timeframe */ - accepted?: number; + accepted?: number | undefined; /** Number of blocked contact for the timeframe */ - blocked?: number; + blocked?: number | undefined; /** Number of delivered SMS for the timeframe */ - delivered?: number; + delivered?: number | undefined; /** Number of hardbounces for the timeframe */ - hardBounces?: number; + hardBounces?: number | undefined; /** Time frame of the report */ - range?: string; + range?: string | undefined; /** Number of rejected SMS for the timeframe */ - rejected?: number; + rejected?: number | undefined; /** Number of answered SMS for the timeframe */ - replied?: number; + replied?: number | undefined; /** Number of requests for the timeframe */ - requests?: number; + requests?: number | undefined; /** Number of skipped SMS for the timeframe */ - skipped?: number; + skipped?: number | undefined; /** Number of softbounces for the timeframe */ - softBounces?: number; + softBounces?: number | undefined; /** Number of unsubscription for the timeframe */ - unsubscribed?: number; + unsubscribed?: number | undefined; } diff --git a/src/api/resources/transactionalSms/types/GetTransacSmsReportResponse.ts b/src/api/resources/transactionalSms/types/GetTransacSmsReportResponse.ts index d5b1197..600a7be 100644 --- a/src/api/resources/transactionalSms/types/GetTransacSmsReportResponse.ts +++ b/src/api/resources/transactionalSms/types/GetTransacSmsReportResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface GetTransacSmsReportResponse { - reports?: GetTransacSmsReportResponse.Reports.Item[]; + reports?: GetTransacSmsReportResponse.Reports.Item[] | undefined; } export namespace GetTransacSmsReportResponse { @@ -10,27 +10,27 @@ export namespace GetTransacSmsReportResponse { export namespace Reports { export interface Item { /** Number of accepted SMS for the date */ - accepted?: number; + accepted?: number | undefined; /** Number of blocked contact for the date */ - blocked?: number; + blocked?: number | undefined; /** Date for which statistics are retrieved */ - date?: string; + date?: string | undefined; /** Number of delivered SMS for the date */ - delivered?: number; + delivered?: number | undefined; /** Number of hardbounces for the date */ - hardBounces?: number; + hardBounces?: number | undefined; /** Number of rejected SMS for the date */ - rejected?: number; + rejected?: number | undefined; /** Number of answered SMS for the date */ - replied?: number; + replied?: number | undefined; /** Number of requests for the date */ - requests?: number; + requests?: number | undefined; /** Number of skipped SMS for the date */ - skipped?: number; + skipped?: number | undefined; /** Number of softbounces for the date */ - softBounces?: number; + softBounces?: number | undefined; /** Number of unsubscription for the date */ - unsubscribed?: number; + unsubscribed?: number | undefined; } } } diff --git a/src/api/resources/transactionalSms/types/SendTransacSmsResponse.ts b/src/api/resources/transactionalSms/types/SendTransacSmsResponse.ts index add3c35..6f40480 100644 --- a/src/api/resources/transactionalSms/types/SendTransacSmsResponse.ts +++ b/src/api/resources/transactionalSms/types/SendTransacSmsResponse.ts @@ -4,9 +4,9 @@ export interface SendTransacSmsResponse { messageId: number; reference: string; /** Remaining SMS credits of the user */ - remainingCredits?: number; + remainingCredits?: number | undefined; /** Count of SMS's to send multiple text messages */ - smsCount?: number; + smsCount?: number | undefined; /** SMS credits used per text message */ - usedCredits?: number; + usedCredits?: number | undefined; } diff --git a/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportResponse.ts b/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportResponse.ts index 85412fd..f98b22c 100644 --- a/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportResponse.ts +++ b/src/api/resources/transactionalWhatsApp/types/GetWhatsappEventReportResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface GetWhatsappEventReportResponse { - events?: GetWhatsappEventReportResponse.Events.Item[]; + events?: GetWhatsappEventReportResponse.Events.Item[] | undefined; } export namespace GetWhatsappEventReportResponse { @@ -10,7 +10,7 @@ export namespace GetWhatsappEventReportResponse { export namespace Events { export interface Item { /** Text of the reply (will be there only in case of `reply` event with text) */ - body?: string; + body?: string | undefined; /** WhatsApp Number with country code. Example, 85264318721 */ contactNumber: string; /** UTC date-time on which the event has been generated */ @@ -18,11 +18,11 @@ export namespace GetWhatsappEventReportResponse { /** Event which occurred */ event: Item.Event; /** Url of the media reply (will be there only in case of `reply` event with media) */ - mediaUrl?: string; + mediaUrl?: string | undefined; /** Message ID which generated the event */ messageId: string; /** Reason for the event (will be there in case of `error` and `soft-bounce` events) */ - reason?: string; + reason?: string | undefined; /** WhatsApp Number with country code. Example, 85264318721 */ senderNumber: string; } diff --git a/src/api/resources/user/types/EditUserPermissionResponse.ts b/src/api/resources/user/types/EditUserPermissionResponse.ts index 1d903fb..577b9c7 100644 --- a/src/api/resources/user/types/EditUserPermissionResponse.ts +++ b/src/api/resources/user/types/EditUserPermissionResponse.ts @@ -2,9 +2,9 @@ export interface EditUserPermissionResponse { /** Credit note */ - credit_notes?: string[]; + credit_notes?: string[] | undefined; /** Invoice id */ - invoice_id?: string; + invoice_id?: string | undefined; /** Status of the API operation. */ status: string; } diff --git a/src/api/resources/user/types/GetInvitedUsersListResponse.ts b/src/api/resources/user/types/GetInvitedUsersListResponse.ts index 6eeac0b..e052bd7 100644 --- a/src/api/resources/user/types/GetInvitedUsersListResponse.ts +++ b/src/api/resources/user/types/GetInvitedUsersListResponse.ts @@ -2,7 +2,7 @@ export interface GetInvitedUsersListResponse { /** Get invited users list */ - users?: GetInvitedUsersListResponse.Users.Item[]; + users?: GetInvitedUsersListResponse.Users.Item[] | undefined; } export namespace GetInvitedUsersListResponse { @@ -26,11 +26,11 @@ export namespace GetInvitedUsersListResponse { */ export interface FeatureAccess { /** Conversations features accessiblity. */ - conversations?: string; + conversations?: string | undefined; /** CRM features accessiblity. */ - crm?: string; + crm?: string | undefined; /** Marketing features accessiblity. */ - marketing?: string; + marketing?: string | undefined; } } } diff --git a/src/api/resources/user/types/InviteuserResponse.ts b/src/api/resources/user/types/InviteuserResponse.ts index 6826386..d01d7da 100644 --- a/src/api/resources/user/types/InviteuserResponse.ts +++ b/src/api/resources/user/types/InviteuserResponse.ts @@ -2,7 +2,7 @@ export interface InviteuserResponse { /** Invoice id */ - invoice_id?: string; + invoice_id?: string | undefined; /** Status of the API operation. */ status: string; } diff --git a/src/api/resources/user/types/PutRevokeUserPermissionResponse.ts b/src/api/resources/user/types/PutRevokeUserPermissionResponse.ts index 186c476..e48bf7a 100644 --- a/src/api/resources/user/types/PutRevokeUserPermissionResponse.ts +++ b/src/api/resources/user/types/PutRevokeUserPermissionResponse.ts @@ -2,7 +2,7 @@ export interface PutRevokeUserPermissionResponse { /** Credit note */ - credit_notes?: string[]; + credit_notes?: string[] | undefined; /** Status of the API operation. */ status: string; } diff --git a/src/api/resources/user/types/PutresendcancelinvitationResponse.ts b/src/api/resources/user/types/PutresendcancelinvitationResponse.ts index 2c2b746..af95c07 100644 --- a/src/api/resources/user/types/PutresendcancelinvitationResponse.ts +++ b/src/api/resources/user/types/PutresendcancelinvitationResponse.ts @@ -2,7 +2,7 @@ export interface PutresendcancelinvitationResponse { /** Credit note */ - credit_notes?: string[]; + credit_notes?: string[] | undefined; /** Status of the API operation. */ status: string; } diff --git a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts index c8a8d69..cb52650 100644 --- a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts @@ -53,9 +53,9 @@ export namespace CreateWebhookRequest { */ export interface Auth { /** Webhook authentication token */ - token?: string; + token?: string | undefined; /** Type of authentication */ - type?: string; + type?: string | undefined; } /** channel of webhook */ @@ -94,9 +94,9 @@ export namespace CreateWebhookRequest { export namespace Headers { export interface Item { /** Header key name */ - key?: string; + key?: string | undefined; /** Header value */ - value?: string; + value?: string | undefined; } } diff --git a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts index 126cd01..49745bb 100644 --- a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts @@ -40,9 +40,9 @@ export namespace UpdateWebhookRequest { */ export interface Auth { /** Webhook authentication token */ - token?: string; + token?: string | undefined; /** Type of authentication */ - type?: string; + type?: string | undefined; } export type Events = Events.Item[]; @@ -75,9 +75,9 @@ export namespace UpdateWebhookRequest { export namespace Headers { export interface Item { /** Header key name */ - key?: string; + key?: string | undefined; /** Header value */ - value?: string; + value?: string | undefined; } } } diff --git a/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppCampaignRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppCampaignRequest.ts index 7ce0d47..14b5e0b 100644 --- a/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppCampaignRequest.ts +++ b/src/api/resources/whatsAppCampaigns/client/requests/CreateWhatsAppCampaignRequest.ts @@ -26,10 +26,10 @@ export namespace CreateWhatsAppCampaignRequest { */ export interface Recipients { /** List ids to exclude from the campaign */ - excludedListIds?: number[]; + excludedListIds?: number[] | undefined; /** **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to */ - listIds?: number[]; + listIds?: number[] | undefined; /** **Mandatory if listIds are not used**. Segment ids to send the campaign to. */ - segments?: number[]; + segments?: number[] | undefined; } } diff --git a/src/api/resources/whatsAppCampaigns/client/requests/UpdateWhatsAppCampaignRequest.ts b/src/api/resources/whatsAppCampaigns/client/requests/UpdateWhatsAppCampaignRequest.ts index a332848..299a82f 100644 --- a/src/api/resources/whatsAppCampaigns/client/requests/UpdateWhatsAppCampaignRequest.ts +++ b/src/api/resources/whatsAppCampaigns/client/requests/UpdateWhatsAppCampaignRequest.ts @@ -32,10 +32,10 @@ export namespace UpdateWhatsAppCampaignRequest { */ export interface Recipients { /** List ids to exclude from the campaign */ - excludedListIds?: number[]; + excludedListIds?: number[] | undefined; /** **Mandatory if scheduledAt is not empty**. List Ids to send the campaign to */ - listIds?: number[]; + listIds?: number[] | undefined; /** **Mandatory if listIds are not used**. Segment ids to send the campaign to. */ - segments?: number[]; + segments?: number[] | undefined; } } diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts index 7b4f1f1..81b80ef 100644 --- a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts @@ -14,10 +14,10 @@ export interface GetWhatsAppCampaignResponse { /** UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; /** UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ - scheduledAt?: string; + scheduledAt?: string | undefined; /** Sender of the WhatsApp Campaign */ senderNumber: string; - stats?: Brevo.WhatsappCampStats; + stats?: Brevo.WhatsappCampStats | undefined; template: GetWhatsAppCampaignResponse.Template; } @@ -37,23 +37,23 @@ export namespace GetWhatsAppCampaignResponse { export interface Template { /** array of variables item variables */ - body_variables?: Brevo.VariablesItems[]; - button_type?: string; + body_variables?: Brevo.VariablesItems[] | undefined; + button_type?: string | undefined; /** description of the template */ - category?: string; + category?: string | undefined; /** array of component item objects */ - components?: Template.Components.Item[]; - contains_button?: boolean; - display_header?: boolean; + components?: Template.Components.Item[] | undefined; + contains_button?: boolean | undefined; + display_header?: boolean | undefined; /** type of header */ - header_type?: string; + header_type?: string | undefined; /** array of variables item object */ - header_variables?: Brevo.VariablesItems[]; - hide_footer?: boolean; + header_variables?: Brevo.VariablesItems[] | undefined; + hide_footer?: boolean | undefined; /** language of the template */ - language?: string; + language?: string | undefined; /** name of the template */ - name?: string; + name?: string | undefined; } export namespace Template { @@ -61,8 +61,8 @@ export namespace GetWhatsAppCampaignResponse { export namespace Components { export interface Item { - text?: string; - type?: string; + text?: string | undefined; + type?: string | undefined; } } } diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsResponse.ts index f0e75ff..bbaea3d 100644 --- a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsResponse.ts +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignsResponse.ts @@ -3,9 +3,9 @@ import type * as Brevo from "../../../index.js"; export interface GetWhatsAppCampaignsResponse { - campaigns?: GetWhatsAppCampaignsResponse.Campaigns.Item[]; + campaigns?: GetWhatsAppCampaignsResponse.Campaigns.Item[] | undefined; /** Number of WhatsApp campaigns retrieved */ - count?: number; + count?: number | undefined; } export namespace GetWhatsAppCampaignsResponse { @@ -20,18 +20,18 @@ export namespace GetWhatsAppCampaignsResponse { /** Creation UTC date-time of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Error Reason associated with the WhatsApp campaign sending */ - errorReason?: string; + errorReason?: string | undefined; /** ID of the WhatsApp Campaign */ id: number; /** Count of invalidated contacts */ - invalidatedContacts?: number; + invalidatedContacts?: number | undefined; /** UTC date-time of last modification of the WhatsApp campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; /** Read percentage of the the whatsapp campaign created */ - readPercentage?: number; + readPercentage?: number | undefined; /** UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ scheduledAt: string; - stats?: Brevo.WhatsappCampStats; + stats?: Brevo.WhatsappCampStats | undefined; /** Id of the WhatsApp template */ templateId: string; } diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppConfigResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppConfigResponse.ts index 41b0ce2..be0e8d0 100644 --- a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppConfigResponse.ts +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppConfigResponse.ts @@ -2,17 +2,17 @@ export interface GetWhatsAppConfigResponse { /** Verification status information of the Business account */ - businessStatus?: string; + businessStatus?: string | undefined; /** Status of the name associated with WhatsApp Phone number */ - phoneNumberNameStatus?: GetWhatsAppConfigResponse.PhoneNumberNameStatus; + phoneNumberNameStatus?: GetWhatsAppConfigResponse.PhoneNumberNameStatus | undefined; /** Quality status of phone number associated with WhatsApp account. There are three quality ratings. example - **High (GREEN) , Medium (YELLOW) and Low(RED)** */ - phoneNumberQuality?: GetWhatsAppConfigResponse.PhoneNumberQuality; + phoneNumberQuality?: GetWhatsAppConfigResponse.PhoneNumberQuality | undefined; /** Sending limit of the WhatsApp account */ - sendingLimit?: string; + sendingLimit?: string | undefined; /** Id of the WhatsApp business account */ - whatsappBusinessAccountId?: string; + whatsappBusinessAccountId?: string | undefined; /** Status information related to WhatsApp Api account */ - whatsappBusinessAccountStatus?: GetWhatsAppConfigResponse.WhatsappBusinessAccountStatus; + whatsappBusinessAccountStatus?: GetWhatsAppConfigResponse.WhatsappBusinessAccountStatus | undefined; } export namespace GetWhatsAppConfigResponse { diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts index 3142bc9..d4ab0d9 100644 --- a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts @@ -2,8 +2,8 @@ export interface GetWhatsAppTemplatesResponse { /** Number of whatsApp templates retrieved */ - count?: number; - templates?: GetWhatsAppTemplatesResponse.Templates.Item[]; + count?: number | undefined; + templates?: GetWhatsAppTemplatesResponse.Templates.Item[] | undefined; } export namespace GetWhatsAppTemplatesResponse { @@ -16,7 +16,7 @@ export namespace GetWhatsAppTemplatesResponse { /** Creation UTC date-time of the whatsApp template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Error reason in the template creation */ - errorReason?: string; + errorReason?: string | undefined; /** ID of the whatsApp template */ id: number; /** Language in which template exists */ diff --git a/src/api/types/BalanceDefinition.ts b/src/api/types/BalanceDefinition.ts index 2bb26b4..7cf72c3 100644 --- a/src/api/types/BalanceDefinition.ts +++ b/src/api/types/BalanceDefinition.ts @@ -2,45 +2,45 @@ export interface BalanceDefinition { /** startOfPeriod depicts the balancy expiry on start of day/week/month/year. endOfPeriod depicts the balancy expiry on end of day/week/month/year */ - balanceAvailabilityDurationModifier?: BalanceDefinition.BalanceAvailabilityDurationModifier; + balanceAvailabilityDurationModifier?: BalanceDefinition.BalanceAvailabilityDurationModifier | undefined; /** Unit of time for the balance's availability (e.g., day/week/month/year). */ - balanceAvailabilityDurationUnit?: string; + balanceAvailabilityDurationUnit?: string | undefined; /** Number of days/weeks/month/year for balance expiry */ - balanceAvailabilityDurationValue?: number; + balanceAvailabilityDurationValue?: number | undefined; /** Date when the balance expires and can no longer be used, in dd/mm format. The balance will be expired when this date appears next in the calendar and only one of balanceExpirationDate or balance availability fields can be used. */ - balanceExpirationDate?: string; + balanceExpirationDate?: string | undefined; /** Partial enables partial credit of balance if maximum balance limit is reaching. Strict enables rejection of transaction if it will breach the max credit amount limit. */ - balanceOptionAmountOvertakingStrategy?: string; + balanceOptionAmountOvertakingStrategy?: string | undefined; /** Rounding strategy for credit transactions. */ - balanceOptionCreditRounding?: string; + balanceOptionCreditRounding?: string | undefined; /** Rounding strategy for debit transactions. */ - balanceOptionDebitRounding?: string; + balanceOptionDebitRounding?: string | undefined; /** Timestamp of balance definition creation. */ - createdAt?: string; + createdAt?: string | undefined; /** Timestamp of balance definition deletion (nullable). */ - deletedAt?: string; + deletedAt?: string | undefined; /** Short description of the balance definition. */ - description?: string; + description?: string | undefined; /** Unique identifier for the balance definition. */ - id?: string; + id?: string | undefined; /** Optional image reference URL. */ - imageRef?: string; + imageRef?: string | undefined; /** Maximum allowable balance. */ - maxAmount?: number; + maxAmount?: number | undefined; /** Max credit allowed per operation. */ - maxCreditAmountLimit?: number; + maxCreditAmountLimit?: number | undefined; /** Max debit allowed per operation. */ - maxDebitAmountLimit?: number; + maxDebitAmountLimit?: number | undefined; /** Additional metadata for the balance definition. */ - meta?: Record; + meta?: Record | undefined; /** Minimum allowable balance. */ - minAmount?: number; + minAmount?: number | undefined; /** Name of the balance definition. */ - name?: string; + name?: string | undefined; /** Unit of balance (e.g., points, currency). */ - unit?: string; + unit?: string | undefined; /** Timestamp of the last update. */ - updatedAt?: string; + updatedAt?: string | undefined; } export namespace BalanceDefinition { diff --git a/src/api/types/BalanceLimit.ts b/src/api/types/BalanceLimit.ts index 2945963..4706149 100644 --- a/src/api/types/BalanceLimit.ts +++ b/src/api/types/BalanceLimit.ts @@ -2,23 +2,23 @@ export interface BalanceLimit { /** balance definition ID */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** Defines the type of constraint (e.g., transaction-based or amount-based). */ - constraintType?: string; + constraintType?: string | undefined; /** Timestamp of when the balance limit was created. */ createdAt: string; /** Time unit for the balance limit (day, week, month, year). */ - durationUnit?: string; + durationUnit?: string | undefined; /** Number of time units the balance limit applies to. */ - durationValue?: number; + durationValue?: number | undefined; /** Unique identifier for the balance limit. */ - id?: string; + id?: string | undefined; /** Indicates if the limit resets periodically based on a sliding schedule. */ - slidingSchedule?: boolean; + slidingSchedule?: boolean | undefined; /** Specifies whether the limit applies to credit or debit transactions. */ - transactionType?: string; + transactionType?: string | undefined; /** Timestamp of the last update to the balance limit. */ updatedAt: string; /** The maximum allowed value for the defined constraint. */ - value?: number; + value?: number | undefined; } diff --git a/src/api/types/Company.ts b/src/api/types/Company.ts index 920e101..d5a58d3 100644 --- a/src/api/types/Company.ts +++ b/src/api/types/Company.ts @@ -5,11 +5,11 @@ */ export interface Company { /** Company attributes with values */ - attributes?: Record; + attributes?: Record | undefined; /** Unique company id */ - id?: string; + id?: string | undefined; /** Contact ids for contacts linked to this company */ - linkedContactsIds?: number[]; + linkedContactsIds?: number[] | undefined; /** Deals ids for companies linked to this company */ - linkedDealsIds?: string[]; + linkedDealsIds?: string[] | undefined; } diff --git a/src/api/types/ContactErrorModel.ts b/src/api/types/ContactErrorModel.ts index 920119c..51de895 100644 --- a/src/api/types/ContactErrorModel.ts +++ b/src/api/types/ContactErrorModel.ts @@ -6,7 +6,7 @@ export interface ContactErrorModel { /** Readable message associated to the failure */ message: string; /** Additional information about the error */ - metadata?: Record; + metadata?: Record | undefined; } export namespace ContactErrorModel { diff --git a/src/api/types/ConversationsMessage.ts b/src/api/types/ConversationsMessage.ts index 7dbd1d2..b56c13c 100644 --- a/src/api/types/ConversationsMessage.ts +++ b/src/api/types/ConversationsMessage.ts @@ -5,58 +5,58 @@ */ export interface ConversationsMessage { /** ID of the agent on whose behalf the message was sent (only in messages sent by an agent). */ - agentId?: string; + agentId?: string | undefined; /** Agent’s name as displayed to the visitor. Only in the messages sent by an agent. */ - agentName?: string; + agentName?: string | undefined; /** Only set if the agent has uploaded a profile picture. */ - agentUserpic?: string; + agentUserpic?: string | undefined; /** An array of file attachments. */ - attachments?: ConversationsMessage.Attachments.Item[]; + attachments?: ConversationsMessage.Attachments.Item[] | undefined; /** An array containing details of the blind carbon copy (BCC) recipients (applicable only to messages in email threads). */ - bcc?: ConversationsMessage.Bcc.Item[]; + bcc?: ConversationsMessage.Bcc.Item[] | undefined; /** An array containing details of the carbon copy (CC) recipients (applicable only to messages in email threads). */ - cc?: ConversationsMessage.Cc.Item[]; + cc?: ConversationsMessage.Cc.Item[] | undefined; /** Timestamp in milliseconds. */ - createdAt?: number; - file?: ConversationsMessage.File_; + createdAt?: number | undefined; + file?: ConversationsMessage.File_ | undefined; /** Status of the message forwarding to the source. */ - forwardedToSourceStatus?: ConversationsMessage.ForwardedToSourceStatus; + forwardedToSourceStatus?: ConversationsMessage.ForwardedToSourceStatus | undefined; /** An object containing details about the email sender (applicable only to messages in email threads). */ - from?: ConversationsMessage.From; + from?: ConversationsMessage.From | undefined; /** The HTML content of the message. */ - html?: string; + html?: string | undefined; /** Message ID. It can be used for further manipulations with the message. */ - id?: string; + id?: string | undefined; /** Integration details. */ - integrations?: Record; + integrations?: Record | undefined; /** `true` for automated messages generated by an AI bot. */ - isBot?: boolean; + isBot?: boolean | undefined; /** `true` for missed and offline messages. */ - isMissed?: boolean; + isMissed?: boolean | undefined; /** `true` for unread agent’s messages in finished chats. */ - isMissedByVisitor?: boolean; + isMissedByVisitor?: boolean | undefined; /** `true` for pushed messages */ - isPushed?: boolean; + isPushed?: boolean | undefined; /** `true` for automatic messages from “Targeted chats & triggers” and API (https://developers.brevo.com/docs/javascript-api-reference#sendautomessage) */ - isTrigger?: boolean; + isTrigger?: boolean | undefined; /** Unescaped HTML content of the message (may include unsafe HTML). */ - rawUnsafeHtml?: string; + rawUnsafeHtml?: string | undefined; /** In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop. */ - receivedFrom?: string; + receivedFrom?: string | undefined; /** An object containing details of the reply-to email address (applicable only to messages in email threads). */ - replyTo?: ConversationsMessage.ReplyTo; + replyTo?: ConversationsMessage.ReplyTo | undefined; /** The ID of the message assigned by the integration source. */ - sourceMessageId?: string; + sourceMessageId?: string | undefined; /** The subject line of the email message (only for messages sent to email threads). */ - subject?: string; + subject?: string | undefined; /** Message text or name of the attached file */ - text?: string; + text?: string | undefined; /** An array containing details of the recipients (applicable only to messages in email threads). */ - to?: ConversationsMessage.To.Item[]; + to?: ConversationsMessage.To.Item[] | undefined; /** `"agent"` for agents’ messages, `"visitor"` for visitors’ messages. */ - type?: ConversationsMessage.Type; + type?: ConversationsMessage.Type | undefined; /** visitor’s ID */ - visitorId?: string; + visitorId?: string | undefined; } export namespace ConversationsMessage { @@ -65,17 +65,17 @@ export namespace ConversationsMessage { export namespace Attachments { export interface Item { /** The name of the file. */ - fileName?: string; + fileName?: string | undefined; /** The ID of the inline file. */ - inlineId?: string; + inlineId?: string | undefined; /** `true` for images. */ - isImage?: boolean; + isImage?: boolean | undefined; /** `true` for inline files. */ - isInline?: string; + isInline?: string | undefined; /** The size of the file in bytes. */ - size?: number; + size?: number | undefined; /** The URL of the file. */ - url?: string; + url?: string | undefined; } } @@ -83,8 +83,8 @@ export namespace ConversationsMessage { export namespace Bcc { export interface Item { - email?: string; - name?: string; + email?: string | undefined; + name?: string | undefined; } } @@ -92,22 +92,22 @@ export namespace ConversationsMessage { export namespace Cc { export interface Item { - email?: string; - name?: string; + email?: string | undefined; + name?: string | undefined; } } export interface File_ { /** Name of the file */ - filename?: string; + filename?: string | undefined; /** image info is passed in case the file is an image */ - imageInfo?: File_.ImageInfo; + imageInfo?: File_.ImageInfo | undefined; /** Whether the file is an image */ - isImage?: boolean; + isImage?: boolean | undefined; /** Size in bytes */ - size?: number; + size?: number | undefined; /** URL of the file */ - url?: string; + url?: string | undefined; } export namespace File_ { @@ -116,11 +116,11 @@ export namespace ConversationsMessage { */ export interface ImageInfo { /** height of the image */ - height?: number; + height?: number | undefined; /** URL of the preview */ - previewUrl?: string; + previewUrl?: string | undefined; /** Width of the image */ - width?: number; + width?: number | undefined; } } @@ -128,32 +128,32 @@ export namespace ConversationsMessage { * Status of the message forwarding to the source. */ export interface ForwardedToSourceStatus { - error?: string; - isSuccess?: boolean; + error?: string | undefined; + isSuccess?: boolean | undefined; } /** * An object containing details about the email sender (applicable only to messages in email threads). */ export interface From { - email?: string; - name?: string; + email?: string | undefined; + name?: string | undefined; } /** * An object containing details of the reply-to email address (applicable only to messages in email threads). */ export interface ReplyTo { - email?: string; - name?: string; + email?: string | undefined; + name?: string | undefined; } export type To = To.Item[]; export namespace To { export interface Item { - email?: string; - name?: string; + email?: string | undefined; + name?: string | undefined; } } diff --git a/src/api/types/CreateUpdateFolder.ts b/src/api/types/CreateUpdateFolder.ts index 47c1340..43a33da 100644 --- a/src/api/types/CreateUpdateFolder.ts +++ b/src/api/types/CreateUpdateFolder.ts @@ -2,5 +2,5 @@ export interface CreateUpdateFolder { /** Name of the folder */ - name?: string; + name?: string | undefined; } diff --git a/src/api/types/Deal.ts b/src/api/types/Deal.ts index 1370a94..a0ad470 100644 --- a/src/api/types/Deal.ts +++ b/src/api/types/Deal.ts @@ -5,11 +5,11 @@ */ export interface Deal { /** Deal attributes with values */ - attributes?: Record; + attributes?: Record | undefined; /** Unique deal id */ - id?: string; + id?: string | undefined; /** Companies ids for companies linked to this deal */ - linkedCompaniesIds?: string[]; + linkedCompaniesIds?: string[] | undefined; /** Contact ids for contacts linked to this deal */ - linkedContactsIds?: number[]; + linkedContactsIds?: number[] | undefined; } diff --git a/src/api/types/ErrorModel.ts b/src/api/types/ErrorModel.ts index 0319619..5ca6e1b 100644 --- a/src/api/types/ErrorModel.ts +++ b/src/api/types/ErrorModel.ts @@ -2,7 +2,7 @@ export interface ErrorModel { /** Error code displayed in case of a failure */ - code?: string; + code?: string | undefined; /** Readable message associated to the failure */ message: string; } diff --git a/src/api/types/FileData.ts b/src/api/types/FileData.ts index e8ae0a0..f528215 100644 --- a/src/api/types/FileData.ts +++ b/src/api/types/FileData.ts @@ -5,17 +5,17 @@ */ export interface FileData { /** Account id of user which created the file */ - authorId?: string; + authorId?: string | undefined; /** Company id linked to a file */ - companyId?: string; + companyId?: string | undefined; /** Contact id of contact on which file is uploaded */ - contactId?: number; + contactId?: number | undefined; /** File created date/time */ - createdAt?: string; + createdAt?: string | undefined; /** Deal id linked to a file */ - dealId?: string; + dealId?: string | undefined; /** Name of uploaded file */ - name?: string; + name?: string | undefined; /** Size of file in bytes */ - size?: number; + size?: number | undefined; } diff --git a/src/api/types/GetCampaignStats.ts b/src/api/types/GetCampaignStats.ts index f0f6085..618a403 100644 --- a/src/api/types/GetCampaignStats.ts +++ b/src/api/types/GetCampaignStats.ts @@ -8,19 +8,19 @@ export interface GetCampaignStats { /** Number of complaints (Spam reports) for the campaign */ complaints: number; /** Number of deferred emails for the campaign */ - deferred?: number; + deferred?: number | undefined; /** Number of delivered emails for the campaign */ delivered: number; /** Rate of recipients without any privacy protection option enabled in their email client_dev, applied to all delivered emails */ - estimatedViews?: number; + estimatedViews?: number | undefined; /** Number of harbounce for the campaign */ hardBounces: number; /** List Id of email campaign (only in case of get email campaign(s)(not for global stats)) */ - listId?: number; + listId?: number | undefined; /** Percentage of recipients who open the email out of your total number of recipients. Depending on your Campaign settings, they may include Apple MPP opens. */ opensRate: number; /** Total number of non-delivered campaigns for a particular campaign id. */ - returnBounce?: number; + returnBounce?: number | undefined; /** Number of sent emails for the campaign */ sent: number; /** Number of softbounce for the campaign */ @@ -28,7 +28,7 @@ export interface GetCampaignStats { /** Recipients without any privacy protection option enabled in their email client_dev */ trackableViews: number; /** Rate of recipients without any privacy protection option enabled in their email client_dev */ - trackableViewsRate?: number; + trackableViewsRate?: number | undefined; /** Number of unique clicks for the campaign */ uniqueClicks: number; /** Number of unique openings for the campaign */ diff --git a/src/api/types/GetCategoryDetails.ts b/src/api/types/GetCategoryDetails.ts index d474b06..30b8a07 100644 --- a/src/api/types/GetCategoryDetails.ts +++ b/src/api/types/GetCategoryDetails.ts @@ -12,5 +12,5 @@ export interface GetCategoryDetails { /** Name of the category for which you requested the details */ name: string; /** URL to the category */ - url?: string; + url?: string | undefined; } diff --git a/src/api/types/GetContactDetails.ts b/src/api/types/GetContactDetails.ts index 45374d9..124eb51 100644 --- a/src/api/types/GetContactDetails.ts +++ b/src/api/types/GetContactDetails.ts @@ -6,13 +6,13 @@ export interface GetContactDetails { /** Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Email address of the contact for which you requested the details */ - email?: string; + email?: string | undefined; /** Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) */ emailBlacklisted: boolean; /** ID of the contact for which you requested the details */ id: number; listIds: number[]; - listUnsubscribed?: number[]; + listUnsubscribed?: number[] | undefined; /** Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; /** Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) */ diff --git a/src/api/types/GetCouponCollection.ts b/src/api/types/GetCouponCollection.ts index 2f23b13..a00afc1 100644 --- a/src/api/types/GetCouponCollection.ts +++ b/src/api/types/GetCouponCollection.ts @@ -6,7 +6,7 @@ export interface GetCouponCollection { /** The default coupon of the collection. */ defaultCoupon: string; /** Expiration date for the coupon collection in RFC3339 format. */ - expirationDate?: string; + expirationDate?: string | undefined; /** The id of the collection. */ id: string; /** The name of the collection. */ @@ -14,9 +14,9 @@ export interface GetCouponCollection { /** Number of coupons that have not been sent yet. */ remainingCoupons: number; /** If present, an email notification is going to be sent when the total number of available coupons falls below the defined threshold. */ - remainingCouponsAlert?: number; + remainingCouponsAlert?: number | undefined; /** If present, an email notification is going to be sent the defined amount of days before to the expiration date. */ - remainingDaysAlert?: number; + remainingDaysAlert?: number | undefined; /** Total number of coupons in the collection. */ totalCoupons: number; } diff --git a/src/api/types/GetExtendedCampaignOverview.ts b/src/api/types/GetExtendedCampaignOverview.ts index 48b784e..0b4c7e7 100644 --- a/src/api/types/GetExtendedCampaignOverview.ts +++ b/src/api/types/GetExtendedCampaignOverview.ts @@ -2,33 +2,33 @@ export interface GetExtendedCampaignOverview { /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ - abTesting?: boolean; + abTesting?: boolean | undefined; /** ID of the campaign */ id: number; /** Name of the campaign */ name: string; /** Preview text or preheader of the email campaign */ - previewText?: string; + previewText?: string | undefined; /** UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) */ - scheduledAt?: string; + scheduledAt?: string | undefined; /** It is true if you have chosen to send your campaign at best time, otherwise it is false */ - sendAtBestTime?: boolean; + sendAtBestTime?: boolean | undefined; /** The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` */ - splitRule?: number; + splitRule?: number | undefined; /** Status of the campaign */ status: GetExtendedCampaignOverview.Status; /** Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` */ - subject?: string; + subject?: string | undefined; /** Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ - subjectA?: string; + subjectA?: string | undefined; /** Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` */ - subjectB?: string; + subjectB?: string | undefined; /** Type of campaign */ type: GetExtendedCampaignOverview.Type; /** Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` */ - winnerCriteria?: string; + winnerCriteria?: string | undefined; /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ - winnerDelay?: number; + winnerDelay?: number | undefined; /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Footer of the campaign */ @@ -38,35 +38,35 @@ export interface GetExtendedCampaignOverview { /** HTML content of the campaign */ htmlContent: string; /** Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. */ - inlineImageActivation?: boolean; + inlineImageActivation?: boolean | undefined; /** Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign */ - mirrorActive?: boolean; + mirrorActive?: boolean | undefined; /** UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; /** FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times */ - recurring?: boolean; + recurring?: boolean | undefined; /** Email defined as the "Reply to" of the campaign */ replyTo: string; /** Total number of non-delivered campaigns for a particular campaign id. */ - returnBounce?: number; + returnBounce?: number | undefined; sender: GetExtendedCampaignOverview.Sender; /** Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' */ - sentDate?: string; + sentDate?: string | undefined; /** Link to share the campaign on social medias */ - shareLink?: string; + shareLink?: string | undefined; /** Tag of the campaign */ - tag?: string; + tag?: string | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ - toField?: string; + toField?: string | undefined; /** utm parameter associated with campaign */ - utmCampaignValue?: string; + utmCampaignValue?: string | undefined; /** utm id active */ - utmIDActive?: boolean; - utmMedium?: string; + utmIDActive?: boolean | undefined; + utmMedium?: string | undefined; /** source of utm */ - utmSource?: string; + utmSource?: string | undefined; } export namespace GetExtendedCampaignOverview { @@ -89,10 +89,10 @@ export namespace GetExtendedCampaignOverview { export interface Sender { /** Sender email of the campaign */ - email?: string; + email?: string | undefined; /** Sender id of the campaign */ - id?: number; + id?: number | undefined; /** Sender name of the campaign */ - name?: string; + name?: string | undefined; } } diff --git a/src/api/types/GetExtendedCampaignStats.ts b/src/api/types/GetExtendedCampaignStats.ts index 5e135a4..7f8b3fb 100644 --- a/src/api/types/GetExtendedCampaignStats.ts +++ b/src/api/types/GetExtendedCampaignStats.ts @@ -26,12 +26,12 @@ export namespace GetExtendedCampaignStats { export interface StatsByDevice { /** Statistics of the campaign on the basis of desktop devices */ - desktop?: Record; + desktop?: Record | undefined; /** Statistics of the campaign on the basis of mobile devices */ - mobile?: Record; + mobile?: Record | undefined; /** Statistics of the campaign on the basis of tablet devices */ - tablet?: Record; + tablet?: Record | undefined; /** Statistics of the campaign on the basis of unknown devices */ - unknown?: Record; + unknown?: Record | undefined; } } diff --git a/src/api/types/GetProductDetails.ts b/src/api/types/GetProductDetails.ts index 5422f0b..464093b 100644 --- a/src/api/types/GetProductDetails.ts +++ b/src/api/types/GetProductDetails.ts @@ -2,35 +2,35 @@ export interface GetProductDetails { /** Category ID-s of the product */ - categories?: string[]; + categories?: string[] | undefined; /** Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Product ID for which you requested the details */ id: string; /** Absolute URL to the cover image of the product */ - imageUrl?: string; + imageUrl?: string | undefined; /** Product get deleted from the shop's database but not from Brevo */ - isDeleted?: boolean; + isDeleted?: boolean | undefined; /** Meta data of product such as description, vendor, producer, stock level, etc. */ - metaInfo?: Record; + metaInfo?: Record | undefined; /** Last modification UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; /** Name of the product for which you requested the details */ name: string; /** Parent product id of the product */ - parentId?: string; + parentId?: string | undefined; /** Price of the product */ - price?: number; + price?: number | undefined; /** S3 url of original image */ - s3Original?: string; + s3Original?: string | undefined; /** S3 thumbnail url of original image in 120x120 dimension for analytics section */ s3ThumbAnalytics: string; /** S3 thumbnail url of original image in 600x400 dimension for editor section */ s3ThumbEditor: string; /** Product identifier from the shop */ - sku?: string; + sku?: string | undefined; /** Current stock value of the product from the shop's database */ - stock?: number; + stock?: number | undefined; /** URL to the product */ - url?: string; + url?: string | undefined; } diff --git a/src/api/types/GetSmsCampaignOverview.ts b/src/api/types/GetSmsCampaignOverview.ts index 735abf8..0339585 100644 --- a/src/api/types/GetSmsCampaignOverview.ts +++ b/src/api/types/GetSmsCampaignOverview.ts @@ -12,7 +12,7 @@ export interface GetSmsCampaignOverview { /** Name of the SMS Campaign */ name: string; /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ - scheduledAt?: string; + scheduledAt?: string | undefined; /** Sender of the SMS Campaign */ sender: string; /** Status of the SMS Campaign */ diff --git a/src/api/types/GetSmtpTemplateOverview.ts b/src/api/types/GetSmtpTemplateOverview.ts index 2d21df8..156e587 100644 --- a/src/api/types/GetSmtpTemplateOverview.ts +++ b/src/api/types/GetSmtpTemplateOverview.ts @@ -4,7 +4,7 @@ export interface GetSmtpTemplateOverview { /** Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. */ - doiTemplate?: boolean; + doiTemplate?: boolean | undefined; /** HTML content of the template */ htmlContent: string; /** ID of the template */ @@ -31,10 +31,10 @@ export interface GetSmtpTemplateOverview { export namespace GetSmtpTemplateOverview { export interface Sender { /** From email for the template */ - email?: string; + email?: string | undefined; /** Sender id of the template */ - id?: string; + id?: string | undefined; /** From email for the template */ - name?: string; + name?: string | undefined; } } diff --git a/src/api/types/GetWebhook.ts b/src/api/types/GetWebhook.ts index d4f2778..15afb08 100644 --- a/src/api/types/GetWebhook.ts +++ b/src/api/types/GetWebhook.ts @@ -2,20 +2,20 @@ export interface GetWebhook { /** Authentication header to be send with the webhook requests */ - auth?: Record; + auth?: Record | undefined; /** * Batching configuration of the webhook, we send batched webhooks if its * true */ - batched?: boolean; + batched?: boolean | undefined; /** channel of webhook */ - channel?: GetWebhook.Channel; + channel?: GetWebhook.Channel | undefined; /** Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Description of the webhook */ description: string; events: string[]; - headers?: Record[]; + headers?: Record[] | undefined; /** ID of the webhook */ id: number; /** Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) */ diff --git a/src/api/types/Inviteuser.ts b/src/api/types/Inviteuser.ts index 074363d..2f11122 100644 --- a/src/api/types/Inviteuser.ts +++ b/src/api/types/Inviteuser.ts @@ -17,9 +17,9 @@ export namespace Inviteuser { */ export interface Item { /** Feature name */ - feature?: Item.Feature; + feature?: Item.Feature | undefined; /** Permissions for a given feature */ - permissions?: Item.Permissions.Item[]; + permissions?: Item.Permissions.Item[] | undefined; } export namespace Item { diff --git a/src/api/types/LoyaltyProgram.ts b/src/api/types/LoyaltyProgram.ts index 2ca6bd4..19a675b 100644 --- a/src/api/types/LoyaltyProgram.ts +++ b/src/api/types/LoyaltyProgram.ts @@ -2,29 +2,29 @@ export interface LoyaltyProgram { /** Loyalty Program code count */ - codeCount?: number; + codeCount?: number | undefined; /** Loyalty Program creation date */ - createdAt?: string; + createdAt?: string | undefined; /** Loyalty Program description */ - description?: string; + description?: string | undefined; /** string */ - documentId?: string; + documentId?: string | undefined; /** Loyalty Program ID */ - id?: string; + id?: string | undefined; /** Loyalty Program meta data */ - meta?: Record; + meta?: Record | undefined; /** Loyalty Program name */ - name?: string; + name?: string | undefined; /** string */ - pattern?: string; + pattern?: string | undefined; /** Loyalty Program state */ - state?: LoyaltyProgram.State; + state?: LoyaltyProgram.State | undefined; /** Loyalty Program subscription generator ID */ - subscriptionGeneratorId?: string; + subscriptionGeneratorId?: string | undefined; /** Loyalty Program subscription pool ID */ - subscriptionPoolId?: string; + subscriptionPoolId?: string | undefined; /** Loyalty Program last modification date */ - updatedAt?: string; + updatedAt?: string | undefined; } export namespace LoyaltyProgram { diff --git a/src/api/types/NodeResponse.ts b/src/api/types/NodeResponse.ts index fe37393..94880a6 100644 --- a/src/api/types/NodeResponse.ts +++ b/src/api/types/NodeResponse.ts @@ -4,19 +4,19 @@ import type * as Brevo from "../index.js"; export interface NodeResponse { /** array[object] */ - args?: Brevo.NodeResponse[]; + args?: Brevo.NodeResponse[] | undefined; /** Array values for rule definition */ - array?: Brevo.NodeResponse[]; + array?: Brevo.NodeResponse[] | undefined; /** Boolean values for rule definition */ - boolean?: boolean; + boolean?: boolean | undefined; /** Description for rule definition */ - description?: string; + description?: string | undefined; /** Float values for rule definition */ - float?: number; + float?: number | undefined; /** int64 */ - int?: number; + int?: number | undefined; /** Operator selected for rule definition */ - op?: string; + op?: string | undefined; /** Boolean values for rule definition */ - string?: string; + string?: string | undefined; } diff --git a/src/api/types/Note.ts b/src/api/types/Note.ts index 540f61f..e2dc39d 100644 --- a/src/api/types/Note.ts +++ b/src/api/types/Note.ts @@ -5,17 +5,17 @@ */ export interface Note { /** Account details of user which created the note */ - authorId?: Record; + authorId?: Record | undefined; /** Contact ids linked to a note */ - contactIds?: number[]; + contactIds?: number[] | undefined; /** Note created date/time */ - createdAt?: string; + createdAt?: string | undefined; /** Deal ids linked to a note */ - dealIds?: string[]; + dealIds?: string[] | undefined; /** Unique note Id */ - id?: string; + id?: string | undefined; /** Text content of a note */ text: string; /** Note updated date/time */ - updatedAt?: string; + updatedAt?: string | undefined; } diff --git a/src/api/types/NoteData.ts b/src/api/types/NoteData.ts index cfdb12a..7d9df9e 100644 --- a/src/api/types/NoteData.ts +++ b/src/api/types/NoteData.ts @@ -5,11 +5,11 @@ */ export interface NoteData { /** Company Ids linked to a note */ - companyIds?: string[]; + companyIds?: string[] | undefined; /** Contact Ids linked to a note */ - contactIds?: number[]; + contactIds?: number[] | undefined; /** Deal Ids linked to a note */ - dealIds?: string[]; + dealIds?: string[] | undefined; /** Text content of a note */ text: string; } diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 181324e..1753e35 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -4,22 +4,22 @@ export interface Order { /** Total amount of the order, including all shipping expenses, tax and the price of items. */ amount: number; /** Billing details of an order. */ - billing?: Order.Billing; + billing?: Order.Billing | undefined; /** Coupons applied to the order. Stored case insensitive. */ - coupons?: string[]; + coupons?: string[] | undefined; /** Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created. */ createdAt: string; /** Unique ID of the order. */ id: string; /** Identifies the contact associated with the order. */ - identifiers?: Order.Identifiers; + identifiers?: Order.Identifiers | undefined; /** Meta data of order to store additional detal such as custom message, customer type, source. */ - metaInfo?: Record; + metaInfo?: Record | undefined; products: Order.Products.Item[]; /** State of the order. */ status: string; /** ID of store where the order is placed */ - storeId?: string; + storeId?: string | undefined; /** Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated. */ updatedAt: string; } @@ -30,21 +30,21 @@ export namespace Order { */ export interface Billing { /** Full billing address. */ - address?: string; + address?: string | undefined; /** Exact city of the address. */ - city?: string; + city?: string | undefined; /** Billing country name. */ - country?: string; + country?: string | undefined; /** Billing country 2-letter ISO code. */ - countryCode?: string; + countryCode?: string | undefined; /** How the visitor will pay for the item(s), e.g. paypal, check, etc. */ - paymentMethod?: string; + paymentMethod?: string | undefined; /** Billing phone number. */ - phone?: string; + phone?: string | undefined; /** Postcode for delivery and billing. */ - postCode?: string; + postCode?: string | undefined; /** Exact region (state/province) for delivery and billing. */ - region?: string; + region?: string | undefined; } /** @@ -52,13 +52,13 @@ export namespace Order { */ export interface Identifiers { /** Email of the contact associated with the order */ - email_id?: string; + email_id?: string | undefined; /** ext_id associated with the order */ - ext_id?: string; + ext_id?: string | undefined; /** loyalty_subscription_id associated with the order */ - loyalty_subscription_id?: string; + loyalty_subscription_id?: string | undefined; /** Phone number of the contact associated with the order */ - phone_id?: string; + phone_id?: string | undefined; } export namespace MetaInfo { @@ -79,7 +79,7 @@ export namespace Order { /** How many pieces of the product the visitor has added to the cart. */ quantity: number; /** Product ID of the red color shirts. */ - variantId?: string; + variantId?: string | undefined; } } } diff --git a/src/api/types/Pipeline.ts b/src/api/types/Pipeline.ts index 0528af0..72551f5 100644 --- a/src/api/types/Pipeline.ts +++ b/src/api/types/Pipeline.ts @@ -5,11 +5,11 @@ */ export interface Pipeline { /** Pipeline id */ - pipeline?: string; + pipeline?: string | undefined; /** Pipeline Name */ - pipeline_name?: string; + pipeline_name?: string | undefined; /** List of stages */ - stages?: Pipeline.Stages.Item[]; + stages?: Pipeline.Stages.Item[] | undefined; } export namespace Pipeline { @@ -21,9 +21,9 @@ export namespace Pipeline { */ export interface Item { /** Stage id */ - id?: string; + id?: string | undefined; /** Stage name */ - name?: string; + name?: string | undefined; } } } diff --git a/src/api/types/PostContactInfo.ts b/src/api/types/PostContactInfo.ts index 5359429..bbe0eeb 100644 --- a/src/api/types/PostContactInfo.ts +++ b/src/api/types/PostContactInfo.ts @@ -6,12 +6,12 @@ export interface PostContactInfo { export namespace PostContactInfo { export interface Contacts { - failure?: Contacts.Failure; + failure?: Contacts.Failure | undefined; /** Id of the process created to remove contacts from list when user opts for "all" option. */ - processId?: number; - success?: Contacts.Success; + processId?: number | undefined; + success?: Contacts.Success | undefined; /** Displays the count of total number of contacts removed from list when user opts for "all" option. */ - total?: number; + total?: number | undefined; } export namespace Contacts { diff --git a/src/api/types/PostSendFailed.ts b/src/api/types/PostSendFailed.ts index c9c2e35..70910d1 100644 --- a/src/api/types/PostSendFailed.ts +++ b/src/api/types/PostSendFailed.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. export interface PostSendFailed { - blackListedEmails?: string[]; + blackListedEmails?: string[] | undefined; /** Response code */ code: string; /** Response message */ message: string; - unexistingEmails?: string[]; - withoutListEmails?: string[]; + unexistingEmails?: string[] | undefined; + withoutListEmails?: string[] | undefined; } diff --git a/src/api/types/Redeem.ts b/src/api/types/Redeem.ts index 90914e5..3f83495 100644 --- a/src/api/types/Redeem.ts +++ b/src/api/types/Redeem.ts @@ -2,31 +2,31 @@ export interface Redeem { /** Timestamp when the redemption was cancelled */ - cancelledAt?: string; + cancelledAt?: string | undefined; /** Timestamp when the redemption was completed */ - completedAt?: string; + completedAt?: string | undefined; /** Unique identifier for the contact */ - contactId?: number; + contactId?: number | undefined; /** Timestamp when the redemption was created */ - createdAt?: string; + createdAt?: string | undefined; /** Unique identifier for the debit transaction */ - debitTransactionId?: string; + debitTransactionId?: string | undefined; /** Timestamp when the redemption expires */ - expiresAt?: string; + expiresAt?: string | undefined; /** Unique identifier for the redemption */ - id?: string; + id?: string | undefined; /** Unique identifier for the loyalty program */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Additional metadata associated with the redemption */ - meta?: Record; + meta?: Record | undefined; /** Reason for rejection if the redemption was rejected */ - rejectReason?: string; + rejectReason?: string | undefined; /** Timestamp when the redemption was rejected */ - rejectedAt?: string; + rejectedAt?: string | undefined; /** Unique identifier for the reward attribution */ - rewardAttributionId?: string; + rewardAttributionId?: string | undefined; /** Current status of the redemption */ - status?: string; + status?: string | undefined; /** Timestamp when the redemption was last updated */ - updatedAt?: string; + updatedAt?: string | undefined; } diff --git a/src/api/types/RuleConditionResponse.ts b/src/api/types/RuleConditionResponse.ts index d371650..1488b59 100644 --- a/src/api/types/RuleConditionResponse.ts +++ b/src/api/types/RuleConditionResponse.ts @@ -4,13 +4,13 @@ import type * as Brevo from "../index.js"; export interface RuleConditionResponse { /** Metric to indicate AND between rules */ - and?: Brevo.RuleConditionResponse[]; + and?: Brevo.RuleConditionResponse[] | undefined; /** Condition of the rule */ - lhs?: Brevo.ValueResponse; + lhs?: Brevo.ValueResponse | undefined; /** Selected operator for the rule */ - op?: string; + op?: string | undefined; /** Metric to indicate OR between rules */ - or?: Brevo.RuleConditionResponse[]; + or?: Brevo.RuleConditionResponse[] | undefined; /** Action of the rule */ - rhs?: Brevo.ValueResponse; + rhs?: Brevo.ValueResponse | undefined; } diff --git a/src/api/types/SendReport.ts b/src/api/types/SendReport.ts index 27df3d2..e61d25d 100644 --- a/src/api/types/SendReport.ts +++ b/src/api/types/SendReport.ts @@ -4,7 +4,7 @@ export interface SendReport { /** Custom attributes for the report email. */ email: SendReport.Email; /** Language of email content for campaign report sending. */ - language?: SendReport.Language; + language?: SendReport.Language | undefined; } export namespace SendReport { diff --git a/src/api/types/SendTestEmail.ts b/src/api/types/SendTestEmail.ts index 192467d..570327a 100644 --- a/src/api/types/SendTestEmail.ts +++ b/src/api/types/SendTestEmail.ts @@ -2,5 +2,5 @@ export interface SendTestEmail { /** List of the email addresses of the recipients whom you wish to send the test mail. _If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day_. */ - emailTo?: string[]; + emailTo?: string[] | undefined; } diff --git a/src/api/types/SendTransacSms.ts b/src/api/types/SendTransacSms.ts index 7c1f51e..db1a777 100644 --- a/src/api/types/SendTransacSms.ts +++ b/src/api/types/SendTransacSms.ts @@ -2,19 +2,19 @@ export interface SendTransacSms { /** A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** */ - organisationPrefix?: string; + organisationPrefix?: string | undefined; /** Mobile number to send SMS with the country code */ recipient: string; /** Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** */ sender: string; /** Tag of the message */ - tag?: SendTransacSms.Tag; + tag?: SendTransacSms.Tag | undefined; /** Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. */ - type?: SendTransacSms.Type; + type?: SendTransacSms.Type | undefined; /** Format of the message. It indicates whether the content should be treated as unicode or not. */ - unicodeEnabled?: boolean; + unicodeEnabled?: boolean | undefined; /** Webhook to call for each event triggered by the message (delivered etc.) */ - webUrl?: string; + webUrl?: string | undefined; } export namespace SendTransacSms { @@ -23,7 +23,7 @@ export namespace SendTransacSms { */ export interface Tag { /** A tag can be a string or an array of strings. */ - field?: Tag.Field; + field?: Tag.Field | undefined; } export namespace Tag { diff --git a/src/api/types/Task.ts b/src/api/types/Task.ts index d3418dc..455b6ab 100644 --- a/src/api/types/Task.ts +++ b/src/api/types/Task.ts @@ -5,13 +5,13 @@ */ export interface Task { /** Companies ids for companies a task is linked to */ - companiesIds?: string[]; + companiesIds?: string[] | undefined; /** Contact ids for contacts linked to this task */ - contactsIds?: number[]; + contactsIds?: number[] | undefined; /** Deal ids for deals a task is linked to */ - dealsIds?: string[]; + dealsIds?: string[] | undefined; /** Unique task id */ - id?: string; + id?: string | undefined; /** Name of task */ name: string; /** Id for type of task e.g Call / Email / Meeting etc. */ diff --git a/src/api/types/Tier.ts b/src/api/types/Tier.ts index f121ffa..1249b8e 100644 --- a/src/api/types/Tier.ts +++ b/src/api/types/Tier.ts @@ -2,21 +2,21 @@ export interface Tier { /** Conditions required to access this tier */ - accessConditions?: Tier.AccessConditions.Item[]; - createdAt?: string; + accessConditions?: Tier.AccessConditions.Item[] | undefined; + createdAt?: string | undefined; /** Associated group Id */ - groupId?: string; + groupId?: string | undefined; /** Tier image reference */ - imageRef?: string; + imageRef?: string | undefined; /** Associated loyalty program Id */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Tier name */ - name?: string; + name?: string | undefined; /** Tier id */ - tierId?: string; + tierId?: string | undefined; /** Rewards associated with this tier */ - tierRewards?: Tier.TierRewards.Item[]; - updatedAt?: string; + tierRewards?: Tier.TierRewards.Item[] | undefined; + updatedAt?: string | undefined; } export namespace Tier { @@ -25,11 +25,11 @@ export namespace Tier { export namespace AccessConditions { export interface Item { /** Balance definition identifier */ - balanceDefinitionId?: string; - createdAt?: string; + balanceDefinitionId?: string | undefined; + createdAt?: string | undefined; /** Minimum value required to access this tier */ - minimumValue?: number; - updatedAt?: string; + minimumValue?: number | undefined; + updatedAt?: string | undefined; } } @@ -37,10 +37,10 @@ export namespace Tier { export namespace TierRewards { export interface Item { - createdAt?: string; + createdAt?: string | undefined; /** Reward to be attributed on tier assignment */ - rewardId?: string; - updatedAt?: string; + rewardId?: string | undefined; + updatedAt?: string | undefined; } } } diff --git a/src/api/types/TierGroup.ts b/src/api/types/TierGroup.ts index 1c8f7f1..758f977 100644 --- a/src/api/types/TierGroup.ts +++ b/src/api/types/TierGroup.ts @@ -2,21 +2,21 @@ export interface TierGroup { /** Timestamp when the tier group was created */ - createdAt?: string; + createdAt?: string | undefined; /** Select real_time to downgrade tier on real time balance updates. Select membership_anniversary to downgrade tier on subscription anniversary. Select tier_anniversary to downgrade tier on tier anniversary. */ - downgradeStrategy?: TierGroup.DowngradeStrategy; + downgradeStrategy?: TierGroup.DowngradeStrategy | undefined; /** Tier group unique identifier */ - id?: string; + id?: string | undefined; /** Associated loyalty program Id */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Tier group name */ - name?: string; + name?: string | undefined; /** Order of the tiers in the group in ascending order */ - tierOrder?: string[]; + tierOrder?: string[] | undefined; /** Timestamp when the tier group was last updated */ - updatedAt?: string; + updatedAt?: string | undefined; /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ - upgradeStrategy?: TierGroup.UpgradeStrategy; + upgradeStrategy?: TierGroup.UpgradeStrategy | undefined; } export namespace TierGroup { diff --git a/src/api/types/Transaction.ts b/src/api/types/Transaction.ts index dc0d9d4..48a8675 100644 --- a/src/api/types/Transaction.ts +++ b/src/api/types/Transaction.ts @@ -5,33 +5,33 @@ */ export interface Transaction { /** The transaction amount. */ - amount?: number; + amount?: number | undefined; /** Unique identifier (UUID) of the associated balance definition. */ - balanceDefinitionId?: string; + balanceDefinitionId?: string | undefined; /** Timestamp when the transaction was canceled (nullable). */ - cancelledAt?: string; + cancelledAt?: string | undefined; /** Timestamp when the transaction was completed (nullable). */ - completedAt?: string; + completedAt?: string | undefined; /** Unique identifier of the contact associated with the transaction. */ - contactId?: number; + contactId?: number | undefined; /** Timestamp when the transaction was created. */ - createdAt?: string; + createdAt?: string | undefined; /** Optional timestamp indicating when the transaction event occurred. */ - eventTime?: string; + eventTime?: string | undefined; /** Expiry date of the transaction (nullable). */ - expirationDate?: string; + expirationDate?: string | undefined; /** Unique identifier (UUID) of the transaction. */ - id?: string; + id?: string | undefined; /** Unique identifier (UUID) of the associated loyalty program. */ - loyaltyProgramId?: string; + loyaltyProgramId?: string | undefined; /** Optional metadata associated with the transaction. */ - meta?: Record; + meta?: Record | undefined; /** Reason for rejection if the transaction was declined (nullable). */ - rejectReason?: string; + rejectReason?: string | undefined; /** Timestamp when the transaction was rejected (nullable). */ - rejectedAt?: string; + rejectedAt?: string | undefined; /** The current status of the transaction (e.g., pending, completed, rejected). */ - status?: string; + status?: string | undefined; /** Timestamp when the transaction was last updated. */ - updatedAt?: string; + updatedAt?: string | undefined; } diff --git a/src/api/types/UpdateCampaignStatus.ts b/src/api/types/UpdateCampaignStatus.ts index 13718d9..a978877 100644 --- a/src/api/types/UpdateCampaignStatus.ts +++ b/src/api/types/UpdateCampaignStatus.ts @@ -5,7 +5,7 @@ */ export interface UpdateCampaignStatus { /** Note:- **replicateTemplate** status will be available **only for template type campaigns.** */ - status?: UpdateCampaignStatus.Status; + status?: UpdateCampaignStatus.Status | undefined; } export namespace UpdateCampaignStatus { diff --git a/src/api/types/ValueResponse.ts b/src/api/types/ValueResponse.ts index 8e4b851..384691b 100644 --- a/src/api/types/ValueResponse.ts +++ b/src/api/types/ValueResponse.ts @@ -4,19 +4,19 @@ import type * as Brevo from "../index.js"; export interface ValueResponse { /** Array values to define the rule */ - array?: Brevo.ValueResponse[]; + array?: Brevo.ValueResponse[] | undefined; /** Boolean values for rule definition */ - boolean?: boolean; + boolean?: boolean | undefined; /** string */ - contactProperty?: string; + contactProperty?: string | undefined; /** Selected date for rule definition */ - date?: string; + date?: string | undefined; /** Selected event property for rule definition */ - eventProperty?: string; + eventProperty?: string | undefined; /** Created expression for rule definition */ - expression?: Brevo.NodeResponse; + expression?: Brevo.NodeResponse | undefined; /** Boolean values for rule definition */ - number?: number; + number?: number | undefined; /** String values for rule definition */ - string?: string; + string?: string | undefined; } diff --git a/src/api/types/VariablesItems.ts b/src/api/types/VariablesItems.ts index 7ebe304..a3b8972 100644 --- a/src/api/types/VariablesItems.ts +++ b/src/api/types/VariablesItems.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export interface VariablesItems { - datatype?: string; - default?: string; - name?: string; + datatype?: string | undefined; + default?: string | undefined; + name?: string | undefined; } diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 45cae32..5e5058a 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -218,7 +218,13 @@ async function getHeaders(args: Fetcher.Args): Promise { newHeaders.set( "Accept", - args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : "*/*", + args.responseType === "json" + ? "application/json" + : args.responseType === "text" + ? "text/plain" + : args.responseType === "sse" + ? "text/event-stream" + : "*/*", ); if (args.body !== undefined && args.contentType != null) { newHeaders.set("Content-Type", args.contentType); diff --git a/src/version.ts b/src/version.ts index c0103fd..4197eac 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "5.0.0"; +export const SDK_VERSION = "4.0.3"; diff --git a/tests/unit/file/file.test.ts b/tests/unit/file/file.test.ts index d7c4570..6cd6509 100644 --- a/tests/unit/file/file.test.ts +++ b/tests/unit/file/file.test.ts @@ -5,6 +5,7 @@ import { toBinaryUploadRequest, type Uploadable } from "../../../src/core/file/i describe("toBinaryUploadRequest", () => { const TEST_FILE_PATH = join(__dirname, "..", "test-file.txt"); + const TEST_FILE_SIZE = fs.statSync(TEST_FILE_PATH).size.toString(); beforeEach(() => { vi.clearAllMocks(); @@ -377,7 +378,7 @@ describe("toBinaryUploadRequest", () => { expect(result.headers).toEqual({ "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path "Content-Type": "text/plain", - "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + "Content-Length": TEST_FILE_SIZE, // Should determine from file system (OS-agnostic) }); }); @@ -391,7 +392,7 @@ describe("toBinaryUploadRequest", () => { expect(result.body).toBeInstanceOf(fs.ReadStream); expect(result.headers).toEqual({ "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path - "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + "Content-Length": TEST_FILE_SIZE, // Should determine from file system (OS-agnostic) }); }); }); diff --git a/tests/wire/customObjects.test.ts b/tests/wire/customObjects.test.ts index b937282..d1a829e 100644 --- a/tests/wire/customObjects.test.ts +++ b/tests/wire/customObjects.test.ts @@ -125,7 +125,7 @@ describe("CustomObjectsClient", () => { count: 350, records: [ { - associations: [{ object_type: "garage" }], + associations: [{ object_type: "garage", records: [{ identifiers: { id: 12345 } }] }], attributes: { color: "Black", engine_type: "Hybrid", make: "Toyoto", model: "Corolla", year: 2020 }, createdAt: "2025-07-22T10:20:30Z", identifiers: { ext_id: "507f1f77bc", id: 16789 }, @@ -153,6 +153,13 @@ describe("CustomObjectsClient", () => { associations: [ { object_type: "garage", + records: [ + { + identifiers: { + id: 12345, + }, + }, + ], }, ], attributes: { From 15f6916d32ebe1aea66433b4cfa6c3cfba576ec4 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 16:53:50 +0000 Subject: [PATCH 24/33] SDK regeneration --- .fern/metadata.json | 2 +- package.json | 2 +- src/BaseClient.ts | 4 ++-- src/version.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 8fe5699..0a1de29 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "4.0.3" + "sdkVersion": "4.0.5" } diff --git a/package.json b/package.json index 88a9aea..252699c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "4.0.3", + "version": "4.0.5", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 87ddfe0..01b3158 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions Date: Fri, 20 Feb 2026 17:18:50 +0000 Subject: [PATCH 25/33] SDK regeneration --- .fern/metadata.json | 2 +- package.json | 2 +- src/BaseClient.ts | 4 ++-- src/version.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 0a1de29..8227c6e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "4.0.5" + "sdkVersion": "4.0.1" } diff --git a/package.json b/package.json index 252699c..5c57ded 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "4.0.5", + "version": "4.0.1", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 01b3158..ee746f1 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions Date: Mon, 23 Feb 2026 12:51:06 +0000 Subject: [PATCH 26/33] test: update test fixtures and CLI version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update test data structures and CLI version to maintain consistency across the codebase. The changes ensure tests remain compatible with the current API expectations while keeping development tooling up to date. Key changes: - Update CLI version from 3.79.2 to 3.76.0 in metadata - Simplify association test data by removing nested records structure - Remove specific identifier details from garage associations in test fixtures 🌿 Generated with Fern --- .fern/metadata.json | 4 ++-- changelog.md | 11 +++++++++++ package.json | 2 +- src/BaseClient.ts | 4 ++-- src/version.ts | 2 +- tests/wire/customObjects.test.ts | 9 +-------- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 8227c6e..47bccb4 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "3.79.2", + "cliVersion": "3.76.0", "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "3.48.2", "generatorConfig": { @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "4.0.1" + "sdkVersion": "4.0.2" } diff --git a/changelog.md b/changelog.md index 9c639c8..f6c77a8 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,14 @@ +## 4.0.2 - 2026-02-23 +* test: update test fixtures and CLI version +* Update test data structures and CLI version to maintain consistency across +* the codebase. The changes ensure tests remain compatible with the current +* API expectations while keeping development tooling up to date. +* Key changes: +* Update CLI version from 3.79.2 to 3.76.0 in metadata +* Simplify association test data by removing nested records structure +* Remove specific identifier details from garage associations in test fixtures +* 🌿 Generated with Fern + ## 5.0.0 - 2026-02-18 * fix: update delete tier operations to return void instead of string * Change deleteTierGroup and deleteTier methods to return void instead of string, which better reflects the actual API behavior for delete operations. This aligns the return types with the expected void response when deletion operations complete successfully. diff --git a/package.json b/package.json index 5c57ded..9a13987 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "4.0.1", + "version": "4.0.2", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index ee746f1..346c62c 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions { count: 350, records: [ { - associations: [{ object_type: "garage", records: [{ identifiers: { id: 12345 } }] }], + associations: [{ object_type: "garage" }], attributes: { color: "Black", engine_type: "Hybrid", make: "Toyoto", model: "Corolla", year: 2020 }, createdAt: "2025-07-22T10:20:30Z", identifiers: { ext_id: "507f1f77bc", id: 16789 }, @@ -153,13 +153,6 @@ describe("CustomObjectsClient", () => { associations: [ { object_type: "garage", - records: [ - { - identifiers: { - id: 12345, - }, - }, - ], }, ], attributes: { From e022b9a2f143ac3ea79acbd6031b4396cfc656c8 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 16:22:55 +0000 Subject: [PATCH 27/33] chore: update CLI version and enhance test coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Fern CLI version from 3.76.0 to 3.85.3 to leverage the latest tooling improvements and bug fixes. Additionally, expand test coverage for custom objects by adding more comprehensive association data structures with nested records and identifiers. Key changes: - Update Fern CLI version to 3.85.3 - Add nested records structure to association test data - Include identifier objects with ID values in test cases 🌿 Generated with Fern --- .fern/metadata.json | 4 ++-- changelog.md | 9 +++++++++ package.json | 2 +- src/BaseClient.ts | 4 ++-- src/version.ts | 2 +- tests/wire/customObjects.test.ts | 9 ++++++++- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 47bccb4..f41e74e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "3.76.0", + "cliVersion": "3.85.3", "generatorName": "fernapi/fern-typescript-sdk", "generatorVersion": "3.48.2", "generatorConfig": { @@ -15,5 +15,5 @@ } } }, - "sdkVersion": "4.0.2" + "sdkVersion": "4.0.3" } diff --git a/changelog.md b/changelog.md index f6c77a8..fd00819 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,12 @@ +## 4.0.3 - 2026-02-24 +* chore: update CLI version and enhance test coverage +* Update Fern CLI version from 3.76.0 to 3.85.3 to leverage the latest tooling improvements and bug fixes. Additionally, expand test coverage for custom objects by adding more comprehensive association data structures with nested records and identifiers. +* Key changes: +* Update Fern CLI version to 3.85.3 +* Add nested records structure to association test data +* Include identifier objects with ID values in test cases +* 🌿 Generated with Fern + ## 4.0.2 - 2026-02-23 * test: update test fixtures and CLI version * Update test data structures and CLI version to maintain consistency across diff --git a/package.json b/package.json index 9a13987..88a9aea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "4.0.2", + "version": "4.0.3", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 346c62c..87ddfe0 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions { count: 350, records: [ { - associations: [{ object_type: "garage" }], + associations: [{ object_type: "garage", records: [{ identifiers: { id: 12345 } }] }], attributes: { color: "Black", engine_type: "Hybrid", make: "Toyoto", model: "Corolla", year: 2020 }, createdAt: "2025-07-22T10:20:30Z", identifiers: { ext_id: "507f1f77bc", id: 16789 }, @@ -153,6 +153,13 @@ describe("CustomObjectsClient", () => { associations: [ { object_type: "garage", + records: [ + { + identifiers: { + id: 12345, + }, + }, + ], }, ], attributes: { From 034debce64e8addca04587872bfa871f46b1f5ff Mon Sep 17 00:00:00 2001 From: Mauricio Date: Sun, 8 Mar 2026 16:27:06 +0100 Subject: [PATCH 28/33] Change package imports to scoped version Updated package import paths to use scoped package '@getbrevo/brevo'. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7843b98..83077ed 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,13 @@ ## Installation ```bash -npm install getbrevo/brevo +npm install @getbrevo/brevo ``` ## Quick Start ```typescript -import { BrevoClient } from 'getbrevo/brevo'; +import { BrevoClient } from '@getbrevo/brevo'; const brevo = new BrevoClient({ apiKey: 'your-api-key', @@ -54,7 +54,7 @@ const brevo = new BrevoClient({ The SDK throws specific error types based on HTTP status codes. ```typescript -import { BrevoError, UnauthorizedError, TooManyRequestsError } from 'getbrevo/brevo'; +import { BrevoError, UnauthorizedError, TooManyRequestsError } from '@getbrevo/brevo'; try { await brevo.transactionalEmails.sendTransacEmail({...}); @@ -241,7 +241,7 @@ URL.revokeObjectURL(url); All request and response types are exported. ```typescript -import { Brevo } from 'getbrevo/brevo'; +import { BrevoClient } from '@getbrevo/brevo'; const request: Brevo.SendTransacEmailRequest = { subject: "First email", From 2074806686922d7af12307a44aa7a8b66d66acf3 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 13:35:20 +0000 Subject: [PATCH 29/33] SDK regeneration --- .fern/metadata.json | 7 +- .github/workflows/ci.yml | 10 +- biome.json | 2 +- package.json | 360 +++++++++++++- pnpm-lock.yaml | 447 +++++++++-------- reference.md | 450 ++++++++++++------ src/BaseClient.ts | 4 +- src/api/resources/account/exports.ts | 4 + .../account/types/GetAccountResponse.ts | 2 +- src/api/resources/balance/client/Client.ts | 21 +- ...nceProgramsPidTransactionHistoryRequest.ts | 10 +- src/api/resources/balance/exports.ts | 4 + ...msPidTransactionHistoryRequestSortField.ts | 9 - src/api/resources/balance/types/index.ts | 1 - src/api/resources/companies/client/Client.ts | 139 ++++++ .../requests/DeleteCrmAttributesIdRequest.ts | 12 + .../requests/PatchCrmAttributesIdRequest.ts | 38 ++ .../companies/client/requests/index.ts | 2 + src/api/resources/companies/exports.ts | 4 + src/api/resources/contacts/client/Client.ts | 60 +-- .../requests/AddContactToListRequest.ts | 24 - .../requests/RemoveContactFromListRequest.ts | 32 -- src/api/resources/contacts/exports.ts | 4 + src/api/resources/conversations/exports.ts | 4 + src/api/resources/coupons/exports.ts | 4 + .../resources/customObjects/client/Client.ts | 20 +- .../client/requests/UpsertrecordsRequest.ts | 2 +- src/api/resources/customObjects/exports.ts | 4 + .../types/UpsertrecordsResponse.ts | 2 +- src/api/resources/deals/client/Client.ts | 2 + src/api/resources/deals/exports.ts | 4 + .../requests/AuthenticateDomainRequest.ts | 5 - .../client/requests/CreateDomainRequest.ts | 10 - .../requests/GetDomainConfigurationRequest.ts | 5 - src/api/resources/domains/exports.ts | 4 + src/api/resources/ecommerce/client/Client.ts | 6 +- .../requests/CreateBatchOrderRequest.ts | 3 +- src/api/resources/ecommerce/exports.ts | 4 + .../resources/emailCampaigns/client/Client.ts | 10 +- .../requests/GetEmailCampaignRequest.ts | 2 + src/api/resources/emailCampaigns/exports.ts | 4 + .../types/GetEmailCampaignResponse.ts | 7 + .../types/GetEmailCampaignsRequestStatus.ts | 2 + .../types/GetEmailCampaignsResponse.ts | 7 + src/api/resources/event/client/Client.ts | 73 +++ src/api/resources/event/exports.ts | 4 + src/api/resources/event/index.ts | 1 + .../types/CreateBatchEventsRequestItem.ts | 66 +++ src/api/resources/event/types/index.ts | 1 + .../requests/GetExternalFeedByUuidRequest.ts | 10 - src/api/resources/externalFeeds/exports.ts | 4 + src/api/resources/files/exports.ts | 4 + .../resources/inboundParsing/client/Client.ts | 1 + src/api/resources/inboundParsing/exports.ts | 4 + src/api/resources/index.ts | 1 + src/api/resources/masterAccount/exports.ts | 4 + src/api/resources/notes/exports.ts | 4 + src/api/resources/payments/exports.ts | 4 + .../client/requests/GetProcessRequest.ts | 15 - src/api/resources/process/exports.ts | 4 + src/api/resources/program/client/Client.ts | 91 ++++ .../DeleteContactSubscriptionRequest.ts | 15 + .../program/client/requests/index.ts | 1 + src/api/resources/program/exports.ts | 4 + src/api/resources/reward/exports.ts | 4 + .../client/requests/CreateSenderRequest.ts | 12 - .../requests/GetIpsFromSenderRequest.ts | 5 - .../client/requests/GetSendersRequest.ts | 3 - src/api/resources/senders/exports.ts | 4 + src/api/resources/smsCampaigns/exports.ts | 4 + src/api/resources/smsTemplates/exports.ts | 4 + src/api/resources/tasks/exports.ts | 4 + src/api/resources/tier/exports.ts | 4 + .../transactionalEmails/client/Client.ts | 8 +- .../requests/GetScheduledEmailByIdRequest.ts | 7 - .../resources/transactionalEmails/exports.ts | 4 + .../transactionalSms/client/Client.ts | 14 +- src/api/resources/transactionalSms/exports.ts | 4 + .../transactionalWhatsApp/client/Client.ts | 3 +- .../transactionalWhatsApp/exports.ts | 4 + src/api/resources/user/exports.ts | 4 + src/api/resources/webhooks/client/Client.ts | 20 +- .../client/requests/CreateWebhookRequest.ts | 2 + .../client/requests/UpdateWebhookRequest.ts | 2 + src/api/resources/webhooks/exports.ts | 4 + .../whatsAppCampaigns/client/Client.ts | 63 +-- .../resources/whatsAppCampaigns/exports.ts | 4 + src/api/types/BatchEventsResponse.ts | 30 ++ src/api/types/GetCampaignStats.ts | 4 +- src/api/types/GetExtendedCampaignOverview.ts | 7 + src/api/types/Order.ts | 14 +- src/api/types/SendTransacSms.ts | 4 + src/api/types/UpdateCampaignStatus.ts | 1 + src/api/types/index.ts | 1 + src/core/fetcher/Fetcher.ts | 1 + src/core/fetcher/makeRequest.ts | 28 ++ src/core/runtime/runtime.ts | 16 +- src/version.ts | 2 +- tests/mock-server/mockEndpointBuilder.ts | 15 +- tests/mock-server/withFormUrlEncoded.ts | 19 +- tests/unit/fetcher/makeRequest.test.ts | 106 ++++- tests/wire/balance.test.ts | 24 +- tests/wire/companies.test.ts | 113 +++++ tests/wire/ecommerce.test.ts | 32 +- tests/wire/emailCampaigns.test.ts | 12 + tests/wire/event.test.ts | 78 +++ tests/wire/program.test.ts | 139 ++++++ 107 files changed, 2146 insertions(+), 755 deletions(-) create mode 100644 src/api/resources/account/exports.ts create mode 100644 src/api/resources/balance/exports.ts delete mode 100644 src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts create mode 100644 src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts create mode 100644 src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts create mode 100644 src/api/resources/companies/exports.ts create mode 100644 src/api/resources/contacts/exports.ts create mode 100644 src/api/resources/conversations/exports.ts create mode 100644 src/api/resources/coupons/exports.ts create mode 100644 src/api/resources/customObjects/exports.ts create mode 100644 src/api/resources/deals/exports.ts create mode 100644 src/api/resources/domains/exports.ts create mode 100644 src/api/resources/ecommerce/exports.ts create mode 100644 src/api/resources/emailCampaigns/exports.ts create mode 100644 src/api/resources/event/exports.ts create mode 100644 src/api/resources/event/types/CreateBatchEventsRequestItem.ts create mode 100644 src/api/resources/event/types/index.ts create mode 100644 src/api/resources/externalFeeds/exports.ts create mode 100644 src/api/resources/files/exports.ts create mode 100644 src/api/resources/inboundParsing/exports.ts create mode 100644 src/api/resources/masterAccount/exports.ts create mode 100644 src/api/resources/notes/exports.ts create mode 100644 src/api/resources/payments/exports.ts create mode 100644 src/api/resources/process/exports.ts create mode 100644 src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts create mode 100644 src/api/resources/program/exports.ts create mode 100644 src/api/resources/reward/exports.ts create mode 100644 src/api/resources/senders/exports.ts create mode 100644 src/api/resources/smsCampaigns/exports.ts create mode 100644 src/api/resources/smsTemplates/exports.ts create mode 100644 src/api/resources/tasks/exports.ts create mode 100644 src/api/resources/tier/exports.ts create mode 100644 src/api/resources/transactionalEmails/exports.ts create mode 100644 src/api/resources/transactionalSms/exports.ts create mode 100644 src/api/resources/transactionalWhatsApp/exports.ts create mode 100644 src/api/resources/user/exports.ts create mode 100644 src/api/resources/webhooks/exports.ts create mode 100644 src/api/resources/whatsAppCampaigns/exports.ts create mode 100644 src/api/types/BatchEventsResponse.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index f41e74e..42039c4 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "3.85.3", + "cliVersion": "4.22.0", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.48.2", + "generatorVersion": "3.53.11", "generatorConfig": { "generateWireTests": true, "namespaceExport": "Brevo", @@ -15,5 +15,6 @@ } } }, - "sdkVersion": "4.0.3" + "originGitCommit": "306749c7d7549425dfc33ec33b6a91ea016d77c3", + "sdkVersion": "5.0.1" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c70c5b..7076aee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,5 +74,13 @@ jobs: elif [[ ${GITHUB_REF} == *beta* ]]; then publish --access public --tag beta else - publish --access public + PKG_NAME=$(node -p "require('./package.json').name") + PKG_VERSION=$(node -p "require('./package.json').version") + CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0") + if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then + echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})" + publish --access public --tag backport + else + publish --access public + fi fi \ No newline at end of file diff --git a/biome.json b/biome.json index 371d365..5084b70 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.3/schema.json", "root": true, "vcs": { "enabled": false diff --git a/package.json b/package.json index 88a9aea..fa52ec4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "4.0.3", + "version": "5.0.1", "private": false, "repository": { "type": "git", @@ -12,7 +12,6 @@ "types": "./dist/cjs/index.d.ts", "exports": { ".": { - "types": "./dist/cjs/index.d.ts", "import": { "types": "./dist/esm/index.d.mts", "default": "./dist/esm/index.mjs" @@ -23,6 +22,358 @@ }, "default": "./dist/cjs/index.js" }, + "./account": { + "import": { + "types": "./dist/esm/api/resources/account/exports.d.mts", + "default": "./dist/esm/api/resources/account/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/account/exports.d.ts", + "default": "./dist/cjs/api/resources/account/exports.js" + }, + "default": "./dist/cjs/api/resources/account/exports.js" + }, + "./masterAccount": { + "import": { + "types": "./dist/esm/api/resources/masterAccount/exports.d.mts", + "default": "./dist/esm/api/resources/masterAccount/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/masterAccount/exports.d.ts", + "default": "./dist/cjs/api/resources/masterAccount/exports.js" + }, + "default": "./dist/cjs/api/resources/masterAccount/exports.js" + }, + "./user": { + "import": { + "types": "./dist/esm/api/resources/user/exports.d.mts", + "default": "./dist/esm/api/resources/user/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/user/exports.d.ts", + "default": "./dist/cjs/api/resources/user/exports.js" + }, + "default": "./dist/cjs/api/resources/user/exports.js" + }, + "./process": { + "import": { + "types": "./dist/esm/api/resources/process/exports.d.mts", + "default": "./dist/esm/api/resources/process/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/process/exports.d.ts", + "default": "./dist/cjs/api/resources/process/exports.js" + }, + "default": "./dist/cjs/api/resources/process/exports.js" + }, + "./senders": { + "import": { + "types": "./dist/esm/api/resources/senders/exports.d.mts", + "default": "./dist/esm/api/resources/senders/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/senders/exports.d.ts", + "default": "./dist/cjs/api/resources/senders/exports.js" + }, + "default": "./dist/cjs/api/resources/senders/exports.js" + }, + "./domains": { + "import": { + "types": "./dist/esm/api/resources/domains/exports.d.mts", + "default": "./dist/esm/api/resources/domains/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/domains/exports.d.ts", + "default": "./dist/cjs/api/resources/domains/exports.js" + }, + "default": "./dist/cjs/api/resources/domains/exports.js" + }, + "./webhooks": { + "import": { + "types": "./dist/esm/api/resources/webhooks/exports.d.mts", + "default": "./dist/esm/api/resources/webhooks/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/webhooks/exports.d.ts", + "default": "./dist/cjs/api/resources/webhooks/exports.js" + }, + "default": "./dist/cjs/api/resources/webhooks/exports.js" + }, + "./externalFeeds": { + "import": { + "types": "./dist/esm/api/resources/externalFeeds/exports.d.mts", + "default": "./dist/esm/api/resources/externalFeeds/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/externalFeeds/exports.d.ts", + "default": "./dist/cjs/api/resources/externalFeeds/exports.js" + }, + "default": "./dist/cjs/api/resources/externalFeeds/exports.js" + }, + "./customObjects": { + "import": { + "types": "./dist/esm/api/resources/customObjects/exports.d.mts", + "default": "./dist/esm/api/resources/customObjects/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/customObjects/exports.d.ts", + "default": "./dist/cjs/api/resources/customObjects/exports.js" + }, + "default": "./dist/cjs/api/resources/customObjects/exports.js" + }, + "./contacts": { + "import": { + "types": "./dist/esm/api/resources/contacts/exports.d.mts", + "default": "./dist/esm/api/resources/contacts/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/contacts/exports.d.ts", + "default": "./dist/cjs/api/resources/contacts/exports.js" + }, + "default": "./dist/cjs/api/resources/contacts/exports.js" + }, + "./conversations": { + "import": { + "types": "./dist/esm/api/resources/conversations/exports.d.mts", + "default": "./dist/esm/api/resources/conversations/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/conversations/exports.d.ts", + "default": "./dist/cjs/api/resources/conversations/exports.js" + }, + "default": "./dist/cjs/api/resources/conversations/exports.js" + }, + "./ecommerce": { + "import": { + "types": "./dist/esm/api/resources/ecommerce/exports.d.mts", + "default": "./dist/esm/api/resources/ecommerce/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/ecommerce/exports.d.ts", + "default": "./dist/cjs/api/resources/ecommerce/exports.js" + }, + "default": "./dist/cjs/api/resources/ecommerce/exports.js" + }, + "./coupons": { + "import": { + "types": "./dist/esm/api/resources/coupons/exports.d.mts", + "default": "./dist/esm/api/resources/coupons/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/coupons/exports.d.ts", + "default": "./dist/cjs/api/resources/coupons/exports.js" + }, + "default": "./dist/cjs/api/resources/coupons/exports.js" + }, + "./payments": { + "import": { + "types": "./dist/esm/api/resources/payments/exports.d.mts", + "default": "./dist/esm/api/resources/payments/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/payments/exports.d.ts", + "default": "./dist/cjs/api/resources/payments/exports.js" + }, + "default": "./dist/cjs/api/resources/payments/exports.js" + }, + "./event": { + "import": { + "types": "./dist/esm/api/resources/event/exports.d.mts", + "default": "./dist/esm/api/resources/event/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/event/exports.d.ts", + "default": "./dist/cjs/api/resources/event/exports.js" + }, + "default": "./dist/cjs/api/resources/event/exports.js" + }, + "./inboundParsing": { + "import": { + "types": "./dist/esm/api/resources/inboundParsing/exports.d.mts", + "default": "./dist/esm/api/resources/inboundParsing/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/inboundParsing/exports.d.ts", + "default": "./dist/cjs/api/resources/inboundParsing/exports.js" + }, + "default": "./dist/cjs/api/resources/inboundParsing/exports.js" + }, + "./balance": { + "import": { + "types": "./dist/esm/api/resources/balance/exports.d.mts", + "default": "./dist/esm/api/resources/balance/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/balance/exports.d.ts", + "default": "./dist/cjs/api/resources/balance/exports.js" + }, + "default": "./dist/cjs/api/resources/balance/exports.js" + }, + "./program": { + "import": { + "types": "./dist/esm/api/resources/program/exports.d.mts", + "default": "./dist/esm/api/resources/program/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/program/exports.d.ts", + "default": "./dist/cjs/api/resources/program/exports.js" + }, + "default": "./dist/cjs/api/resources/program/exports.js" + }, + "./reward": { + "import": { + "types": "./dist/esm/api/resources/reward/exports.d.mts", + "default": "./dist/esm/api/resources/reward/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/reward/exports.d.ts", + "default": "./dist/cjs/api/resources/reward/exports.js" + }, + "default": "./dist/cjs/api/resources/reward/exports.js" + }, + "./tier": { + "import": { + "types": "./dist/esm/api/resources/tier/exports.d.mts", + "default": "./dist/esm/api/resources/tier/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/tier/exports.d.ts", + "default": "./dist/cjs/api/resources/tier/exports.js" + }, + "default": "./dist/cjs/api/resources/tier/exports.js" + }, + "./emailCampaigns": { + "import": { + "types": "./dist/esm/api/resources/emailCampaigns/exports.d.mts", + "default": "./dist/esm/api/resources/emailCampaigns/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/emailCampaigns/exports.d.ts", + "default": "./dist/cjs/api/resources/emailCampaigns/exports.js" + }, + "default": "./dist/cjs/api/resources/emailCampaigns/exports.js" + }, + "./smsCampaigns": { + "import": { + "types": "./dist/esm/api/resources/smsCampaigns/exports.d.mts", + "default": "./dist/esm/api/resources/smsCampaigns/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/smsCampaigns/exports.d.ts", + "default": "./dist/cjs/api/resources/smsCampaigns/exports.js" + }, + "default": "./dist/cjs/api/resources/smsCampaigns/exports.js" + }, + "./whatsAppCampaigns": { + "import": { + "types": "./dist/esm/api/resources/whatsAppCampaigns/exports.d.mts", + "default": "./dist/esm/api/resources/whatsAppCampaigns/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/whatsAppCampaigns/exports.d.ts", + "default": "./dist/cjs/api/resources/whatsAppCampaigns/exports.js" + }, + "default": "./dist/cjs/api/resources/whatsAppCampaigns/exports.js" + }, + "./companies": { + "import": { + "types": "./dist/esm/api/resources/companies/exports.d.mts", + "default": "./dist/esm/api/resources/companies/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/companies/exports.d.ts", + "default": "./dist/cjs/api/resources/companies/exports.js" + }, + "default": "./dist/cjs/api/resources/companies/exports.js" + }, + "./deals": { + "import": { + "types": "./dist/esm/api/resources/deals/exports.d.mts", + "default": "./dist/esm/api/resources/deals/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/deals/exports.d.ts", + "default": "./dist/cjs/api/resources/deals/exports.js" + }, + "default": "./dist/cjs/api/resources/deals/exports.js" + }, + "./files": { + "import": { + "types": "./dist/esm/api/resources/files/exports.d.mts", + "default": "./dist/esm/api/resources/files/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/files/exports.d.ts", + "default": "./dist/cjs/api/resources/files/exports.js" + }, + "default": "./dist/cjs/api/resources/files/exports.js" + }, + "./notes": { + "import": { + "types": "./dist/esm/api/resources/notes/exports.d.mts", + "default": "./dist/esm/api/resources/notes/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/notes/exports.d.ts", + "default": "./dist/cjs/api/resources/notes/exports.js" + }, + "default": "./dist/cjs/api/resources/notes/exports.js" + }, + "./tasks": { + "import": { + "types": "./dist/esm/api/resources/tasks/exports.d.mts", + "default": "./dist/esm/api/resources/tasks/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/tasks/exports.d.ts", + "default": "./dist/cjs/api/resources/tasks/exports.js" + }, + "default": "./dist/cjs/api/resources/tasks/exports.js" + }, + "./transactionalWhatsApp": { + "import": { + "types": "./dist/esm/api/resources/transactionalWhatsApp/exports.d.mts", + "default": "./dist/esm/api/resources/transactionalWhatsApp/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/transactionalWhatsApp/exports.d.ts", + "default": "./dist/cjs/api/resources/transactionalWhatsApp/exports.js" + }, + "default": "./dist/cjs/api/resources/transactionalWhatsApp/exports.js" + }, + "./transactionalEmails": { + "import": { + "types": "./dist/esm/api/resources/transactionalEmails/exports.d.mts", + "default": "./dist/esm/api/resources/transactionalEmails/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/transactionalEmails/exports.d.ts", + "default": "./dist/cjs/api/resources/transactionalEmails/exports.js" + }, + "default": "./dist/cjs/api/resources/transactionalEmails/exports.js" + }, + "./transactionalSms": { + "import": { + "types": "./dist/esm/api/resources/transactionalSms/exports.d.mts", + "default": "./dist/esm/api/resources/transactionalSms/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/transactionalSms/exports.d.ts", + "default": "./dist/cjs/api/resources/transactionalSms/exports.js" + }, + "default": "./dist/cjs/api/resources/transactionalSms/exports.js" + }, + "./smsTemplates": { + "import": { + "types": "./dist/esm/api/resources/smsTemplates/exports.d.mts", + "default": "./dist/esm/api/resources/smsTemplates/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/smsTemplates/exports.d.ts", + "default": "./dist/cjs/api/resources/smsTemplates/exports.js" + }, + "default": "./dist/cjs/api/resources/smsTemplates/exports.js" + }, "./package.json": "./package.json" }, "files": [ @@ -53,13 +404,14 @@ "msw": "2.11.2", "@types/node": "^18.19.70", "typescript": "~5.7.2", - "@biomejs/biome": "2.3.11" + "@biomejs/biome": "2.4.3" }, "browser": { "fs": false, "os": false, "path": false, - "stream": false + "stream": false, + "crypto": false }, "packageManager": "pnpm@10.20.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08ec090..0e5535f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: 2.3.11 - version: 2.3.11 + specifier: 2.4.3 + version: 2.4.3 '@types/node': specifier: ^18.19.70 version: 18.19.130 @@ -19,7 +19,7 @@ importers: version: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) ts-loader: specifier: ^9.5.1 - version: 9.5.4(typescript@5.7.3)(webpack@5.105.2) + version: 9.5.4(typescript@5.7.3)(webpack@5.105.4) typescript: specifier: ~5.7.2 version: 5.7.3 @@ -28,59 +28,59 @@ importers: version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0) webpack: specifier: ^5.97.1 - version: 5.105.2 + version: 5.105.4 packages: - '@biomejs/biome@2.3.11': - resolution: {integrity: sha512-/zt+6qazBWguPG6+eWmiELqO+9jRsMZ/DBU3lfuU2ngtIQYzymocHhKiZRyrbra4aCOoyTg/BmY+6WH5mv9xmQ==} + '@biomejs/biome@2.4.3': + resolution: {integrity: sha512-cBrjf6PNF6yfL8+kcNl85AjiK2YHNsbU0EvDOwiZjBPbMbQ5QcgVGFpjD0O52p8nec5O8NYw7PKw3xUR7fPAkQ==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.3.11': - resolution: {integrity: sha512-/uXXkBcPKVQY7rc9Ys2CrlirBJYbpESEDme7RKiBD6MmqR2w3j0+ZZXRIL2xiaNPsIMMNhP1YnA+jRRxoOAFrA==} + '@biomejs/cli-darwin-arm64@2.4.3': + resolution: {integrity: sha512-eOafSFlI/CF4id2tlwq9CVHgeEqvTL5SrhWff6ZORp6S3NL65zdsR3ugybItkgF8Pf4D9GSgtbB6sE3UNgOM9w==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.3.11': - resolution: {integrity: sha512-fh7nnvbweDPm2xEmFjfmq7zSUiox88plgdHF9OIW4i99WnXrAC3o2P3ag9judoUMv8FCSUnlwJCM1B64nO5Fbg==} + '@biomejs/cli-darwin-x64@2.4.3': + resolution: {integrity: sha512-V2+av4ilbWcBMNufTtMMXVW00nPwyIjI5qf7n9wSvUaZ+tt0EvMGk46g9sAFDJBEDOzSyoRXiSP6pCvKTOEbPA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.3.11': - resolution: {integrity: sha512-XPSQ+XIPZMLaZ6zveQdwNjbX+QdROEd1zPgMwD47zvHV+tCGB88VH+aynyGxAHdzL+Tm/+DtKST5SECs4iwCLg==} + '@biomejs/cli-linux-arm64-musl@2.4.3': + resolution: {integrity: sha512-QuFzvsGo8BA4Xm7jGX5idkw6BqFblcCPySMTvq0AhGYnhUej5VJIDJbmTKfHqwjHepZiC4fA+T5i6wmiZolZNw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@2.3.11': - resolution: {integrity: sha512-l4xkGa9E7Uc0/05qU2lMYfN1H+fzzkHgaJoy98wO+b/7Gl78srbCRRgwYSW+BTLixTBrM6Ede5NSBwt7rd/i6g==} + '@biomejs/cli-linux-arm64@2.4.3': + resolution: {integrity: sha512-0m+O0x9FgK99FAwDK+fiDtjs2wnqq7bvfj17KJVeCkTwT/liI+Q9njJG7lwXK0iSJVXeFNRIxukpVI3SifMYAA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@2.3.11': - resolution: {integrity: sha512-vU7a8wLs5C9yJ4CB8a44r12aXYb8yYgBn+WeyzbMjaCMklzCv1oXr8x+VEyWodgJt9bDmhiaW/I0RHbn7rsNmw==} + '@biomejs/cli-linux-x64-musl@2.4.3': + resolution: {integrity: sha512-qEc0OCpj/uytruQ4wLM0yWNJLZy0Up8H1Er5MW3SrstqM6J2d4XqdNA86xzCy8MQCHpoVZ3lFye3GBlIL4/ljw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@2.3.11': - resolution: {integrity: sha512-/1s9V/H3cSe0r0Mv/Z8JryF5x9ywRxywomqZVLHAoa/uN0eY7F8gEngWKNS5vbbN/BsfpCG5yeBT5ENh50Frxg==} + '@biomejs/cli-linux-x64@2.4.3': + resolution: {integrity: sha512-NVqh0saIU0u5OfOp/0jFdlKRE59+XyMvWmtx0f6Nm/2OpdxBl04coRIftBbY9d1gfu+23JVv4CItAqPYrjYh5w==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@2.3.11': - resolution: {integrity: sha512-PZQ6ElCOnkYapSsysiTy0+fYX+agXPlWugh6+eQ6uPKI3vKAqNp6TnMhoM3oY2NltSB89hz59o8xIfOdyhi9Iw==} + '@biomejs/cli-win32-arm64@2.4.3': + resolution: {integrity: sha512-gRO96vrIARilv/Cp2ZnmNNL5LSZg3RO75GPp13hsLO3N4YVpE7saaMDp2bcyV48y2N2Pbit1brkGVGta0yd6VQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.3.11': - resolution: {integrity: sha512-43VrG813EW+b5+YbDbz31uUsheX+qFKCpXeY9kfdAx+ww3naKxeVkTD9zLIWxUPfJquANMHrmW3wbe/037G0Qg==} + '@biomejs/cli-win32-x64@2.4.3': + resolution: {integrity: sha512-vSm/vOJe06pf14aGHfHl3Ar91Nlx4YYmohElDJ+17UbRwe99n987S/MhAlQOkONqf1utJor04ChkCPmKb8SWdw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -311,128 +311,128 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@rollup/rollup-android-arm-eabi@4.57.1': - resolution: {integrity: sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==} + '@rollup/rollup-android-arm-eabi@4.59.0': + resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.57.1': - resolution: {integrity: sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==} + '@rollup/rollup-android-arm64@4.59.0': + resolution: {integrity: sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.57.1': - resolution: {integrity: sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==} + '@rollup/rollup-darwin-arm64@4.59.0': + resolution: {integrity: sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.57.1': - resolution: {integrity: sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==} + '@rollup/rollup-darwin-x64@4.59.0': + resolution: {integrity: sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.57.1': - resolution: {integrity: sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==} + '@rollup/rollup-freebsd-arm64@4.59.0': + resolution: {integrity: sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.57.1': - resolution: {integrity: sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==} + '@rollup/rollup-freebsd-x64@4.59.0': + resolution: {integrity: sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.57.1': - resolution: {integrity: sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==} + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.57.1': - resolution: {integrity: sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==} + '@rollup/rollup-linux-arm-musleabihf@4.59.0': + resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.57.1': - resolution: {integrity: sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==} + '@rollup/rollup-linux-arm64-gnu@4.59.0': + resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.57.1': - resolution: {integrity: sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==} + '@rollup/rollup-linux-arm64-musl@4.59.0': + resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.57.1': - resolution: {integrity: sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==} + '@rollup/rollup-linux-loong64-gnu@4.59.0': + resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-loong64-musl@4.57.1': - resolution: {integrity: sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==} + '@rollup/rollup-linux-loong64-musl@4.59.0': + resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.57.1': - resolution: {integrity: sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==} + '@rollup/rollup-linux-ppc64-gnu@4.59.0': + resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-ppc64-musl@4.57.1': - resolution: {integrity: sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==} + '@rollup/rollup-linux-ppc64-musl@4.59.0': + resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.57.1': - resolution: {integrity: sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==} + '@rollup/rollup-linux-riscv64-gnu@4.59.0': + resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.57.1': - resolution: {integrity: sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==} + '@rollup/rollup-linux-riscv64-musl@4.59.0': + resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.57.1': - resolution: {integrity: sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==} + '@rollup/rollup-linux-s390x-gnu@4.59.0': + resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.57.1': - resolution: {integrity: sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==} + '@rollup/rollup-linux-x64-gnu@4.59.0': + resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.57.1': - resolution: {integrity: sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==} + '@rollup/rollup-linux-x64-musl@4.59.0': + resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} cpu: [x64] os: [linux] - '@rollup/rollup-openbsd-x64@4.57.1': - resolution: {integrity: sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==} + '@rollup/rollup-openbsd-x64@4.59.0': + resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.57.1': - resolution: {integrity: sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==} + '@rollup/rollup-openharmony-arm64@4.59.0': + resolution: {integrity: sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.57.1': - resolution: {integrity: sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==} + '@rollup/rollup-win32-arm64-msvc@4.59.0': + resolution: {integrity: sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.57.1': - resolution: {integrity: sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==} + '@rollup/rollup-win32-ia32-msvc@4.59.0': + resolution: {integrity: sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.57.1': - resolution: {integrity: sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==} + '@rollup/rollup-win32-x64-gnu@4.59.0': + resolution: {integrity: sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.57.1': - resolution: {integrity: sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==} + '@rollup/rollup-win32-x64-msvc@4.59.0': + resolution: {integrity: sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==} cpu: [x64] os: [win32] @@ -549,8 +549,8 @@ packages: peerDependencies: acorn: ^8.14.0 - acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} engines: {node: '>=0.4.0'} hasBin: true @@ -567,8 +567,8 @@ packages: peerDependencies: ajv: ^8.8.2 - ajv@8.17.1: - resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + ajv@8.18.0: + resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -582,8 +582,9 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - baseline-browser-mapping@2.9.19: - resolution: {integrity: sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==} + baseline-browser-mapping@2.10.0: + resolution: {integrity: sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==} + engines: {node: '>=6.0.0'} hasBin: true braces@3.0.3: @@ -602,8 +603,8 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - caniuse-lite@1.0.30001769: - resolution: {integrity: sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==} + caniuse-lite@1.0.30001777: + resolution: {integrity: sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==} chai@5.3.3: resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} @@ -656,14 +657,14 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} - electron-to-chromium@1.5.286: - resolution: {integrity: sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==} + electron-to-chromium@1.5.307: + resolution: {integrity: sha512-5z3uFKBWjiNR44nFcYdkcXjKMbg5KXNdciu7mhTPo9tB7NbqSNP2sSnGR+fqknZSCwKkBN+oxiiajWs4dT6ORg==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enhanced-resolve@5.19.0: - resolution: {integrity: sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==} + enhanced-resolve@5.20.0: + resolution: {integrity: sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ==} engines: {node: '>=10.13.0'} es-module-lexer@1.7.0: @@ -742,8 +743,8 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphql@16.12.0: - resolution: {integrity: sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==} + graphql@16.13.1: + resolution: {integrity: sha512-gGgrVCoDKlIZ8fIqXBBb0pPKqDgki0Z/FSKNiQzSGj2uEYHr1tq5wmBegGwJx6QB5S5cM0khSBpi/JFHMCvsmQ==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} has-flag@4.0.0: @@ -827,8 +828,8 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - node-releases@2.0.27: - resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} + node-releases@2.0.36: + resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} outvariant@1.4.3: resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} @@ -854,13 +855,10 @@ packages: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} - postcss@8.5.6: - resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + postcss@8.5.8: + resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} engines: {node: ^10 || ^12 || >=14} - randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -872,14 +870,11 @@ packages: rettime@0.7.0: resolution: {integrity: sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==} - rollup@4.57.1: - resolution: {integrity: sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==} + rollup@4.59.0: + resolution: {integrity: sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - schema-utils@4.3.3: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} @@ -889,9 +884,6 @@ packages: engines: {node: '>=10'} hasBin: true - serialize-javascript@6.0.2: - resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} - siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -950,8 +942,8 @@ packages: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} - terser-webpack-plugin@5.3.16: - resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} + terser-webpack-plugin@5.4.0: + resolution: {integrity: sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==} engines: {node: '>= 10.13.0'} peerDependencies: '@swc/core': '*' @@ -993,11 +985,11 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} - tldts-core@7.0.23: - resolution: {integrity: sha512-0g9vrtDQLrNIiCj22HSe9d4mLVG3g5ph5DZ8zCKBr4OtrspmNB6ss7hVyzArAeE88ceZocIEGkyW1Ime7fxPtQ==} + tldts-core@7.0.25: + resolution: {integrity: sha512-ZjCZK0rppSBu7rjHYDYsEaMOIbbT+nWF57hKkv4IUmZWBNrBWBOjIElc0mKRgLM8bm7x/BBlof6t2gi/Oq/Asw==} - tldts@7.0.23: - resolution: {integrity: sha512-ASdhgQIBSay0R/eXggAkQ53G4nTJqTXqC2kbaBbdDwM7SkjyZyO0OaaN1/FH7U/yCeqOHDwFO5j8+Os/IS1dXw==} + tldts@7.0.25: + resolution: {integrity: sha512-keinCnPbwXEUG3ilrWQZU+CqcTTzHq9m2HhoUP2l7Xmi8l1LuijAXLpAJ5zRW+ifKTNscs4NdCkfkDCBYm352w==} hasBin: true to-regex-range@5.0.1: @@ -1110,12 +1102,12 @@ packages: resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} engines: {node: '>=10.13.0'} - webpack-sources@3.3.3: - resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} + webpack-sources@3.3.4: + resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} engines: {node: '>=10.13.0'} - webpack@5.105.2: - resolution: {integrity: sha512-dRXm0a2qcHPUBEzVk8uph0xWSjV/xZxenQQbLwnwP7caQCYpqG1qddwlyEkIDkYn0K8tvmcrZ+bOrzoQ3HxCDw==} + webpack@5.105.4: + resolution: {integrity: sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -1155,39 +1147,39 @@ packages: snapshots: - '@biomejs/biome@2.3.11': + '@biomejs/biome@2.4.3': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.3.11 - '@biomejs/cli-darwin-x64': 2.3.11 - '@biomejs/cli-linux-arm64': 2.3.11 - '@biomejs/cli-linux-arm64-musl': 2.3.11 - '@biomejs/cli-linux-x64': 2.3.11 - '@biomejs/cli-linux-x64-musl': 2.3.11 - '@biomejs/cli-win32-arm64': 2.3.11 - '@biomejs/cli-win32-x64': 2.3.11 - - '@biomejs/cli-darwin-arm64@2.3.11': + '@biomejs/cli-darwin-arm64': 2.4.3 + '@biomejs/cli-darwin-x64': 2.4.3 + '@biomejs/cli-linux-arm64': 2.4.3 + '@biomejs/cli-linux-arm64-musl': 2.4.3 + '@biomejs/cli-linux-x64': 2.4.3 + '@biomejs/cli-linux-x64-musl': 2.4.3 + '@biomejs/cli-win32-arm64': 2.4.3 + '@biomejs/cli-win32-x64': 2.4.3 + + '@biomejs/cli-darwin-arm64@2.4.3': optional: true - '@biomejs/cli-darwin-x64@2.3.11': + '@biomejs/cli-darwin-x64@2.4.3': optional: true - '@biomejs/cli-linux-arm64-musl@2.3.11': + '@biomejs/cli-linux-arm64-musl@2.4.3': optional: true - '@biomejs/cli-linux-arm64@2.3.11': + '@biomejs/cli-linux-arm64@2.4.3': optional: true - '@biomejs/cli-linux-x64-musl@2.3.11': + '@biomejs/cli-linux-x64-musl@2.4.3': optional: true - '@biomejs/cli-linux-x64@2.3.11': + '@biomejs/cli-linux-x64@2.4.3': optional: true - '@biomejs/cli-win32-arm64@2.3.11': + '@biomejs/cli-win32-arm64@2.4.3': optional: true - '@biomejs/cli-win32-x64@2.3.11': + '@biomejs/cli-win32-x64@2.4.3': optional: true '@bundled-es-modules/cookie@2.0.1': @@ -1341,79 +1333,79 @@ snapshots: '@open-draft/until@2.1.0': {} - '@rollup/rollup-android-arm-eabi@4.57.1': + '@rollup/rollup-android-arm-eabi@4.59.0': optional: true - '@rollup/rollup-android-arm64@4.57.1': + '@rollup/rollup-android-arm64@4.59.0': optional: true - '@rollup/rollup-darwin-arm64@4.57.1': + '@rollup/rollup-darwin-arm64@4.59.0': optional: true - '@rollup/rollup-darwin-x64@4.57.1': + '@rollup/rollup-darwin-x64@4.59.0': optional: true - '@rollup/rollup-freebsd-arm64@4.57.1': + '@rollup/rollup-freebsd-arm64@4.59.0': optional: true - '@rollup/rollup-freebsd-x64@4.57.1': + '@rollup/rollup-freebsd-x64@4.59.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.57.1': + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.57.1': + '@rollup/rollup-linux-arm-musleabihf@4.59.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.57.1': + '@rollup/rollup-linux-arm64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.57.1': + '@rollup/rollup-linux-arm64-musl@4.59.0': optional: true - '@rollup/rollup-linux-loong64-gnu@4.57.1': + '@rollup/rollup-linux-loong64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-loong64-musl@4.57.1': + '@rollup/rollup-linux-loong64-musl@4.59.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.57.1': + '@rollup/rollup-linux-ppc64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-ppc64-musl@4.57.1': + '@rollup/rollup-linux-ppc64-musl@4.59.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.57.1': + '@rollup/rollup-linux-riscv64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.57.1': + '@rollup/rollup-linux-riscv64-musl@4.59.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.57.1': + '@rollup/rollup-linux-s390x-gnu@4.59.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.57.1': + '@rollup/rollup-linux-x64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-x64-musl@4.57.1': + '@rollup/rollup-linux-x64-musl@4.59.0': optional: true - '@rollup/rollup-openbsd-x64@4.57.1': + '@rollup/rollup-openbsd-x64@4.59.0': optional: true - '@rollup/rollup-openharmony-arm64@4.57.1': + '@rollup/rollup-openharmony-arm64@4.59.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.57.1': + '@rollup/rollup-win32-arm64-msvc@4.59.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.57.1': + '@rollup/rollup-win32-ia32-msvc@4.59.0': optional: true - '@rollup/rollup-win32-x64-gnu@4.57.1': + '@rollup/rollup-win32-x64-gnu@4.59.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.57.1': + '@rollup/rollup-win32-x64-msvc@4.59.0': optional: true '@types/chai@5.2.3': @@ -1568,22 +1560,22 @@ snapshots: '@xtuc/long@4.2.2': {} - acorn-import-phases@1.0.4(acorn@8.15.0): + acorn-import-phases@1.0.4(acorn@8.16.0): dependencies: - acorn: 8.15.0 + acorn: 8.16.0 - acorn@8.15.0: {} + acorn@8.16.0: {} - ajv-formats@2.1.1(ajv@8.17.1): + ajv-formats@2.1.1(ajv@8.18.0): optionalDependencies: - ajv: 8.17.1 + ajv: 8.18.0 - ajv-keywords@5.1.0(ajv@8.17.1): + ajv-keywords@5.1.0(ajv@8.18.0): dependencies: - ajv: 8.17.1 + ajv: 8.18.0 fast-deep-equal: 3.1.3 - ajv@8.17.1: + ajv@8.18.0: dependencies: fast-deep-equal: 3.1.3 fast-uri: 3.1.0 @@ -1598,7 +1590,7 @@ snapshots: assertion-error@2.0.1: {} - baseline-browser-mapping@2.9.19: {} + baseline-browser-mapping@2.10.0: {} braces@3.0.3: dependencies: @@ -1606,17 +1598,17 @@ snapshots: browserslist@4.28.1: dependencies: - baseline-browser-mapping: 2.9.19 - caniuse-lite: 1.0.30001769 - electron-to-chromium: 1.5.286 - node-releases: 2.0.27 + baseline-browser-mapping: 2.10.0 + caniuse-lite: 1.0.30001777 + electron-to-chromium: 1.5.307 + node-releases: 2.0.36 update-browserslist-db: 1.2.3(browserslist@4.28.1) buffer-from@1.1.2: {} cac@6.7.14: {} - caniuse-lite@1.0.30001769: {} + caniuse-lite@1.0.30001777: {} chai@5.3.3: dependencies: @@ -1659,11 +1651,11 @@ snapshots: deep-eql@5.0.2: {} - electron-to-chromium@1.5.286: {} + electron-to-chromium@1.5.307: {} emoji-regex@8.0.0: {} - enhanced-resolve@5.19.0: + enhanced-resolve@5.20.0: dependencies: graceful-fs: 4.2.11 tapable: 2.3.0 @@ -1745,7 +1737,7 @@ snapshots: graceful-fs@4.2.11: {} - graphql@16.12.0: {} + graphql@16.13.1: {} has-flag@4.0.0: {} @@ -1802,7 +1794,7 @@ snapshots: '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 '@types/statuses': 2.0.6 - graphql: 16.12.0 + graphql: 16.13.1 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 @@ -1824,7 +1816,7 @@ snapshots: neo-async@2.6.2: {} - node-releases@2.0.27: {} + node-releases@2.0.36: {} outvariant@1.4.3: {} @@ -1840,68 +1832,58 @@ snapshots: picomatch@4.0.3: {} - postcss@8.5.6: + postcss@8.5.8: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 - randombytes@2.1.0: - dependencies: - safe-buffer: 5.2.1 - require-directory@2.1.1: {} require-from-string@2.0.2: {} rettime@0.7.0: {} - rollup@4.57.1: + rollup@4.59.0: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.57.1 - '@rollup/rollup-android-arm64': 4.57.1 - '@rollup/rollup-darwin-arm64': 4.57.1 - '@rollup/rollup-darwin-x64': 4.57.1 - '@rollup/rollup-freebsd-arm64': 4.57.1 - '@rollup/rollup-freebsd-x64': 4.57.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.57.1 - '@rollup/rollup-linux-arm-musleabihf': 4.57.1 - '@rollup/rollup-linux-arm64-gnu': 4.57.1 - '@rollup/rollup-linux-arm64-musl': 4.57.1 - '@rollup/rollup-linux-loong64-gnu': 4.57.1 - '@rollup/rollup-linux-loong64-musl': 4.57.1 - '@rollup/rollup-linux-ppc64-gnu': 4.57.1 - '@rollup/rollup-linux-ppc64-musl': 4.57.1 - '@rollup/rollup-linux-riscv64-gnu': 4.57.1 - '@rollup/rollup-linux-riscv64-musl': 4.57.1 - '@rollup/rollup-linux-s390x-gnu': 4.57.1 - '@rollup/rollup-linux-x64-gnu': 4.57.1 - '@rollup/rollup-linux-x64-musl': 4.57.1 - '@rollup/rollup-openbsd-x64': 4.57.1 - '@rollup/rollup-openharmony-arm64': 4.57.1 - '@rollup/rollup-win32-arm64-msvc': 4.57.1 - '@rollup/rollup-win32-ia32-msvc': 4.57.1 - '@rollup/rollup-win32-x64-gnu': 4.57.1 - '@rollup/rollup-win32-x64-msvc': 4.57.1 + '@rollup/rollup-android-arm-eabi': 4.59.0 + '@rollup/rollup-android-arm64': 4.59.0 + '@rollup/rollup-darwin-arm64': 4.59.0 + '@rollup/rollup-darwin-x64': 4.59.0 + '@rollup/rollup-freebsd-arm64': 4.59.0 + '@rollup/rollup-freebsd-x64': 4.59.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.59.0 + '@rollup/rollup-linux-arm-musleabihf': 4.59.0 + '@rollup/rollup-linux-arm64-gnu': 4.59.0 + '@rollup/rollup-linux-arm64-musl': 4.59.0 + '@rollup/rollup-linux-loong64-gnu': 4.59.0 + '@rollup/rollup-linux-loong64-musl': 4.59.0 + '@rollup/rollup-linux-ppc64-gnu': 4.59.0 + '@rollup/rollup-linux-ppc64-musl': 4.59.0 + '@rollup/rollup-linux-riscv64-gnu': 4.59.0 + '@rollup/rollup-linux-riscv64-musl': 4.59.0 + '@rollup/rollup-linux-s390x-gnu': 4.59.0 + '@rollup/rollup-linux-x64-gnu': 4.59.0 + '@rollup/rollup-linux-x64-musl': 4.59.0 + '@rollup/rollup-openbsd-x64': 4.59.0 + '@rollup/rollup-openharmony-arm64': 4.59.0 + '@rollup/rollup-win32-arm64-msvc': 4.59.0 + '@rollup/rollup-win32-ia32-msvc': 4.59.0 + '@rollup/rollup-win32-x64-gnu': 4.59.0 + '@rollup/rollup-win32-x64-msvc': 4.59.0 fsevents: 2.3.3 - safe-buffer@5.2.1: {} - schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.17.1 - ajv-formats: 2.1.1(ajv@8.17.1) - ajv-keywords: 5.1.0(ajv@8.17.1) + ajv: 8.18.0 + ajv-formats: 2.1.1(ajv@8.18.0) + ajv-keywords: 5.1.0(ajv@8.18.0) semver@7.7.4: {} - serialize-javascript@6.0.2: - dependencies: - randombytes: 2.1.0 - siginfo@2.0.0: {} signal-exit@4.1.0: {} @@ -1949,19 +1931,18 @@ snapshots: tapable@2.3.0: {} - terser-webpack-plugin@5.3.16(webpack@5.105.2): + terser-webpack-plugin@5.4.0(webpack@5.105.4): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 - serialize-javascript: 6.0.2 terser: 5.46.0 - webpack: 5.105.2 + webpack: 5.105.4 terser@5.46.0: dependencies: '@jridgewell/source-map': 0.3.11 - acorn: 8.15.0 + acorn: 8.16.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -1980,11 +1961,11 @@ snapshots: tinyspy@4.0.4: {} - tldts-core@7.0.23: {} + tldts-core@7.0.25: {} - tldts@7.0.23: + tldts@7.0.25: dependencies: - tldts-core: 7.0.23 + tldts-core: 7.0.25 to-regex-range@5.0.1: dependencies: @@ -1992,17 +1973,17 @@ snapshots: tough-cookie@6.0.0: dependencies: - tldts: 7.0.23 + tldts: 7.0.25 - ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.2): + ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.4): dependencies: chalk: 4.1.2 - enhanced-resolve: 5.19.0 + enhanced-resolve: 5.20.0 micromatch: 4.0.8 semver: 7.7.4 source-map: 0.7.6 typescript: 5.7.3 - webpack: 5.105.2 + webpack: 5.105.4 type-fest@4.41.0: {} @@ -2042,8 +2023,8 @@ snapshots: esbuild: 0.27.3 fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 - postcss: 8.5.6 - rollup: 4.57.1 + postcss: 8.5.8 + rollup: 4.59.0 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 18.19.130 @@ -2096,9 +2077,9 @@ snapshots: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - webpack-sources@3.3.3: {} + webpack-sources@3.3.4: {} - webpack@5.105.2: + webpack@5.105.4: dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.8 @@ -2106,11 +2087,11 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.15.0 - acorn-import-phases: 1.0.4(acorn@8.15.0) + acorn: 8.16.0 + acorn-import-phases: 1.0.4(acorn@8.16.0) browserslist: 4.28.1 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.19.0 + enhanced-resolve: 5.20.0 es-module-lexer: 2.0.0 eslint-scope: 5.1.1 events: 3.3.0 @@ -2122,9 +2103,9 @@ snapshots: neo-async: 2.6.2 schema-utils: 4.3.3 tapable: 2.3.0 - terser-webpack-plugin: 5.3.16(webpack@5.105.2) + terser-webpack-plugin: 5.4.0(webpack@5.105.4) watchpack: 2.5.1 - webpack-sources: 3.3.3 + webpack-sources: 3.3.4 transitivePeerDependencies: - '@swc/core' - esbuild diff --git a/reference.md b/reference.md index 6309719..dfaf381 100644 --- a/reference.md +++ b/reference.md @@ -3638,22 +3638,16 @@ await client.webhooks.createWebhook({
- -To have it activated please send us a request and we will activate it for your account. + +This is an enterprise feature. Contact us to activate it for your account. -Exports webhook event history to CSV format for analysis and reporting. - -Use this to: -- Generate comprehensive webhook event reports -- Analyze webhook delivery patterns and success rates -- Export event data for external analysis tools -- Create historical reports for compliance and auditing -- Track webhook performance and reliability metrics +Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body. -Key information returned: -- Process ID for tracking export completion -- CSV file will be delivered to specified webhook URL +Use this endpoint to: +- Export webhook event history filtered by date range, event type, or email address +- Generate reports for compliance, auditing, or performance analysis +- Track delivery patterns and webhook reliability over time
@@ -4381,12 +4375,8 @@ await client.externalFeeds.deleteExternalFeed({
- -Custom objects are only available to Enterprise plans. - -This feature is in beta. These are subject to change. - - +Custom objects are only available to Enterprise plans. +This feature is in beta. These are subject to change. This API allows bulk upsert of object records in a single request. Each object record may include - Attributes - Identifiers @@ -4400,8 +4390,8 @@ This API allows bulk upsert of object records in a single request. Each object r - Max 500 attributes defined per object record upsert request - This is coherent with schema limitation: an object cannot have more than 500 attributes. - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - - Max 10 associations defined per object record upsert request - - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. + - Max 10 associations defined per associated object type, in each record of the request + - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests. **Errors:** - Make sure both object records exist before associating them, else the API will return an error. - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". @@ -4470,12 +4460,8 @@ await client.customObjects.upsertrecords({
- -Custom objects are only available to Enterprise plans. - -This feature is in beta. These are subject to change. - - +Custom objects are only available to Enterprise plans. +This feature is in beta. These are subject to change. This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint.
@@ -4606,26 +4592,6 @@ await client.customObjects.batchDeleteObjectRecords({
-#### 📝 Description - -
-
- -
-
- - -Accepted Number Formats - -91xxxxxxxxxx -+91xxxxxxxxxx -0091xxxxxxxxxx - -
-
-
-
- #### 🔌 Usage
@@ -4683,6 +4649,8 @@ await client.contacts.getContacts();
+Follow this format when passing a "SMS" phone number as an attribute. +Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx Creates new contacts on Brevo. Contacts can be created by passing either -

1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
@@ -5045,9 +5013,7 @@ await client.contacts.updateBatchContacts();
- -attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. - +attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.
@@ -5180,17 +5146,11 @@ await client.contacts.requestContactExport({
- -Ongoing changes for this endpoint - +Ongoing changes for this endpoint We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - These are non breaking changes. - The default value for the attributes will be 0. - -The uniqueSubscribers field is deprecated - +The uniqueSubscribers field is deprecated
@@ -5302,13 +5262,9 @@ await client.contacts.createFolder({});
- -Ongoing changes for this endpoint. - +Ongoing changes for this endpoint. We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - -These are non breaking changes. The default value for the attributes will be 0. - +These are non breaking changes. The default value for the attributes will be 0.
@@ -5476,13 +5432,9 @@ await client.contacts.deleteFolder({
- -Ongoing changes for this endpoint. - +Ongoing changes for this endpoint. We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - -These are non breaking changes. The default value for the attributes will be 0. - +These are non breaking changes. The default value for the attributes will be 0.
@@ -5610,13 +5562,9 @@ await client.contacts.importContacts();
- -Ongoing changes for this endpoint. - +Ongoing changes for this endpoint. We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - -These are non breaking changes. The default value for the attributes will be 0. - +These are non breaking changes. The default value for the attributes will be 0.
@@ -6092,14 +6040,8 @@ await client.contacts.getSegments();
- -Accepted Number Formats - -91xxxxxxxxxx -+91xxxxxxxxxx -0091xxxxxxxxxx - - +Follow this format when passing a "SMS" phone number as an attribute. +Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx There are 2 ways to get a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
@@ -6165,6 +6107,8 @@ await client.contacts.getContactInfo({
+Follow this format when passing a "SMS" phone number as an attribute. +Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx There are 2 ways to update a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
@@ -7525,8 +7469,7 @@ await client.ecommerce.createOrder({ id: "14", products: [{ price: 99.99, - productId: "P1", - quantity: 10 + productId: "P1" }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z" @@ -7600,8 +7543,7 @@ await client.ecommerce.createBatchOrder({ id: "14", products: [{ price: 99.99, - productId: "P1", - quantity: 10 + productId: "P1" }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z" @@ -8378,6 +8320,72 @@ await client.event.createEvent({ + + + + +
client.event.createBatchEvents({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create multiple events to track contacts' interactions in a single request. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.event.createBatchEvents([{ + event_name: "order_created", + identifiers: {} + }]); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateBatchEventsRequestItem[]` + +
+
+ +
+
+ +**requestOptions:** `EventClient.RequestOptions` + +
+
+
+
+ +
@@ -9550,8 +9558,8 @@ Returns transaction history ```typescript await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id" + contactId: 1, + balanceDefinitionId: "balanceDefinitionId" }); ``` @@ -10238,6 +10246,72 @@ await client.program.getParameterSubscriptionInfo({ + + + + +
client.program.deleteContactSubscription({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete subscription for a contact +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteContactSubscriptionRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ +
@@ -11844,11 +11918,8 @@ await client.tier.deleteTier({
- -The response payload for this endpoint has changed - -You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). - +The response payload for this endpoint has changed +You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
@@ -13172,19 +13243,11 @@ await client.whatsAppCampaigns.getWhatsAppCampaigns();
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - - - -This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - -[Get all the Segments](https://developers.brevo.com/reference/getsegments) - +[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -13252,11 +13315,8 @@ await client.whatsAppCampaigns.createWhatsAppCampaign({
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -13311,11 +13371,8 @@ await client.whatsAppCampaigns.getWhatsAppConfig();
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -13432,11 +13489,8 @@ await client.whatsAppCampaigns.getWhatsAppTemplates();
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -13501,11 +13555,11 @@ await client.whatsAppCampaigns.sendWhatsAppTemplateApproval({
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. +[Get all the Lists](https://developers.brevo.com/reference/getlists-1) +[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -13570,19 +13624,11 @@ await client.whatsAppCampaigns.getWhatsAppCampaign({
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - - - -This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - -[Get all the Segments](https://developers.brevo.com/reference/getsegments) - +[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -14103,6 +14149,108 @@ await client.companies.createACompanyDealAttribute({ + + + + +
client.companies.deleteAnAttribute({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.deleteAnAttribute({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCrmAttributesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.updateAnAttribute({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.updateAnAttribute({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PatchCrmAttributesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ +
@@ -15527,7 +15675,8 @@ await client.tasks.getAllTaskTypes();
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**)
@@ -16262,13 +16411,9 @@ await client.transactionalEmails.getTransacEmailsList();
- -You can get the uuid using either of the following methods: - +You can get the uuid using either of the following methods: Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response. - -The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. - +The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL.
@@ -16918,15 +17063,9 @@ await client.transactionalEmails.sendTestTemplate({
- -If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. - -Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. - - - -Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. - +If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. +Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. +Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.
@@ -17228,3 +17367,4 @@ await client.smsTemplates.getSmsTemplates(); + diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 87ddfe0..662fab3 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions> { - const { - pid, - limit, - offset, - sort_field: sortField, - sort, - contact_id: contactId, - balance_definition_id: balanceDefinitionId, - filters, - } = request; + const { pid, limit, offset, sortField, sort, contactId, balanceDefinitionId, filters } = request; const _queryParams: Record = { limit, offset, - sort_field: sortField != null ? sortField : undefined, + sortField: sortField != null ? sortField : undefined, sort: sort != null ? sort : undefined, - contact_id: contactId, - balance_definition_id: balanceDefinitionId, + contactId, + balanceDefinitionId, filters, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); diff --git a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts index 0f78401..4e44bdd 100644 --- a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts +++ b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts @@ -6,8 +6,8 @@ import type * as Brevo from "../../../../index.js"; * @example * { * pid: "pid", - * contact_id: 1, - * balance_definition_id: "balance_definition_id" + * contactId: 1, + * balanceDefinitionId: "balanceDefinitionId" * } */ export interface GetLoyaltyBalanceProgramsPidTransactionHistoryRequest { @@ -18,13 +18,13 @@ export interface GetLoyaltyBalanceProgramsPidTransactionHistoryRequest { /** Skip a number of records */ offset?: number; /** Field to sort by */ - sort_field?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField; + sortField?: "createdAt"; /** Sort order, either asc or desc */ sort?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort; /** Contact ID */ - contact_id: number; + contactId: number; /** Balance Definition ID */ - balance_definition_id: string; + balanceDefinitionId: string; /** Filters to apply */ filters?: string | string[]; } diff --git a/src/api/resources/balance/exports.ts b/src/api/resources/balance/exports.ts new file mode 100644 index 0000000..7d8e9e6 --- /dev/null +++ b/src/api/resources/balance/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { BalanceClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts deleted file mode 100644 index 06c550c..0000000 --- a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField = { - Name: "name", - CreatedAt: "created_at", - UpdatedAt: "updated_at", -} as const; -export type GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField = - (typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField)[keyof typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField]; diff --git a/src/api/resources/balance/types/index.ts b/src/api/resources/balance/types/index.ts index 80b736d..6ede06d 100644 --- a/src/api/resources/balance/types/index.ts +++ b/src/api/resources/balance/types/index.ts @@ -7,7 +7,6 @@ export * from "./GetBalanceDefinitionRequestVersion.js"; export * from "./GetBalanceLimitRequestVersion.js"; export * from "./GetContactBalancesResponse.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.js"; -export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.js"; export * from "./GetSubscriptionBalancesResponse.js"; export * from "./PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.js"; diff --git a/src/api/resources/companies/client/Client.ts b/src/api/resources/companies/client/Client.ts index e10046a..025cc1c 100644 --- a/src/api/resources/companies/client/Client.ts +++ b/src/api/resources/companies/client/Client.ts @@ -590,6 +590,145 @@ export class CompaniesClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/attributes"); } + /** + * @param {Brevo.DeleteCrmAttributesIdRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.companies.deleteAnAttribute({ + * id: "id" + * }) + */ + public deleteAnAttribute( + request: Brevo.DeleteCrmAttributesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteAnAttribute(request, requestOptions)); + } + + private async __deleteAnAttribute( + request: Brevo.DeleteCrmAttributesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/attributes/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/crm/attributes/{id}"); + } + + /** + * @param {Brevo.PatchCrmAttributesIdRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.companies.updateAnAttribute({ + * id: "id" + * }) + */ + public updateAnAttribute( + request: Brevo.PatchCrmAttributesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateAnAttribute(request, requestOptions)); + } + + private async __updateAnAttribute( + request: Brevo.PatchCrmAttributesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/attributes/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/crm/attributes/{id}"); + } + /** * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * diff --git a/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts b/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts new file mode 100644 index 0000000..69f8d3e --- /dev/null +++ b/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteCrmAttributesIdRequest { + /** Attribute ID */ + id: string; +} diff --git a/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts b/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts new file mode 100644 index 0000000..dce4554 --- /dev/null +++ b/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts @@ -0,0 +1,38 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface PatchCrmAttributesIdRequest { + /** Attribute ID */ + id: string; + /** Attribute display label */ + label?: string; + /** Updated labels for selectable options */ + optionsLabels?: PatchCrmAttributesIdRequest.OptionsLabels.Item[]; + /** The type of object the attribute belongs to, it cannot be updated after creation */ + objectType?: PatchCrmAttributesIdRequest.ObjectType; +} + +export namespace PatchCrmAttributesIdRequest { + export type OptionsLabels = OptionsLabels.Item[]; + + export namespace OptionsLabels { + export interface Item { + /** Internal option identifier */ + key: string; + /** Display label for the option */ + value: string; + } + } + + /** The type of object the attribute belongs to, it cannot be updated after creation */ + export const ObjectType = { + Companies: "companies", + Deals: "deals", + } as const; + export type ObjectType = (typeof ObjectType)[keyof typeof ObjectType]; +} diff --git a/src/api/resources/companies/client/requests/index.ts b/src/api/resources/companies/client/requests/index.ts index 0d519c9..d3b626f 100644 --- a/src/api/resources/companies/client/requests/index.ts +++ b/src/api/resources/companies/client/requests/index.ts @@ -1,8 +1,10 @@ export type { DeleteCompaniesIdRequest } from "./DeleteCompaniesIdRequest.js"; +export type { DeleteCrmAttributesIdRequest } from "./DeleteCrmAttributesIdRequest.js"; export type { GetCompaniesIdRequest } from "./GetCompaniesIdRequest.js"; export type { GetCompaniesRequest } from "./GetCompaniesRequest.js"; export type { PatchCompaniesIdRequest } from "./PatchCompaniesIdRequest.js"; export type { PatchCompaniesLinkUnlinkIdRequest } from "./PatchCompaniesLinkUnlinkIdRequest.js"; +export { PatchCrmAttributesIdRequest } from "./PatchCrmAttributesIdRequest.js"; export type { PostCompaniesImportRequest } from "./PostCompaniesImportRequest.js"; export type { PostCompaniesRequest } from "./PostCompaniesRequest.js"; export { PostCrmAttributesRequest } from "./PostCrmAttributesRequest.js"; diff --git a/src/api/resources/companies/exports.ts b/src/api/resources/companies/exports.ts new file mode 100644 index 0000000..2ca4d18 --- /dev/null +++ b/src/api/resources/companies/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CompaniesClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/contacts/client/Client.ts b/src/api/resources/contacts/client/Client.ts index 535274e..ffe5862 100644 --- a/src/api/resources/contacts/client/Client.ts +++ b/src/api/resources/contacts/client/Client.ts @@ -23,14 +23,6 @@ export class ContactsClient { } /** - * - * Accepted Number Formats - * - * 91xxxxxxxxxx - * +91xxxxxxxxxx - * 0091xxxxxxxxxx - * - * * @param {Brevo.GetContactsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -110,6 +102,8 @@ export class ContactsClient { } /** + * Follow this format when passing a "SMS" phone number as an attribute. + * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx * Creates new contacts on Brevo. Contacts can be created by passing either -

1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
* * @param {Brevo.CreateContactRequest} request @@ -600,9 +594,7 @@ export class ContactsClient { } /** - * - * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. - * + * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. * * @param {Brevo.CreateDoiContactRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -754,17 +746,11 @@ export class ContactsClient { } /** - * - * Ongoing changes for this endpoint - * + * Ongoing changes for this endpoint * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * * These are non breaking changes. - * * The default value for the attributes will be 0. - * - * The uniqueSubscribers field is deprecated - * + * The uniqueSubscribers field is deprecated * * @param {Brevo.GetFoldersRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -899,13 +885,9 @@ export class ContactsClient { } /** - * - * Ongoing changes for this endpoint. - * + * Ongoing changes for this endpoint. * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * - * These are non breaking changes. The default value for the attributes will be 0. - * + * These are non breaking changes. The default value for the attributes will be 0. * * @param {Brevo.GetFolderRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1120,13 +1102,9 @@ export class ContactsClient { } /** - * - * Ongoing changes for this endpoint. - * + * Ongoing changes for this endpoint. * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * - * These are non breaking changes. The default value for the attributes will be 0. - * + * These are non breaking changes. The default value for the attributes will be 0. * * @param {Brevo.GetFolderListsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1273,13 +1251,9 @@ export class ContactsClient { } /** - * - * Ongoing changes for this endpoint. - * + * Ongoing changes for this endpoint. * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * - * These are non breaking changes. The default value for the attributes will be 0. - * + * These are non breaking changes. The default value for the attributes will be 0. * * @param {Brevo.GetListsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1973,14 +1947,8 @@ export class ContactsClient { } /** - * - * Accepted Number Formats - * - * 91xxxxxxxxxx - * +91xxxxxxxxxx - * 0091xxxxxxxxxx - * - * + * Follow this format when passing a "SMS" phone number as an attribute. + * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx * There are 2 ways to get a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges. * * @param {Brevo.GetContactInfoRequest} request @@ -2056,6 +2024,8 @@ export class ContactsClient { } /** + * Follow this format when passing a "SMS" phone number as an attribute. + * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx * There are 2 ways to update a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute * * @param {Brevo.UpdateContactRequest} request diff --git a/src/api/resources/contacts/client/requests/AddContactToListRequest.ts b/src/api/resources/contacts/client/requests/AddContactToListRequest.ts index 0cfa627..2ce05f9 100644 --- a/src/api/resources/contacts/client/requests/AddContactToListRequest.ts +++ b/src/api/resources/contacts/client/requests/AddContactToListRequest.ts @@ -26,30 +26,6 @@ import type * as Brevo from "../../../../index.js"; * ids: [1, 2] * } * } - * - * @example - * { - * listId: 1000000, - * body: { - * emails: ["jeff32@example.com", "jim56@example.com"] - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * emails: ["jeff32@example.com", "jim56@example.com"] - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * emails: ["jeff32@example.com", "jim56@example.com"] - * } - * } */ export interface AddContactToListRequest { /** Id of the list */ diff --git a/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts b/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts index 860544a..edb52db 100644 --- a/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts +++ b/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts @@ -34,38 +34,6 @@ import type * as Brevo from "../../../../index.js"; * ids: [1, 2] * } * } - * - * @example - * { - * listId: 1000000, - * body: { - * all: true - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * all: true - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * all: true - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * all: true - * } - * } */ export interface RemoveContactFromListRequest { /** Id of the list */ diff --git a/src/api/resources/contacts/exports.ts b/src/api/resources/contacts/exports.ts new file mode 100644 index 0000000..657fdf5 --- /dev/null +++ b/src/api/resources/contacts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ContactsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/conversations/exports.ts b/src/api/resources/conversations/exports.ts new file mode 100644 index 0000000..82be4a7 --- /dev/null +++ b/src/api/resources/conversations/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ConversationsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/coupons/exports.ts b/src/api/resources/coupons/exports.ts new file mode 100644 index 0000000..8bd048a --- /dev/null +++ b/src/api/resources/coupons/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CouponsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/customObjects/client/Client.ts b/src/api/resources/customObjects/client/Client.ts index 4d8d8ff..012c9ad 100644 --- a/src/api/resources/customObjects/client/Client.ts +++ b/src/api/resources/customObjects/client/Client.ts @@ -23,12 +23,8 @@ export class CustomObjectsClient { } /** - * - * Custom objects are only available to Enterprise plans. - * - * This feature is in beta. These are subject to change. - * - * + * Custom objects are only available to Enterprise plans. + * This feature is in beta. These are subject to change. * This API allows bulk upsert of object records in a single request. Each object record may include * - Attributes * - Identifiers @@ -42,8 +38,8 @@ export class CustomObjectsClient { * - Max 500 attributes defined per object record upsert request * - This is coherent with schema limitation: an object cannot have more than 500 attributes. * - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - * - Max 10 associations defined per object record upsert request - * - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. + * - Max 10 associations defined per associated object type, in each record of the request + * - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests. * **Errors:** * - Make sure both object records exist before associating them, else the API will return an error. * - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". @@ -131,12 +127,8 @@ export class CustomObjectsClient { } /** - * - * Custom objects are only available to Enterprise plans. - * - * This feature is in beta. These are subject to change. - * - * + * Custom objects are only available to Enterprise plans. + * This feature is in beta. These are subject to change. * This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint. * * @param {Brevo.GetrecordsRequest} request diff --git a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts index faf7fb5..36e0ce2 100644 --- a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts +++ b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts @@ -20,7 +20,7 @@ export namespace UpsertrecordsRequest { export namespace Records { export interface Item { associations?: Item.Associations.Item[] | undefined; - /** Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required. */ + /** Attributes attached with the object record. Only the already created attributes will be used with records. Pass the value with the attributes key you want to set or update for the object record. Minimum 1 attribute is required. */ attributes?: Record | undefined; /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request. */ identifiers?: Item.Identifiers | undefined; diff --git a/src/api/resources/customObjects/exports.ts b/src/api/resources/customObjects/exports.ts new file mode 100644 index 0000000..5be143e --- /dev/null +++ b/src/api/resources/customObjects/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomObjectsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts index bc889e6..d7b1c12 100644 --- a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts +++ b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts @@ -2,6 +2,6 @@ export interface UpsertrecordsResponse { message?: string | undefined; - /** Unique Id for the batch process used to track the status of the batch. */ + /** Unique Id for the batch process used to track the status of the batch. **How to use this processId:** Refer to the [Get process status API](https://developers.brevo.com/reference/get-process) to check the execution status of this batch using the returned `processId`. */ processId?: number | undefined; } diff --git a/src/api/resources/deals/client/Client.ts b/src/api/resources/deals/client/Client.ts index ffb26c4..d0e428b 100644 --- a/src/api/resources/deals/client/Client.ts +++ b/src/api/resources/deals/client/Client.ts @@ -584,6 +584,8 @@ export class DealsClient { } /** + * @deprecated + * * This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. * * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/deals/exports.ts b/src/api/resources/deals/exports.ts new file mode 100644 index 0000000..1c1e9ee --- /dev/null +++ b/src/api/resources/deals/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { DealsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts b/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts index 7b80387..b5071d8 100644 --- a/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts +++ b/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts @@ -1,11 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * domainName: "domainName" - * } - * * @example * { * domainName: "domainName" diff --git a/src/api/resources/domains/client/requests/CreateDomainRequest.ts b/src/api/resources/domains/client/requests/CreateDomainRequest.ts index acb9725..09e38e9 100644 --- a/src/api/resources/domains/client/requests/CreateDomainRequest.ts +++ b/src/api/resources/domains/client/requests/CreateDomainRequest.ts @@ -15,16 +15,6 @@ * { * name: "test.example.com" * } - * - * @example - * { - * name: "mycompany.com" - * } - * - * @example - * { - * name: "mycompany.com" - * } */ export interface CreateDomainRequest { /** Domain name to be added */ diff --git a/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts b/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts index 03b367f..a9880eb 100644 --- a/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts +++ b/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts @@ -1,11 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * domainName: "domainName" - * } - * * @example * { * domainName: "domainName" diff --git a/src/api/resources/domains/exports.ts b/src/api/resources/domains/exports.ts new file mode 100644 index 0000000..7752741 --- /dev/null +++ b/src/api/resources/domains/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { DomainsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index a3b3a4a..b85d222 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -856,8 +856,7 @@ export class EcommerceClient { * id: "14", * products: [{ * price: 99.99, - * productId: "P1", - * quantity: 10 + * productId: "P1" * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" @@ -935,8 +934,7 @@ export class EcommerceClient { * id: "14", * products: [{ * price: 99.99, - * productId: "P1", - * quantity: 10 + * productId: "P1" * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" diff --git a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts index fcecd5a..62a9c47 100644 --- a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts @@ -11,8 +11,7 @@ import type * as Brevo from "../../../../index.js"; * id: "14", * products: [{ * price: 99.99, - * productId: "P1", - * quantity: 10 + * productId: "P1" * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" diff --git a/src/api/resources/ecommerce/exports.ts b/src/api/resources/ecommerce/exports.ts new file mode 100644 index 0000000..924f6e2 --- /dev/null +++ b/src/api/resources/ecommerce/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EcommerceClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/emailCampaigns/client/Client.ts b/src/api/resources/emailCampaigns/client/Client.ts index 29f1aa1..d9758c5 100644 --- a/src/api/resources/emailCampaigns/client/Client.ts +++ b/src/api/resources/emailCampaigns/client/Client.ts @@ -23,11 +23,8 @@ export class EmailCampaignsClient { } /** - * - * The response payload for this endpoint has changed - * - * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). - * + * The response payload for this endpoint has changed + * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). * * @param {Brevo.GetEmailCampaignsRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -270,9 +267,10 @@ export class EmailCampaignsClient { request: Brevo.GetEmailCampaignRequest, requestOptions?: EmailCampaignsClient.RequestOptions, ): Promise> { - const { campaignId, statistics } = request; + const { campaignId, statistics, excludeHtmlContent } = request; const _queryParams: Record = { statistics: statistics != null ? statistics : undefined, + excludeHtmlContent, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( diff --git a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts index d77d4ef..d176a52 100644 --- a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts +++ b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts @@ -13,4 +13,6 @@ export interface GetEmailCampaignRequest { campaignId: number; /** Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. */ statistics?: Brevo.GetEmailCampaignRequestStatistics; + /** Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body */ + excludeHtmlContent?: boolean; } diff --git a/src/api/resources/emailCampaigns/exports.ts b/src/api/resources/emailCampaigns/exports.ts new file mode 100644 index 0000000..d63193f --- /dev/null +++ b/src/api/resources/emailCampaigns/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EmailCampaignsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts index 990d630..a6642f8 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts @@ -3,6 +3,8 @@ import type * as Brevo from "../../../index.js"; export interface GetEmailCampaignResponse { + /** Url of the attachment file. Only available if the campaign has an attachment. */ + attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -58,6 +60,8 @@ export interface GetEmailCampaignResponse { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; + /** List of tags of the campaign */ + tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -82,6 +86,9 @@ export namespace GetEmailCampaignResponse { Queued: "queued", Suspended: "suspended", InProcess: "in_process", + InReview: "in_review", + Cancelling: "cancelling", + Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts index a7f4447..7e4058e 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts @@ -8,6 +8,8 @@ export const GetEmailCampaignsRequestStatus = { Draft: "draft", InProcess: "inProcess", InReview: "inReview", + Cancelling: "cancelling", + Cancelled: "cancelled", } as const; export type GetEmailCampaignsRequestStatus = (typeof GetEmailCampaignsRequestStatus)[keyof typeof GetEmailCampaignsRequestStatus]; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts index 4811eba..71d563b 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts @@ -13,6 +13,8 @@ export namespace GetEmailCampaignsResponse { export namespace Campaigns { export interface Item { + /** Url of the attachment file. Only available if the campaign has an attachment. */ + attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -68,6 +70,8 @@ export namespace GetEmailCampaignsResponse { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; + /** List of tags of the campaign */ + tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -92,6 +96,9 @@ export namespace GetEmailCampaignsResponse { Queued: "queued", Suspended: "suspended", InProcess: "in_process", + InReview: "in_review", + Cancelling: "cancelling", + Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/resources/event/client/Client.ts b/src/api/resources/event/client/Client.ts index 3d70be3..8ec429f 100644 --- a/src/api/resources/event/client/Client.ts +++ b/src/api/resources/event/client/Client.ts @@ -94,4 +94,77 @@ export class EventClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/events"); } + + /** + * Create multiple events to track contacts' interactions in a single request. + * + * @param {Brevo.CreateBatchEventsRequestItem[]} request + * @param {EventClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * + * @example + * await client.event.createBatchEvents([{ + * event_name: "order_created", + * identifiers: {} + * }]) + */ + public createBatchEvents( + request: Brevo.CreateBatchEventsRequestItem[], + requestOptions?: EventClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createBatchEvents(request, requestOptions)); + } + + private async __createBatchEvents( + request: Brevo.CreateBatchEventsRequestItem[], + requestOptions?: EventClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "events/batch", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/events/batch"); + } } diff --git a/src/api/resources/event/exports.ts b/src/api/resources/event/exports.ts new file mode 100644 index 0000000..f341a0f --- /dev/null +++ b/src/api/resources/event/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EventClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/event/index.ts b/src/api/resources/event/index.ts index 914b8c3..d9adb1a 100644 --- a/src/api/resources/event/index.ts +++ b/src/api/resources/event/index.ts @@ -1 +1,2 @@ export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/event/types/CreateBatchEventsRequestItem.ts b/src/api/resources/event/types/CreateBatchEventsRequestItem.ts new file mode 100644 index 0000000..2ccc0ac --- /dev/null +++ b/src/api/resources/event/types/CreateBatchEventsRequestItem.ts @@ -0,0 +1,66 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateBatchEventsRequestItem { + /** Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **"FIRSTNAME": "Jane" , "AGE": 37** */ + contact_properties?: Record | undefined; + /** Timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used. */ + event_date?: string | undefined; + /** The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. */ + event_name: string; + /** Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. */ + event_properties?: Record | undefined; + /** Identifies the contact associated with the event. At least one identifier is required. */ + identifiers: CreateBatchEventsRequestItem.Identifiers; + /** Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. */ + object?: CreateBatchEventsRequestItem.Object_ | undefined; +} + +export namespace CreateBatchEventsRequestItem { + export namespace ContactProperties { + export type Value = string | number; + } + + export namespace EventProperties { + export type Value = string | number | Record | unknown[]; + } + + /** + * Identifies the contact associated with the event. At least one identifier is required. + */ + export interface Identifiers { + /** Internal unique contact ID. When present, this takes priority over all other identifiers for event attribution and contact resolution. */ + contact_id?: number | undefined; + /** Email Id associated with the event */ + email_id?: string | undefined; + /** ext_id associated with the event */ + ext_id?: string | undefined; + /** landline_number associated with the event */ + landline_number_id?: string | undefined; + /** SMS associated with the event */ + phone_id?: string | undefined; + /** whatsapp associated with the event */ + whatsapp_id?: string | undefined; + } + + /** + * Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. + */ + export interface Object_ { + /** Identifiers for the object. */ + identifiers?: Object_.Identifiers | undefined; + /** Type of object (e.g., subscription, vehicle, etc.) */ + type?: string | undefined; + } + + export namespace Object_ { + /** + * Identifiers for the object. + */ + export interface Identifiers { + /** External object ID */ + ext_id?: string | undefined; + /** Internal object ID */ + id?: string | undefined; + } + } +} diff --git a/src/api/resources/event/types/index.ts b/src/api/resources/event/types/index.ts new file mode 100644 index 0000000..b2fea88 --- /dev/null +++ b/src/api/resources/event/types/index.ts @@ -0,0 +1 @@ +export * from "./CreateBatchEventsRequestItem.js"; diff --git a/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts b/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts index 4f01391..bd3f468 100644 --- a/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts +++ b/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts @@ -1,16 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" - * } - * - * @example - * { - * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" - * } - * * @example * { * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" diff --git a/src/api/resources/externalFeeds/exports.ts b/src/api/resources/externalFeeds/exports.ts new file mode 100644 index 0000000..c87b185 --- /dev/null +++ b/src/api/resources/externalFeeds/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ExternalFeedsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/files/exports.ts b/src/api/resources/files/exports.ts new file mode 100644 index 0000000..679b539 --- /dev/null +++ b/src/api/resources/files/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { FilesClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/inboundParsing/client/Client.ts b/src/api/resources/inboundParsing/client/Client.ts index c33ce9e..1691671 100644 --- a/src/api/resources/inboundParsing/client/Client.ts +++ b/src/api/resources/inboundParsing/client/Client.ts @@ -167,6 +167,7 @@ export class InboundParsingClient { /** * This endpoint will retrieve inbound attachment with download token. + * * @throws {@link Brevo.BadRequestError} * @throws {@link Brevo.NotFoundError} */ diff --git a/src/api/resources/inboundParsing/exports.ts b/src/api/resources/inboundParsing/exports.ts new file mode 100644 index 0000000..e380874 --- /dev/null +++ b/src/api/resources/inboundParsing/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { InboundParsingClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index b4c41cb..7252a47 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -33,6 +33,7 @@ export * as emailCampaigns from "./emailCampaigns/index.js"; export * from "./emailCampaigns/types/index.js"; export * from "./event/client/requests/index.js"; export * as event from "./event/index.js"; +export * from "./event/types/index.js"; export * from "./externalFeeds/client/requests/index.js"; export * as externalFeeds from "./externalFeeds/index.js"; export * from "./externalFeeds/types/index.js"; diff --git a/src/api/resources/masterAccount/exports.ts b/src/api/resources/masterAccount/exports.ts new file mode 100644 index 0000000..2eeb5e1 --- /dev/null +++ b/src/api/resources/masterAccount/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { MasterAccountClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/notes/exports.ts b/src/api/resources/notes/exports.ts new file mode 100644 index 0000000..13f20ba --- /dev/null +++ b/src/api/resources/notes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { NotesClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/payments/exports.ts b/src/api/resources/payments/exports.ts new file mode 100644 index 0000000..8e9673c --- /dev/null +++ b/src/api/resources/payments/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PaymentsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/process/client/requests/GetProcessRequest.ts b/src/api/resources/process/client/requests/GetProcessRequest.ts index 8ead15f..3e45723 100644 --- a/src/api/resources/process/client/requests/GetProcessRequest.ts +++ b/src/api/resources/process/client/requests/GetProcessRequest.ts @@ -1,21 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * processId: 1000000 - * } - * - * @example - * { - * processId: 1000000 - * } - * - * @example - * { - * processId: 1000000 - * } - * * @example * { * processId: 1000000 diff --git a/src/api/resources/process/exports.ts b/src/api/resources/process/exports.ts new file mode 100644 index 0000000..0b1e905 --- /dev/null +++ b/src/api/resources/process/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ProcessClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/program/client/Client.ts b/src/api/resources/program/client/Client.ts index 35e679a..e2823b6 100644 --- a/src/api/resources/program/client/Client.ts +++ b/src/api/resources/program/client/Client.ts @@ -651,6 +651,97 @@ export class ProgramClient { ); } + /** + * Delete subscription for a contact + * + * @param {Brevo.DeleteContactSubscriptionRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.deleteContactSubscription({ + * pid: "pid", + * cid: 1 + * }) + */ + public deleteContactSubscription( + request: Brevo.DeleteContactSubscriptionRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteContactSubscription(request, requestOptions)); + } + + private async __deleteContactSubscription( + request: Brevo.DeleteContactSubscriptionRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid, cid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}/contact/${core.url.encodePathParam(cid)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/config/programs/{pid}/contact/{cid}", + ); + } + /** * Publishes loyalty program * diff --git a/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts b/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts new file mode 100644 index 0000000..947fb1a --- /dev/null +++ b/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * cid: 1 + * } + */ +export interface DeleteContactSubscriptionRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; + /** Contact ID. */ + cid: number; +} diff --git a/src/api/resources/program/client/requests/index.ts b/src/api/resources/program/client/requests/index.ts index 1bac46c..277ff1d 100644 --- a/src/api/resources/program/client/requests/index.ts +++ b/src/api/resources/program/client/requests/index.ts @@ -1,5 +1,6 @@ export type { CreateNewLpRequest } from "./CreateNewLpRequest.js"; export type { DeleteContactMembersRequest } from "./DeleteContactMembersRequest.js"; +export type { DeleteContactSubscriptionRequest } from "./DeleteContactSubscriptionRequest.js"; export type { DeleteLoyaltyProgramRequest } from "./DeleteLoyaltyProgramRequest.js"; export type { GetLoyaltyProgramInfoRequest } from "./GetLoyaltyProgramInfoRequest.js"; export type { GetLpListRequest } from "./GetLpListRequest.js"; diff --git a/src/api/resources/program/exports.ts b/src/api/resources/program/exports.ts new file mode 100644 index 0000000..ca64af9 --- /dev/null +++ b/src/api/resources/program/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ProgramClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/reward/exports.ts b/src/api/resources/reward/exports.ts new file mode 100644 index 0000000..606509a --- /dev/null +++ b/src/api/resources/reward/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { RewardClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/senders/client/requests/CreateSenderRequest.ts b/src/api/resources/senders/client/requests/CreateSenderRequest.ts index 9fc4ae9..d6566d4 100644 --- a/src/api/resources/senders/client/requests/CreateSenderRequest.ts +++ b/src/api/resources/senders/client/requests/CreateSenderRequest.ts @@ -32,18 +32,6 @@ * }], * name: "Newsletter" * } - * - * @example - * { - * email: "support@example.com", - * name: "Support Team" - * } - * - * @example - * { - * email: "support@example.com", - * name: "Support Team" - * } */ export interface CreateSenderRequest { /** diff --git a/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts b/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts index c90da79..82259b1 100644 --- a/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts +++ b/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts @@ -1,11 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * senderId: 1000000 - * } - * * @example * { * senderId: 1000000 diff --git a/src/api/resources/senders/client/requests/GetSendersRequest.ts b/src/api/resources/senders/client/requests/GetSendersRequest.ts index 78e6525..2538f7b 100644 --- a/src/api/resources/senders/client/requests/GetSendersRequest.ts +++ b/src/api/resources/senders/client/requests/GetSendersRequest.ts @@ -1,9 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/senders/exports.ts b/src/api/resources/senders/exports.ts new file mode 100644 index 0000000..5e2aeb8 --- /dev/null +++ b/src/api/resources/senders/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SendersClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/smsCampaigns/exports.ts b/src/api/resources/smsCampaigns/exports.ts new file mode 100644 index 0000000..470a71e --- /dev/null +++ b/src/api/resources/smsCampaigns/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SmsCampaignsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/smsTemplates/exports.ts b/src/api/resources/smsTemplates/exports.ts new file mode 100644 index 0000000..0fcb7e5 --- /dev/null +++ b/src/api/resources/smsTemplates/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SmsTemplatesClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/tasks/exports.ts b/src/api/resources/tasks/exports.ts new file mode 100644 index 0000000..f7e668f --- /dev/null +++ b/src/api/resources/tasks/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TasksClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/tier/exports.ts b/src/api/resources/tier/exports.ts new file mode 100644 index 0000000..32def3d --- /dev/null +++ b/src/api/resources/tier/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TierClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/transactionalEmails/client/Client.ts b/src/api/resources/transactionalEmails/client/Client.ts index 45e8cb4..4d7da71 100644 --- a/src/api/resources/transactionalEmails/client/Client.ts +++ b/src/api/resources/transactionalEmails/client/Client.ts @@ -761,13 +761,9 @@ export class TransactionalEmailsClient { } /** - * - * You can get the uuid using either of the following methods: - * + * You can get the uuid using either of the following methods: * Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response. - * - * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. - * + * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. * * @param {Brevo.GetTransacEmailContentRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts index 235c13c..1f724df 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts @@ -3,13 +3,6 @@ import type * as Brevo from "../../../../index.js"; /** - * @example - * { - * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", - * startDate: "2022-02-02", - * endDate: "2022-03-02" - * } - * * @example * { * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", diff --git a/src/api/resources/transactionalEmails/exports.ts b/src/api/resources/transactionalEmails/exports.ts new file mode 100644 index 0000000..88be674 --- /dev/null +++ b/src/api/resources/transactionalEmails/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TransactionalEmailsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/transactionalSms/client/Client.ts b/src/api/resources/transactionalSms/client/Client.ts index e945006..3ad1b61 100644 --- a/src/api/resources/transactionalSms/client/Client.ts +++ b/src/api/resources/transactionalSms/client/Client.ts @@ -23,15 +23,9 @@ export class TransactionalSmsClient { } /** - * - * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. - * - * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. - * - * - * - * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. - * + * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. + * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. + * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. * * @param {Brevo.SendTransacSms} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -104,6 +98,8 @@ export class TransactionalSmsClient { } /** + * @deprecated + * * @param {Brevo.SendTransacSms} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. * diff --git a/src/api/resources/transactionalSms/exports.ts b/src/api/resources/transactionalSms/exports.ts new file mode 100644 index 0000000..7605e1e --- /dev/null +++ b/src/api/resources/transactionalSms/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TransactionalSmsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/transactionalWhatsApp/client/Client.ts b/src/api/resources/transactionalWhatsApp/client/Client.ts index f50da6e..9ef4c07 100644 --- a/src/api/resources/transactionalWhatsApp/client/Client.ts +++ b/src/api/resources/transactionalWhatsApp/client/Client.ts @@ -23,7 +23,8 @@ export class TransactionalWhatsAppClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) * * @param {Brevo.SendWhatsappMessageRequest} request diff --git a/src/api/resources/transactionalWhatsApp/exports.ts b/src/api/resources/transactionalWhatsApp/exports.ts new file mode 100644 index 0000000..361c1d0 --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TransactionalWhatsAppClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/user/exports.ts b/src/api/resources/user/exports.ts new file mode 100644 index 0000000..8f9b9cd --- /dev/null +++ b/src/api/resources/user/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { UserClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index b995b0b..1ce80b5 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -187,22 +187,16 @@ export class WebhooksClient { } /** - * - * To have it activated please send us a request and we will activate it for your account. + * + * This is an enterprise feature. Contact us to activate it for your account. * * - * Exports webhook event history to CSV format for analysis and reporting. + * Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body. * - * Use this to: - * - Generate comprehensive webhook event reports - * - Analyze webhook delivery patterns and success rates - * - Export event data for external analysis tools - * - Create historical reports for compliance and auditing - * - Track webhook performance and reliability metrics - * - * Key information returned: - * - Process ID for tracking export completion - * - CSV file will be delivered to specified webhook URL + * Use this endpoint to: + * - Export webhook event history filtered by date range, event type, or email address + * - Generate reports for compliance, auditing, or performance analysis + * - Track delivery patterns and webhook reliability over time * * @param {Brevo.ExportWebhooksHistoryRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts index cb52650..0c734aa 100644 --- a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts @@ -37,6 +37,7 @@ export interface CreateWebhookRequest { * type **Marketing** channel **SMS** #### * `sent`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`, * `subscribe`,`skip` + * #### `reply` */ events: CreateWebhookRequest.Events.Item[]; /** Custom headers to be send with webhooks */ @@ -85,6 +86,7 @@ export namespace CreateWebhookRequest { ContactUpdated: "contactUpdated", ContactDeleted: "contactDeleted", InboundEmailProcessed: "inboundEmailProcessed", + Reply: "reply", } as const; export type Item = (typeof Item)[keyof typeof Item]; } diff --git a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts index 49745bb..d736e28 100644 --- a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts @@ -26,6 +26,7 @@ export interface UpdateWebhookRequest { * #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, * `unsubscribed`, `listAddition` & `delivered` - Possible values * for **Inbound** type webhook: #### `inboundEmailProcessed` + * #### `reply` */ events?: UpdateWebhookRequest.Events.Item[]; /** Custom headers to be send with webhooks */ @@ -66,6 +67,7 @@ export namespace UpdateWebhookRequest { ContactUpdated: "contactUpdated", ContactDeleted: "contactDeleted", InboundEmailProcessed: "inboundEmailProcessed", + Reply: "reply", } as const; export type Item = (typeof Item)[keyof typeof Item]; } diff --git a/src/api/resources/webhooks/exports.ts b/src/api/resources/webhooks/exports.ts new file mode 100644 index 0000000..7773e64 --- /dev/null +++ b/src/api/resources/webhooks/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WebhooksClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/whatsAppCampaigns/client/Client.ts b/src/api/resources/whatsAppCampaigns/client/Client.ts index b9becb7..aa9e3b8 100644 --- a/src/api/resources/whatsAppCampaigns/client/Client.ts +++ b/src/api/resources/whatsAppCampaigns/client/Client.ts @@ -93,19 +93,11 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * - * - * - * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - * - * [Get all the Segments](https://developers.brevo.com/reference/getsegments) - * + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) * * @param {Brevo.CreateWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -177,11 +169,8 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -242,11 +231,8 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * * @param {Brevo.CreateWhatsAppTemplateRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -394,11 +380,8 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * * @param {Brevo.SendWhatsAppTemplateApprovalRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -470,11 +453,11 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. + * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) * * @param {Brevo.GetWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -549,19 +532,11 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * - * - * - * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - * - * [Get all the Segments](https://developers.brevo.com/reference/getsegments) - * + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) * * @param {Brevo.UpdateWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/whatsAppCampaigns/exports.ts b/src/api/resources/whatsAppCampaigns/exports.ts new file mode 100644 index 0000000..35b77f8 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WhatsAppCampaignsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/types/BatchEventsResponse.ts b/src/api/types/BatchEventsResponse.ts new file mode 100644 index 0000000..0b745e8 --- /dev/null +++ b/src/api/types/BatchEventsResponse.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Response returned when a batch of events is processed + */ +export interface BatchEventsResponse { + /** Status of the batch request */ + status: string; + /** Total number of events submitted in the batch */ + total_events: number; + /** Number of events that were successfully processed */ + successful_events: number; + /** Number of events that failed to be processed */ + failed_events: number; + /** List of errors for the failed events */ + errors: BatchEventsResponse.Errors.Item[]; +} + +export namespace BatchEventsResponse { + export type Errors = Errors.Item[]; + + export namespace Errors { + export interface Item { + /** Index positions (0-based) of the events that caused the error */ + eventIndex?: number[] | undefined; + /** Description of the error */ + message?: string | undefined; + } + } +} diff --git a/src/api/types/GetCampaignStats.ts b/src/api/types/GetCampaignStats.ts index 618a403..76f44c9 100644 --- a/src/api/types/GetCampaignStats.ts +++ b/src/api/types/GetCampaignStats.ts @@ -2,7 +2,7 @@ export interface GetCampaignStats { /** Numbers of times your email has been opened automatically through Apple MPP. */ - appleMppOpens: number; + appleMppOpens: number | null; /** Number of total clicks for the campaign */ clickers: number; /** Number of complaints (Spam reports) for the campaign */ @@ -18,7 +18,7 @@ export interface GetCampaignStats { /** List Id of email campaign (only in case of get email campaign(s)(not for global stats)) */ listId?: number | undefined; /** Percentage of recipients who open the email out of your total number of recipients. Depending on your Campaign settings, they may include Apple MPP opens. */ - opensRate: number; + opensRate: number | null; /** Total number of non-delivered campaigns for a particular campaign id. */ returnBounce?: number | undefined; /** Number of sent emails for the campaign */ diff --git a/src/api/types/GetExtendedCampaignOverview.ts b/src/api/types/GetExtendedCampaignOverview.ts index 0b4c7e7..114e7e6 100644 --- a/src/api/types/GetExtendedCampaignOverview.ts +++ b/src/api/types/GetExtendedCampaignOverview.ts @@ -1,6 +1,8 @@ // This file was auto-generated by Fern from our API Definition. export interface GetExtendedCampaignOverview { + /** Url of the attachment file. Only available if the campaign has an attachment. */ + attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -56,6 +58,8 @@ export interface GetExtendedCampaignOverview { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; + /** List of tags of the campaign */ + tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -78,6 +82,9 @@ export namespace GetExtendedCampaignOverview { Queued: "queued", Suspended: "suspended", InProcess: "in_process", + InReview: "in_review", + Cancelling: "cancelling", + Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 1753e35..34a51e7 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -76,10 +76,20 @@ export namespace Order { price: number; /** ID of the product. */ productId: string; - /** How many pieces of the product the visitor has added to the cart. */ - quantity: number; /** Product ID of the red color shirts. */ variantId?: string | undefined; + /** + * **Required if quantityFloat is empty.** + * + * Number of product units added to the cart (whole numbers only, e.g., 10) + */ + quantity?: number | undefined; + /** + * **Required if quantity is empty.** + * + * Number of product units added to the cart(supports decimals, e.g., 20.52) + */ + quantityFloat?: number | undefined; } } } diff --git a/src/api/types/SendTransacSms.ts b/src/api/types/SendTransacSms.ts index db1a777..ed8686c 100644 --- a/src/api/types/SendTransacSms.ts +++ b/src/api/types/SendTransacSms.ts @@ -15,6 +15,10 @@ export interface SendTransacSms { unicodeEnabled?: boolean | undefined; /** Webhook to call for each event triggered by the message (delivered etc.) */ webUrl?: string | undefined; + /** Template ID to send SMS with the template. When provided, overrides the content parameter. Mandatory if 'content' is not passed. */ + templateId?: number | undefined; + /** Content of the message. If more than **160 characters** long, will be sent as multiple text messages. Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed. */ + content?: string | undefined; } export namespace SendTransacSms { diff --git a/src/api/types/UpdateCampaignStatus.ts b/src/api/types/UpdateCampaignStatus.ts index a978877..f3ef1d3 100644 --- a/src/api/types/UpdateCampaignStatus.ts +++ b/src/api/types/UpdateCampaignStatus.ts @@ -18,6 +18,7 @@ export namespace UpdateCampaignStatus { Queued: "queued", Replicate: "replicate", ReplicateTemplate: "replicateTemplate", + Cancel: "cancel", Draft: "draft", } as const; export type Status = (typeof Status)[keyof typeof Status]; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 28b4c8d..1823608 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -4,6 +4,7 @@ export * from "./AbTestVersionStats.js"; export * from "./BadRequestErrorBody.js"; export * from "./BalanceDefinition.js"; export * from "./BalanceLimit.js"; +export * from "./BatchEventsResponse.js"; export * from "./Cart.js"; export * from "./Company.js"; export * from "./Configuration.js"; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 5e5058a..764d2e1 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -282,6 +282,7 @@ export async function fetcherImpl(args: Fetcher.Args): Promise Promise, url: string, @@ -10,6 +36,7 @@ export const makeRequest = async ( abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", + disableCache?: boolean, ): Promise => { const signals: AbortSignal[] = []; @@ -32,6 +59,7 @@ export const makeRequest = async ( credentials: withCredentials ? "include" : undefined, // @ts-ignore duplex, + ...(disableCache && isCacheNoStoreSupported() ? { cache: "no-store" as RequestCache } : {}), }); if (timeoutAbortId != null) { diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts index 56ebbb8..e6e66b2 100644 --- a/src/core/runtime/runtime.ts +++ b/src/core/runtime/runtime.ts @@ -113,18 +113,18 @@ function evaluateRuntime(): Runtime { /** * A constant that indicates whether the environment the code is running is Node.JS. + * + * We assign `process` to a local variable first to avoid being flagged by + * bundlers that perform static analysis on `process.versions` (e.g. Next.js + * Edge Runtime warns about Node.js APIs even when they are guarded). */ - const isNode = - typeof process !== "undefined" && - "version" in process && - !!process.version && - "versions" in process && - !!process.versions?.node; + const _process = typeof process !== "undefined" ? process : undefined; + const isNode = typeof _process !== "undefined" && typeof _process.versions?.node === "string"; if (isNode) { return { type: "node", - version: process.versions.node, - parsedVersion: Number(process.versions.node.split(".")[0]), + version: _process.versions.node, + parsedVersion: Number(_process.versions.node.split(".")[0]), }; } diff --git a/src/version.ts b/src/version.ts index 4197eac..25cf4d2 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "4.0.3"; +export const SDK_VERSION = "5.0.1"; diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 78985e7..3e8540a 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -2,7 +2,7 @@ import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponse import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; -import { withFormUrlEncoded } from "./withFormUrlEncoded"; +import { type WithFormUrlEncodedOptions, withFormUrlEncoded } from "./withFormUrlEncoded"; import { withHeaders } from "./withHeaders"; import { type WithJsonOptions, withJson } from "./withJson"; @@ -27,7 +27,7 @@ interface RequestHeadersStage extends RequestBodyStage, ResponseStage { interface RequestBodyStage extends ResponseStage { jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage; - formUrlEncodedBody(body: unknown): ResponseStage; + formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage; } interface ResponseStage { @@ -44,6 +44,7 @@ interface ResponseHeaderStage extends ResponseBodyStage, BuildStage { interface ResponseBodyStage { jsonBody(body: unknown): BuildStage; + sseBody(body: string): BuildStage; } interface BuildStage { @@ -137,13 +138,13 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta return this; } - formUrlEncodedBody(body: unknown): ResponseStage { + formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage { if (body === undefined) { throw new Error( "Undefined is not valid for form-urlencoded. Do not call formUrlEncodedBody if you want an empty body.", ); } - this.predicates.push((resolver) => withFormUrlEncoded(body, resolver)); + this.predicates.push((resolver) => withFormUrlEncoded(body, resolver, options)); return this; } @@ -201,6 +202,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo return this; } + public sseBody(body: string): BuildStage { + this.responseHeaders["Content-Type"] = "text/event-stream"; + this.responseBody = body; + return this; + } + public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { const response = new HttpResponse(this.responseBody, { diff --git a/tests/mock-server/withFormUrlEncoded.ts b/tests/mock-server/withFormUrlEncoded.ts index e250cb3..2b23448 100644 --- a/tests/mock-server/withFormUrlEncoded.ts +++ b/tests/mock-server/withFormUrlEncoded.ts @@ -2,12 +2,26 @@ import { type HttpResponseResolver, passthrough } from "msw"; import { toJson } from "../../src/core/json"; +export interface WithFormUrlEncodedOptions { + /** + * List of field names to ignore when comparing request bodies. + * This is useful for pagination cursor fields that change between requests. + */ + ignoredFields?: string[]; +} + /** * Creates a request matcher that validates if the request form-urlencoded body exactly matches the expected object * @param expectedBody - The exact body object to match against * @param resolver - Response resolver to execute if body matches + * @param options - Optional configuration including fields to ignore */ -export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { +export function withFormUrlEncoded( + expectedBody: unknown, + resolver: HttpResponseResolver, + options?: WithFormUrlEncodedOptions, +): HttpResponseResolver { + const ignoredFields = options?.ignoredFields ?? []; return async (args) => { const { request } = args; @@ -41,7 +55,8 @@ export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponse } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).length > 0) { + const filteredMismatches = Object.keys(mismatches).filter((key) => !ignoredFields.includes(key)); + if (filteredMismatches.length > 0) { console.error("Form-urlencoded body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } diff --git a/tests/unit/fetcher/makeRequest.test.ts b/tests/unit/fetcher/makeRequest.test.ts index ea49466..bde1945 100644 --- a/tests/unit/fetcher/makeRequest.test.ts +++ b/tests/unit/fetcher/makeRequest.test.ts @@ -1,5 +1,9 @@ import type { Mock } from "vitest"; -import { makeRequest } from "../../../src/core/fetcher/makeRequest"; +import { + isCacheNoStoreSupported, + makeRequest, + resetCacheNoStoreSupported, +} from "../../../src/core/fetcher/makeRequest"; describe("Test makeRequest", () => { const mockPostUrl = "https://httpbin.org/post"; @@ -12,6 +16,7 @@ describe("Test makeRequest", () => { beforeEach(() => { mockFetch = vi.fn(); mockFetch.mockResolvedValue(new Response(JSON.stringify({ test: "successful" }), { status: 200 })); + resetCacheNoStoreSupported(); }); it("should handle POST request correctly", async () => { @@ -51,4 +56,103 @@ describe("Test makeRequest", () => { expect(calledOptions.signal).toBeDefined(); expect(calledOptions.signal).toBeInstanceOf(AbortSignal); }); + + it("should not include cache option when disableCache is not set", async () => { + await makeRequest(mockFetch, mockGetUrl, "GET", mockHeaders, undefined); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + }); + + it("should not include cache option when disableCache is false", async () => { + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + false, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + }); + + it("should include cache: no-store when disableCache is true and runtime supports it", async () => { + // In Node.js test environment, Request supports the cache option + expect(isCacheNoStoreSupported()).toBe(true); + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + true, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBe("no-store"); + }); + + it("should cache the result of isCacheNoStoreSupported", () => { + const first = isCacheNoStoreSupported(); + const second = isCacheNoStoreSupported(); + expect(first).toBe(second); + }); + + it("should reset cache detection state with resetCacheNoStoreSupported", () => { + // First call caches the result + const first = isCacheNoStoreSupported(); + expect(first).toBe(true); + + // Reset clears the cache + resetCacheNoStoreSupported(); + + // After reset, it should re-detect (and still return true in Node.js) + const second = isCacheNoStoreSupported(); + expect(second).toBe(true); + }); + + it("should not include cache option when runtime does not support it (e.g. Cloudflare Workers)", async () => { + // Mock Request constructor to throw when cache option is passed, + // simulating runtimes like Cloudflare Workers + const OriginalRequest = globalThis.Request; + globalThis.Request = class MockRequest { + constructor(_url: string, init?: RequestInit) { + if (init?.cache != null) { + throw new TypeError("The 'cache' field on 'RequestInitializerDict' is not implemented."); + } + } + } as unknown as typeof Request; + + try { + // Reset so the detection runs fresh with the mocked Request + resetCacheNoStoreSupported(); + expect(isCacheNoStoreSupported()).toBe(false); + + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + true, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + } finally { + // Restore original Request + globalThis.Request = OriginalRequest; + resetCacheNoStoreSupported(); + } + }); }); diff --git a/tests/wire/balance.test.ts b/tests/wire/balance.test.ts index 7d005b7..a929387 100644 --- a/tests/wire/balance.test.ts +++ b/tests/wire/balance.test.ts @@ -2367,8 +2367,8 @@ describe("BalanceClient", () => { const response = await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); expect(response).toEqual({ balanceDefinitionId: "balanceDefinitionId", @@ -2410,8 +2410,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnauthorizedError); }); @@ -2432,8 +2432,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.ForbiddenError); }); @@ -2454,8 +2454,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.NotFoundError); }); @@ -2476,8 +2476,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnprocessableEntityError); }); @@ -2498,8 +2498,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.InternalServerError); }); diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts index 9fcb13f..3fd874a 100644 --- a/tests/wire/companies.test.ts +++ b/tests/wire/companies.test.ts @@ -407,6 +407,119 @@ describe("CompaniesClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); + test("deleteAnAttribute (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/crm/attributes/id").respondWith().statusCode(200).build(); + + const response = await client.companies.deleteAnAttribute({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteAnAttribute (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/crm/attributes/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.deleteAnAttribute({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteAnAttribute (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/crm/attributes/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.deleteAnAttribute({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateAnAttribute (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .patch("/crm/attributes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.companies.updateAnAttribute({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("updateAnAttribute (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/attributes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.updateAnAttribute({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateAnAttribute (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .patch("/crm/attributes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.updateAnAttribute({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + test("getCompanyAttributes", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); diff --git a/tests/wire/ecommerce.test.ts b/tests/wire/ecommerce.test.ts index 24535a9..15fc945 100644 --- a/tests/wire/ecommerce.test.ts +++ b/tests/wire/ecommerce.test.ts @@ -660,8 +660,8 @@ describe("EcommerceClient", () => { id: "order1803", identifiers: { ext_id: "ab12", loyalty_subscription_id: "1234" }, products: [ - { price: 100, productId: 21, quantity: 2, variantId: "P100" }, - { price: 100, productId: 21, quantity: 2, variantId: "P15756" }, + { price: 100, productId: 21, quantity: 2, quantityFloat: 0, variantId: "P100" }, + { price: 100, productId: 21, quantity: 0, quantityFloat: 2.52, variantId: "P15756" }, ], status: "complete", storeId: "123", @@ -701,12 +701,14 @@ describe("EcommerceClient", () => { price: 100, productId: 21, quantity: 2, + quantityFloat: 0, variantId: "P100", }, { price: 100, productId: 21, - quantity: 2, + quantity: 0, + quantityFloat: 2.52, variantId: "P15756", }, ], @@ -737,7 +739,7 @@ describe("EcommerceClient", () => { amount: 308.42, createdAt: "2021-07-29T20:59:23.383Z", id: "14", - products: [{ price: 99.99, productId: "P1", quantity: 10 }], + products: [{ price: 99.99, productId: "P1" }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z", }; @@ -752,7 +754,6 @@ describe("EcommerceClient", () => { { price: 99.99, productId: "P1", - quantity: 10, }, ], status: "completed", @@ -769,8 +770,8 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId", quantity: 1.1 }, - { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId" }, ], status: "status", updatedAt: "updatedAt", @@ -794,12 +795,10 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", - quantity: 1.1, }, { price: 1.1, productId: "productId", - quantity: 1.1, }, ], status: "status", @@ -817,7 +816,7 @@ describe("EcommerceClient", () => { amount: 308.42, createdAt: "2021-07-29T20:59:23.383Z", id: "14", - products: [{ price: 99.99, productId: "P1", quantity: 10 }], + products: [{ price: 99.99, productId: "P1" }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z", }, @@ -843,7 +842,6 @@ describe("EcommerceClient", () => { { price: 99.99, productId: "P1", - quantity: 10, }, ], status: "completed", @@ -867,8 +865,8 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId", quantity: 1.1 }, - { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId" }, ], status: "status", updatedAt: "updatedAt", @@ -878,8 +876,8 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId", quantity: 1.1 }, - { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId" }, ], status: "status", updatedAt: "updatedAt", @@ -907,12 +905,10 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", - quantity: 1.1, }, { price: 1.1, productId: "productId", - quantity: 1.1, }, ], status: "status", @@ -926,12 +922,10 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", - quantity: 1.1, }, { price: 1.1, productId: "productId", - quantity: 1.1, }, ], status: "status", diff --git a/tests/wire/emailCampaigns.test.ts b/tests/wire/emailCampaigns.test.ts index cf7e061..652329a 100644 --- a/tests/wire/emailCampaigns.test.ts +++ b/tests/wire/emailCampaigns.test.ts @@ -12,6 +12,7 @@ describe("EmailCampaignsClient", () => { const rawResponseBody = { campaigns: [ { + attachmentFile: "http://mydomain.com/campaign/attachment/file.pdf", abTesting: true, id: 12, name: "EN - Sales Summer 2017", @@ -40,6 +41,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["tag1", "tag2"], testSent: true, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -142,6 +144,7 @@ describe("EmailCampaignsClient", () => { }, }, { + attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -170,6 +173,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -280,6 +284,7 @@ describe("EmailCampaignsClient", () => { expect(response).toEqual({ campaigns: [ { + attachmentFile: "http://mydomain.com/campaign/attachment/file.pdf", abTesting: true, id: 12, name: "EN - Sales Summer 2017", @@ -312,6 +317,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["tag1", "tag2"], testSent: true, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -422,6 +428,7 @@ describe("EmailCampaignsClient", () => { }, }, { + attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -454,6 +461,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -675,6 +683,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { + attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -703,6 +712,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -806,6 +816,7 @@ describe("EmailCampaignsClient", () => { campaignId: 1000000, }); expect(response).toEqual({ + attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -838,6 +849,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", diff --git a/tests/wire/event.test.ts b/tests/wire/event.test.ts index 80ed7f0..5a8a4ec 100644 --- a/tests/wire/event.test.ts +++ b/tests/wire/event.test.ts @@ -62,4 +62,82 @@ describe("EventClient", () => { }); }).rejects.toThrow(Brevo.UnauthorizedError); }); + + test("createBatchEvents (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = [{ event_name: "order_created", identifiers: {} }]; + + server.mockEndpoint().post("/events/batch").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); + + const response = await client.event.createBatchEvents([ + { + event_name: "order_created", + identifiers: {}, + }, + ]); + expect(response).toEqual(undefined); + }); + + test("createBatchEvents (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = [ + { event_name: "event_name", identifiers: {} }, + { event_name: "event_name", identifiers: {} }, + ]; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/events/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.event.createBatchEvents([ + { + event_name: "event_name", + identifiers: {}, + }, + { + event_name: "event_name", + identifiers: {}, + }, + ]); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createBatchEvents (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = [ + { event_name: "event_name", identifiers: {} }, + { event_name: "event_name", identifiers: {} }, + ]; + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .post("/events/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.event.createBatchEvents([ + { + event_name: "event_name", + identifiers: {}, + }, + { + event_name: "event_name", + identifiers: {}, + }, + ]); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); }); diff --git a/tests/wire/program.test.ts b/tests/wire/program.test.ts index 44e2bcc..17b383a 100644 --- a/tests/wire/program.test.ts +++ b/tests/wire/program.test.ts @@ -1120,6 +1120,145 @@ describe("ProgramClient", () => { }).rejects.toThrow(Brevo.InternalServerError); }); + test("deleteContactSubscription (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/loyalty/config/programs/pid/contact/1").respondWith().statusCode(200).build(); + + const response = await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + expect(response).toEqual(undefined); + }); + + test("deleteContactSubscription (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteContactSubscription (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deleteContactSubscription (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteContactSubscription (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteContactSubscription (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("deleteContactSubscription (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + test("publishLoyaltyProgram (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); From ea3f37ed5fdcba51ab7ae7898d6dc2802fb9413d Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 19:36:25 +0000 Subject: [PATCH 30/33] SDK regeneration Unable to analyze changes with AI, incrementing PATCH version. --- .fern/metadata.json | 8 +- .github/workflows/ci.yml | 10 +- biome.json | 2 +- changelog.md | 4 + package.json | 360 +------------- pnpm-lock.yaml | 447 ++++++++--------- reference.md | 450 ++++++------------ src/BaseClient.ts | 4 +- src/api/resources/account/exports.ts | 4 - .../account/types/GetAccountResponse.ts | 2 +- src/api/resources/balance/client/Client.ts | 21 +- ...nceProgramsPidTransactionHistoryRequest.ts | 10 +- src/api/resources/balance/exports.ts | 4 - ...msPidTransactionHistoryRequestSortField.ts | 9 + src/api/resources/balance/types/index.ts | 1 + src/api/resources/companies/client/Client.ts | 139 ------ .../requests/DeleteCrmAttributesIdRequest.ts | 12 - .../requests/PatchCrmAttributesIdRequest.ts | 38 -- .../companies/client/requests/index.ts | 2 - src/api/resources/companies/exports.ts | 4 - src/api/resources/contacts/client/Client.ts | 60 ++- .../requests/AddContactToListRequest.ts | 24 + .../requests/RemoveContactFromListRequest.ts | 32 ++ src/api/resources/contacts/exports.ts | 4 - src/api/resources/conversations/exports.ts | 4 - src/api/resources/coupons/exports.ts | 4 - .../resources/customObjects/client/Client.ts | 20 +- .../client/requests/UpsertrecordsRequest.ts | 2 +- src/api/resources/customObjects/exports.ts | 4 - .../types/UpsertrecordsResponse.ts | 2 +- src/api/resources/deals/client/Client.ts | 2 - src/api/resources/deals/exports.ts | 4 - .../requests/AuthenticateDomainRequest.ts | 5 + .../client/requests/CreateDomainRequest.ts | 10 + .../requests/GetDomainConfigurationRequest.ts | 5 + src/api/resources/domains/exports.ts | 4 - src/api/resources/ecommerce/client/Client.ts | 6 +- .../requests/CreateBatchOrderRequest.ts | 3 +- src/api/resources/ecommerce/exports.ts | 4 - .../resources/emailCampaigns/client/Client.ts | 10 +- .../requests/GetEmailCampaignRequest.ts | 2 - src/api/resources/emailCampaigns/exports.ts | 4 - .../types/GetEmailCampaignResponse.ts | 7 - .../types/GetEmailCampaignsRequestStatus.ts | 2 - .../types/GetEmailCampaignsResponse.ts | 7 - src/api/resources/event/client/Client.ts | 73 --- src/api/resources/event/exports.ts | 4 - src/api/resources/event/index.ts | 1 - .../types/CreateBatchEventsRequestItem.ts | 66 --- src/api/resources/event/types/index.ts | 1 - .../requests/GetExternalFeedByUuidRequest.ts | 10 + src/api/resources/externalFeeds/exports.ts | 4 - src/api/resources/files/exports.ts | 4 - .../resources/inboundParsing/client/Client.ts | 1 - src/api/resources/inboundParsing/exports.ts | 4 - src/api/resources/index.ts | 1 - src/api/resources/masterAccount/exports.ts | 4 - src/api/resources/notes/exports.ts | 4 - src/api/resources/payments/exports.ts | 4 - .../client/requests/GetProcessRequest.ts | 15 + src/api/resources/process/exports.ts | 4 - src/api/resources/program/client/Client.ts | 91 ---- .../DeleteContactSubscriptionRequest.ts | 15 - .../program/client/requests/index.ts | 1 - src/api/resources/program/exports.ts | 4 - src/api/resources/reward/exports.ts | 4 - .../client/requests/CreateSenderRequest.ts | 12 + .../requests/GetIpsFromSenderRequest.ts | 5 + .../client/requests/GetSendersRequest.ts | 3 + src/api/resources/senders/exports.ts | 4 - src/api/resources/smsCampaigns/exports.ts | 4 - src/api/resources/smsTemplates/exports.ts | 4 - src/api/resources/tasks/exports.ts | 4 - src/api/resources/tier/exports.ts | 4 - .../transactionalEmails/client/Client.ts | 8 +- .../requests/GetScheduledEmailByIdRequest.ts | 7 + .../resources/transactionalEmails/exports.ts | 4 - .../transactionalSms/client/Client.ts | 14 +- src/api/resources/transactionalSms/exports.ts | 4 - .../transactionalWhatsApp/client/Client.ts | 3 +- .../transactionalWhatsApp/exports.ts | 4 - src/api/resources/user/exports.ts | 4 - src/api/resources/webhooks/client/Client.ts | 20 +- .../client/requests/CreateWebhookRequest.ts | 2 - .../client/requests/UpdateWebhookRequest.ts | 2 - src/api/resources/webhooks/exports.ts | 4 - .../whatsAppCampaigns/client/Client.ts | 63 ++- .../resources/whatsAppCampaigns/exports.ts | 4 - src/api/types/BatchEventsResponse.ts | 30 -- src/api/types/GetCampaignStats.ts | 4 +- src/api/types/GetExtendedCampaignOverview.ts | 7 - src/api/types/Order.ts | 14 +- src/api/types/UpdateCampaignStatus.ts | 1 - src/api/types/index.ts | 1 - src/core/fetcher/Fetcher.ts | 1 - src/core/fetcher/makeRequest.ts | 28 -- src/core/runtime/runtime.ts | 16 +- src/version.ts | 2 +- tests/mock-server/mockEndpointBuilder.ts | 15 +- tests/mock-server/withFormUrlEncoded.ts | 19 +- tests/unit/fetcher/makeRequest.test.ts | 106 +---- tests/wire/balance.test.ts | 24 +- tests/wire/companies.test.ts | 113 ----- tests/wire/ecommerce.test.ts | 32 +- tests/wire/emailCampaigns.test.ts | 12 - tests/wire/event.test.ts | 78 --- tests/wire/program.test.ts | 139 ------ 107 files changed, 760 insertions(+), 2142 deletions(-) delete mode 100644 src/api/resources/account/exports.ts delete mode 100644 src/api/resources/balance/exports.ts create mode 100644 src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts delete mode 100644 src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts delete mode 100644 src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts delete mode 100644 src/api/resources/companies/exports.ts delete mode 100644 src/api/resources/contacts/exports.ts delete mode 100644 src/api/resources/conversations/exports.ts delete mode 100644 src/api/resources/coupons/exports.ts delete mode 100644 src/api/resources/customObjects/exports.ts delete mode 100644 src/api/resources/deals/exports.ts delete mode 100644 src/api/resources/domains/exports.ts delete mode 100644 src/api/resources/ecommerce/exports.ts delete mode 100644 src/api/resources/emailCampaigns/exports.ts delete mode 100644 src/api/resources/event/exports.ts delete mode 100644 src/api/resources/event/types/CreateBatchEventsRequestItem.ts delete mode 100644 src/api/resources/event/types/index.ts delete mode 100644 src/api/resources/externalFeeds/exports.ts delete mode 100644 src/api/resources/files/exports.ts delete mode 100644 src/api/resources/inboundParsing/exports.ts delete mode 100644 src/api/resources/masterAccount/exports.ts delete mode 100644 src/api/resources/notes/exports.ts delete mode 100644 src/api/resources/payments/exports.ts delete mode 100644 src/api/resources/process/exports.ts delete mode 100644 src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts delete mode 100644 src/api/resources/program/exports.ts delete mode 100644 src/api/resources/reward/exports.ts delete mode 100644 src/api/resources/senders/exports.ts delete mode 100644 src/api/resources/smsCampaigns/exports.ts delete mode 100644 src/api/resources/smsTemplates/exports.ts delete mode 100644 src/api/resources/tasks/exports.ts delete mode 100644 src/api/resources/tier/exports.ts delete mode 100644 src/api/resources/transactionalEmails/exports.ts delete mode 100644 src/api/resources/transactionalSms/exports.ts delete mode 100644 src/api/resources/transactionalWhatsApp/exports.ts delete mode 100644 src/api/resources/user/exports.ts delete mode 100644 src/api/resources/webhooks/exports.ts delete mode 100644 src/api/resources/whatsAppCampaigns/exports.ts delete mode 100644 src/api/types/BatchEventsResponse.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index 42039c4..028f542 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "4.22.0", + "cliVersion": "4.25.0", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.53.11", + "generatorVersion": "3.48.2", "generatorConfig": { "generateWireTests": true, "namespaceExport": "Brevo", @@ -15,6 +15,6 @@ } } }, - "originGitCommit": "306749c7d7549425dfc33ec33b6a91ea016d77c3", - "sdkVersion": "5.0.1" + "originGitCommit": "0270908073ab43956eab9fce001fe4f6c09affc5", + "sdkVersion": "5.0.2" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7076aee..1c70c5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,13 +74,5 @@ jobs: elif [[ ${GITHUB_REF} == *beta* ]]; then publish --access public --tag beta else - PKG_NAME=$(node -p "require('./package.json').name") - PKG_VERSION=$(node -p "require('./package.json').version") - CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0") - if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then - echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})" - publish --access public --tag backport - else - publish --access public - fi + publish --access public fi \ No newline at end of file diff --git a/biome.json b/biome.json index 5084b70..371d365 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.4.3/schema.json", + "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", "root": true, "vcs": { "enabled": false diff --git a/changelog.md b/changelog.md index fd00819..d25a1e7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +## 5.0.2 - 2026-03-12 +* SDK regeneration +* Unable to analyze changes with AI, incrementing PATCH version. + ## 4.0.3 - 2026-02-24 * chore: update CLI version and enhance test coverage * Update Fern CLI version from 3.76.0 to 3.85.3 to leverage the latest tooling improvements and bug fixes. Additionally, expand test coverage for custom objects by adding more comprehensive association data structures with nested records and identifiers. diff --git a/package.json b/package.json index fa52ec4..424efc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "5.0.1", + "version": "5.0.2", "private": false, "repository": { "type": "git", @@ -12,6 +12,7 @@ "types": "./dist/cjs/index.d.ts", "exports": { ".": { + "types": "./dist/cjs/index.d.ts", "import": { "types": "./dist/esm/index.d.mts", "default": "./dist/esm/index.mjs" @@ -22,358 +23,6 @@ }, "default": "./dist/cjs/index.js" }, - "./account": { - "import": { - "types": "./dist/esm/api/resources/account/exports.d.mts", - "default": "./dist/esm/api/resources/account/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/account/exports.d.ts", - "default": "./dist/cjs/api/resources/account/exports.js" - }, - "default": "./dist/cjs/api/resources/account/exports.js" - }, - "./masterAccount": { - "import": { - "types": "./dist/esm/api/resources/masterAccount/exports.d.mts", - "default": "./dist/esm/api/resources/masterAccount/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/masterAccount/exports.d.ts", - "default": "./dist/cjs/api/resources/masterAccount/exports.js" - }, - "default": "./dist/cjs/api/resources/masterAccount/exports.js" - }, - "./user": { - "import": { - "types": "./dist/esm/api/resources/user/exports.d.mts", - "default": "./dist/esm/api/resources/user/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/user/exports.d.ts", - "default": "./dist/cjs/api/resources/user/exports.js" - }, - "default": "./dist/cjs/api/resources/user/exports.js" - }, - "./process": { - "import": { - "types": "./dist/esm/api/resources/process/exports.d.mts", - "default": "./dist/esm/api/resources/process/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/process/exports.d.ts", - "default": "./dist/cjs/api/resources/process/exports.js" - }, - "default": "./dist/cjs/api/resources/process/exports.js" - }, - "./senders": { - "import": { - "types": "./dist/esm/api/resources/senders/exports.d.mts", - "default": "./dist/esm/api/resources/senders/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/senders/exports.d.ts", - "default": "./dist/cjs/api/resources/senders/exports.js" - }, - "default": "./dist/cjs/api/resources/senders/exports.js" - }, - "./domains": { - "import": { - "types": "./dist/esm/api/resources/domains/exports.d.mts", - "default": "./dist/esm/api/resources/domains/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/domains/exports.d.ts", - "default": "./dist/cjs/api/resources/domains/exports.js" - }, - "default": "./dist/cjs/api/resources/domains/exports.js" - }, - "./webhooks": { - "import": { - "types": "./dist/esm/api/resources/webhooks/exports.d.mts", - "default": "./dist/esm/api/resources/webhooks/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/webhooks/exports.d.ts", - "default": "./dist/cjs/api/resources/webhooks/exports.js" - }, - "default": "./dist/cjs/api/resources/webhooks/exports.js" - }, - "./externalFeeds": { - "import": { - "types": "./dist/esm/api/resources/externalFeeds/exports.d.mts", - "default": "./dist/esm/api/resources/externalFeeds/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/externalFeeds/exports.d.ts", - "default": "./dist/cjs/api/resources/externalFeeds/exports.js" - }, - "default": "./dist/cjs/api/resources/externalFeeds/exports.js" - }, - "./customObjects": { - "import": { - "types": "./dist/esm/api/resources/customObjects/exports.d.mts", - "default": "./dist/esm/api/resources/customObjects/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/customObjects/exports.d.ts", - "default": "./dist/cjs/api/resources/customObjects/exports.js" - }, - "default": "./dist/cjs/api/resources/customObjects/exports.js" - }, - "./contacts": { - "import": { - "types": "./dist/esm/api/resources/contacts/exports.d.mts", - "default": "./dist/esm/api/resources/contacts/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/contacts/exports.d.ts", - "default": "./dist/cjs/api/resources/contacts/exports.js" - }, - "default": "./dist/cjs/api/resources/contacts/exports.js" - }, - "./conversations": { - "import": { - "types": "./dist/esm/api/resources/conversations/exports.d.mts", - "default": "./dist/esm/api/resources/conversations/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/conversations/exports.d.ts", - "default": "./dist/cjs/api/resources/conversations/exports.js" - }, - "default": "./dist/cjs/api/resources/conversations/exports.js" - }, - "./ecommerce": { - "import": { - "types": "./dist/esm/api/resources/ecommerce/exports.d.mts", - "default": "./dist/esm/api/resources/ecommerce/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/ecommerce/exports.d.ts", - "default": "./dist/cjs/api/resources/ecommerce/exports.js" - }, - "default": "./dist/cjs/api/resources/ecommerce/exports.js" - }, - "./coupons": { - "import": { - "types": "./dist/esm/api/resources/coupons/exports.d.mts", - "default": "./dist/esm/api/resources/coupons/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/coupons/exports.d.ts", - "default": "./dist/cjs/api/resources/coupons/exports.js" - }, - "default": "./dist/cjs/api/resources/coupons/exports.js" - }, - "./payments": { - "import": { - "types": "./dist/esm/api/resources/payments/exports.d.mts", - "default": "./dist/esm/api/resources/payments/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/payments/exports.d.ts", - "default": "./dist/cjs/api/resources/payments/exports.js" - }, - "default": "./dist/cjs/api/resources/payments/exports.js" - }, - "./event": { - "import": { - "types": "./dist/esm/api/resources/event/exports.d.mts", - "default": "./dist/esm/api/resources/event/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/event/exports.d.ts", - "default": "./dist/cjs/api/resources/event/exports.js" - }, - "default": "./dist/cjs/api/resources/event/exports.js" - }, - "./inboundParsing": { - "import": { - "types": "./dist/esm/api/resources/inboundParsing/exports.d.mts", - "default": "./dist/esm/api/resources/inboundParsing/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/inboundParsing/exports.d.ts", - "default": "./dist/cjs/api/resources/inboundParsing/exports.js" - }, - "default": "./dist/cjs/api/resources/inboundParsing/exports.js" - }, - "./balance": { - "import": { - "types": "./dist/esm/api/resources/balance/exports.d.mts", - "default": "./dist/esm/api/resources/balance/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/balance/exports.d.ts", - "default": "./dist/cjs/api/resources/balance/exports.js" - }, - "default": "./dist/cjs/api/resources/balance/exports.js" - }, - "./program": { - "import": { - "types": "./dist/esm/api/resources/program/exports.d.mts", - "default": "./dist/esm/api/resources/program/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/program/exports.d.ts", - "default": "./dist/cjs/api/resources/program/exports.js" - }, - "default": "./dist/cjs/api/resources/program/exports.js" - }, - "./reward": { - "import": { - "types": "./dist/esm/api/resources/reward/exports.d.mts", - "default": "./dist/esm/api/resources/reward/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/reward/exports.d.ts", - "default": "./dist/cjs/api/resources/reward/exports.js" - }, - "default": "./dist/cjs/api/resources/reward/exports.js" - }, - "./tier": { - "import": { - "types": "./dist/esm/api/resources/tier/exports.d.mts", - "default": "./dist/esm/api/resources/tier/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/tier/exports.d.ts", - "default": "./dist/cjs/api/resources/tier/exports.js" - }, - "default": "./dist/cjs/api/resources/tier/exports.js" - }, - "./emailCampaigns": { - "import": { - "types": "./dist/esm/api/resources/emailCampaigns/exports.d.mts", - "default": "./dist/esm/api/resources/emailCampaigns/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/emailCampaigns/exports.d.ts", - "default": "./dist/cjs/api/resources/emailCampaigns/exports.js" - }, - "default": "./dist/cjs/api/resources/emailCampaigns/exports.js" - }, - "./smsCampaigns": { - "import": { - "types": "./dist/esm/api/resources/smsCampaigns/exports.d.mts", - "default": "./dist/esm/api/resources/smsCampaigns/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/smsCampaigns/exports.d.ts", - "default": "./dist/cjs/api/resources/smsCampaigns/exports.js" - }, - "default": "./dist/cjs/api/resources/smsCampaigns/exports.js" - }, - "./whatsAppCampaigns": { - "import": { - "types": "./dist/esm/api/resources/whatsAppCampaigns/exports.d.mts", - "default": "./dist/esm/api/resources/whatsAppCampaigns/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/whatsAppCampaigns/exports.d.ts", - "default": "./dist/cjs/api/resources/whatsAppCampaigns/exports.js" - }, - "default": "./dist/cjs/api/resources/whatsAppCampaigns/exports.js" - }, - "./companies": { - "import": { - "types": "./dist/esm/api/resources/companies/exports.d.mts", - "default": "./dist/esm/api/resources/companies/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/companies/exports.d.ts", - "default": "./dist/cjs/api/resources/companies/exports.js" - }, - "default": "./dist/cjs/api/resources/companies/exports.js" - }, - "./deals": { - "import": { - "types": "./dist/esm/api/resources/deals/exports.d.mts", - "default": "./dist/esm/api/resources/deals/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/deals/exports.d.ts", - "default": "./dist/cjs/api/resources/deals/exports.js" - }, - "default": "./dist/cjs/api/resources/deals/exports.js" - }, - "./files": { - "import": { - "types": "./dist/esm/api/resources/files/exports.d.mts", - "default": "./dist/esm/api/resources/files/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/files/exports.d.ts", - "default": "./dist/cjs/api/resources/files/exports.js" - }, - "default": "./dist/cjs/api/resources/files/exports.js" - }, - "./notes": { - "import": { - "types": "./dist/esm/api/resources/notes/exports.d.mts", - "default": "./dist/esm/api/resources/notes/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/notes/exports.d.ts", - "default": "./dist/cjs/api/resources/notes/exports.js" - }, - "default": "./dist/cjs/api/resources/notes/exports.js" - }, - "./tasks": { - "import": { - "types": "./dist/esm/api/resources/tasks/exports.d.mts", - "default": "./dist/esm/api/resources/tasks/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/tasks/exports.d.ts", - "default": "./dist/cjs/api/resources/tasks/exports.js" - }, - "default": "./dist/cjs/api/resources/tasks/exports.js" - }, - "./transactionalWhatsApp": { - "import": { - "types": "./dist/esm/api/resources/transactionalWhatsApp/exports.d.mts", - "default": "./dist/esm/api/resources/transactionalWhatsApp/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/transactionalWhatsApp/exports.d.ts", - "default": "./dist/cjs/api/resources/transactionalWhatsApp/exports.js" - }, - "default": "./dist/cjs/api/resources/transactionalWhatsApp/exports.js" - }, - "./transactionalEmails": { - "import": { - "types": "./dist/esm/api/resources/transactionalEmails/exports.d.mts", - "default": "./dist/esm/api/resources/transactionalEmails/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/transactionalEmails/exports.d.ts", - "default": "./dist/cjs/api/resources/transactionalEmails/exports.js" - }, - "default": "./dist/cjs/api/resources/transactionalEmails/exports.js" - }, - "./transactionalSms": { - "import": { - "types": "./dist/esm/api/resources/transactionalSms/exports.d.mts", - "default": "./dist/esm/api/resources/transactionalSms/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/transactionalSms/exports.d.ts", - "default": "./dist/cjs/api/resources/transactionalSms/exports.js" - }, - "default": "./dist/cjs/api/resources/transactionalSms/exports.js" - }, - "./smsTemplates": { - "import": { - "types": "./dist/esm/api/resources/smsTemplates/exports.d.mts", - "default": "./dist/esm/api/resources/smsTemplates/exports.mjs" - }, - "require": { - "types": "./dist/cjs/api/resources/smsTemplates/exports.d.ts", - "default": "./dist/cjs/api/resources/smsTemplates/exports.js" - }, - "default": "./dist/cjs/api/resources/smsTemplates/exports.js" - }, "./package.json": "./package.json" }, "files": [ @@ -404,14 +53,13 @@ "msw": "2.11.2", "@types/node": "^18.19.70", "typescript": "~5.7.2", - "@biomejs/biome": "2.4.3" + "@biomejs/biome": "2.3.11" }, "browser": { "fs": false, "os": false, "path": false, - "stream": false, - "crypto": false + "stream": false }, "packageManager": "pnpm@10.20.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e5535f..08ec090 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: 2.4.3 - version: 2.4.3 + specifier: 2.3.11 + version: 2.3.11 '@types/node': specifier: ^18.19.70 version: 18.19.130 @@ -19,7 +19,7 @@ importers: version: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) ts-loader: specifier: ^9.5.1 - version: 9.5.4(typescript@5.7.3)(webpack@5.105.4) + version: 9.5.4(typescript@5.7.3)(webpack@5.105.2) typescript: specifier: ~5.7.2 version: 5.7.3 @@ -28,59 +28,59 @@ importers: version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0) webpack: specifier: ^5.97.1 - version: 5.105.4 + version: 5.105.2 packages: - '@biomejs/biome@2.4.3': - resolution: {integrity: sha512-cBrjf6PNF6yfL8+kcNl85AjiK2YHNsbU0EvDOwiZjBPbMbQ5QcgVGFpjD0O52p8nec5O8NYw7PKw3xUR7fPAkQ==} + '@biomejs/biome@2.3.11': + resolution: {integrity: sha512-/zt+6qazBWguPG6+eWmiELqO+9jRsMZ/DBU3lfuU2ngtIQYzymocHhKiZRyrbra4aCOoyTg/BmY+6WH5mv9xmQ==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.4.3': - resolution: {integrity: sha512-eOafSFlI/CF4id2tlwq9CVHgeEqvTL5SrhWff6ZORp6S3NL65zdsR3ugybItkgF8Pf4D9GSgtbB6sE3UNgOM9w==} + '@biomejs/cli-darwin-arm64@2.3.11': + resolution: {integrity: sha512-/uXXkBcPKVQY7rc9Ys2CrlirBJYbpESEDme7RKiBD6MmqR2w3j0+ZZXRIL2xiaNPsIMMNhP1YnA+jRRxoOAFrA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.4.3': - resolution: {integrity: sha512-V2+av4ilbWcBMNufTtMMXVW00nPwyIjI5qf7n9wSvUaZ+tt0EvMGk46g9sAFDJBEDOzSyoRXiSP6pCvKTOEbPA==} + '@biomejs/cli-darwin-x64@2.3.11': + resolution: {integrity: sha512-fh7nnvbweDPm2xEmFjfmq7zSUiox88plgdHF9OIW4i99WnXrAC3o2P3ag9judoUMv8FCSUnlwJCM1B64nO5Fbg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.4.3': - resolution: {integrity: sha512-QuFzvsGo8BA4Xm7jGX5idkw6BqFblcCPySMTvq0AhGYnhUej5VJIDJbmTKfHqwjHepZiC4fA+T5i6wmiZolZNw==} + '@biomejs/cli-linux-arm64-musl@2.3.11': + resolution: {integrity: sha512-XPSQ+XIPZMLaZ6zveQdwNjbX+QdROEd1zPgMwD47zvHV+tCGB88VH+aynyGxAHdzL+Tm/+DtKST5SECs4iwCLg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@2.4.3': - resolution: {integrity: sha512-0m+O0x9FgK99FAwDK+fiDtjs2wnqq7bvfj17KJVeCkTwT/liI+Q9njJG7lwXK0iSJVXeFNRIxukpVI3SifMYAA==} + '@biomejs/cli-linux-arm64@2.3.11': + resolution: {integrity: sha512-l4xkGa9E7Uc0/05qU2lMYfN1H+fzzkHgaJoy98wO+b/7Gl78srbCRRgwYSW+BTLixTBrM6Ede5NSBwt7rd/i6g==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@2.4.3': - resolution: {integrity: sha512-qEc0OCpj/uytruQ4wLM0yWNJLZy0Up8H1Er5MW3SrstqM6J2d4XqdNA86xzCy8MQCHpoVZ3lFye3GBlIL4/ljw==} + '@biomejs/cli-linux-x64-musl@2.3.11': + resolution: {integrity: sha512-vU7a8wLs5C9yJ4CB8a44r12aXYb8yYgBn+WeyzbMjaCMklzCv1oXr8x+VEyWodgJt9bDmhiaW/I0RHbn7rsNmw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@2.4.3': - resolution: {integrity: sha512-NVqh0saIU0u5OfOp/0jFdlKRE59+XyMvWmtx0f6Nm/2OpdxBl04coRIftBbY9d1gfu+23JVv4CItAqPYrjYh5w==} + '@biomejs/cli-linux-x64@2.3.11': + resolution: {integrity: sha512-/1s9V/H3cSe0r0Mv/Z8JryF5x9ywRxywomqZVLHAoa/uN0eY7F8gEngWKNS5vbbN/BsfpCG5yeBT5ENh50Frxg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@2.4.3': - resolution: {integrity: sha512-gRO96vrIARilv/Cp2ZnmNNL5LSZg3RO75GPp13hsLO3N4YVpE7saaMDp2bcyV48y2N2Pbit1brkGVGta0yd6VQ==} + '@biomejs/cli-win32-arm64@2.3.11': + resolution: {integrity: sha512-PZQ6ElCOnkYapSsysiTy0+fYX+agXPlWugh6+eQ6uPKI3vKAqNp6TnMhoM3oY2NltSB89hz59o8xIfOdyhi9Iw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.4.3': - resolution: {integrity: sha512-vSm/vOJe06pf14aGHfHl3Ar91Nlx4YYmohElDJ+17UbRwe99n987S/MhAlQOkONqf1utJor04ChkCPmKb8SWdw==} + '@biomejs/cli-win32-x64@2.3.11': + resolution: {integrity: sha512-43VrG813EW+b5+YbDbz31uUsheX+qFKCpXeY9kfdAx+ww3naKxeVkTD9zLIWxUPfJquANMHrmW3wbe/037G0Qg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -311,128 +311,128 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@rollup/rollup-android-arm-eabi@4.59.0': - resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} + '@rollup/rollup-android-arm-eabi@4.57.1': + resolution: {integrity: sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.59.0': - resolution: {integrity: sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==} + '@rollup/rollup-android-arm64@4.57.1': + resolution: {integrity: sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.59.0': - resolution: {integrity: sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==} + '@rollup/rollup-darwin-arm64@4.57.1': + resolution: {integrity: sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.59.0': - resolution: {integrity: sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==} + '@rollup/rollup-darwin-x64@4.57.1': + resolution: {integrity: sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.59.0': - resolution: {integrity: sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==} + '@rollup/rollup-freebsd-arm64@4.57.1': + resolution: {integrity: sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.59.0': - resolution: {integrity: sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==} + '@rollup/rollup-freebsd-x64@4.57.1': + resolution: {integrity: sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.59.0': - resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} + '@rollup/rollup-linux-arm-gnueabihf@4.57.1': + resolution: {integrity: sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.59.0': - resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} + '@rollup/rollup-linux-arm-musleabihf@4.57.1': + resolution: {integrity: sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.59.0': - resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} + '@rollup/rollup-linux-arm64-gnu@4.57.1': + resolution: {integrity: sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.59.0': - resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} + '@rollup/rollup-linux-arm64-musl@4.57.1': + resolution: {integrity: sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.59.0': - resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} + '@rollup/rollup-linux-loong64-gnu@4.57.1': + resolution: {integrity: sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-loong64-musl@4.59.0': - resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} + '@rollup/rollup-linux-loong64-musl@4.57.1': + resolution: {integrity: sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.59.0': - resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} + '@rollup/rollup-linux-ppc64-gnu@4.57.1': + resolution: {integrity: sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-ppc64-musl@4.59.0': - resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} + '@rollup/rollup-linux-ppc64-musl@4.57.1': + resolution: {integrity: sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.59.0': - resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} + '@rollup/rollup-linux-riscv64-gnu@4.57.1': + resolution: {integrity: sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.59.0': - resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} + '@rollup/rollup-linux-riscv64-musl@4.57.1': + resolution: {integrity: sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.59.0': - resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} + '@rollup/rollup-linux-s390x-gnu@4.57.1': + resolution: {integrity: sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.59.0': - resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} + '@rollup/rollup-linux-x64-gnu@4.57.1': + resolution: {integrity: sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.59.0': - resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} + '@rollup/rollup-linux-x64-musl@4.57.1': + resolution: {integrity: sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==} cpu: [x64] os: [linux] - '@rollup/rollup-openbsd-x64@4.59.0': - resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} + '@rollup/rollup-openbsd-x64@4.57.1': + resolution: {integrity: sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.59.0': - resolution: {integrity: sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==} + '@rollup/rollup-openharmony-arm64@4.57.1': + resolution: {integrity: sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.59.0': - resolution: {integrity: sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==} + '@rollup/rollup-win32-arm64-msvc@4.57.1': + resolution: {integrity: sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.59.0': - resolution: {integrity: sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==} + '@rollup/rollup-win32-ia32-msvc@4.57.1': + resolution: {integrity: sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.59.0': - resolution: {integrity: sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==} + '@rollup/rollup-win32-x64-gnu@4.57.1': + resolution: {integrity: sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.59.0': - resolution: {integrity: sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==} + '@rollup/rollup-win32-x64-msvc@4.57.1': + resolution: {integrity: sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==} cpu: [x64] os: [win32] @@ -549,8 +549,8 @@ packages: peerDependencies: acorn: ^8.14.0 - acorn@8.16.0: - resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} hasBin: true @@ -567,8 +567,8 @@ packages: peerDependencies: ajv: ^8.8.2 - ajv@8.18.0: - resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} + ajv@8.17.1: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -582,9 +582,8 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - baseline-browser-mapping@2.10.0: - resolution: {integrity: sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==} - engines: {node: '>=6.0.0'} + baseline-browser-mapping@2.9.19: + resolution: {integrity: sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==} hasBin: true braces@3.0.3: @@ -603,8 +602,8 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - caniuse-lite@1.0.30001777: - resolution: {integrity: sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==} + caniuse-lite@1.0.30001769: + resolution: {integrity: sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==} chai@5.3.3: resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} @@ -657,14 +656,14 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} - electron-to-chromium@1.5.307: - resolution: {integrity: sha512-5z3uFKBWjiNR44nFcYdkcXjKMbg5KXNdciu7mhTPo9tB7NbqSNP2sSnGR+fqknZSCwKkBN+oxiiajWs4dT6ORg==} + electron-to-chromium@1.5.286: + resolution: {integrity: sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enhanced-resolve@5.20.0: - resolution: {integrity: sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ==} + enhanced-resolve@5.19.0: + resolution: {integrity: sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==} engines: {node: '>=10.13.0'} es-module-lexer@1.7.0: @@ -743,8 +742,8 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphql@16.13.1: - resolution: {integrity: sha512-gGgrVCoDKlIZ8fIqXBBb0pPKqDgki0Z/FSKNiQzSGj2uEYHr1tq5wmBegGwJx6QB5S5cM0khSBpi/JFHMCvsmQ==} + graphql@16.12.0: + resolution: {integrity: sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} has-flag@4.0.0: @@ -828,8 +827,8 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - node-releases@2.0.36: - resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} + node-releases@2.0.27: + resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} outvariant@1.4.3: resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} @@ -855,10 +854,13 @@ packages: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} - postcss@8.5.8: - resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -870,11 +872,14 @@ packages: rettime@0.7.0: resolution: {integrity: sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==} - rollup@4.59.0: - resolution: {integrity: sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==} + rollup@4.57.1: + resolution: {integrity: sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + schema-utils@4.3.3: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} @@ -884,6 +889,9 @@ packages: engines: {node: '>=10'} hasBin: true + serialize-javascript@6.0.2: + resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -942,8 +950,8 @@ packages: resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} engines: {node: '>=6'} - terser-webpack-plugin@5.4.0: - resolution: {integrity: sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==} + terser-webpack-plugin@5.3.16: + resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} engines: {node: '>= 10.13.0'} peerDependencies: '@swc/core': '*' @@ -985,11 +993,11 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} - tldts-core@7.0.25: - resolution: {integrity: sha512-ZjCZK0rppSBu7rjHYDYsEaMOIbbT+nWF57hKkv4IUmZWBNrBWBOjIElc0mKRgLM8bm7x/BBlof6t2gi/Oq/Asw==} + tldts-core@7.0.23: + resolution: {integrity: sha512-0g9vrtDQLrNIiCj22HSe9d4mLVG3g5ph5DZ8zCKBr4OtrspmNB6ss7hVyzArAeE88ceZocIEGkyW1Ime7fxPtQ==} - tldts@7.0.25: - resolution: {integrity: sha512-keinCnPbwXEUG3ilrWQZU+CqcTTzHq9m2HhoUP2l7Xmi8l1LuijAXLpAJ5zRW+ifKTNscs4NdCkfkDCBYm352w==} + tldts@7.0.23: + resolution: {integrity: sha512-ASdhgQIBSay0R/eXggAkQ53G4nTJqTXqC2kbaBbdDwM7SkjyZyO0OaaN1/FH7U/yCeqOHDwFO5j8+Os/IS1dXw==} hasBin: true to-regex-range@5.0.1: @@ -1102,12 +1110,12 @@ packages: resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} engines: {node: '>=10.13.0'} - webpack-sources@3.3.4: - resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} + webpack-sources@3.3.3: + resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} engines: {node: '>=10.13.0'} - webpack@5.105.4: - resolution: {integrity: sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==} + webpack@5.105.2: + resolution: {integrity: sha512-dRXm0a2qcHPUBEzVk8uph0xWSjV/xZxenQQbLwnwP7caQCYpqG1qddwlyEkIDkYn0K8tvmcrZ+bOrzoQ3HxCDw==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -1147,39 +1155,39 @@ packages: snapshots: - '@biomejs/biome@2.4.3': + '@biomejs/biome@2.3.11': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.4.3 - '@biomejs/cli-darwin-x64': 2.4.3 - '@biomejs/cli-linux-arm64': 2.4.3 - '@biomejs/cli-linux-arm64-musl': 2.4.3 - '@biomejs/cli-linux-x64': 2.4.3 - '@biomejs/cli-linux-x64-musl': 2.4.3 - '@biomejs/cli-win32-arm64': 2.4.3 - '@biomejs/cli-win32-x64': 2.4.3 - - '@biomejs/cli-darwin-arm64@2.4.3': + '@biomejs/cli-darwin-arm64': 2.3.11 + '@biomejs/cli-darwin-x64': 2.3.11 + '@biomejs/cli-linux-arm64': 2.3.11 + '@biomejs/cli-linux-arm64-musl': 2.3.11 + '@biomejs/cli-linux-x64': 2.3.11 + '@biomejs/cli-linux-x64-musl': 2.3.11 + '@biomejs/cli-win32-arm64': 2.3.11 + '@biomejs/cli-win32-x64': 2.3.11 + + '@biomejs/cli-darwin-arm64@2.3.11': optional: true - '@biomejs/cli-darwin-x64@2.4.3': + '@biomejs/cli-darwin-x64@2.3.11': optional: true - '@biomejs/cli-linux-arm64-musl@2.4.3': + '@biomejs/cli-linux-arm64-musl@2.3.11': optional: true - '@biomejs/cli-linux-arm64@2.4.3': + '@biomejs/cli-linux-arm64@2.3.11': optional: true - '@biomejs/cli-linux-x64-musl@2.4.3': + '@biomejs/cli-linux-x64-musl@2.3.11': optional: true - '@biomejs/cli-linux-x64@2.4.3': + '@biomejs/cli-linux-x64@2.3.11': optional: true - '@biomejs/cli-win32-arm64@2.4.3': + '@biomejs/cli-win32-arm64@2.3.11': optional: true - '@biomejs/cli-win32-x64@2.4.3': + '@biomejs/cli-win32-x64@2.3.11': optional: true '@bundled-es-modules/cookie@2.0.1': @@ -1333,79 +1341,79 @@ snapshots: '@open-draft/until@2.1.0': {} - '@rollup/rollup-android-arm-eabi@4.59.0': + '@rollup/rollup-android-arm-eabi@4.57.1': optional: true - '@rollup/rollup-android-arm64@4.59.0': + '@rollup/rollup-android-arm64@4.57.1': optional: true - '@rollup/rollup-darwin-arm64@4.59.0': + '@rollup/rollup-darwin-arm64@4.57.1': optional: true - '@rollup/rollup-darwin-x64@4.59.0': + '@rollup/rollup-darwin-x64@4.57.1': optional: true - '@rollup/rollup-freebsd-arm64@4.59.0': + '@rollup/rollup-freebsd-arm64@4.57.1': optional: true - '@rollup/rollup-freebsd-x64@4.59.0': + '@rollup/rollup-freebsd-x64@4.57.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + '@rollup/rollup-linux-arm-gnueabihf@4.57.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.59.0': + '@rollup/rollup-linux-arm-musleabihf@4.57.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.59.0': + '@rollup/rollup-linux-arm64-gnu@4.57.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.59.0': + '@rollup/rollup-linux-arm64-musl@4.57.1': optional: true - '@rollup/rollup-linux-loong64-gnu@4.59.0': + '@rollup/rollup-linux-loong64-gnu@4.57.1': optional: true - '@rollup/rollup-linux-loong64-musl@4.59.0': + '@rollup/rollup-linux-loong64-musl@4.57.1': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.59.0': + '@rollup/rollup-linux-ppc64-gnu@4.57.1': optional: true - '@rollup/rollup-linux-ppc64-musl@4.59.0': + '@rollup/rollup-linux-ppc64-musl@4.57.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.59.0': + '@rollup/rollup-linux-riscv64-gnu@4.57.1': optional: true - '@rollup/rollup-linux-riscv64-musl@4.59.0': + '@rollup/rollup-linux-riscv64-musl@4.57.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.59.0': + '@rollup/rollup-linux-s390x-gnu@4.57.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.59.0': + '@rollup/rollup-linux-x64-gnu@4.57.1': optional: true - '@rollup/rollup-linux-x64-musl@4.59.0': + '@rollup/rollup-linux-x64-musl@4.57.1': optional: true - '@rollup/rollup-openbsd-x64@4.59.0': + '@rollup/rollup-openbsd-x64@4.57.1': optional: true - '@rollup/rollup-openharmony-arm64@4.59.0': + '@rollup/rollup-openharmony-arm64@4.57.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.59.0': + '@rollup/rollup-win32-arm64-msvc@4.57.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.59.0': + '@rollup/rollup-win32-ia32-msvc@4.57.1': optional: true - '@rollup/rollup-win32-x64-gnu@4.59.0': + '@rollup/rollup-win32-x64-gnu@4.57.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.59.0': + '@rollup/rollup-win32-x64-msvc@4.57.1': optional: true '@types/chai@5.2.3': @@ -1560,22 +1568,22 @@ snapshots: '@xtuc/long@4.2.2': {} - acorn-import-phases@1.0.4(acorn@8.16.0): + acorn-import-phases@1.0.4(acorn@8.15.0): dependencies: - acorn: 8.16.0 + acorn: 8.15.0 - acorn@8.16.0: {} + acorn@8.15.0: {} - ajv-formats@2.1.1(ajv@8.18.0): + ajv-formats@2.1.1(ajv@8.17.1): optionalDependencies: - ajv: 8.18.0 + ajv: 8.17.1 - ajv-keywords@5.1.0(ajv@8.18.0): + ajv-keywords@5.1.0(ajv@8.17.1): dependencies: - ajv: 8.18.0 + ajv: 8.17.1 fast-deep-equal: 3.1.3 - ajv@8.18.0: + ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 fast-uri: 3.1.0 @@ -1590,7 +1598,7 @@ snapshots: assertion-error@2.0.1: {} - baseline-browser-mapping@2.10.0: {} + baseline-browser-mapping@2.9.19: {} braces@3.0.3: dependencies: @@ -1598,17 +1606,17 @@ snapshots: browserslist@4.28.1: dependencies: - baseline-browser-mapping: 2.10.0 - caniuse-lite: 1.0.30001777 - electron-to-chromium: 1.5.307 - node-releases: 2.0.36 + baseline-browser-mapping: 2.9.19 + caniuse-lite: 1.0.30001769 + electron-to-chromium: 1.5.286 + node-releases: 2.0.27 update-browserslist-db: 1.2.3(browserslist@4.28.1) buffer-from@1.1.2: {} cac@6.7.14: {} - caniuse-lite@1.0.30001777: {} + caniuse-lite@1.0.30001769: {} chai@5.3.3: dependencies: @@ -1651,11 +1659,11 @@ snapshots: deep-eql@5.0.2: {} - electron-to-chromium@1.5.307: {} + electron-to-chromium@1.5.286: {} emoji-regex@8.0.0: {} - enhanced-resolve@5.20.0: + enhanced-resolve@5.19.0: dependencies: graceful-fs: 4.2.11 tapable: 2.3.0 @@ -1737,7 +1745,7 @@ snapshots: graceful-fs@4.2.11: {} - graphql@16.13.1: {} + graphql@16.12.0: {} has-flag@4.0.0: {} @@ -1794,7 +1802,7 @@ snapshots: '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 '@types/statuses': 2.0.6 - graphql: 16.13.1 + graphql: 16.12.0 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 @@ -1816,7 +1824,7 @@ snapshots: neo-async@2.6.2: {} - node-releases@2.0.36: {} + node-releases@2.0.27: {} outvariant@1.4.3: {} @@ -1832,58 +1840,68 @@ snapshots: picomatch@4.0.3: {} - postcss@8.5.8: + postcss@8.5.6: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 + randombytes@2.1.0: + dependencies: + safe-buffer: 5.2.1 + require-directory@2.1.1: {} require-from-string@2.0.2: {} rettime@0.7.0: {} - rollup@4.59.0: + rollup@4.57.1: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.59.0 - '@rollup/rollup-android-arm64': 4.59.0 - '@rollup/rollup-darwin-arm64': 4.59.0 - '@rollup/rollup-darwin-x64': 4.59.0 - '@rollup/rollup-freebsd-arm64': 4.59.0 - '@rollup/rollup-freebsd-x64': 4.59.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.59.0 - '@rollup/rollup-linux-arm-musleabihf': 4.59.0 - '@rollup/rollup-linux-arm64-gnu': 4.59.0 - '@rollup/rollup-linux-arm64-musl': 4.59.0 - '@rollup/rollup-linux-loong64-gnu': 4.59.0 - '@rollup/rollup-linux-loong64-musl': 4.59.0 - '@rollup/rollup-linux-ppc64-gnu': 4.59.0 - '@rollup/rollup-linux-ppc64-musl': 4.59.0 - '@rollup/rollup-linux-riscv64-gnu': 4.59.0 - '@rollup/rollup-linux-riscv64-musl': 4.59.0 - '@rollup/rollup-linux-s390x-gnu': 4.59.0 - '@rollup/rollup-linux-x64-gnu': 4.59.0 - '@rollup/rollup-linux-x64-musl': 4.59.0 - '@rollup/rollup-openbsd-x64': 4.59.0 - '@rollup/rollup-openharmony-arm64': 4.59.0 - '@rollup/rollup-win32-arm64-msvc': 4.59.0 - '@rollup/rollup-win32-ia32-msvc': 4.59.0 - '@rollup/rollup-win32-x64-gnu': 4.59.0 - '@rollup/rollup-win32-x64-msvc': 4.59.0 + '@rollup/rollup-android-arm-eabi': 4.57.1 + '@rollup/rollup-android-arm64': 4.57.1 + '@rollup/rollup-darwin-arm64': 4.57.1 + '@rollup/rollup-darwin-x64': 4.57.1 + '@rollup/rollup-freebsd-arm64': 4.57.1 + '@rollup/rollup-freebsd-x64': 4.57.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.57.1 + '@rollup/rollup-linux-arm-musleabihf': 4.57.1 + '@rollup/rollup-linux-arm64-gnu': 4.57.1 + '@rollup/rollup-linux-arm64-musl': 4.57.1 + '@rollup/rollup-linux-loong64-gnu': 4.57.1 + '@rollup/rollup-linux-loong64-musl': 4.57.1 + '@rollup/rollup-linux-ppc64-gnu': 4.57.1 + '@rollup/rollup-linux-ppc64-musl': 4.57.1 + '@rollup/rollup-linux-riscv64-gnu': 4.57.1 + '@rollup/rollup-linux-riscv64-musl': 4.57.1 + '@rollup/rollup-linux-s390x-gnu': 4.57.1 + '@rollup/rollup-linux-x64-gnu': 4.57.1 + '@rollup/rollup-linux-x64-musl': 4.57.1 + '@rollup/rollup-openbsd-x64': 4.57.1 + '@rollup/rollup-openharmony-arm64': 4.57.1 + '@rollup/rollup-win32-arm64-msvc': 4.57.1 + '@rollup/rollup-win32-ia32-msvc': 4.57.1 + '@rollup/rollup-win32-x64-gnu': 4.57.1 + '@rollup/rollup-win32-x64-msvc': 4.57.1 fsevents: 2.3.3 + safe-buffer@5.2.1: {} + schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.18.0 - ajv-formats: 2.1.1(ajv@8.18.0) - ajv-keywords: 5.1.0(ajv@8.18.0) + ajv: 8.17.1 + ajv-formats: 2.1.1(ajv@8.17.1) + ajv-keywords: 5.1.0(ajv@8.17.1) semver@7.7.4: {} + serialize-javascript@6.0.2: + dependencies: + randombytes: 2.1.0 + siginfo@2.0.0: {} signal-exit@4.1.0: {} @@ -1931,18 +1949,19 @@ snapshots: tapable@2.3.0: {} - terser-webpack-plugin@5.4.0(webpack@5.105.4): + terser-webpack-plugin@5.3.16(webpack@5.105.2): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 + serialize-javascript: 6.0.2 terser: 5.46.0 - webpack: 5.105.4 + webpack: 5.105.2 terser@5.46.0: dependencies: '@jridgewell/source-map': 0.3.11 - acorn: 8.16.0 + acorn: 8.15.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -1961,11 +1980,11 @@ snapshots: tinyspy@4.0.4: {} - tldts-core@7.0.25: {} + tldts-core@7.0.23: {} - tldts@7.0.25: + tldts@7.0.23: dependencies: - tldts-core: 7.0.25 + tldts-core: 7.0.23 to-regex-range@5.0.1: dependencies: @@ -1973,17 +1992,17 @@ snapshots: tough-cookie@6.0.0: dependencies: - tldts: 7.0.25 + tldts: 7.0.23 - ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.4): + ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.2): dependencies: chalk: 4.1.2 - enhanced-resolve: 5.20.0 + enhanced-resolve: 5.19.0 micromatch: 4.0.8 semver: 7.7.4 source-map: 0.7.6 typescript: 5.7.3 - webpack: 5.105.4 + webpack: 5.105.2 type-fest@4.41.0: {} @@ -2023,8 +2042,8 @@ snapshots: esbuild: 0.27.3 fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 - postcss: 8.5.8 - rollup: 4.59.0 + postcss: 8.5.6 + rollup: 4.57.1 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 18.19.130 @@ -2077,9 +2096,9 @@ snapshots: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - webpack-sources@3.3.4: {} + webpack-sources@3.3.3: {} - webpack@5.105.4: + webpack@5.105.2: dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.8 @@ -2087,11 +2106,11 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.16.0 - acorn-import-phases: 1.0.4(acorn@8.16.0) + acorn: 8.15.0 + acorn-import-phases: 1.0.4(acorn@8.15.0) browserslist: 4.28.1 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.20.0 + enhanced-resolve: 5.19.0 es-module-lexer: 2.0.0 eslint-scope: 5.1.1 events: 3.3.0 @@ -2103,9 +2122,9 @@ snapshots: neo-async: 2.6.2 schema-utils: 4.3.3 tapable: 2.3.0 - terser-webpack-plugin: 5.4.0(webpack@5.105.4) + terser-webpack-plugin: 5.3.16(webpack@5.105.2) watchpack: 2.5.1 - webpack-sources: 3.3.4 + webpack-sources: 3.3.3 transitivePeerDependencies: - '@swc/core' - esbuild diff --git a/reference.md b/reference.md index dfaf381..6309719 100644 --- a/reference.md +++ b/reference.md @@ -3638,16 +3638,22 @@ await client.webhooks.createWebhook({
- -This is an enterprise feature. Contact us to activate it for your account. + +To have it activated please send us a request and we will activate it for your account. -Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body. +Exports webhook event history to CSV format for analysis and reporting. + +Use this to: +- Generate comprehensive webhook event reports +- Analyze webhook delivery patterns and success rates +- Export event data for external analysis tools +- Create historical reports for compliance and auditing +- Track webhook performance and reliability metrics -Use this endpoint to: -- Export webhook event history filtered by date range, event type, or email address -- Generate reports for compliance, auditing, or performance analysis -- Track delivery patterns and webhook reliability over time +Key information returned: +- Process ID for tracking export completion +- CSV file will be delivered to specified webhook URL
@@ -4375,8 +4381,12 @@ await client.externalFeeds.deleteExternalFeed({
-Custom objects are only available to Enterprise plans. -This feature is in beta. These are subject to change. + +Custom objects are only available to Enterprise plans. + +This feature is in beta. These are subject to change. + + This API allows bulk upsert of object records in a single request. Each object record may include - Attributes - Identifiers @@ -4390,8 +4400,8 @@ This API allows bulk upsert of object records in a single request. Each object r - Max 500 attributes defined per object record upsert request - This is coherent with schema limitation: an object cannot have more than 500 attributes. - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - - Max 10 associations defined per associated object type, in each record of the request - - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests. + - Max 10 associations defined per object record upsert request + - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. **Errors:** - Make sure both object records exist before associating them, else the API will return an error. - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". @@ -4460,8 +4470,12 @@ await client.customObjects.upsertrecords({
-Custom objects are only available to Enterprise plans. -This feature is in beta. These are subject to change. + +Custom objects are only available to Enterprise plans. + +This feature is in beta. These are subject to change. + + This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint.
@@ -4592,6 +4606,26 @@ await client.customObjects.batchDeleteObjectRecords({
+#### 📝 Description + +
+
+ +
+
+ + +Accepted Number Formats + +91xxxxxxxxxx ++91xxxxxxxxxx +0091xxxxxxxxxx + +
+
+
+
+ #### 🔌 Usage
@@ -4649,8 +4683,6 @@ await client.contacts.getContacts();
-Follow this format when passing a "SMS" phone number as an attribute. -Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx Creates new contacts on Brevo. Contacts can be created by passing either -

1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
@@ -5013,7 +5045,9 @@ await client.contacts.updateBatchContacts();
-attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. + +attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. +
@@ -5146,11 +5180,17 @@ await client.contacts.requestContactExport({
-Ongoing changes for this endpoint + +Ongoing changes for this endpoint + We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + These are non breaking changes. + The default value for the attributes will be 0. -The uniqueSubscribers field is deprecated + +The uniqueSubscribers field is deprecated +
@@ -5262,9 +5302,13 @@ await client.contacts.createFolder({});
-Ongoing changes for this endpoint. + +Ongoing changes for this endpoint. + We're dropping support for the response attributes totalSubscribers and totalBlacklisted. -These are non breaking changes. The default value for the attributes will be 0. + +These are non breaking changes. The default value for the attributes will be 0. +
@@ -5432,9 +5476,13 @@ await client.contacts.deleteFolder({
-Ongoing changes for this endpoint. + +Ongoing changes for this endpoint. + We're dropping support for the response attributes totalSubscribers and totalBlacklisted. -These are non breaking changes. The default value for the attributes will be 0. + +These are non breaking changes. The default value for the attributes will be 0. +
@@ -5562,9 +5610,13 @@ await client.contacts.importContacts();
-Ongoing changes for this endpoint. + +Ongoing changes for this endpoint. + We're dropping support for the response attributes totalSubscribers and totalBlacklisted. -These are non breaking changes. The default value for the attributes will be 0. + +These are non breaking changes. The default value for the attributes will be 0. +
@@ -6040,8 +6092,14 @@ await client.contacts.getSegments();
-Follow this format when passing a "SMS" phone number as an attribute. -Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx + +Accepted Number Formats + +91xxxxxxxxxx ++91xxxxxxxxxx +0091xxxxxxxxxx + + There are 2 ways to get a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
@@ -6107,8 +6165,6 @@ await client.contacts.getContactInfo({
-Follow this format when passing a "SMS" phone number as an attribute. -Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx There are 2 ways to update a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
@@ -7469,7 +7525,8 @@ await client.ecommerce.createOrder({ id: "14", products: [{ price: 99.99, - productId: "P1" + productId: "P1", + quantity: 10 }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z" @@ -7543,7 +7600,8 @@ await client.ecommerce.createBatchOrder({ id: "14", products: [{ price: 99.99, - productId: "P1" + productId: "P1", + quantity: 10 }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z" @@ -8320,72 +8378,6 @@ await client.event.createEvent({
- - - - -
client.event.createBatchEvents({ ...params }) -> void -
-
- -#### 📝 Description - -
-
- -
-
- -Create multiple events to track contacts' interactions in a single request. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.event.createBatchEvents([{ - event_name: "order_created", - identifiers: {} - }]); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Brevo.CreateBatchEventsRequestItem[]` - -
-
- -
-
- -**requestOptions:** `EventClient.RequestOptions` - -
-
-
-
- -
@@ -9558,8 +9550,8 @@ Returns transaction history ```typescript await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, - balanceDefinitionId: "balanceDefinitionId" + contact_id: 1, + balance_definition_id: "balance_definition_id" }); ``` @@ -10246,72 +10238,6 @@ await client.program.getParameterSubscriptionInfo({ - - - - -
client.program.deleteContactSubscription({ ...params }) -> void -
-
- -#### 📝 Description - -
-
- -
-
- -Delete subscription for a contact -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.program.deleteContactSubscription({ - pid: "pid", - cid: 1 -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Brevo.DeleteContactSubscriptionRequest` - -
-
- -
-
- -**requestOptions:** `ProgramClient.RequestOptions` - -
-
-
-
- -
@@ -11918,8 +11844,11 @@ await client.tier.deleteTier({
-The response payload for this endpoint has changed -You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). + +The response payload for this endpoint has changed + +You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). +
@@ -13243,11 +13172,19 @@ await client.whatsAppCampaigns.getWhatsAppCampaigns();
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account -This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + + + +This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. + [Get all the Lists](https://developers.brevo.com/reference/getlists-1) -[Get all the Segments](https://developers.brevo.com/reference/getsegments) + +[Get all the Segments](https://developers.brevo.com/reference/getsegments) +
@@ -13315,8 +13252,11 @@ await client.whatsAppCampaigns.createWhatsAppCampaign({
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +
@@ -13371,8 +13311,11 @@ await client.whatsAppCampaigns.getWhatsAppConfig();
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +
@@ -13489,8 +13432,11 @@ await client.whatsAppCampaigns.getWhatsAppTemplates();
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +
@@ -13555,11 +13501,11 @@ await client.whatsAppCampaigns.sendWhatsAppTemplateApproval({
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account -This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. -[Get all the Lists](https://developers.brevo.com/reference/getlists-1) -[Get all the Segments](https://developers.brevo.com/reference/getsegments) + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +
@@ -13624,11 +13570,19 @@ await client.whatsAppCampaigns.getWhatsAppCampaign({
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account -This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. + +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + + + +This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. + [Get all the Lists](https://developers.brevo.com/reference/getlists-1) -[Get all the Segments](https://developers.brevo.com/reference/getsegments) + +[Get all the Segments](https://developers.brevo.com/reference/getsegments) +
@@ -14149,108 +14103,6 @@ await client.companies.createACompanyDealAttribute({ - - - - -
client.companies.deleteAnAttribute({ ...params }) -> void -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.companies.deleteAnAttribute({ - id: "id" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Brevo.DeleteCrmAttributesIdRequest` - -
-
- -
-
- -**requestOptions:** `CompaniesClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.companies.updateAnAttribute({ ...params }) -> void -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.companies.updateAnAttribute({ - id: "id" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Brevo.PatchCrmAttributesIdRequest` - -
-
- -
-
- -**requestOptions:** `CompaniesClient.RequestOptions` - -
-
-
-
- -
@@ -15675,8 +15527,7 @@ await client.tasks.getAllTaskTypes();
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**)
@@ -16411,9 +16262,13 @@ await client.transactionalEmails.getTransacEmailsList();
-You can get the uuid using either of the following methods: + +You can get the uuid using either of the following methods: + Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response. -The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. + +The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. +
@@ -17063,9 +16918,15 @@ await client.transactionalEmails.sendTestTemplate({
-If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. -Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. -Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. + +If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. + +Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. + + + +Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. +
@@ -17367,4 +17228,3 @@ await client.smsTemplates.getSmsTemplates(); - diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 662fab3..61cff76 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions> { - const { pid, limit, offset, sortField, sort, contactId, balanceDefinitionId, filters } = request; + const { + pid, + limit, + offset, + sort_field: sortField, + sort, + contact_id: contactId, + balance_definition_id: balanceDefinitionId, + filters, + } = request; const _queryParams: Record = { limit, offset, - sortField: sortField != null ? sortField : undefined, + sort_field: sortField != null ? sortField : undefined, sort: sort != null ? sort : undefined, - contactId, - balanceDefinitionId, + contact_id: contactId, + balance_definition_id: balanceDefinitionId, filters, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); diff --git a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts index 4e44bdd..0f78401 100644 --- a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts +++ b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts @@ -6,8 +6,8 @@ import type * as Brevo from "../../../../index.js"; * @example * { * pid: "pid", - * contactId: 1, - * balanceDefinitionId: "balanceDefinitionId" + * contact_id: 1, + * balance_definition_id: "balance_definition_id" * } */ export interface GetLoyaltyBalanceProgramsPidTransactionHistoryRequest { @@ -18,13 +18,13 @@ export interface GetLoyaltyBalanceProgramsPidTransactionHistoryRequest { /** Skip a number of records */ offset?: number; /** Field to sort by */ - sortField?: "createdAt"; + sort_field?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField; /** Sort order, either asc or desc */ sort?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort; /** Contact ID */ - contactId: number; + contact_id: number; /** Balance Definition ID */ - balanceDefinitionId: string; + balance_definition_id: string; /** Filters to apply */ filters?: string | string[]; } diff --git a/src/api/resources/balance/exports.ts b/src/api/resources/balance/exports.ts deleted file mode 100644 index 7d8e9e6..0000000 --- a/src/api/resources/balance/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { BalanceClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts new file mode 100644 index 0000000..06c550c --- /dev/null +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField = { + Name: "name", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} as const; +export type GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField = + (typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField)[keyof typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField]; diff --git a/src/api/resources/balance/types/index.ts b/src/api/resources/balance/types/index.ts index 6ede06d..80b736d 100644 --- a/src/api/resources/balance/types/index.ts +++ b/src/api/resources/balance/types/index.ts @@ -7,6 +7,7 @@ export * from "./GetBalanceDefinitionRequestVersion.js"; export * from "./GetBalanceLimitRequestVersion.js"; export * from "./GetContactBalancesResponse.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.js"; +export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.js"; export * from "./GetSubscriptionBalancesResponse.js"; export * from "./PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.js"; diff --git a/src/api/resources/companies/client/Client.ts b/src/api/resources/companies/client/Client.ts index 025cc1c..e10046a 100644 --- a/src/api/resources/companies/client/Client.ts +++ b/src/api/resources/companies/client/Client.ts @@ -590,145 +590,6 @@ export class CompaniesClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/attributes"); } - /** - * @param {Brevo.DeleteCrmAttributesIdRequest} request - * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Brevo.BadRequestError} - * @throws {@link Brevo.NotFoundError} - * - * @example - * await client.companies.deleteAnAttribute({ - * id: "id" - * }) - */ - public deleteAnAttribute( - request: Brevo.DeleteCrmAttributesIdRequest, - requestOptions?: CompaniesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__deleteAnAttribute(request, requestOptions)); - } - - private async __deleteAnAttribute( - request: Brevo.DeleteCrmAttributesIdRequest, - requestOptions?: CompaniesClient.RequestOptions, - ): Promise> { - const { id } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.BrevoEnvironment.Default, - `crm/attributes/${core.url.encodePathParam(id)}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); - case 404: - throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); - default: - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/crm/attributes/{id}"); - } - - /** - * @param {Brevo.PatchCrmAttributesIdRequest} request - * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Brevo.BadRequestError} - * @throws {@link Brevo.NotFoundError} - * - * @example - * await client.companies.updateAnAttribute({ - * id: "id" - * }) - */ - public updateAnAttribute( - request: Brevo.PatchCrmAttributesIdRequest, - requestOptions?: CompaniesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__updateAnAttribute(request, requestOptions)); - } - - private async __updateAnAttribute( - request: Brevo.PatchCrmAttributesIdRequest, - requestOptions?: CompaniesClient.RequestOptions, - ): Promise> { - const { id, ..._body } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.BrevoEnvironment.Default, - `crm/attributes/${core.url.encodePathParam(id)}`, - ), - method: "PATCH", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: _body, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); - case 404: - throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); - default: - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/crm/attributes/{id}"); - } - /** * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * diff --git a/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts b/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts deleted file mode 100644 index 69f8d3e..0000000 --- a/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * id: "id" - * } - */ -export interface DeleteCrmAttributesIdRequest { - /** Attribute ID */ - id: string; -} diff --git a/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts b/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts deleted file mode 100644 index dce4554..0000000 --- a/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts +++ /dev/null @@ -1,38 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * id: "id" - * } - */ -export interface PatchCrmAttributesIdRequest { - /** Attribute ID */ - id: string; - /** Attribute display label */ - label?: string; - /** Updated labels for selectable options */ - optionsLabels?: PatchCrmAttributesIdRequest.OptionsLabels.Item[]; - /** The type of object the attribute belongs to, it cannot be updated after creation */ - objectType?: PatchCrmAttributesIdRequest.ObjectType; -} - -export namespace PatchCrmAttributesIdRequest { - export type OptionsLabels = OptionsLabels.Item[]; - - export namespace OptionsLabels { - export interface Item { - /** Internal option identifier */ - key: string; - /** Display label for the option */ - value: string; - } - } - - /** The type of object the attribute belongs to, it cannot be updated after creation */ - export const ObjectType = { - Companies: "companies", - Deals: "deals", - } as const; - export type ObjectType = (typeof ObjectType)[keyof typeof ObjectType]; -} diff --git a/src/api/resources/companies/client/requests/index.ts b/src/api/resources/companies/client/requests/index.ts index d3b626f..0d519c9 100644 --- a/src/api/resources/companies/client/requests/index.ts +++ b/src/api/resources/companies/client/requests/index.ts @@ -1,10 +1,8 @@ export type { DeleteCompaniesIdRequest } from "./DeleteCompaniesIdRequest.js"; -export type { DeleteCrmAttributesIdRequest } from "./DeleteCrmAttributesIdRequest.js"; export type { GetCompaniesIdRequest } from "./GetCompaniesIdRequest.js"; export type { GetCompaniesRequest } from "./GetCompaniesRequest.js"; export type { PatchCompaniesIdRequest } from "./PatchCompaniesIdRequest.js"; export type { PatchCompaniesLinkUnlinkIdRequest } from "./PatchCompaniesLinkUnlinkIdRequest.js"; -export { PatchCrmAttributesIdRequest } from "./PatchCrmAttributesIdRequest.js"; export type { PostCompaniesImportRequest } from "./PostCompaniesImportRequest.js"; export type { PostCompaniesRequest } from "./PostCompaniesRequest.js"; export { PostCrmAttributesRequest } from "./PostCrmAttributesRequest.js"; diff --git a/src/api/resources/companies/exports.ts b/src/api/resources/companies/exports.ts deleted file mode 100644 index 2ca4d18..0000000 --- a/src/api/resources/companies/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { CompaniesClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/contacts/client/Client.ts b/src/api/resources/contacts/client/Client.ts index ffe5862..535274e 100644 --- a/src/api/resources/contacts/client/Client.ts +++ b/src/api/resources/contacts/client/Client.ts @@ -23,6 +23,14 @@ export class ContactsClient { } /** + * + * Accepted Number Formats + * + * 91xxxxxxxxxx + * +91xxxxxxxxxx + * 0091xxxxxxxxxx + * + * * @param {Brevo.GetContactsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -102,8 +110,6 @@ export class ContactsClient { } /** - * Follow this format when passing a "SMS" phone number as an attribute. - * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx * Creates new contacts on Brevo. Contacts can be created by passing either -

1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
* * @param {Brevo.CreateContactRequest} request @@ -594,7 +600,9 @@ export class ContactsClient { } /** - * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. + * + * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. + * * * @param {Brevo.CreateDoiContactRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -746,11 +754,17 @@ export class ContactsClient { } /** - * Ongoing changes for this endpoint + * + * Ongoing changes for this endpoint + * * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. + * * These are non breaking changes. + * * The default value for the attributes will be 0. - * The uniqueSubscribers field is deprecated + * + * The uniqueSubscribers field is deprecated + * * * @param {Brevo.GetFoldersRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -885,9 +899,13 @@ export class ContactsClient { } /** - * Ongoing changes for this endpoint. + * + * Ongoing changes for this endpoint. + * * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * These are non breaking changes. The default value for the attributes will be 0. + * + * These are non breaking changes. The default value for the attributes will be 0. + * * * @param {Brevo.GetFolderRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1102,9 +1120,13 @@ export class ContactsClient { } /** - * Ongoing changes for this endpoint. + * + * Ongoing changes for this endpoint. + * * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * These are non breaking changes. The default value for the attributes will be 0. + * + * These are non breaking changes. The default value for the attributes will be 0. + * * * @param {Brevo.GetFolderListsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1251,9 +1273,13 @@ export class ContactsClient { } /** - * Ongoing changes for this endpoint. + * + * Ongoing changes for this endpoint. + * * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * These are non breaking changes. The default value for the attributes will be 0. + * + * These are non breaking changes. The default value for the attributes will be 0. + * * * @param {Brevo.GetListsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1947,8 +1973,14 @@ export class ContactsClient { } /** - * Follow this format when passing a "SMS" phone number as an attribute. - * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx + * + * Accepted Number Formats + * + * 91xxxxxxxxxx + * +91xxxxxxxxxx + * 0091xxxxxxxxxx + * + * * There are 2 ways to get a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges. * * @param {Brevo.GetContactInfoRequest} request @@ -2024,8 +2056,6 @@ export class ContactsClient { } /** - * Follow this format when passing a "SMS" phone number as an attribute. - * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx * There are 2 ways to update a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute * * @param {Brevo.UpdateContactRequest} request diff --git a/src/api/resources/contacts/client/requests/AddContactToListRequest.ts b/src/api/resources/contacts/client/requests/AddContactToListRequest.ts index 2ce05f9..0cfa627 100644 --- a/src/api/resources/contacts/client/requests/AddContactToListRequest.ts +++ b/src/api/resources/contacts/client/requests/AddContactToListRequest.ts @@ -26,6 +26,30 @@ import type * as Brevo from "../../../../index.js"; * ids: [1, 2] * } * } + * + * @example + * { + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * emails: ["jeff32@example.com", "jim56@example.com"] + * } + * } */ export interface AddContactToListRequest { /** Id of the list */ diff --git a/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts b/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts index edb52db..860544a 100644 --- a/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts +++ b/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts @@ -34,6 +34,38 @@ import type * as Brevo from "../../../../index.js"; * ids: [1, 2] * } * } + * + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } + * + * @example + * { + * listId: 1000000, + * body: { + * all: true + * } + * } */ export interface RemoveContactFromListRequest { /** Id of the list */ diff --git a/src/api/resources/contacts/exports.ts b/src/api/resources/contacts/exports.ts deleted file mode 100644 index 657fdf5..0000000 --- a/src/api/resources/contacts/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { ContactsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/conversations/exports.ts b/src/api/resources/conversations/exports.ts deleted file mode 100644 index 82be4a7..0000000 --- a/src/api/resources/conversations/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { ConversationsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/coupons/exports.ts b/src/api/resources/coupons/exports.ts deleted file mode 100644 index 8bd048a..0000000 --- a/src/api/resources/coupons/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { CouponsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/customObjects/client/Client.ts b/src/api/resources/customObjects/client/Client.ts index 012c9ad..4d8d8ff 100644 --- a/src/api/resources/customObjects/client/Client.ts +++ b/src/api/resources/customObjects/client/Client.ts @@ -23,8 +23,12 @@ export class CustomObjectsClient { } /** - * Custom objects are only available to Enterprise plans. - * This feature is in beta. These are subject to change. + * + * Custom objects are only available to Enterprise plans. + * + * This feature is in beta. These are subject to change. + * + * * This API allows bulk upsert of object records in a single request. Each object record may include * - Attributes * - Identifiers @@ -38,8 +42,8 @@ export class CustomObjectsClient { * - Max 500 attributes defined per object record upsert request * - This is coherent with schema limitation: an object cannot have more than 500 attributes. * - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - * - Max 10 associations defined per associated object type, in each record of the request - * - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests. + * - Max 10 associations defined per object record upsert request + * - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. * **Errors:** * - Make sure both object records exist before associating them, else the API will return an error. * - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". @@ -127,8 +131,12 @@ export class CustomObjectsClient { } /** - * Custom objects are only available to Enterprise plans. - * This feature is in beta. These are subject to change. + * + * Custom objects are only available to Enterprise plans. + * + * This feature is in beta. These are subject to change. + * + * * This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint. * * @param {Brevo.GetrecordsRequest} request diff --git a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts index 36e0ce2..faf7fb5 100644 --- a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts +++ b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts @@ -20,7 +20,7 @@ export namespace UpsertrecordsRequest { export namespace Records { export interface Item { associations?: Item.Associations.Item[] | undefined; - /** Attributes attached with the object record. Only the already created attributes will be used with records. Pass the value with the attributes key you want to set or update for the object record. Minimum 1 attribute is required. */ + /** Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required. */ attributes?: Record | undefined; /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request. */ identifiers?: Item.Identifiers | undefined; diff --git a/src/api/resources/customObjects/exports.ts b/src/api/resources/customObjects/exports.ts deleted file mode 100644 index 5be143e..0000000 --- a/src/api/resources/customObjects/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { CustomObjectsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts index d7b1c12..bc889e6 100644 --- a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts +++ b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts @@ -2,6 +2,6 @@ export interface UpsertrecordsResponse { message?: string | undefined; - /** Unique Id for the batch process used to track the status of the batch. **How to use this processId:** Refer to the [Get process status API](https://developers.brevo.com/reference/get-process) to check the execution status of this batch using the returned `processId`. */ + /** Unique Id for the batch process used to track the status of the batch. */ processId?: number | undefined; } diff --git a/src/api/resources/deals/client/Client.ts b/src/api/resources/deals/client/Client.ts index d0e428b..ffb26c4 100644 --- a/src/api/resources/deals/client/Client.ts +++ b/src/api/resources/deals/client/Client.ts @@ -584,8 +584,6 @@ export class DealsClient { } /** - * @deprecated - * * This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. * * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/deals/exports.ts b/src/api/resources/deals/exports.ts deleted file mode 100644 index 1c1e9ee..0000000 --- a/src/api/resources/deals/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { DealsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts b/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts index b5071d8..7b80387 100644 --- a/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts +++ b/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts @@ -1,6 +1,11 @@ // This file was auto-generated by Fern from our API Definition. /** + * @example + * { + * domainName: "domainName" + * } + * * @example * { * domainName: "domainName" diff --git a/src/api/resources/domains/client/requests/CreateDomainRequest.ts b/src/api/resources/domains/client/requests/CreateDomainRequest.ts index 09e38e9..acb9725 100644 --- a/src/api/resources/domains/client/requests/CreateDomainRequest.ts +++ b/src/api/resources/domains/client/requests/CreateDomainRequest.ts @@ -15,6 +15,16 @@ * { * name: "test.example.com" * } + * + * @example + * { + * name: "mycompany.com" + * } + * + * @example + * { + * name: "mycompany.com" + * } */ export interface CreateDomainRequest { /** Domain name to be added */ diff --git a/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts b/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts index a9880eb..03b367f 100644 --- a/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts +++ b/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts @@ -1,6 +1,11 @@ // This file was auto-generated by Fern from our API Definition. /** + * @example + * { + * domainName: "domainName" + * } + * * @example * { * domainName: "domainName" diff --git a/src/api/resources/domains/exports.ts b/src/api/resources/domains/exports.ts deleted file mode 100644 index 7752741..0000000 --- a/src/api/resources/domains/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { DomainsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index b85d222..a3b3a4a 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -856,7 +856,8 @@ export class EcommerceClient { * id: "14", * products: [{ * price: 99.99, - * productId: "P1" + * productId: "P1", + * quantity: 10 * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" @@ -934,7 +935,8 @@ export class EcommerceClient { * id: "14", * products: [{ * price: 99.99, - * productId: "P1" + * productId: "P1", + * quantity: 10 * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" diff --git a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts index 62a9c47..fcecd5a 100644 --- a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts @@ -11,7 +11,8 @@ import type * as Brevo from "../../../../index.js"; * id: "14", * products: [{ * price: 99.99, - * productId: "P1" + * productId: "P1", + * quantity: 10 * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" diff --git a/src/api/resources/ecommerce/exports.ts b/src/api/resources/ecommerce/exports.ts deleted file mode 100644 index 924f6e2..0000000 --- a/src/api/resources/ecommerce/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { EcommerceClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/emailCampaigns/client/Client.ts b/src/api/resources/emailCampaigns/client/Client.ts index d9758c5..29f1aa1 100644 --- a/src/api/resources/emailCampaigns/client/Client.ts +++ b/src/api/resources/emailCampaigns/client/Client.ts @@ -23,8 +23,11 @@ export class EmailCampaignsClient { } /** - * The response payload for this endpoint has changed - * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). + * + * The response payload for this endpoint has changed + * + * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). + * * * @param {Brevo.GetEmailCampaignsRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -267,10 +270,9 @@ export class EmailCampaignsClient { request: Brevo.GetEmailCampaignRequest, requestOptions?: EmailCampaignsClient.RequestOptions, ): Promise> { - const { campaignId, statistics, excludeHtmlContent } = request; + const { campaignId, statistics } = request; const _queryParams: Record = { statistics: statistics != null ? statistics : undefined, - excludeHtmlContent, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( diff --git a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts index d176a52..d77d4ef 100644 --- a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts +++ b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts @@ -13,6 +13,4 @@ export interface GetEmailCampaignRequest { campaignId: number; /** Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. */ statistics?: Brevo.GetEmailCampaignRequestStatistics; - /** Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body */ - excludeHtmlContent?: boolean; } diff --git a/src/api/resources/emailCampaigns/exports.ts b/src/api/resources/emailCampaigns/exports.ts deleted file mode 100644 index d63193f..0000000 --- a/src/api/resources/emailCampaigns/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { EmailCampaignsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts index a6642f8..990d630 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts @@ -3,8 +3,6 @@ import type * as Brevo from "../../../index.js"; export interface GetEmailCampaignResponse { - /** Url of the attachment file. Only available if the campaign has an attachment. */ - attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -60,8 +58,6 @@ export interface GetEmailCampaignResponse { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; - /** List of tags of the campaign */ - tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -86,9 +82,6 @@ export namespace GetEmailCampaignResponse { Queued: "queued", Suspended: "suspended", InProcess: "in_process", - InReview: "in_review", - Cancelling: "cancelling", - Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts index 7e4058e..a7f4447 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts @@ -8,8 +8,6 @@ export const GetEmailCampaignsRequestStatus = { Draft: "draft", InProcess: "inProcess", InReview: "inReview", - Cancelling: "cancelling", - Cancelled: "cancelled", } as const; export type GetEmailCampaignsRequestStatus = (typeof GetEmailCampaignsRequestStatus)[keyof typeof GetEmailCampaignsRequestStatus]; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts index 71d563b..4811eba 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts @@ -13,8 +13,6 @@ export namespace GetEmailCampaignsResponse { export namespace Campaigns { export interface Item { - /** Url of the attachment file. Only available if the campaign has an attachment. */ - attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -70,8 +68,6 @@ export namespace GetEmailCampaignsResponse { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; - /** List of tags of the campaign */ - tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -96,9 +92,6 @@ export namespace GetEmailCampaignsResponse { Queued: "queued", Suspended: "suspended", InProcess: "in_process", - InReview: "in_review", - Cancelling: "cancelling", - Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/resources/event/client/Client.ts b/src/api/resources/event/client/Client.ts index 8ec429f..3d70be3 100644 --- a/src/api/resources/event/client/Client.ts +++ b/src/api/resources/event/client/Client.ts @@ -94,77 +94,4 @@ export class EventClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/events"); } - - /** - * Create multiple events to track contacts' interactions in a single request. - * - * @param {Brevo.CreateBatchEventsRequestItem[]} request - * @param {EventClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Brevo.BadRequestError} - * @throws {@link Brevo.UnauthorizedError} - * - * @example - * await client.event.createBatchEvents([{ - * event_name: "order_created", - * identifiers: {} - * }]) - */ - public createBatchEvents( - request: Brevo.CreateBatchEventsRequestItem[], - requestOptions?: EventClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__createBatchEvents(request, requestOptions)); - } - - private async __createBatchEvents( - request: Brevo.CreateBatchEventsRequestItem[], - requestOptions?: EventClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.BrevoEnvironment.Default, - "events/batch", - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); - case 401: - throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); - default: - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/events/batch"); - } } diff --git a/src/api/resources/event/exports.ts b/src/api/resources/event/exports.ts deleted file mode 100644 index f341a0f..0000000 --- a/src/api/resources/event/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { EventClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/event/index.ts b/src/api/resources/event/index.ts index d9adb1a..914b8c3 100644 --- a/src/api/resources/event/index.ts +++ b/src/api/resources/event/index.ts @@ -1,2 +1 @@ export * from "./client/index.js"; -export * from "./types/index.js"; diff --git a/src/api/resources/event/types/CreateBatchEventsRequestItem.ts b/src/api/resources/event/types/CreateBatchEventsRequestItem.ts deleted file mode 100644 index 2ccc0ac..0000000 --- a/src/api/resources/event/types/CreateBatchEventsRequestItem.ts +++ /dev/null @@ -1,66 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface CreateBatchEventsRequestItem { - /** Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **"FIRSTNAME": "Jane" , "AGE": 37** */ - contact_properties?: Record | undefined; - /** Timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used. */ - event_date?: string | undefined; - /** The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. */ - event_name: string; - /** Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. */ - event_properties?: Record | undefined; - /** Identifies the contact associated with the event. At least one identifier is required. */ - identifiers: CreateBatchEventsRequestItem.Identifiers; - /** Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. */ - object?: CreateBatchEventsRequestItem.Object_ | undefined; -} - -export namespace CreateBatchEventsRequestItem { - export namespace ContactProperties { - export type Value = string | number; - } - - export namespace EventProperties { - export type Value = string | number | Record | unknown[]; - } - - /** - * Identifies the contact associated with the event. At least one identifier is required. - */ - export interface Identifiers { - /** Internal unique contact ID. When present, this takes priority over all other identifiers for event attribution and contact resolution. */ - contact_id?: number | undefined; - /** Email Id associated with the event */ - email_id?: string | undefined; - /** ext_id associated with the event */ - ext_id?: string | undefined; - /** landline_number associated with the event */ - landline_number_id?: string | undefined; - /** SMS associated with the event */ - phone_id?: string | undefined; - /** whatsapp associated with the event */ - whatsapp_id?: string | undefined; - } - - /** - * Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. - */ - export interface Object_ { - /** Identifiers for the object. */ - identifiers?: Object_.Identifiers | undefined; - /** Type of object (e.g., subscription, vehicle, etc.) */ - type?: string | undefined; - } - - export namespace Object_ { - /** - * Identifiers for the object. - */ - export interface Identifiers { - /** External object ID */ - ext_id?: string | undefined; - /** Internal object ID */ - id?: string | undefined; - } - } -} diff --git a/src/api/resources/event/types/index.ts b/src/api/resources/event/types/index.ts deleted file mode 100644 index b2fea88..0000000 --- a/src/api/resources/event/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./CreateBatchEventsRequestItem.js"; diff --git a/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts b/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts index bd3f468..4f01391 100644 --- a/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts +++ b/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts @@ -1,6 +1,16 @@ // This file was auto-generated by Fern from our API Definition. /** + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" + * } + * + * @example + * { + * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" + * } + * * @example * { * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" diff --git a/src/api/resources/externalFeeds/exports.ts b/src/api/resources/externalFeeds/exports.ts deleted file mode 100644 index c87b185..0000000 --- a/src/api/resources/externalFeeds/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { ExternalFeedsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/files/exports.ts b/src/api/resources/files/exports.ts deleted file mode 100644 index 679b539..0000000 --- a/src/api/resources/files/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { FilesClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/inboundParsing/client/Client.ts b/src/api/resources/inboundParsing/client/Client.ts index 1691671..c33ce9e 100644 --- a/src/api/resources/inboundParsing/client/Client.ts +++ b/src/api/resources/inboundParsing/client/Client.ts @@ -167,7 +167,6 @@ export class InboundParsingClient { /** * This endpoint will retrieve inbound attachment with download token. - * * @throws {@link Brevo.BadRequestError} * @throws {@link Brevo.NotFoundError} */ diff --git a/src/api/resources/inboundParsing/exports.ts b/src/api/resources/inboundParsing/exports.ts deleted file mode 100644 index e380874..0000000 --- a/src/api/resources/inboundParsing/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { InboundParsingClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 7252a47..b4c41cb 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -33,7 +33,6 @@ export * as emailCampaigns from "./emailCampaigns/index.js"; export * from "./emailCampaigns/types/index.js"; export * from "./event/client/requests/index.js"; export * as event from "./event/index.js"; -export * from "./event/types/index.js"; export * from "./externalFeeds/client/requests/index.js"; export * as externalFeeds from "./externalFeeds/index.js"; export * from "./externalFeeds/types/index.js"; diff --git a/src/api/resources/masterAccount/exports.ts b/src/api/resources/masterAccount/exports.ts deleted file mode 100644 index 2eeb5e1..0000000 --- a/src/api/resources/masterAccount/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { MasterAccountClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/notes/exports.ts b/src/api/resources/notes/exports.ts deleted file mode 100644 index 13f20ba..0000000 --- a/src/api/resources/notes/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { NotesClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/payments/exports.ts b/src/api/resources/payments/exports.ts deleted file mode 100644 index 8e9673c..0000000 --- a/src/api/resources/payments/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { PaymentsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/process/client/requests/GetProcessRequest.ts b/src/api/resources/process/client/requests/GetProcessRequest.ts index 3e45723..8ead15f 100644 --- a/src/api/resources/process/client/requests/GetProcessRequest.ts +++ b/src/api/resources/process/client/requests/GetProcessRequest.ts @@ -1,6 +1,21 @@ // This file was auto-generated by Fern from our API Definition. /** + * @example + * { + * processId: 1000000 + * } + * + * @example + * { + * processId: 1000000 + * } + * + * @example + * { + * processId: 1000000 + * } + * * @example * { * processId: 1000000 diff --git a/src/api/resources/process/exports.ts b/src/api/resources/process/exports.ts deleted file mode 100644 index 0b1e905..0000000 --- a/src/api/resources/process/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { ProcessClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/program/client/Client.ts b/src/api/resources/program/client/Client.ts index e2823b6..35e679a 100644 --- a/src/api/resources/program/client/Client.ts +++ b/src/api/resources/program/client/Client.ts @@ -651,97 +651,6 @@ export class ProgramClient { ); } - /** - * Delete subscription for a contact - * - * @param {Brevo.DeleteContactSubscriptionRequest} request - * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Brevo.BadRequestError} - * @throws {@link Brevo.UnauthorizedError} - * @throws {@link Brevo.ForbiddenError} - * @throws {@link Brevo.NotFoundError} - * @throws {@link Brevo.UnprocessableEntityError} - * @throws {@link Brevo.InternalServerError} - * - * @example - * await client.program.deleteContactSubscription({ - * pid: "pid", - * cid: 1 - * }) - */ - public deleteContactSubscription( - request: Brevo.DeleteContactSubscriptionRequest, - requestOptions?: ProgramClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__deleteContactSubscription(request, requestOptions)); - } - - private async __deleteContactSubscription( - request: Brevo.DeleteContactSubscriptionRequest, - requestOptions?: ProgramClient.RequestOptions, - ): Promise> { - const { pid, cid } = request; - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await core.fetcher({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.BrevoEnvironment.Default, - `loyalty/config/programs/${core.url.encodePathParam(pid)}/contact/${core.url.encodePathParam(cid)}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); - case 401: - throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); - case 403: - throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); - case 404: - throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); - case 422: - throw new Brevo.UnprocessableEntityError( - _response.error.body as Brevo.ErrorModel, - _response.rawResponse, - ); - case 500: - throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); - default: - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/loyalty/config/programs/{pid}/contact/{cid}", - ); - } - /** * Publishes loyalty program * diff --git a/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts b/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts deleted file mode 100644 index 947fb1a..0000000 --- a/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * pid: "pid", - * cid: 1 - * } - */ -export interface DeleteContactSubscriptionRequest { - /** Loyalty Program ID. A unique identifier for the loyalty program. */ - pid: string; - /** Contact ID. */ - cid: number; -} diff --git a/src/api/resources/program/client/requests/index.ts b/src/api/resources/program/client/requests/index.ts index 277ff1d..1bac46c 100644 --- a/src/api/resources/program/client/requests/index.ts +++ b/src/api/resources/program/client/requests/index.ts @@ -1,6 +1,5 @@ export type { CreateNewLpRequest } from "./CreateNewLpRequest.js"; export type { DeleteContactMembersRequest } from "./DeleteContactMembersRequest.js"; -export type { DeleteContactSubscriptionRequest } from "./DeleteContactSubscriptionRequest.js"; export type { DeleteLoyaltyProgramRequest } from "./DeleteLoyaltyProgramRequest.js"; export type { GetLoyaltyProgramInfoRequest } from "./GetLoyaltyProgramInfoRequest.js"; export type { GetLpListRequest } from "./GetLpListRequest.js"; diff --git a/src/api/resources/program/exports.ts b/src/api/resources/program/exports.ts deleted file mode 100644 index ca64af9..0000000 --- a/src/api/resources/program/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { ProgramClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/reward/exports.ts b/src/api/resources/reward/exports.ts deleted file mode 100644 index 606509a..0000000 --- a/src/api/resources/reward/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { RewardClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/senders/client/requests/CreateSenderRequest.ts b/src/api/resources/senders/client/requests/CreateSenderRequest.ts index d6566d4..9fc4ae9 100644 --- a/src/api/resources/senders/client/requests/CreateSenderRequest.ts +++ b/src/api/resources/senders/client/requests/CreateSenderRequest.ts @@ -32,6 +32,18 @@ * }], * name: "Newsletter" * } + * + * @example + * { + * email: "support@example.com", + * name: "Support Team" + * } + * + * @example + * { + * email: "support@example.com", + * name: "Support Team" + * } */ export interface CreateSenderRequest { /** diff --git a/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts b/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts index 82259b1..c90da79 100644 --- a/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts +++ b/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts @@ -1,6 +1,11 @@ // This file was auto-generated by Fern from our API Definition. /** + * @example + * { + * senderId: 1000000 + * } + * * @example * { * senderId: 1000000 diff --git a/src/api/resources/senders/client/requests/GetSendersRequest.ts b/src/api/resources/senders/client/requests/GetSendersRequest.ts index 2538f7b..78e6525 100644 --- a/src/api/resources/senders/client/requests/GetSendersRequest.ts +++ b/src/api/resources/senders/client/requests/GetSendersRequest.ts @@ -1,6 +1,9 @@ // This file was auto-generated by Fern from our API Definition. /** + * @example + * {} + * * @example * {} */ diff --git a/src/api/resources/senders/exports.ts b/src/api/resources/senders/exports.ts deleted file mode 100644 index 5e2aeb8..0000000 --- a/src/api/resources/senders/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { SendersClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/smsCampaigns/exports.ts b/src/api/resources/smsCampaigns/exports.ts deleted file mode 100644 index 470a71e..0000000 --- a/src/api/resources/smsCampaigns/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { SmsCampaignsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/smsTemplates/exports.ts b/src/api/resources/smsTemplates/exports.ts deleted file mode 100644 index 0fcb7e5..0000000 --- a/src/api/resources/smsTemplates/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { SmsTemplatesClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/tasks/exports.ts b/src/api/resources/tasks/exports.ts deleted file mode 100644 index f7e668f..0000000 --- a/src/api/resources/tasks/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { TasksClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/tier/exports.ts b/src/api/resources/tier/exports.ts deleted file mode 100644 index 32def3d..0000000 --- a/src/api/resources/tier/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { TierClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/transactionalEmails/client/Client.ts b/src/api/resources/transactionalEmails/client/Client.ts index 4d7da71..45e8cb4 100644 --- a/src/api/resources/transactionalEmails/client/Client.ts +++ b/src/api/resources/transactionalEmails/client/Client.ts @@ -761,9 +761,13 @@ export class TransactionalEmailsClient { } /** - * You can get the uuid using either of the following methods: + * + * You can get the uuid using either of the following methods: + * * Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response. - * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. + * + * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. + * * * @param {Brevo.GetTransacEmailContentRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts index 1f724df..235c13c 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts @@ -3,6 +3,13 @@ import type * as Brevo from "../../../../index.js"; /** + * @example + * { + * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", + * startDate: "2022-02-02", + * endDate: "2022-03-02" + * } + * * @example * { * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", diff --git a/src/api/resources/transactionalEmails/exports.ts b/src/api/resources/transactionalEmails/exports.ts deleted file mode 100644 index 88be674..0000000 --- a/src/api/resources/transactionalEmails/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { TransactionalEmailsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/transactionalSms/client/Client.ts b/src/api/resources/transactionalSms/client/Client.ts index 3ad1b61..e945006 100644 --- a/src/api/resources/transactionalSms/client/Client.ts +++ b/src/api/resources/transactionalSms/client/Client.ts @@ -23,9 +23,15 @@ export class TransactionalSmsClient { } /** - * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. - * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. - * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. + * + * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. + * + * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. + * + * + * + * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. + * * * @param {Brevo.SendTransacSms} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -98,8 +104,6 @@ export class TransactionalSmsClient { } /** - * @deprecated - * * @param {Brevo.SendTransacSms} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. * diff --git a/src/api/resources/transactionalSms/exports.ts b/src/api/resources/transactionalSms/exports.ts deleted file mode 100644 index 7605e1e..0000000 --- a/src/api/resources/transactionalSms/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { TransactionalSmsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/transactionalWhatsApp/client/Client.ts b/src/api/resources/transactionalWhatsApp/client/Client.ts index 9ef4c07..f50da6e 100644 --- a/src/api/resources/transactionalWhatsApp/client/Client.ts +++ b/src/api/resources/transactionalWhatsApp/client/Client.ts @@ -23,8 +23,7 @@ export class TransactionalWhatsAppClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) * * @param {Brevo.SendWhatsappMessageRequest} request diff --git a/src/api/resources/transactionalWhatsApp/exports.ts b/src/api/resources/transactionalWhatsApp/exports.ts deleted file mode 100644 index 361c1d0..0000000 --- a/src/api/resources/transactionalWhatsApp/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { TransactionalWhatsAppClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/user/exports.ts b/src/api/resources/user/exports.ts deleted file mode 100644 index 8f9b9cd..0000000 --- a/src/api/resources/user/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { UserClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index 1ce80b5..b995b0b 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -187,16 +187,22 @@ export class WebhooksClient { } /** - * - * This is an enterprise feature. Contact us to activate it for your account. + * + * To have it activated please send us a request and we will activate it for your account. * * - * Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body. + * Exports webhook event history to CSV format for analysis and reporting. * - * Use this endpoint to: - * - Export webhook event history filtered by date range, event type, or email address - * - Generate reports for compliance, auditing, or performance analysis - * - Track delivery patterns and webhook reliability over time + * Use this to: + * - Generate comprehensive webhook event reports + * - Analyze webhook delivery patterns and success rates + * - Export event data for external analysis tools + * - Create historical reports for compliance and auditing + * - Track webhook performance and reliability metrics + * + * Key information returned: + * - Process ID for tracking export completion + * - CSV file will be delivered to specified webhook URL * * @param {Brevo.ExportWebhooksHistoryRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts index 0c734aa..cb52650 100644 --- a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts @@ -37,7 +37,6 @@ export interface CreateWebhookRequest { * type **Marketing** channel **SMS** #### * `sent`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`, * `subscribe`,`skip` - * #### `reply` */ events: CreateWebhookRequest.Events.Item[]; /** Custom headers to be send with webhooks */ @@ -86,7 +85,6 @@ export namespace CreateWebhookRequest { ContactUpdated: "contactUpdated", ContactDeleted: "contactDeleted", InboundEmailProcessed: "inboundEmailProcessed", - Reply: "reply", } as const; export type Item = (typeof Item)[keyof typeof Item]; } diff --git a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts index d736e28..49745bb 100644 --- a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts @@ -26,7 +26,6 @@ export interface UpdateWebhookRequest { * #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, * `unsubscribed`, `listAddition` & `delivered` - Possible values * for **Inbound** type webhook: #### `inboundEmailProcessed` - * #### `reply` */ events?: UpdateWebhookRequest.Events.Item[]; /** Custom headers to be send with webhooks */ @@ -67,7 +66,6 @@ export namespace UpdateWebhookRequest { ContactUpdated: "contactUpdated", ContactDeleted: "contactDeleted", InboundEmailProcessed: "inboundEmailProcessed", - Reply: "reply", } as const; export type Item = (typeof Item)[keyof typeof Item]; } diff --git a/src/api/resources/webhooks/exports.ts b/src/api/resources/webhooks/exports.ts deleted file mode 100644 index 7773e64..0000000 --- a/src/api/resources/webhooks/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { WebhooksClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/resources/whatsAppCampaigns/client/Client.ts b/src/api/resources/whatsAppCampaigns/client/Client.ts index aa9e3b8..b9becb7 100644 --- a/src/api/resources/whatsAppCampaigns/client/Client.ts +++ b/src/api/resources/whatsAppCampaigns/client/Client.ts @@ -93,11 +93,19 @@ export class WhatsAppCampaignsClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * + * + * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. + * * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - * [Get all the Segments](https://developers.brevo.com/reference/getsegments) + * + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) + * * * @param {Brevo.CreateWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -169,8 +177,11 @@ export class WhatsAppCampaignsClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * * * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -231,8 +242,11 @@ export class WhatsAppCampaignsClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * * * @param {Brevo.CreateWhatsAppTemplateRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -380,8 +394,11 @@ export class WhatsAppCampaignsClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * * * @param {Brevo.SendWhatsAppTemplateApprovalRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -453,11 +470,11 @@ export class WhatsAppCampaignsClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. - * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - * [Get all the Segments](https://developers.brevo.com/reference/getsegments) + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * * * @param {Brevo.GetWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -532,11 +549,19 @@ export class WhatsAppCampaignsClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. + * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * + * + * + * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. + * * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - * [Get all the Segments](https://developers.brevo.com/reference/getsegments) + * + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) + * * * @param {Brevo.UpdateWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/whatsAppCampaigns/exports.ts b/src/api/resources/whatsAppCampaigns/exports.ts deleted file mode 100644 index 35b77f8..0000000 --- a/src/api/resources/whatsAppCampaigns/exports.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export { WhatsAppCampaignsClient } from "./client/Client.js"; -export * from "./client/index.js"; diff --git a/src/api/types/BatchEventsResponse.ts b/src/api/types/BatchEventsResponse.ts deleted file mode 100644 index 0b745e8..0000000 --- a/src/api/types/BatchEventsResponse.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Response returned when a batch of events is processed - */ -export interface BatchEventsResponse { - /** Status of the batch request */ - status: string; - /** Total number of events submitted in the batch */ - total_events: number; - /** Number of events that were successfully processed */ - successful_events: number; - /** Number of events that failed to be processed */ - failed_events: number; - /** List of errors for the failed events */ - errors: BatchEventsResponse.Errors.Item[]; -} - -export namespace BatchEventsResponse { - export type Errors = Errors.Item[]; - - export namespace Errors { - export interface Item { - /** Index positions (0-based) of the events that caused the error */ - eventIndex?: number[] | undefined; - /** Description of the error */ - message?: string | undefined; - } - } -} diff --git a/src/api/types/GetCampaignStats.ts b/src/api/types/GetCampaignStats.ts index 76f44c9..618a403 100644 --- a/src/api/types/GetCampaignStats.ts +++ b/src/api/types/GetCampaignStats.ts @@ -2,7 +2,7 @@ export interface GetCampaignStats { /** Numbers of times your email has been opened automatically through Apple MPP. */ - appleMppOpens: number | null; + appleMppOpens: number; /** Number of total clicks for the campaign */ clickers: number; /** Number of complaints (Spam reports) for the campaign */ @@ -18,7 +18,7 @@ export interface GetCampaignStats { /** List Id of email campaign (only in case of get email campaign(s)(not for global stats)) */ listId?: number | undefined; /** Percentage of recipients who open the email out of your total number of recipients. Depending on your Campaign settings, they may include Apple MPP opens. */ - opensRate: number | null; + opensRate: number; /** Total number of non-delivered campaigns for a particular campaign id. */ returnBounce?: number | undefined; /** Number of sent emails for the campaign */ diff --git a/src/api/types/GetExtendedCampaignOverview.ts b/src/api/types/GetExtendedCampaignOverview.ts index 114e7e6..0b4c7e7 100644 --- a/src/api/types/GetExtendedCampaignOverview.ts +++ b/src/api/types/GetExtendedCampaignOverview.ts @@ -1,8 +1,6 @@ // This file was auto-generated by Fern from our API Definition. export interface GetExtendedCampaignOverview { - /** Url of the attachment file. Only available if the campaign has an attachment. */ - attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -58,8 +56,6 @@ export interface GetExtendedCampaignOverview { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; - /** List of tags of the campaign */ - tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -82,9 +78,6 @@ export namespace GetExtendedCampaignOverview { Queued: "queued", Suspended: "suspended", InProcess: "in_process", - InReview: "in_review", - Cancelling: "cancelling", - Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 34a51e7..1753e35 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -76,20 +76,10 @@ export namespace Order { price: number; /** ID of the product. */ productId: string; + /** How many pieces of the product the visitor has added to the cart. */ + quantity: number; /** Product ID of the red color shirts. */ variantId?: string | undefined; - /** - * **Required if quantityFloat is empty.** - * - * Number of product units added to the cart (whole numbers only, e.g., 10) - */ - quantity?: number | undefined; - /** - * **Required if quantity is empty.** - * - * Number of product units added to the cart(supports decimals, e.g., 20.52) - */ - quantityFloat?: number | undefined; } } } diff --git a/src/api/types/UpdateCampaignStatus.ts b/src/api/types/UpdateCampaignStatus.ts index f3ef1d3..a978877 100644 --- a/src/api/types/UpdateCampaignStatus.ts +++ b/src/api/types/UpdateCampaignStatus.ts @@ -18,7 +18,6 @@ export namespace UpdateCampaignStatus { Queued: "queued", Replicate: "replicate", ReplicateTemplate: "replicateTemplate", - Cancel: "cancel", Draft: "draft", } as const; export type Status = (typeof Status)[keyof typeof Status]; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 1823608..28b4c8d 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -4,7 +4,6 @@ export * from "./AbTestVersionStats.js"; export * from "./BadRequestErrorBody.js"; export * from "./BalanceDefinition.js"; export * from "./BalanceLimit.js"; -export * from "./BatchEventsResponse.js"; export * from "./Cart.js"; export * from "./Company.js"; export * from "./Configuration.js"; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 764d2e1..5e5058a 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -282,7 +282,6 @@ export async function fetcherImpl(args: Fetcher.Args): Promise Promise, url: string, @@ -36,7 +10,6 @@ export const makeRequest = async ( abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", - disableCache?: boolean, ): Promise => { const signals: AbortSignal[] = []; @@ -59,7 +32,6 @@ export const makeRequest = async ( credentials: withCredentials ? "include" : undefined, // @ts-ignore duplex, - ...(disableCache && isCacheNoStoreSupported() ? { cache: "no-store" as RequestCache } : {}), }); if (timeoutAbortId != null) { diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts index e6e66b2..56ebbb8 100644 --- a/src/core/runtime/runtime.ts +++ b/src/core/runtime/runtime.ts @@ -113,18 +113,18 @@ function evaluateRuntime(): Runtime { /** * A constant that indicates whether the environment the code is running is Node.JS. - * - * We assign `process` to a local variable first to avoid being flagged by - * bundlers that perform static analysis on `process.versions` (e.g. Next.js - * Edge Runtime warns about Node.js APIs even when they are guarded). */ - const _process = typeof process !== "undefined" ? process : undefined; - const isNode = typeof _process !== "undefined" && typeof _process.versions?.node === "string"; + const isNode = + typeof process !== "undefined" && + "version" in process && + !!process.version && + "versions" in process && + !!process.versions?.node; if (isNode) { return { type: "node", - version: _process.versions.node, - parsedVersion: Number(_process.versions.node.split(".")[0]), + version: process.versions.node, + parsedVersion: Number(process.versions.node.split(".")[0]), }; } diff --git a/src/version.ts b/src/version.ts index 25cf4d2..3185aec 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "5.0.1"; +export const SDK_VERSION = "5.0.2"; diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 3e8540a..78985e7 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -2,7 +2,7 @@ import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponse import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; -import { type WithFormUrlEncodedOptions, withFormUrlEncoded } from "./withFormUrlEncoded"; +import { withFormUrlEncoded } from "./withFormUrlEncoded"; import { withHeaders } from "./withHeaders"; import { type WithJsonOptions, withJson } from "./withJson"; @@ -27,7 +27,7 @@ interface RequestHeadersStage extends RequestBodyStage, ResponseStage { interface RequestBodyStage extends ResponseStage { jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage; - formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage; + formUrlEncodedBody(body: unknown): ResponseStage; } interface ResponseStage { @@ -44,7 +44,6 @@ interface ResponseHeaderStage extends ResponseBodyStage, BuildStage { interface ResponseBodyStage { jsonBody(body: unknown): BuildStage; - sseBody(body: string): BuildStage; } interface BuildStage { @@ -138,13 +137,13 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta return this; } - formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage { + formUrlEncodedBody(body: unknown): ResponseStage { if (body === undefined) { throw new Error( "Undefined is not valid for form-urlencoded. Do not call formUrlEncodedBody if you want an empty body.", ); } - this.predicates.push((resolver) => withFormUrlEncoded(body, resolver, options)); + this.predicates.push((resolver) => withFormUrlEncoded(body, resolver)); return this; } @@ -202,12 +201,6 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo return this; } - public sseBody(body: string): BuildStage { - this.responseHeaders["Content-Type"] = "text/event-stream"; - this.responseBody = body; - return this; - } - public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { const response = new HttpResponse(this.responseBody, { diff --git a/tests/mock-server/withFormUrlEncoded.ts b/tests/mock-server/withFormUrlEncoded.ts index 2b23448..e250cb3 100644 --- a/tests/mock-server/withFormUrlEncoded.ts +++ b/tests/mock-server/withFormUrlEncoded.ts @@ -2,26 +2,12 @@ import { type HttpResponseResolver, passthrough } from "msw"; import { toJson } from "../../src/core/json"; -export interface WithFormUrlEncodedOptions { - /** - * List of field names to ignore when comparing request bodies. - * This is useful for pagination cursor fields that change between requests. - */ - ignoredFields?: string[]; -} - /** * Creates a request matcher that validates if the request form-urlencoded body exactly matches the expected object * @param expectedBody - The exact body object to match against * @param resolver - Response resolver to execute if body matches - * @param options - Optional configuration including fields to ignore */ -export function withFormUrlEncoded( - expectedBody: unknown, - resolver: HttpResponseResolver, - options?: WithFormUrlEncodedOptions, -): HttpResponseResolver { - const ignoredFields = options?.ignoredFields ?? []; +export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { return async (args) => { const { request } = args; @@ -55,8 +41,7 @@ export function withFormUrlEncoded( } const mismatches = findMismatches(actualBody, expectedBody); - const filteredMismatches = Object.keys(mismatches).filter((key) => !ignoredFields.includes(key)); - if (filteredMismatches.length > 0) { + if (Object.keys(mismatches).length > 0) { console.error("Form-urlencoded body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } diff --git a/tests/unit/fetcher/makeRequest.test.ts b/tests/unit/fetcher/makeRequest.test.ts index bde1945..ea49466 100644 --- a/tests/unit/fetcher/makeRequest.test.ts +++ b/tests/unit/fetcher/makeRequest.test.ts @@ -1,9 +1,5 @@ import type { Mock } from "vitest"; -import { - isCacheNoStoreSupported, - makeRequest, - resetCacheNoStoreSupported, -} from "../../../src/core/fetcher/makeRequest"; +import { makeRequest } from "../../../src/core/fetcher/makeRequest"; describe("Test makeRequest", () => { const mockPostUrl = "https://httpbin.org/post"; @@ -16,7 +12,6 @@ describe("Test makeRequest", () => { beforeEach(() => { mockFetch = vi.fn(); mockFetch.mockResolvedValue(new Response(JSON.stringify({ test: "successful" }), { status: 200 })); - resetCacheNoStoreSupported(); }); it("should handle POST request correctly", async () => { @@ -56,103 +51,4 @@ describe("Test makeRequest", () => { expect(calledOptions.signal).toBeDefined(); expect(calledOptions.signal).toBeInstanceOf(AbortSignal); }); - - it("should not include cache option when disableCache is not set", async () => { - await makeRequest(mockFetch, mockGetUrl, "GET", mockHeaders, undefined); - const [, calledOptions] = mockFetch.mock.calls[0]; - expect(calledOptions.cache).toBeUndefined(); - }); - - it("should not include cache option when disableCache is false", async () => { - await makeRequest( - mockFetch, - mockGetUrl, - "GET", - mockHeaders, - undefined, - undefined, - undefined, - undefined, - undefined, - false, - ); - const [, calledOptions] = mockFetch.mock.calls[0]; - expect(calledOptions.cache).toBeUndefined(); - }); - - it("should include cache: no-store when disableCache is true and runtime supports it", async () => { - // In Node.js test environment, Request supports the cache option - expect(isCacheNoStoreSupported()).toBe(true); - await makeRequest( - mockFetch, - mockGetUrl, - "GET", - mockHeaders, - undefined, - undefined, - undefined, - undefined, - undefined, - true, - ); - const [, calledOptions] = mockFetch.mock.calls[0]; - expect(calledOptions.cache).toBe("no-store"); - }); - - it("should cache the result of isCacheNoStoreSupported", () => { - const first = isCacheNoStoreSupported(); - const second = isCacheNoStoreSupported(); - expect(first).toBe(second); - }); - - it("should reset cache detection state with resetCacheNoStoreSupported", () => { - // First call caches the result - const first = isCacheNoStoreSupported(); - expect(first).toBe(true); - - // Reset clears the cache - resetCacheNoStoreSupported(); - - // After reset, it should re-detect (and still return true in Node.js) - const second = isCacheNoStoreSupported(); - expect(second).toBe(true); - }); - - it("should not include cache option when runtime does not support it (e.g. Cloudflare Workers)", async () => { - // Mock Request constructor to throw when cache option is passed, - // simulating runtimes like Cloudflare Workers - const OriginalRequest = globalThis.Request; - globalThis.Request = class MockRequest { - constructor(_url: string, init?: RequestInit) { - if (init?.cache != null) { - throw new TypeError("The 'cache' field on 'RequestInitializerDict' is not implemented."); - } - } - } as unknown as typeof Request; - - try { - // Reset so the detection runs fresh with the mocked Request - resetCacheNoStoreSupported(); - expect(isCacheNoStoreSupported()).toBe(false); - - await makeRequest( - mockFetch, - mockGetUrl, - "GET", - mockHeaders, - undefined, - undefined, - undefined, - undefined, - undefined, - true, - ); - const [, calledOptions] = mockFetch.mock.calls[0]; - expect(calledOptions.cache).toBeUndefined(); - } finally { - // Restore original Request - globalThis.Request = OriginalRequest; - resetCacheNoStoreSupported(); - } - }); }); diff --git a/tests/wire/balance.test.ts b/tests/wire/balance.test.ts index a929387..7d005b7 100644 --- a/tests/wire/balance.test.ts +++ b/tests/wire/balance.test.ts @@ -2367,8 +2367,8 @@ describe("BalanceClient", () => { const response = await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, - balanceDefinitionId: "balanceDefinitionId", + contact_id: 1, + balance_definition_id: "balance_definition_id", }); expect(response).toEqual({ balanceDefinitionId: "balanceDefinitionId", @@ -2410,8 +2410,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, - balanceDefinitionId: "balanceDefinitionId", + contact_id: 1, + balance_definition_id: "balance_definition_id", }); }).rejects.toThrow(Brevo.UnauthorizedError); }); @@ -2432,8 +2432,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, - balanceDefinitionId: "balanceDefinitionId", + contact_id: 1, + balance_definition_id: "balance_definition_id", }); }).rejects.toThrow(Brevo.ForbiddenError); }); @@ -2454,8 +2454,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, - balanceDefinitionId: "balanceDefinitionId", + contact_id: 1, + balance_definition_id: "balance_definition_id", }); }).rejects.toThrow(Brevo.NotFoundError); }); @@ -2476,8 +2476,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, - balanceDefinitionId: "balanceDefinitionId", + contact_id: 1, + balance_definition_id: "balance_definition_id", }); }).rejects.toThrow(Brevo.UnprocessableEntityError); }); @@ -2498,8 +2498,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, - balanceDefinitionId: "balanceDefinitionId", + contact_id: 1, + balance_definition_id: "balance_definition_id", }); }).rejects.toThrow(Brevo.InternalServerError); }); diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts index 3fd874a..9fcb13f 100644 --- a/tests/wire/companies.test.ts +++ b/tests/wire/companies.test.ts @@ -407,119 +407,6 @@ describe("CompaniesClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); - test("deleteAnAttribute (1)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - server.mockEndpoint().delete("/crm/attributes/id").respondWith().statusCode(200).build(); - - const response = await client.companies.deleteAnAttribute({ - id: "id", - }); - expect(response).toEqual(undefined); - }); - - test("deleteAnAttribute (2)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/crm/attributes/id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.deleteAnAttribute({ - id: "id", - }); - }).rejects.toThrow(Brevo.BadRequestError); - }); - - test("deleteAnAttribute (3)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/crm/attributes/id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.deleteAnAttribute({ - id: "id", - }); - }).rejects.toThrow(Brevo.NotFoundError); - }); - - test("updateAnAttribute (1)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = {}; - - server - .mockEndpoint() - .patch("/crm/attributes/id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .build(); - - const response = await client.companies.updateAnAttribute({ - id: "id", - }); - expect(response).toEqual(undefined); - }); - - test("updateAnAttribute (2)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/crm/attributes/id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.updateAnAttribute({ - id: "id", - }); - }).rejects.toThrow(Brevo.BadRequestError); - }); - - test("updateAnAttribute (3)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/crm/attributes/id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.updateAnAttribute({ - id: "id", - }); - }).rejects.toThrow(Brevo.NotFoundError); - }); - test("getCompanyAttributes", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); diff --git a/tests/wire/ecommerce.test.ts b/tests/wire/ecommerce.test.ts index 15fc945..24535a9 100644 --- a/tests/wire/ecommerce.test.ts +++ b/tests/wire/ecommerce.test.ts @@ -660,8 +660,8 @@ describe("EcommerceClient", () => { id: "order1803", identifiers: { ext_id: "ab12", loyalty_subscription_id: "1234" }, products: [ - { price: 100, productId: 21, quantity: 2, quantityFloat: 0, variantId: "P100" }, - { price: 100, productId: 21, quantity: 0, quantityFloat: 2.52, variantId: "P15756" }, + { price: 100, productId: 21, quantity: 2, variantId: "P100" }, + { price: 100, productId: 21, quantity: 2, variantId: "P15756" }, ], status: "complete", storeId: "123", @@ -701,14 +701,12 @@ describe("EcommerceClient", () => { price: 100, productId: 21, quantity: 2, - quantityFloat: 0, variantId: "P100", }, { price: 100, productId: 21, - quantity: 0, - quantityFloat: 2.52, + quantity: 2, variantId: "P15756", }, ], @@ -739,7 +737,7 @@ describe("EcommerceClient", () => { amount: 308.42, createdAt: "2021-07-29T20:59:23.383Z", id: "14", - products: [{ price: 99.99, productId: "P1" }], + products: [{ price: 99.99, productId: "P1", quantity: 10 }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z", }; @@ -754,6 +752,7 @@ describe("EcommerceClient", () => { { price: 99.99, productId: "P1", + quantity: 10, }, ], status: "completed", @@ -770,8 +769,8 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId" }, - { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId", quantity: 1.1 }, ], status: "status", updatedAt: "updatedAt", @@ -795,10 +794,12 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", + quantity: 1.1, }, { price: 1.1, productId: "productId", + quantity: 1.1, }, ], status: "status", @@ -816,7 +817,7 @@ describe("EcommerceClient", () => { amount: 308.42, createdAt: "2021-07-29T20:59:23.383Z", id: "14", - products: [{ price: 99.99, productId: "P1" }], + products: [{ price: 99.99, productId: "P1", quantity: 10 }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z", }, @@ -842,6 +843,7 @@ describe("EcommerceClient", () => { { price: 99.99, productId: "P1", + quantity: 10, }, ], status: "completed", @@ -865,8 +867,8 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId" }, - { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId", quantity: 1.1 }, ], status: "status", updatedAt: "updatedAt", @@ -876,8 +878,8 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId" }, - { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId", quantity: 1.1 }, ], status: "status", updatedAt: "updatedAt", @@ -905,10 +907,12 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", + quantity: 1.1, }, { price: 1.1, productId: "productId", + quantity: 1.1, }, ], status: "status", @@ -922,10 +926,12 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", + quantity: 1.1, }, { price: 1.1, productId: "productId", + quantity: 1.1, }, ], status: "status", diff --git a/tests/wire/emailCampaigns.test.ts b/tests/wire/emailCampaigns.test.ts index 652329a..cf7e061 100644 --- a/tests/wire/emailCampaigns.test.ts +++ b/tests/wire/emailCampaigns.test.ts @@ -12,7 +12,6 @@ describe("EmailCampaignsClient", () => { const rawResponseBody = { campaigns: [ { - attachmentFile: "http://mydomain.com/campaign/attachment/file.pdf", abTesting: true, id: 12, name: "EN - Sales Summer 2017", @@ -41,7 +40,6 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", - tags: ["tag1", "tag2"], testSent: true, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -144,7 +142,6 @@ describe("EmailCampaignsClient", () => { }, }, { - attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -173,7 +170,6 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", - tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -284,7 +280,6 @@ describe("EmailCampaignsClient", () => { expect(response).toEqual({ campaigns: [ { - attachmentFile: "http://mydomain.com/campaign/attachment/file.pdf", abTesting: true, id: 12, name: "EN - Sales Summer 2017", @@ -317,7 +312,6 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", - tags: ["tag1", "tag2"], testSent: true, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -428,7 +422,6 @@ describe("EmailCampaignsClient", () => { }, }, { - attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -461,7 +454,6 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", - tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -683,7 +675,6 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -712,7 +703,6 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", tag: "Newsletter", - tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -816,7 +806,6 @@ describe("EmailCampaignsClient", () => { campaignId: 1000000, }); expect(response).toEqual({ - attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -849,7 +838,6 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", tag: "Newsletter", - tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", diff --git a/tests/wire/event.test.ts b/tests/wire/event.test.ts index 5a8a4ec..80ed7f0 100644 --- a/tests/wire/event.test.ts +++ b/tests/wire/event.test.ts @@ -62,82 +62,4 @@ describe("EventClient", () => { }); }).rejects.toThrow(Brevo.UnauthorizedError); }); - - test("createBatchEvents (1)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = [{ event_name: "order_created", identifiers: {} }]; - - server.mockEndpoint().post("/events/batch").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); - - const response = await client.event.createBatchEvents([ - { - event_name: "order_created", - identifiers: {}, - }, - ]); - expect(response).toEqual(undefined); - }); - - test("createBatchEvents (2)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = [ - { event_name: "event_name", identifiers: {} }, - { event_name: "event_name", identifiers: {} }, - ]; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/events/batch") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.event.createBatchEvents([ - { - event_name: "event_name", - identifiers: {}, - }, - { - event_name: "event_name", - identifiers: {}, - }, - ]); - }).rejects.toThrow(Brevo.BadRequestError); - }); - - test("createBatchEvents (3)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = [ - { event_name: "event_name", identifiers: {} }, - { event_name: "event_name", identifiers: {} }, - ]; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/events/batch") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.event.createBatchEvents([ - { - event_name: "event_name", - identifiers: {}, - }, - { - event_name: "event_name", - identifiers: {}, - }, - ]); - }).rejects.toThrow(Brevo.UnauthorizedError); - }); }); diff --git a/tests/wire/program.test.ts b/tests/wire/program.test.ts index 17b383a..44e2bcc 100644 --- a/tests/wire/program.test.ts +++ b/tests/wire/program.test.ts @@ -1120,145 +1120,6 @@ describe("ProgramClient", () => { }).rejects.toThrow(Brevo.InternalServerError); }); - test("deleteContactSubscription (1)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - server.mockEndpoint().delete("/loyalty/config/programs/pid/contact/1").respondWith().statusCode(200).build(); - - const response = await client.program.deleteContactSubscription({ - pid: "pid", - cid: 1, - }); - expect(response).toEqual(undefined); - }); - - test("deleteContactSubscription (2)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/loyalty/config/programs/pid/contact/1") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.program.deleteContactSubscription({ - pid: "pid", - cid: 1, - }); - }).rejects.toThrow(Brevo.BadRequestError); - }); - - test("deleteContactSubscription (3)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/loyalty/config/programs/pid/contact/1") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.program.deleteContactSubscription({ - pid: "pid", - cid: 1, - }); - }).rejects.toThrow(Brevo.UnauthorizedError); - }); - - test("deleteContactSubscription (4)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/loyalty/config/programs/pid/contact/1") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.program.deleteContactSubscription({ - pid: "pid", - cid: 1, - }); - }).rejects.toThrow(Brevo.ForbiddenError); - }); - - test("deleteContactSubscription (5)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/loyalty/config/programs/pid/contact/1") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.program.deleteContactSubscription({ - pid: "pid", - cid: 1, - }); - }).rejects.toThrow(Brevo.NotFoundError); - }); - - test("deleteContactSubscription (6)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { message: "message" }; - server - .mockEndpoint() - .delete("/loyalty/config/programs/pid/contact/1") - .respondWith() - .statusCode(422) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.program.deleteContactSubscription({ - pid: "pid", - cid: 1, - }); - }).rejects.toThrow(Brevo.UnprocessableEntityError); - }); - - test("deleteContactSubscription (7)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/loyalty/config/programs/pid/contact/1") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.program.deleteContactSubscription({ - pid: "pid", - cid: 1, - }); - }).rejects.toThrow(Brevo.InternalServerError); - }); - test("publishLoyaltyProgram (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); From 2e9c40f3612758c0b42ad3ea3fd9fcffde548ea3 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 09:06:28 +0000 Subject: [PATCH 31/33] SDK regeneration --- .fern/metadata.json | 8 +- .github/workflows/ci.yml | 14 +- biome.json | 2 +- package.json | 360 ++++++++- pnpm-lock.yaml | 739 +++++++++--------- reference.md | 517 ++++++++---- src/BaseClient.ts | 4 +- src/Client.ts | 32 + src/api/resources/account/exports.ts | 4 + .../account/types/GetAccountResponse.ts | 2 +- src/api/resources/balance/client/Client.ts | 36 +- .../requests/GetContactBalancesRequest.ts | 2 + ...yBalanceProgramsPidActiveBalanceRequest.ts | 2 + ...nceProgramsPidTransactionHistoryRequest.ts | 16 +- .../GetSubscriptionBalancesRequest.ts | 2 + ...nceProgramsPidBalanceDefinitionsRequest.ts | 13 +- .../UpdateBalanceDefinitionRequest.ts | 13 +- src/api/resources/balance/exports.ts | 4 + ...gramsPidTransactionHistoryRequestStatus.ts | 11 + ...ansactionHistoryRequestTransactionType.ts} | 11 +- src/api/resources/balance/types/index.ts | 3 +- src/api/resources/companies/client/Client.ts | 139 ++++ .../requests/DeleteCrmAttributesIdRequest.ts | 12 + .../requests/PatchCrmAttributesIdRequest.ts | 38 + .../companies/client/requests/index.ts | 2 + src/api/resources/companies/exports.ts | 4 + src/api/resources/contacts/client/Client.ts | 60 +- .../requests/AddContactToListRequest.ts | 24 - .../requests/RemoveContactFromListRequest.ts | 32 - src/api/resources/contacts/exports.ts | 4 + src/api/resources/conversations/exports.ts | 4 + src/api/resources/coupons/exports.ts | 4 + .../resources/customObjects/client/Client.ts | 20 +- .../client/requests/UpsertrecordsRequest.ts | 2 +- src/api/resources/customObjects/exports.ts | 4 + .../types/UpsertrecordsResponse.ts | 2 +- src/api/resources/deals/client/Client.ts | 2 + src/api/resources/deals/exports.ts | 4 + .../requests/AuthenticateDomainRequest.ts | 5 - .../client/requests/CreateDomainRequest.ts | 10 - .../requests/GetDomainConfigurationRequest.ts | 5 - src/api/resources/domains/exports.ts | 4 + src/api/resources/ecommerce/client/Client.ts | 6 +- .../requests/CreateBatchOrderRequest.ts | 3 +- .../CreateUpdateBatchProductsRequest.ts | 6 +- .../requests/CreateUpdateProductRequest.ts | 6 +- src/api/resources/ecommerce/exports.ts | 4 + .../resources/emailCampaigns/client/Client.ts | 10 +- .../requests/GetEmailCampaignRequest.ts | 2 + src/api/resources/emailCampaigns/exports.ts | 4 + .../types/GetEmailCampaignResponse.ts | 7 + .../types/GetEmailCampaignsRequestStatus.ts | 2 + .../types/GetEmailCampaignsResponse.ts | 7 + src/api/resources/event/client/Client.ts | 165 ++++ .../event/client/requests/GetEventsRequest.ts | 22 + .../resources/event/client/requests/index.ts | 1 + src/api/resources/event/exports.ts | 4 + src/api/resources/event/index.ts | 1 + .../types/CreateBatchEventsRequestItem.ts | 66 ++ src/api/resources/event/types/index.ts | 1 + .../requests/GetExternalFeedByUuidRequest.ts | 10 - src/api/resources/externalFeeds/exports.ts | 4 + src/api/resources/files/exports.ts | 4 + .../resources/inboundParsing/client/Client.ts | 1 + src/api/resources/inboundParsing/exports.ts | 4 + src/api/resources/index.ts | 1 + src/api/resources/masterAccount/exports.ts | 4 + src/api/resources/notes/exports.ts | 4 + src/api/resources/payments/exports.ts | 4 + .../client/requests/GetProcessRequest.ts | 15 - src/api/resources/process/exports.ts | 4 + src/api/resources/program/client/Client.ts | 94 ++- .../DeleteContactSubscriptionRequest.ts | 15 + .../GetParameterSubscriptionInfoRequest.ts | 2 + .../program/client/requests/index.ts | 1 + src/api/resources/program/exports.ts | 4 + src/api/resources/reward/exports.ts | 4 + .../client/requests/CreateSenderRequest.ts | 12 - .../requests/GetIpsFromSenderRequest.ts | 5 - .../client/requests/GetSendersRequest.ts | 3 - src/api/resources/senders/exports.ts | 4 + src/api/resources/smsCampaigns/exports.ts | 4 + src/api/resources/smsTemplates/exports.ts | 4 + src/api/resources/tasks/exports.ts | 4 + .../client/requests/CreateTierGroupRequest.ts | 13 + .../client/requests/UpdateTierGroupRequest.ts | 13 + src/api/resources/tier/exports.ts | 4 + .../transactionalEmails/client/Client.ts | 8 +- .../requests/GetScheduledEmailByIdRequest.ts | 7 - .../resources/transactionalEmails/exports.ts | 4 + .../transactionalSms/client/Client.ts | 14 +- src/api/resources/transactionalSms/exports.ts | 4 + .../transactionalWhatsApp/client/Client.ts | 3 +- .../transactionalWhatsApp/exports.ts | 4 + src/api/resources/user/exports.ts | 4 + src/api/resources/webhooks/client/Client.ts | 20 +- .../client/requests/CreateWebhookRequest.ts | 2 + .../client/requests/UpdateWebhookRequest.ts | 2 + src/api/resources/webhooks/exports.ts | 4 + .../whatsAppCampaigns/client/Client.ts | 63 +- .../resources/whatsAppCampaigns/exports.ts | 4 + src/api/types/BatchAcceptedResponse.ts | 11 + src/api/types/BatchEventsResponse.ts | 30 + src/api/types/GetCampaignStats.ts | 4 +- src/api/types/GetEventsList.ts | 36 + src/api/types/GetExtendedCampaignOverview.ts | 7 + src/api/types/GetProductDetails.ts | 4 + src/api/types/InternalServerErrorBody.ts | 51 ++ src/api/types/Order.ts | 14 +- src/api/types/UpdateCampaignStatus.ts | 1 + src/api/types/index.ts | 4 + src/core/fetcher/BinaryResponse.ts | 2 +- src/core/fetcher/Fetcher.ts | 1 + src/core/fetcher/index.ts | 2 + src/core/fetcher/makePassthroughRequest.ts | 189 +++++ src/core/fetcher/makeRequest.ts | 28 + src/core/runtime/runtime.ts | 16 +- src/version.ts | 2 +- tests/mock-server/MockServerPool.ts | 2 +- tests/mock-server/mockEndpointBuilder.ts | 15 +- tests/mock-server/withFormUrlEncoded.ts | 19 +- tests/tsconfig.json | 1 - .../fetcher/makePassthroughRequest.test.ts | 398 ++++++++++ tests/unit/fetcher/makeRequest.test.ts | 106 ++- tests/wire/account.test.ts | 3 + tests/wire/balance.test.ts | 129 ++- tests/wire/companies.test.ts | 133 ++++ tests/wire/contacts.test.ts | 81 ++ tests/wire/conversations.test.ts | 28 + tests/wire/coupons.test.ts | 16 + tests/wire/customObjects.test.ts | 15 + tests/wire/deals.test.ts | 18 + tests/wire/domains.test.ts | 18 + tests/wire/ecommerce.test.ts | 88 ++- tests/wire/emailCampaigns.test.ts | 44 ++ tests/wire/event.test.ts | 181 +++++ tests/wire/externalFeeds.test.ts | 16 + tests/wire/files.test.ts | 10 + tests/wire/inboundParsing.test.ts | 4 + tests/wire/masterAccount.test.ts | 44 ++ tests/wire/notes.test.ts | 13 + tests/wire/payments.test.ts | 12 + tests/wire/process.test.ts | 8 + tests/wire/program.test.ts | 214 +++++ tests/wire/reward.test.ts | 65 ++ tests/wire/senders.test.ts | 22 + tests/wire/smsCampaigns.test.ts | 23 + tests/wire/smsTemplates.test.ts | 2 + tests/wire/tasks.test.ts | 12 + tests/wire/tier.test.ts | 62 ++ tests/wire/transactionalEmails.test.ts | 44 ++ tests/wire/transactionalSms.test.ts | 11 + tests/wire/transactionalWhatsApp.test.ts | 4 + tests/wire/user.test.ts | 12 + tests/wire/webhooks.test.ts | 13 + tests/wire/whatsAppCampaigns.test.ts | 17 + tsconfig.base.json | 1 - vitest.config.mts | 4 + 158 files changed, 4281 insertions(+), 906 deletions(-) create mode 100644 src/api/resources/account/exports.ts create mode 100644 src/api/resources/balance/exports.ts create mode 100644 src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.ts rename src/api/resources/balance/types/{GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts => GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.ts} (58%) create mode 100644 src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts create mode 100644 src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts create mode 100644 src/api/resources/companies/exports.ts create mode 100644 src/api/resources/contacts/exports.ts create mode 100644 src/api/resources/conversations/exports.ts create mode 100644 src/api/resources/coupons/exports.ts create mode 100644 src/api/resources/customObjects/exports.ts create mode 100644 src/api/resources/deals/exports.ts create mode 100644 src/api/resources/domains/exports.ts create mode 100644 src/api/resources/ecommerce/exports.ts create mode 100644 src/api/resources/emailCampaigns/exports.ts create mode 100644 src/api/resources/event/client/requests/GetEventsRequest.ts create mode 100644 src/api/resources/event/exports.ts create mode 100644 src/api/resources/event/types/CreateBatchEventsRequestItem.ts create mode 100644 src/api/resources/event/types/index.ts create mode 100644 src/api/resources/externalFeeds/exports.ts create mode 100644 src/api/resources/files/exports.ts create mode 100644 src/api/resources/inboundParsing/exports.ts create mode 100644 src/api/resources/masterAccount/exports.ts create mode 100644 src/api/resources/notes/exports.ts create mode 100644 src/api/resources/payments/exports.ts create mode 100644 src/api/resources/process/exports.ts create mode 100644 src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts create mode 100644 src/api/resources/program/exports.ts create mode 100644 src/api/resources/reward/exports.ts create mode 100644 src/api/resources/senders/exports.ts create mode 100644 src/api/resources/smsCampaigns/exports.ts create mode 100644 src/api/resources/smsTemplates/exports.ts create mode 100644 src/api/resources/tasks/exports.ts create mode 100644 src/api/resources/tier/exports.ts create mode 100644 src/api/resources/transactionalEmails/exports.ts create mode 100644 src/api/resources/transactionalSms/exports.ts create mode 100644 src/api/resources/transactionalWhatsApp/exports.ts create mode 100644 src/api/resources/user/exports.ts create mode 100644 src/api/resources/webhooks/exports.ts create mode 100644 src/api/resources/whatsAppCampaigns/exports.ts create mode 100644 src/api/types/BatchAcceptedResponse.ts create mode 100644 src/api/types/BatchEventsResponse.ts create mode 100644 src/api/types/GetEventsList.ts create mode 100644 src/api/types/InternalServerErrorBody.ts create mode 100644 src/core/fetcher/makePassthroughRequest.ts create mode 100644 tests/unit/fetcher/makePassthroughRequest.test.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index 028f542..a4f544f 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "4.25.0", + "cliVersion": "4.43.1", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.48.2", + "generatorVersion": "3.59.4", "generatorConfig": { "generateWireTests": true, "namespaceExport": "Brevo", @@ -15,6 +15,6 @@ } } }, - "originGitCommit": "0270908073ab43956eab9fce001fe4f6c09affc5", - "sdkVersion": "5.0.2" + "originGitCommit": "7d08ac3fbe2aa66ba3d56077e8582739d530298b", + "sdkVersion": "5.0.3" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c70c5b..4163539 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,10 @@ name: ci on: [push] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: compile: runs-on: ubuntu-latest @@ -74,5 +78,13 @@ jobs: elif [[ ${GITHUB_REF} == *beta* ]]; then publish --access public --tag beta else - publish --access public + PKG_NAME=$(node -p "require('./package.json').name") + PKG_VERSION=$(node -p "require('./package.json').version") + CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0") + if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then + echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})" + publish --access public --tag backport + else + publish --access public + fi fi \ No newline at end of file diff --git a/biome.json b/biome.json index 371d365..5084b70 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.3/schema.json", "root": true, "vcs": { "enabled": false diff --git a/package.json b/package.json index 424efc4..08a3db8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "5.0.2", + "version": "5.0.3", "private": false, "repository": { "type": "git", @@ -12,7 +12,6 @@ "types": "./dist/cjs/index.d.ts", "exports": { ".": { - "types": "./dist/cjs/index.d.ts", "import": { "types": "./dist/esm/index.d.mts", "default": "./dist/esm/index.mjs" @@ -23,6 +22,358 @@ }, "default": "./dist/cjs/index.js" }, + "./account": { + "import": { + "types": "./dist/esm/api/resources/account/exports.d.mts", + "default": "./dist/esm/api/resources/account/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/account/exports.d.ts", + "default": "./dist/cjs/api/resources/account/exports.js" + }, + "default": "./dist/cjs/api/resources/account/exports.js" + }, + "./masterAccount": { + "import": { + "types": "./dist/esm/api/resources/masterAccount/exports.d.mts", + "default": "./dist/esm/api/resources/masterAccount/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/masterAccount/exports.d.ts", + "default": "./dist/cjs/api/resources/masterAccount/exports.js" + }, + "default": "./dist/cjs/api/resources/masterAccount/exports.js" + }, + "./user": { + "import": { + "types": "./dist/esm/api/resources/user/exports.d.mts", + "default": "./dist/esm/api/resources/user/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/user/exports.d.ts", + "default": "./dist/cjs/api/resources/user/exports.js" + }, + "default": "./dist/cjs/api/resources/user/exports.js" + }, + "./process": { + "import": { + "types": "./dist/esm/api/resources/process/exports.d.mts", + "default": "./dist/esm/api/resources/process/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/process/exports.d.ts", + "default": "./dist/cjs/api/resources/process/exports.js" + }, + "default": "./dist/cjs/api/resources/process/exports.js" + }, + "./senders": { + "import": { + "types": "./dist/esm/api/resources/senders/exports.d.mts", + "default": "./dist/esm/api/resources/senders/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/senders/exports.d.ts", + "default": "./dist/cjs/api/resources/senders/exports.js" + }, + "default": "./dist/cjs/api/resources/senders/exports.js" + }, + "./domains": { + "import": { + "types": "./dist/esm/api/resources/domains/exports.d.mts", + "default": "./dist/esm/api/resources/domains/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/domains/exports.d.ts", + "default": "./dist/cjs/api/resources/domains/exports.js" + }, + "default": "./dist/cjs/api/resources/domains/exports.js" + }, + "./webhooks": { + "import": { + "types": "./dist/esm/api/resources/webhooks/exports.d.mts", + "default": "./dist/esm/api/resources/webhooks/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/webhooks/exports.d.ts", + "default": "./dist/cjs/api/resources/webhooks/exports.js" + }, + "default": "./dist/cjs/api/resources/webhooks/exports.js" + }, + "./externalFeeds": { + "import": { + "types": "./dist/esm/api/resources/externalFeeds/exports.d.mts", + "default": "./dist/esm/api/resources/externalFeeds/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/externalFeeds/exports.d.ts", + "default": "./dist/cjs/api/resources/externalFeeds/exports.js" + }, + "default": "./dist/cjs/api/resources/externalFeeds/exports.js" + }, + "./customObjects": { + "import": { + "types": "./dist/esm/api/resources/customObjects/exports.d.mts", + "default": "./dist/esm/api/resources/customObjects/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/customObjects/exports.d.ts", + "default": "./dist/cjs/api/resources/customObjects/exports.js" + }, + "default": "./dist/cjs/api/resources/customObjects/exports.js" + }, + "./contacts": { + "import": { + "types": "./dist/esm/api/resources/contacts/exports.d.mts", + "default": "./dist/esm/api/resources/contacts/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/contacts/exports.d.ts", + "default": "./dist/cjs/api/resources/contacts/exports.js" + }, + "default": "./dist/cjs/api/resources/contacts/exports.js" + }, + "./conversations": { + "import": { + "types": "./dist/esm/api/resources/conversations/exports.d.mts", + "default": "./dist/esm/api/resources/conversations/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/conversations/exports.d.ts", + "default": "./dist/cjs/api/resources/conversations/exports.js" + }, + "default": "./dist/cjs/api/resources/conversations/exports.js" + }, + "./ecommerce": { + "import": { + "types": "./dist/esm/api/resources/ecommerce/exports.d.mts", + "default": "./dist/esm/api/resources/ecommerce/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/ecommerce/exports.d.ts", + "default": "./dist/cjs/api/resources/ecommerce/exports.js" + }, + "default": "./dist/cjs/api/resources/ecommerce/exports.js" + }, + "./coupons": { + "import": { + "types": "./dist/esm/api/resources/coupons/exports.d.mts", + "default": "./dist/esm/api/resources/coupons/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/coupons/exports.d.ts", + "default": "./dist/cjs/api/resources/coupons/exports.js" + }, + "default": "./dist/cjs/api/resources/coupons/exports.js" + }, + "./payments": { + "import": { + "types": "./dist/esm/api/resources/payments/exports.d.mts", + "default": "./dist/esm/api/resources/payments/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/payments/exports.d.ts", + "default": "./dist/cjs/api/resources/payments/exports.js" + }, + "default": "./dist/cjs/api/resources/payments/exports.js" + }, + "./event": { + "import": { + "types": "./dist/esm/api/resources/event/exports.d.mts", + "default": "./dist/esm/api/resources/event/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/event/exports.d.ts", + "default": "./dist/cjs/api/resources/event/exports.js" + }, + "default": "./dist/cjs/api/resources/event/exports.js" + }, + "./inboundParsing": { + "import": { + "types": "./dist/esm/api/resources/inboundParsing/exports.d.mts", + "default": "./dist/esm/api/resources/inboundParsing/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/inboundParsing/exports.d.ts", + "default": "./dist/cjs/api/resources/inboundParsing/exports.js" + }, + "default": "./dist/cjs/api/resources/inboundParsing/exports.js" + }, + "./balance": { + "import": { + "types": "./dist/esm/api/resources/balance/exports.d.mts", + "default": "./dist/esm/api/resources/balance/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/balance/exports.d.ts", + "default": "./dist/cjs/api/resources/balance/exports.js" + }, + "default": "./dist/cjs/api/resources/balance/exports.js" + }, + "./program": { + "import": { + "types": "./dist/esm/api/resources/program/exports.d.mts", + "default": "./dist/esm/api/resources/program/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/program/exports.d.ts", + "default": "./dist/cjs/api/resources/program/exports.js" + }, + "default": "./dist/cjs/api/resources/program/exports.js" + }, + "./reward": { + "import": { + "types": "./dist/esm/api/resources/reward/exports.d.mts", + "default": "./dist/esm/api/resources/reward/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/reward/exports.d.ts", + "default": "./dist/cjs/api/resources/reward/exports.js" + }, + "default": "./dist/cjs/api/resources/reward/exports.js" + }, + "./tier": { + "import": { + "types": "./dist/esm/api/resources/tier/exports.d.mts", + "default": "./dist/esm/api/resources/tier/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/tier/exports.d.ts", + "default": "./dist/cjs/api/resources/tier/exports.js" + }, + "default": "./dist/cjs/api/resources/tier/exports.js" + }, + "./emailCampaigns": { + "import": { + "types": "./dist/esm/api/resources/emailCampaigns/exports.d.mts", + "default": "./dist/esm/api/resources/emailCampaigns/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/emailCampaigns/exports.d.ts", + "default": "./dist/cjs/api/resources/emailCampaigns/exports.js" + }, + "default": "./dist/cjs/api/resources/emailCampaigns/exports.js" + }, + "./smsCampaigns": { + "import": { + "types": "./dist/esm/api/resources/smsCampaigns/exports.d.mts", + "default": "./dist/esm/api/resources/smsCampaigns/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/smsCampaigns/exports.d.ts", + "default": "./dist/cjs/api/resources/smsCampaigns/exports.js" + }, + "default": "./dist/cjs/api/resources/smsCampaigns/exports.js" + }, + "./whatsAppCampaigns": { + "import": { + "types": "./dist/esm/api/resources/whatsAppCampaigns/exports.d.mts", + "default": "./dist/esm/api/resources/whatsAppCampaigns/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/whatsAppCampaigns/exports.d.ts", + "default": "./dist/cjs/api/resources/whatsAppCampaigns/exports.js" + }, + "default": "./dist/cjs/api/resources/whatsAppCampaigns/exports.js" + }, + "./companies": { + "import": { + "types": "./dist/esm/api/resources/companies/exports.d.mts", + "default": "./dist/esm/api/resources/companies/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/companies/exports.d.ts", + "default": "./dist/cjs/api/resources/companies/exports.js" + }, + "default": "./dist/cjs/api/resources/companies/exports.js" + }, + "./deals": { + "import": { + "types": "./dist/esm/api/resources/deals/exports.d.mts", + "default": "./dist/esm/api/resources/deals/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/deals/exports.d.ts", + "default": "./dist/cjs/api/resources/deals/exports.js" + }, + "default": "./dist/cjs/api/resources/deals/exports.js" + }, + "./files": { + "import": { + "types": "./dist/esm/api/resources/files/exports.d.mts", + "default": "./dist/esm/api/resources/files/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/files/exports.d.ts", + "default": "./dist/cjs/api/resources/files/exports.js" + }, + "default": "./dist/cjs/api/resources/files/exports.js" + }, + "./notes": { + "import": { + "types": "./dist/esm/api/resources/notes/exports.d.mts", + "default": "./dist/esm/api/resources/notes/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/notes/exports.d.ts", + "default": "./dist/cjs/api/resources/notes/exports.js" + }, + "default": "./dist/cjs/api/resources/notes/exports.js" + }, + "./tasks": { + "import": { + "types": "./dist/esm/api/resources/tasks/exports.d.mts", + "default": "./dist/esm/api/resources/tasks/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/tasks/exports.d.ts", + "default": "./dist/cjs/api/resources/tasks/exports.js" + }, + "default": "./dist/cjs/api/resources/tasks/exports.js" + }, + "./transactionalWhatsApp": { + "import": { + "types": "./dist/esm/api/resources/transactionalWhatsApp/exports.d.mts", + "default": "./dist/esm/api/resources/transactionalWhatsApp/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/transactionalWhatsApp/exports.d.ts", + "default": "./dist/cjs/api/resources/transactionalWhatsApp/exports.js" + }, + "default": "./dist/cjs/api/resources/transactionalWhatsApp/exports.js" + }, + "./transactionalEmails": { + "import": { + "types": "./dist/esm/api/resources/transactionalEmails/exports.d.mts", + "default": "./dist/esm/api/resources/transactionalEmails/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/transactionalEmails/exports.d.ts", + "default": "./dist/cjs/api/resources/transactionalEmails/exports.js" + }, + "default": "./dist/cjs/api/resources/transactionalEmails/exports.js" + }, + "./transactionalSms": { + "import": { + "types": "./dist/esm/api/resources/transactionalSms/exports.d.mts", + "default": "./dist/esm/api/resources/transactionalSms/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/transactionalSms/exports.d.ts", + "default": "./dist/cjs/api/resources/transactionalSms/exports.js" + }, + "default": "./dist/cjs/api/resources/transactionalSms/exports.js" + }, + "./smsTemplates": { + "import": { + "types": "./dist/esm/api/resources/smsTemplates/exports.d.mts", + "default": "./dist/esm/api/resources/smsTemplates/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/smsTemplates/exports.d.ts", + "default": "./dist/cjs/api/resources/smsTemplates/exports.js" + }, + "default": "./dist/cjs/api/resources/smsTemplates/exports.js" + }, "./package.json": "./package.json" }, "files": [ @@ -53,13 +404,14 @@ "msw": "2.11.2", "@types/node": "^18.19.70", "typescript": "~5.7.2", - "@biomejs/biome": "2.3.11" + "@biomejs/biome": "2.4.3" }, "browser": { "fs": false, "os": false, "path": false, - "stream": false + "stream": false, + "crypto": false }, "packageManager": "pnpm@10.20.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08ec090..410054a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: 2.3.11 - version: 2.3.11 + specifier: 2.4.3 + version: 2.4.3 '@types/node': specifier: ^18.19.70 version: 18.19.130 @@ -19,68 +19,68 @@ importers: version: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) ts-loader: specifier: ^9.5.1 - version: 9.5.4(typescript@5.7.3)(webpack@5.105.2) + version: 9.5.4(typescript@5.7.3)(webpack@5.105.4) typescript: specifier: ~5.7.2 version: 5.7.3 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0) + version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.1) webpack: specifier: ^5.97.1 - version: 5.105.2 + version: 5.105.4 packages: - '@biomejs/biome@2.3.11': - resolution: {integrity: sha512-/zt+6qazBWguPG6+eWmiELqO+9jRsMZ/DBU3lfuU2ngtIQYzymocHhKiZRyrbra4aCOoyTg/BmY+6WH5mv9xmQ==} + '@biomejs/biome@2.4.3': + resolution: {integrity: sha512-cBrjf6PNF6yfL8+kcNl85AjiK2YHNsbU0EvDOwiZjBPbMbQ5QcgVGFpjD0O52p8nec5O8NYw7PKw3xUR7fPAkQ==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.3.11': - resolution: {integrity: sha512-/uXXkBcPKVQY7rc9Ys2CrlirBJYbpESEDme7RKiBD6MmqR2w3j0+ZZXRIL2xiaNPsIMMNhP1YnA+jRRxoOAFrA==} + '@biomejs/cli-darwin-arm64@2.4.3': + resolution: {integrity: sha512-eOafSFlI/CF4id2tlwq9CVHgeEqvTL5SrhWff6ZORp6S3NL65zdsR3ugybItkgF8Pf4D9GSgtbB6sE3UNgOM9w==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.3.11': - resolution: {integrity: sha512-fh7nnvbweDPm2xEmFjfmq7zSUiox88plgdHF9OIW4i99WnXrAC3o2P3ag9judoUMv8FCSUnlwJCM1B64nO5Fbg==} + '@biomejs/cli-darwin-x64@2.4.3': + resolution: {integrity: sha512-V2+av4ilbWcBMNufTtMMXVW00nPwyIjI5qf7n9wSvUaZ+tt0EvMGk46g9sAFDJBEDOzSyoRXiSP6pCvKTOEbPA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.3.11': - resolution: {integrity: sha512-XPSQ+XIPZMLaZ6zveQdwNjbX+QdROEd1zPgMwD47zvHV+tCGB88VH+aynyGxAHdzL+Tm/+DtKST5SECs4iwCLg==} + '@biomejs/cli-linux-arm64-musl@2.4.3': + resolution: {integrity: sha512-QuFzvsGo8BA4Xm7jGX5idkw6BqFblcCPySMTvq0AhGYnhUej5VJIDJbmTKfHqwjHepZiC4fA+T5i6wmiZolZNw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@2.3.11': - resolution: {integrity: sha512-l4xkGa9E7Uc0/05qU2lMYfN1H+fzzkHgaJoy98wO+b/7Gl78srbCRRgwYSW+BTLixTBrM6Ede5NSBwt7rd/i6g==} + '@biomejs/cli-linux-arm64@2.4.3': + resolution: {integrity: sha512-0m+O0x9FgK99FAwDK+fiDtjs2wnqq7bvfj17KJVeCkTwT/liI+Q9njJG7lwXK0iSJVXeFNRIxukpVI3SifMYAA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@2.3.11': - resolution: {integrity: sha512-vU7a8wLs5C9yJ4CB8a44r12aXYb8yYgBn+WeyzbMjaCMklzCv1oXr8x+VEyWodgJt9bDmhiaW/I0RHbn7rsNmw==} + '@biomejs/cli-linux-x64-musl@2.4.3': + resolution: {integrity: sha512-qEc0OCpj/uytruQ4wLM0yWNJLZy0Up8H1Er5MW3SrstqM6J2d4XqdNA86xzCy8MQCHpoVZ3lFye3GBlIL4/ljw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@2.3.11': - resolution: {integrity: sha512-/1s9V/H3cSe0r0Mv/Z8JryF5x9ywRxywomqZVLHAoa/uN0eY7F8gEngWKNS5vbbN/BsfpCG5yeBT5ENh50Frxg==} + '@biomejs/cli-linux-x64@2.4.3': + resolution: {integrity: sha512-NVqh0saIU0u5OfOp/0jFdlKRE59+XyMvWmtx0f6Nm/2OpdxBl04coRIftBbY9d1gfu+23JVv4CItAqPYrjYh5w==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@2.3.11': - resolution: {integrity: sha512-PZQ6ElCOnkYapSsysiTy0+fYX+agXPlWugh6+eQ6uPKI3vKAqNp6TnMhoM3oY2NltSB89hz59o8xIfOdyhi9Iw==} + '@biomejs/cli-win32-arm64@2.4.3': + resolution: {integrity: sha512-gRO96vrIARilv/Cp2ZnmNNL5LSZg3RO75GPp13hsLO3N4YVpE7saaMDp2bcyV48y2N2Pbit1brkGVGta0yd6VQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.3.11': - resolution: {integrity: sha512-43VrG813EW+b5+YbDbz31uUsheX+qFKCpXeY9kfdAx+ww3naKxeVkTD9zLIWxUPfJquANMHrmW3wbe/037G0Qg==} + '@biomejs/cli-win32-x64@2.4.3': + resolution: {integrity: sha512-vSm/vOJe06pf14aGHfHl3Ar91Nlx4YYmohElDJ+17UbRwe99n987S/MhAlQOkONqf1utJor04ChkCPmKb8SWdw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -91,158 +91,158 @@ packages: '@bundled-es-modules/statuses@1.0.1': resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} - '@esbuild/aix-ppc64@0.27.3': - resolution: {integrity: sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==} + '@esbuild/aix-ppc64@0.27.4': + resolution: {integrity: sha512-cQPwL2mp2nSmHHJlCyoXgHGhbEPMrEEU5xhkcy3Hs/O7nGZqEpZ2sUtLaL9MORLtDfRvVl2/3PAuEkYZH0Ty8Q==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.27.3': - resolution: {integrity: sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==} + '@esbuild/android-arm64@0.27.4': + resolution: {integrity: sha512-gdLscB7v75wRfu7QSm/zg6Rx29VLdy9eTr2t44sfTW7CxwAtQghZ4ZnqHk3/ogz7xao0QAgrkradbBzcqFPasw==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.27.3': - resolution: {integrity: sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==} + '@esbuild/android-arm@0.27.4': + resolution: {integrity: sha512-X9bUgvxiC8CHAGKYufLIHGXPJWnr0OCdR0anD2e21vdvgCI8lIfqFbnoeOz7lBjdrAGUhqLZLcQo6MLhTO2DKQ==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.27.3': - resolution: {integrity: sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==} + '@esbuild/android-x64@0.27.4': + resolution: {integrity: sha512-PzPFnBNVF292sfpfhiyiXCGSn9HZg5BcAz+ivBuSsl6Rk4ga1oEXAamhOXRFyMcjwr2DVtm40G65N3GLeH1Lvw==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.27.3': - resolution: {integrity: sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==} + '@esbuild/darwin-arm64@0.27.4': + resolution: {integrity: sha512-b7xaGIwdJlht8ZFCvMkpDN6uiSmnxxK56N2GDTMYPr2/gzvfdQN8rTfBsvVKmIVY/X7EM+/hJKEIbbHs9oA4tQ==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.27.3': - resolution: {integrity: sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==} + '@esbuild/darwin-x64@0.27.4': + resolution: {integrity: sha512-sR+OiKLwd15nmCdqpXMnuJ9W2kpy0KigzqScqHI3Hqwr7IXxBp3Yva+yJwoqh7rE8V77tdoheRYataNKL4QrPw==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.27.3': - resolution: {integrity: sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==} + '@esbuild/freebsd-arm64@0.27.4': + resolution: {integrity: sha512-jnfpKe+p79tCnm4GVav68A7tUFeKQwQyLgESwEAUzyxk/TJr4QdGog9sqWNcUbr/bZt/O/HXouspuQDd9JxFSw==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.27.3': - resolution: {integrity: sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==} + '@esbuild/freebsd-x64@0.27.4': + resolution: {integrity: sha512-2kb4ceA/CpfUrIcTUl1wrP/9ad9Atrp5J94Lq69w7UwOMolPIGrfLSvAKJp0RTvkPPyn6CIWrNy13kyLikZRZQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.27.3': - resolution: {integrity: sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==} + '@esbuild/linux-arm64@0.27.4': + resolution: {integrity: sha512-7nQOttdzVGth1iz57kxg9uCz57dxQLHWxopL6mYuYthohPKEK0vU0C3O21CcBK6KDlkYVcnDXY099HcCDXd9dA==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.27.3': - resolution: {integrity: sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==} + '@esbuild/linux-arm@0.27.4': + resolution: {integrity: sha512-aBYgcIxX/wd5n2ys0yESGeYMGF+pv6g0DhZr3G1ZG4jMfruU9Tl1i2Z+Wnj9/KjGz1lTLCcorqE2viePZqj4Eg==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.27.3': - resolution: {integrity: sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==} + '@esbuild/linux-ia32@0.27.4': + resolution: {integrity: sha512-oPtixtAIzgvzYcKBQM/qZ3R+9TEUd1aNJQu0HhGyqtx6oS7qTpvjheIWBbes4+qu1bNlo2V4cbkISr8q6gRBFA==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.27.3': - resolution: {integrity: sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==} + '@esbuild/linux-loong64@0.27.4': + resolution: {integrity: sha512-8mL/vh8qeCoRcFH2nM8wm5uJP+ZcVYGGayMavi8GmRJjuI3g1v6Z7Ni0JJKAJW+m0EtUuARb6Lmp4hMjzCBWzA==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.27.3': - resolution: {integrity: sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==} + '@esbuild/linux-mips64el@0.27.4': + resolution: {integrity: sha512-1RdrWFFiiLIW7LQq9Q2NES+HiD4NyT8Itj9AUeCl0IVCA459WnPhREKgwrpaIfTOe+/2rdntisegiPWn/r/aAw==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.27.3': - resolution: {integrity: sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==} + '@esbuild/linux-ppc64@0.27.4': + resolution: {integrity: sha512-tLCwNG47l3sd9lpfyx9LAGEGItCUeRCWeAx6x2Jmbav65nAwoPXfewtAdtbtit/pJFLUWOhpv0FpS6GQAmPrHA==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.27.3': - resolution: {integrity: sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==} + '@esbuild/linux-riscv64@0.27.4': + resolution: {integrity: sha512-BnASypppbUWyqjd1KIpU4AUBiIhVr6YlHx/cnPgqEkNoVOhHg+YiSVxM1RLfiy4t9cAulbRGTNCKOcqHrEQLIw==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.27.3': - resolution: {integrity: sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==} + '@esbuild/linux-s390x@0.27.4': + resolution: {integrity: sha512-+eUqgb/Z7vxVLezG8bVB9SfBie89gMueS+I0xYh2tJdw3vqA/0ImZJ2ROeWwVJN59ihBeZ7Tu92dF/5dy5FttA==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.27.3': - resolution: {integrity: sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==} + '@esbuild/linux-x64@0.27.4': + resolution: {integrity: sha512-S5qOXrKV8BQEzJPVxAwnryi2+Iq5pB40gTEIT69BQONqR7JH1EPIcQ/Uiv9mCnn05jff9umq/5nqzxlqTOg9NA==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.27.3': - resolution: {integrity: sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==} + '@esbuild/netbsd-arm64@0.27.4': + resolution: {integrity: sha512-xHT8X4sb0GS8qTqiwzHqpY00C95DPAq7nAwX35Ie/s+LO9830hrMd3oX0ZMKLvy7vsonee73x0lmcdOVXFzd6Q==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.27.3': - resolution: {integrity: sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==} + '@esbuild/netbsd-x64@0.27.4': + resolution: {integrity: sha512-RugOvOdXfdyi5Tyv40kgQnI0byv66BFgAqjdgtAKqHoZTbTF2QqfQrFwa7cHEORJf6X2ht+l9ABLMP0dnKYsgg==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.27.3': - resolution: {integrity: sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==} + '@esbuild/openbsd-arm64@0.27.4': + resolution: {integrity: sha512-2MyL3IAaTX+1/qP0O1SwskwcwCoOI4kV2IBX1xYnDDqthmq5ArrW94qSIKCAuRraMgPOmG0RDTA74mzYNQA9ow==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.27.3': - resolution: {integrity: sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==} + '@esbuild/openbsd-x64@0.27.4': + resolution: {integrity: sha512-u8fg/jQ5aQDfsnIV6+KwLOf1CmJnfu1ShpwqdwC0uA7ZPwFws55Ngc12vBdeUdnuWoQYx/SOQLGDcdlfXhYmXQ==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/openharmony-arm64@0.27.3': - resolution: {integrity: sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==} + '@esbuild/openharmony-arm64@0.27.4': + resolution: {integrity: sha512-JkTZrl6VbyO8lDQO3yv26nNr2RM2yZzNrNHEsj9bm6dOwwu9OYN28CjzZkH57bh4w0I2F7IodpQvUAEd1mbWXg==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] - '@esbuild/sunos-x64@0.27.3': - resolution: {integrity: sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==} + '@esbuild/sunos-x64@0.27.4': + resolution: {integrity: sha512-/gOzgaewZJfeJTlsWhvUEmUG4tWEY2Spp5M20INYRg2ZKl9QPO3QEEgPeRtLjEWSW8FilRNacPOg8R1uaYkA6g==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.27.3': - resolution: {integrity: sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==} + '@esbuild/win32-arm64@0.27.4': + resolution: {integrity: sha512-Z9SExBg2y32smoDQdf1HRwHRt6vAHLXcxD2uGgO/v2jK7Y718Ix4ndsbNMU/+1Qiem9OiOdaqitioZwxivhXYg==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.27.3': - resolution: {integrity: sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==} + '@esbuild/win32-ia32@0.27.4': + resolution: {integrity: sha512-DAyGLS0Jz5G5iixEbMHi5KdiApqHBWMGzTtMiJ72ZOLhbu/bzxgAe8Ue8CTS3n3HbIUHQz/L51yMdGMeoxXNJw==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.27.3': - resolution: {integrity: sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==} + '@esbuild/win32-x64@0.27.4': + resolution: {integrity: sha512-+knoa0BDoeXgkNvvV1vvbZX4+hizelrkwmGJBdT17t8FNPwG2lKemmuMZlmaNQ3ws3DKKCxpb4zRZEIp3UxFCg==} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -311,128 +311,128 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@rollup/rollup-android-arm-eabi@4.57.1': - resolution: {integrity: sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==} + '@rollup/rollup-android-arm-eabi@4.60.0': + resolution: {integrity: sha512-WOhNW9K8bR3kf4zLxbfg6Pxu2ybOUbB2AjMDHSQx86LIF4rH4Ft7vmMwNt0loO0eonglSNy4cpD3MKXXKQu0/A==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.57.1': - resolution: {integrity: sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==} + '@rollup/rollup-android-arm64@4.60.0': + resolution: {integrity: sha512-u6JHLll5QKRvjciE78bQXDmqRqNs5M/3GVqZeMwvmjaNODJih/WIrJlFVEihvV0MiYFmd+ZyPr9wxOVbPAG2Iw==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.57.1': - resolution: {integrity: sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==} + '@rollup/rollup-darwin-arm64@4.60.0': + resolution: {integrity: sha512-qEF7CsKKzSRc20Ciu2Zw1wRrBz4g56F7r/vRwY430UPp/nt1x21Q/fpJ9N5l47WWvJlkNCPJz3QRVw008fi7yA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.57.1': - resolution: {integrity: sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==} + '@rollup/rollup-darwin-x64@4.60.0': + resolution: {integrity: sha512-WADYozJ4QCnXCH4wPB+3FuGmDPoFseVCUrANmA5LWwGmC6FL14BWC7pcq+FstOZv3baGX65tZ378uT6WG8ynTw==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.57.1': - resolution: {integrity: sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==} + '@rollup/rollup-freebsd-arm64@4.60.0': + resolution: {integrity: sha512-6b8wGHJlDrGeSE3aH5mGNHBjA0TTkxdoNHik5EkvPHCt351XnigA4pS7Wsj/Eo9Y8RBU6f35cjN9SYmCFBtzxw==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.57.1': - resolution: {integrity: sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==} + '@rollup/rollup-freebsd-x64@4.60.0': + resolution: {integrity: sha512-h25Ga0t4jaylMB8M/JKAyrvvfxGRjnPQIR8lnCayyzEjEOx2EJIlIiMbhpWxDRKGKF8jbNH01NnN663dH638mA==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.57.1': - resolution: {integrity: sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==} + '@rollup/rollup-linux-arm-gnueabihf@4.60.0': + resolution: {integrity: sha512-RzeBwv0B3qtVBWtcuABtSuCzToo2IEAIQrcyB/b2zMvBWVbjo8bZDjACUpnaafaxhTw2W+imQbP2BD1usasK4g==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.57.1': - resolution: {integrity: sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==} + '@rollup/rollup-linux-arm-musleabihf@4.60.0': + resolution: {integrity: sha512-Sf7zusNI2CIU1HLzuu9Tc5YGAHEZs5Lu7N1ssJG4Tkw6e0MEsN7NdjUDDfGNHy2IU+ENyWT+L2obgWiguWibWQ==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.57.1': - resolution: {integrity: sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==} + '@rollup/rollup-linux-arm64-gnu@4.60.0': + resolution: {integrity: sha512-DX2x7CMcrJzsE91q7/O02IJQ5/aLkVtYFryqCjduJhUfGKG6yJV8hxaw8pZa93lLEpPTP/ohdN4wFz7yp/ry9A==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.57.1': - resolution: {integrity: sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==} + '@rollup/rollup-linux-arm64-musl@4.60.0': + resolution: {integrity: sha512-09EL+yFVbJZlhcQfShpswwRZ0Rg+z/CsSELFCnPt3iK+iqwGsI4zht3secj5vLEs957QvFFXnzAT0FFPIxSrkQ==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.57.1': - resolution: {integrity: sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==} + '@rollup/rollup-linux-loong64-gnu@4.60.0': + resolution: {integrity: sha512-i9IcCMPr3EXm8EQg5jnja0Zyc1iFxJjZWlb4wr7U2Wx/GrddOuEafxRdMPRYVaXjgbhvqalp6np07hN1w9kAKw==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-loong64-musl@4.57.1': - resolution: {integrity: sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==} + '@rollup/rollup-linux-loong64-musl@4.60.0': + resolution: {integrity: sha512-DGzdJK9kyJ+B78MCkWeGnpXJ91tK/iKA6HwHxF4TAlPIY7GXEvMe8hBFRgdrR9Ly4qebR/7gfUs9y2IoaVEyog==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.57.1': - resolution: {integrity: sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==} + '@rollup/rollup-linux-ppc64-gnu@4.60.0': + resolution: {integrity: sha512-RwpnLsqC8qbS8z1H1AxBA1H6qknR4YpPR9w2XX0vo2Sz10miu57PkNcnHVaZkbqyw/kUWfKMI73jhmfi9BRMUQ==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-ppc64-musl@4.57.1': - resolution: {integrity: sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==} + '@rollup/rollup-linux-ppc64-musl@4.60.0': + resolution: {integrity: sha512-Z8pPf54Ly3aqtdWC3G4rFigZgNvd+qJlOE52fmko3KST9SoGfAdSRCwyoyG05q1HrrAblLbk1/PSIV+80/pxLg==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.57.1': - resolution: {integrity: sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==} + '@rollup/rollup-linux-riscv64-gnu@4.60.0': + resolution: {integrity: sha512-3a3qQustp3COCGvnP4SvrMHnPQ9d1vzCakQVRTliaz8cIp/wULGjiGpbcqrkv0WrHTEp8bQD/B3HBjzujVWLOA==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.57.1': - resolution: {integrity: sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==} + '@rollup/rollup-linux-riscv64-musl@4.60.0': + resolution: {integrity: sha512-pjZDsVH/1VsghMJ2/kAaxt6dL0psT6ZexQVrijczOf+PeP2BUqTHYejk3l6TlPRydggINOeNRhvpLa0AYpCWSQ==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.57.1': - resolution: {integrity: sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==} + '@rollup/rollup-linux-s390x-gnu@4.60.0': + resolution: {integrity: sha512-3ObQs0BhvPgiUVZrN7gqCSvmFuMWvWvsjG5ayJ3Lraqv+2KhOsp+pUbigqbeWqueGIsnn+09HBw27rJ+gYK4VQ==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.57.1': - resolution: {integrity: sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==} + '@rollup/rollup-linux-x64-gnu@4.60.0': + resolution: {integrity: sha512-EtylprDtQPdS5rXvAayrNDYoJhIz1/vzN2fEubo3yLE7tfAw+948dO0g4M0vkTVFhKojnF+n6C8bDNe+gDRdTg==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.57.1': - resolution: {integrity: sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==} + '@rollup/rollup-linux-x64-musl@4.60.0': + resolution: {integrity: sha512-k09oiRCi/bHU9UVFqD17r3eJR9bn03TyKraCrlz5ULFJGdJGi7VOmm9jl44vOJvRJ6P7WuBi/s2A97LxxHGIdw==} cpu: [x64] os: [linux] - '@rollup/rollup-openbsd-x64@4.57.1': - resolution: {integrity: sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==} + '@rollup/rollup-openbsd-x64@4.60.0': + resolution: {integrity: sha512-1o/0/pIhozoSaDJoDcec+IVLbnRtQmHwPV730+AOD29lHEEo4F5BEUB24H0OBdhbBBDwIOSuf7vgg0Ywxdfiiw==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.57.1': - resolution: {integrity: sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==} + '@rollup/rollup-openharmony-arm64@4.60.0': + resolution: {integrity: sha512-pESDkos/PDzYwtyzB5p/UoNU/8fJo68vcXM9ZW2V0kjYayj1KaaUfi1NmTUTUpMn4UhU4gTuK8gIaFO4UGuMbA==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.57.1': - resolution: {integrity: sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==} + '@rollup/rollup-win32-arm64-msvc@4.60.0': + resolution: {integrity: sha512-hj1wFStD7B1YBeYmvY+lWXZ7ey73YGPcViMShYikqKT1GtstIKQAtfUI6yrzPjAy/O7pO0VLXGmUVWXQMaYgTQ==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.57.1': - resolution: {integrity: sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==} + '@rollup/rollup-win32-ia32-msvc@4.60.0': + resolution: {integrity: sha512-SyaIPFoxmUPlNDq5EHkTbiKzmSEmq/gOYFI/3HHJ8iS/v1mbugVa7dXUzcJGQfoytp9DJFLhHH4U3/eTy2Bq4w==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.57.1': - resolution: {integrity: sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==} + '@rollup/rollup-win32-x64-gnu@4.60.0': + resolution: {integrity: sha512-RdcryEfzZr+lAr5kRm2ucN9aVlCCa2QNq4hXelZxb8GG0NJSazq44Z3PCCc8wISRuCVnGs0lQJVX5Vp6fKA+IA==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.57.1': - resolution: {integrity: sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==} + '@rollup/rollup-win32-x64-msvc@4.60.0': + resolution: {integrity: sha512-PrsWNQ8BuE00O3Xsx3ALh2Df8fAj9+cvvX9AIA6o4KpATR98c9mud4XtDWVvsEuyia5U4tVSTKygawyJkjm60w==} cpu: [x64] os: [win32] @@ -549,8 +549,8 @@ packages: peerDependencies: acorn: ^8.14.0 - acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} engines: {node: '>=0.4.0'} hasBin: true @@ -567,8 +567,8 @@ packages: peerDependencies: ajv: ^8.8.2 - ajv@8.17.1: - resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + ajv@8.18.0: + resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -582,8 +582,9 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - baseline-browser-mapping@2.9.19: - resolution: {integrity: sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==} + baseline-browser-mapping@2.10.10: + resolution: {integrity: sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ==} + engines: {node: '>=6.0.0'} hasBin: true braces@3.0.3: @@ -602,8 +603,8 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - caniuse-lite@1.0.30001769: - resolution: {integrity: sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==} + caniuse-lite@1.0.30001781: + resolution: {integrity: sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw==} chai@5.3.3: resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} @@ -656,14 +657,14 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} - electron-to-chromium@1.5.286: - resolution: {integrity: sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==} + electron-to-chromium@1.5.321: + resolution: {integrity: sha512-L2C7Q279W2D/J4PLZLk7sebOILDSWos7bMsMNN06rK482umHUrh/3lM8G7IlHFOYip2oAg5nha1rCMxr/rs6ZQ==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enhanced-resolve@5.19.0: - resolution: {integrity: sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==} + enhanced-resolve@5.20.1: + resolution: {integrity: sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==} engines: {node: '>=10.13.0'} es-module-lexer@1.7.0: @@ -672,8 +673,8 @@ packages: es-module-lexer@2.0.0: resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} - esbuild@0.27.3: - resolution: {integrity: sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==} + esbuild@0.27.4: + resolution: {integrity: sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ==} engines: {node: '>=18'} hasBin: true @@ -742,8 +743,8 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphql@16.12.0: - resolution: {integrity: sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==} + graphql@16.13.1: + resolution: {integrity: sha512-gGgrVCoDKlIZ8fIqXBBb0pPKqDgki0Z/FSKNiQzSGj2uEYHr1tq5wmBegGwJx6QB5S5cM0khSBpi/JFHMCvsmQ==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} has-flag@4.0.0: @@ -827,8 +828,8 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - node-releases@2.0.27: - resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} + node-releases@2.0.36: + resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} outvariant@1.4.3: resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} @@ -846,21 +847,18 @@ packages: picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} engines: {node: '>=8.6'} - picomatch@4.0.3: - resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} - postcss@8.5.6: - resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + postcss@8.5.8: + resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} engines: {node: ^10 || ^12 || >=14} - randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -872,14 +870,11 @@ packages: rettime@0.7.0: resolution: {integrity: sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==} - rollup@4.57.1: - resolution: {integrity: sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==} + rollup@4.60.0: + resolution: {integrity: sha512-yqjxruMGBQJ2gG4HtjZtAfXArHomazDHoFwFFmZZl0r7Pdo7qCIXKqKHZc8yeoMgzJJ+pO6pEEHa+V7uzWlrAQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - schema-utils@4.3.3: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} @@ -889,9 +884,6 @@ packages: engines: {node: '>=10'} hasBin: true - serialize-javascript@6.0.2: - resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} - siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -946,12 +938,12 @@ packages: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} - tapable@2.3.0: - resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} + tapable@2.3.1: + resolution: {integrity: sha512-b+u3CEM6FjDHru+nhUSjDofpWSBp2rINziJWgApm72wwGasQ/wKXftZe4tI2Y5HPv6OpzXSZHOFq87H4vfsgsw==} engines: {node: '>=6'} - terser-webpack-plugin@5.3.16: - resolution: {integrity: sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==} + terser-webpack-plugin@5.4.0: + resolution: {integrity: sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==} engines: {node: '>= 10.13.0'} peerDependencies: '@swc/core': '*' @@ -966,8 +958,8 @@ packages: uglify-js: optional: true - terser@5.46.0: - resolution: {integrity: sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==} + terser@5.46.1: + resolution: {integrity: sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ==} engines: {node: '>=10'} hasBin: true @@ -993,19 +985,19 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} - tldts-core@7.0.23: - resolution: {integrity: sha512-0g9vrtDQLrNIiCj22HSe9d4mLVG3g5ph5DZ8zCKBr4OtrspmNB6ss7hVyzArAeE88ceZocIEGkyW1Ime7fxPtQ==} + tldts-core@7.0.27: + resolution: {integrity: sha512-YQ7uPjgWUibIK6DW5lrKujGwUKhLevU4hcGbP5O6TcIUb+oTjJYJVWPS4nZsIHrEEEG6myk/oqAJUEQmpZrHsg==} - tldts@7.0.23: - resolution: {integrity: sha512-ASdhgQIBSay0R/eXggAkQ53G4nTJqTXqC2kbaBbdDwM7SkjyZyO0OaaN1/FH7U/yCeqOHDwFO5j8+Os/IS1dXw==} + tldts@7.0.27: + resolution: {integrity: sha512-I4FZcVFcqCRuT0ph6dCDpPuO4Xgzvh+spkcTr1gK7peIvxWauoloVO0vuy1FQnijT63ss6AsHB6+OIM4aXHbPg==} hasBin: true to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} - tough-cookie@6.0.0: - resolution: {integrity: sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==} + tough-cookie@6.0.1: + resolution: {integrity: sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw==} engines: {node: '>=16'} ts-loader@9.5.4: @@ -1110,12 +1102,12 @@ packages: resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} engines: {node: '>=10.13.0'} - webpack-sources@3.3.3: - resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} + webpack-sources@3.3.4: + resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} engines: {node: '>=10.13.0'} - webpack@5.105.2: - resolution: {integrity: sha512-dRXm0a2qcHPUBEzVk8uph0xWSjV/xZxenQQbLwnwP7caQCYpqG1qddwlyEkIDkYn0K8tvmcrZ+bOrzoQ3HxCDw==} + webpack@5.105.4: + resolution: {integrity: sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -1155,39 +1147,39 @@ packages: snapshots: - '@biomejs/biome@2.3.11': + '@biomejs/biome@2.4.3': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.3.11 - '@biomejs/cli-darwin-x64': 2.3.11 - '@biomejs/cli-linux-arm64': 2.3.11 - '@biomejs/cli-linux-arm64-musl': 2.3.11 - '@biomejs/cli-linux-x64': 2.3.11 - '@biomejs/cli-linux-x64-musl': 2.3.11 - '@biomejs/cli-win32-arm64': 2.3.11 - '@biomejs/cli-win32-x64': 2.3.11 - - '@biomejs/cli-darwin-arm64@2.3.11': + '@biomejs/cli-darwin-arm64': 2.4.3 + '@biomejs/cli-darwin-x64': 2.4.3 + '@biomejs/cli-linux-arm64': 2.4.3 + '@biomejs/cli-linux-arm64-musl': 2.4.3 + '@biomejs/cli-linux-x64': 2.4.3 + '@biomejs/cli-linux-x64-musl': 2.4.3 + '@biomejs/cli-win32-arm64': 2.4.3 + '@biomejs/cli-win32-x64': 2.4.3 + + '@biomejs/cli-darwin-arm64@2.4.3': optional: true - '@biomejs/cli-darwin-x64@2.3.11': + '@biomejs/cli-darwin-x64@2.4.3': optional: true - '@biomejs/cli-linux-arm64-musl@2.3.11': + '@biomejs/cli-linux-arm64-musl@2.4.3': optional: true - '@biomejs/cli-linux-arm64@2.3.11': + '@biomejs/cli-linux-arm64@2.4.3': optional: true - '@biomejs/cli-linux-x64-musl@2.3.11': + '@biomejs/cli-linux-x64-musl@2.4.3': optional: true - '@biomejs/cli-linux-x64@2.3.11': + '@biomejs/cli-linux-x64@2.4.3': optional: true - '@biomejs/cli-win32-arm64@2.3.11': + '@biomejs/cli-win32-arm64@2.4.3': optional: true - '@biomejs/cli-win32-x64@2.3.11': + '@biomejs/cli-win32-x64@2.4.3': optional: true '@bundled-es-modules/cookie@2.0.1': @@ -1198,82 +1190,82 @@ snapshots: dependencies: statuses: 2.0.2 - '@esbuild/aix-ppc64@0.27.3': + '@esbuild/aix-ppc64@0.27.4': optional: true - '@esbuild/android-arm64@0.27.3': + '@esbuild/android-arm64@0.27.4': optional: true - '@esbuild/android-arm@0.27.3': + '@esbuild/android-arm@0.27.4': optional: true - '@esbuild/android-x64@0.27.3': + '@esbuild/android-x64@0.27.4': optional: true - '@esbuild/darwin-arm64@0.27.3': + '@esbuild/darwin-arm64@0.27.4': optional: true - '@esbuild/darwin-x64@0.27.3': + '@esbuild/darwin-x64@0.27.4': optional: true - '@esbuild/freebsd-arm64@0.27.3': + '@esbuild/freebsd-arm64@0.27.4': optional: true - '@esbuild/freebsd-x64@0.27.3': + '@esbuild/freebsd-x64@0.27.4': optional: true - '@esbuild/linux-arm64@0.27.3': + '@esbuild/linux-arm64@0.27.4': optional: true - '@esbuild/linux-arm@0.27.3': + '@esbuild/linux-arm@0.27.4': optional: true - '@esbuild/linux-ia32@0.27.3': + '@esbuild/linux-ia32@0.27.4': optional: true - '@esbuild/linux-loong64@0.27.3': + '@esbuild/linux-loong64@0.27.4': optional: true - '@esbuild/linux-mips64el@0.27.3': + '@esbuild/linux-mips64el@0.27.4': optional: true - '@esbuild/linux-ppc64@0.27.3': + '@esbuild/linux-ppc64@0.27.4': optional: true - '@esbuild/linux-riscv64@0.27.3': + '@esbuild/linux-riscv64@0.27.4': optional: true - '@esbuild/linux-s390x@0.27.3': + '@esbuild/linux-s390x@0.27.4': optional: true - '@esbuild/linux-x64@0.27.3': + '@esbuild/linux-x64@0.27.4': optional: true - '@esbuild/netbsd-arm64@0.27.3': + '@esbuild/netbsd-arm64@0.27.4': optional: true - '@esbuild/netbsd-x64@0.27.3': + '@esbuild/netbsd-x64@0.27.4': optional: true - '@esbuild/openbsd-arm64@0.27.3': + '@esbuild/openbsd-arm64@0.27.4': optional: true - '@esbuild/openbsd-x64@0.27.3': + '@esbuild/openbsd-x64@0.27.4': optional: true - '@esbuild/openharmony-arm64@0.27.3': + '@esbuild/openharmony-arm64@0.27.4': optional: true - '@esbuild/sunos-x64@0.27.3': + '@esbuild/sunos-x64@0.27.4': optional: true - '@esbuild/win32-arm64@0.27.3': + '@esbuild/win32-arm64@0.27.4': optional: true - '@esbuild/win32-ia32@0.27.3': + '@esbuild/win32-ia32@0.27.4': optional: true - '@esbuild/win32-x64@0.27.3': + '@esbuild/win32-x64@0.27.4': optional: true '@inquirer/ansi@1.0.2': {} @@ -1341,79 +1333,79 @@ snapshots: '@open-draft/until@2.1.0': {} - '@rollup/rollup-android-arm-eabi@4.57.1': + '@rollup/rollup-android-arm-eabi@4.60.0': optional: true - '@rollup/rollup-android-arm64@4.57.1': + '@rollup/rollup-android-arm64@4.60.0': optional: true - '@rollup/rollup-darwin-arm64@4.57.1': + '@rollup/rollup-darwin-arm64@4.60.0': optional: true - '@rollup/rollup-darwin-x64@4.57.1': + '@rollup/rollup-darwin-x64@4.60.0': optional: true - '@rollup/rollup-freebsd-arm64@4.57.1': + '@rollup/rollup-freebsd-arm64@4.60.0': optional: true - '@rollup/rollup-freebsd-x64@4.57.1': + '@rollup/rollup-freebsd-x64@4.60.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.57.1': + '@rollup/rollup-linux-arm-gnueabihf@4.60.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.57.1': + '@rollup/rollup-linux-arm-musleabihf@4.60.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.57.1': + '@rollup/rollup-linux-arm64-gnu@4.60.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.57.1': + '@rollup/rollup-linux-arm64-musl@4.60.0': optional: true - '@rollup/rollup-linux-loong64-gnu@4.57.1': + '@rollup/rollup-linux-loong64-gnu@4.60.0': optional: true - '@rollup/rollup-linux-loong64-musl@4.57.1': + '@rollup/rollup-linux-loong64-musl@4.60.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.57.1': + '@rollup/rollup-linux-ppc64-gnu@4.60.0': optional: true - '@rollup/rollup-linux-ppc64-musl@4.57.1': + '@rollup/rollup-linux-ppc64-musl@4.60.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.57.1': + '@rollup/rollup-linux-riscv64-gnu@4.60.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.57.1': + '@rollup/rollup-linux-riscv64-musl@4.60.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.57.1': + '@rollup/rollup-linux-s390x-gnu@4.60.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.57.1': + '@rollup/rollup-linux-x64-gnu@4.60.0': optional: true - '@rollup/rollup-linux-x64-musl@4.57.1': + '@rollup/rollup-linux-x64-musl@4.60.0': optional: true - '@rollup/rollup-openbsd-x64@4.57.1': + '@rollup/rollup-openbsd-x64@4.60.0': optional: true - '@rollup/rollup-openharmony-arm64@4.57.1': + '@rollup/rollup-openharmony-arm64@4.60.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.57.1': + '@rollup/rollup-win32-arm64-msvc@4.60.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.57.1': + '@rollup/rollup-win32-ia32-msvc@4.60.0': optional: true - '@rollup/rollup-win32-x64-gnu@4.57.1': + '@rollup/rollup-win32-x64-gnu@4.60.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.57.1': + '@rollup/rollup-win32-x64-msvc@4.60.0': optional: true '@types/chai@5.2.3': @@ -1453,14 +1445,14 @@ snapshots: chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.0))': + '@vitest/mocker@3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.1))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: msw: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) - vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.1) '@vitest/pretty-format@3.2.4': dependencies: @@ -1568,22 +1560,22 @@ snapshots: '@xtuc/long@4.2.2': {} - acorn-import-phases@1.0.4(acorn@8.15.0): + acorn-import-phases@1.0.4(acorn@8.16.0): dependencies: - acorn: 8.15.0 + acorn: 8.16.0 - acorn@8.15.0: {} + acorn@8.16.0: {} - ajv-formats@2.1.1(ajv@8.17.1): + ajv-formats@2.1.1(ajv@8.18.0): optionalDependencies: - ajv: 8.17.1 + ajv: 8.18.0 - ajv-keywords@5.1.0(ajv@8.17.1): + ajv-keywords@5.1.0(ajv@8.18.0): dependencies: - ajv: 8.17.1 + ajv: 8.18.0 fast-deep-equal: 3.1.3 - ajv@8.17.1: + ajv@8.18.0: dependencies: fast-deep-equal: 3.1.3 fast-uri: 3.1.0 @@ -1598,7 +1590,7 @@ snapshots: assertion-error@2.0.1: {} - baseline-browser-mapping@2.9.19: {} + baseline-browser-mapping@2.10.10: {} braces@3.0.3: dependencies: @@ -1606,17 +1598,17 @@ snapshots: browserslist@4.28.1: dependencies: - baseline-browser-mapping: 2.9.19 - caniuse-lite: 1.0.30001769 - electron-to-chromium: 1.5.286 - node-releases: 2.0.27 + baseline-browser-mapping: 2.10.10 + caniuse-lite: 1.0.30001781 + electron-to-chromium: 1.5.321 + node-releases: 2.0.36 update-browserslist-db: 1.2.3(browserslist@4.28.1) buffer-from@1.1.2: {} cac@6.7.14: {} - caniuse-lite@1.0.30001769: {} + caniuse-lite@1.0.30001781: {} chai@5.3.3: dependencies: @@ -1659,47 +1651,47 @@ snapshots: deep-eql@5.0.2: {} - electron-to-chromium@1.5.286: {} + electron-to-chromium@1.5.321: {} emoji-regex@8.0.0: {} - enhanced-resolve@5.19.0: + enhanced-resolve@5.20.1: dependencies: graceful-fs: 4.2.11 - tapable: 2.3.0 + tapable: 2.3.1 es-module-lexer@1.7.0: {} es-module-lexer@2.0.0: {} - esbuild@0.27.3: + esbuild@0.27.4: optionalDependencies: - '@esbuild/aix-ppc64': 0.27.3 - '@esbuild/android-arm': 0.27.3 - '@esbuild/android-arm64': 0.27.3 - '@esbuild/android-x64': 0.27.3 - '@esbuild/darwin-arm64': 0.27.3 - '@esbuild/darwin-x64': 0.27.3 - '@esbuild/freebsd-arm64': 0.27.3 - '@esbuild/freebsd-x64': 0.27.3 - '@esbuild/linux-arm': 0.27.3 - '@esbuild/linux-arm64': 0.27.3 - '@esbuild/linux-ia32': 0.27.3 - '@esbuild/linux-loong64': 0.27.3 - '@esbuild/linux-mips64el': 0.27.3 - '@esbuild/linux-ppc64': 0.27.3 - '@esbuild/linux-riscv64': 0.27.3 - '@esbuild/linux-s390x': 0.27.3 - '@esbuild/linux-x64': 0.27.3 - '@esbuild/netbsd-arm64': 0.27.3 - '@esbuild/netbsd-x64': 0.27.3 - '@esbuild/openbsd-arm64': 0.27.3 - '@esbuild/openbsd-x64': 0.27.3 - '@esbuild/openharmony-arm64': 0.27.3 - '@esbuild/sunos-x64': 0.27.3 - '@esbuild/win32-arm64': 0.27.3 - '@esbuild/win32-ia32': 0.27.3 - '@esbuild/win32-x64': 0.27.3 + '@esbuild/aix-ppc64': 0.27.4 + '@esbuild/android-arm': 0.27.4 + '@esbuild/android-arm64': 0.27.4 + '@esbuild/android-x64': 0.27.4 + '@esbuild/darwin-arm64': 0.27.4 + '@esbuild/darwin-x64': 0.27.4 + '@esbuild/freebsd-arm64': 0.27.4 + '@esbuild/freebsd-x64': 0.27.4 + '@esbuild/linux-arm': 0.27.4 + '@esbuild/linux-arm64': 0.27.4 + '@esbuild/linux-ia32': 0.27.4 + '@esbuild/linux-loong64': 0.27.4 + '@esbuild/linux-mips64el': 0.27.4 + '@esbuild/linux-ppc64': 0.27.4 + '@esbuild/linux-riscv64': 0.27.4 + '@esbuild/linux-s390x': 0.27.4 + '@esbuild/linux-x64': 0.27.4 + '@esbuild/netbsd-arm64': 0.27.4 + '@esbuild/netbsd-x64': 0.27.4 + '@esbuild/openbsd-arm64': 0.27.4 + '@esbuild/openbsd-x64': 0.27.4 + '@esbuild/openharmony-arm64': 0.27.4 + '@esbuild/sunos-x64': 0.27.4 + '@esbuild/win32-arm64': 0.27.4 + '@esbuild/win32-ia32': 0.27.4 + '@esbuild/win32-x64': 0.27.4 escalade@3.2.0: {} @@ -1728,9 +1720,9 @@ snapshots: fast-uri@3.1.0: {} - fdir@6.5.0(picomatch@4.0.3): + fdir@6.5.0(picomatch@4.0.4): optionalDependencies: - picomatch: 4.0.3 + picomatch: 4.0.4 fill-range@7.1.1: dependencies: @@ -1745,7 +1737,7 @@ snapshots: graceful-fs@4.2.11: {} - graphql@16.12.0: {} + graphql@16.13.1: {} has-flag@4.0.0: {} @@ -1782,7 +1774,7 @@ snapshots: micromatch@4.0.8: dependencies: braces: 3.0.3 - picomatch: 2.3.1 + picomatch: 2.3.2 mime-db@1.52.0: {} @@ -1802,7 +1794,7 @@ snapshots: '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 '@types/statuses': 2.0.6 - graphql: 16.12.0 + graphql: 16.13.1 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 @@ -1810,7 +1802,7 @@ snapshots: picocolors: 1.1.1 rettime: 0.7.0 strict-event-emitter: 0.5.1 - tough-cookie: 6.0.0 + tough-cookie: 6.0.1 type-fest: 4.41.0 yargs: 17.7.2 optionalDependencies: @@ -1824,7 +1816,7 @@ snapshots: neo-async@2.6.2: {} - node-releases@2.0.27: {} + node-releases@2.0.36: {} outvariant@1.4.3: {} @@ -1836,72 +1828,62 @@ snapshots: picocolors@1.1.1: {} - picomatch@2.3.1: {} + picomatch@2.3.2: {} - picomatch@4.0.3: {} + picomatch@4.0.4: {} - postcss@8.5.6: + postcss@8.5.8: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 - randombytes@2.1.0: - dependencies: - safe-buffer: 5.2.1 - require-directory@2.1.1: {} require-from-string@2.0.2: {} rettime@0.7.0: {} - rollup@4.57.1: + rollup@4.60.0: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.57.1 - '@rollup/rollup-android-arm64': 4.57.1 - '@rollup/rollup-darwin-arm64': 4.57.1 - '@rollup/rollup-darwin-x64': 4.57.1 - '@rollup/rollup-freebsd-arm64': 4.57.1 - '@rollup/rollup-freebsd-x64': 4.57.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.57.1 - '@rollup/rollup-linux-arm-musleabihf': 4.57.1 - '@rollup/rollup-linux-arm64-gnu': 4.57.1 - '@rollup/rollup-linux-arm64-musl': 4.57.1 - '@rollup/rollup-linux-loong64-gnu': 4.57.1 - '@rollup/rollup-linux-loong64-musl': 4.57.1 - '@rollup/rollup-linux-ppc64-gnu': 4.57.1 - '@rollup/rollup-linux-ppc64-musl': 4.57.1 - '@rollup/rollup-linux-riscv64-gnu': 4.57.1 - '@rollup/rollup-linux-riscv64-musl': 4.57.1 - '@rollup/rollup-linux-s390x-gnu': 4.57.1 - '@rollup/rollup-linux-x64-gnu': 4.57.1 - '@rollup/rollup-linux-x64-musl': 4.57.1 - '@rollup/rollup-openbsd-x64': 4.57.1 - '@rollup/rollup-openharmony-arm64': 4.57.1 - '@rollup/rollup-win32-arm64-msvc': 4.57.1 - '@rollup/rollup-win32-ia32-msvc': 4.57.1 - '@rollup/rollup-win32-x64-gnu': 4.57.1 - '@rollup/rollup-win32-x64-msvc': 4.57.1 + '@rollup/rollup-android-arm-eabi': 4.60.0 + '@rollup/rollup-android-arm64': 4.60.0 + '@rollup/rollup-darwin-arm64': 4.60.0 + '@rollup/rollup-darwin-x64': 4.60.0 + '@rollup/rollup-freebsd-arm64': 4.60.0 + '@rollup/rollup-freebsd-x64': 4.60.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.60.0 + '@rollup/rollup-linux-arm-musleabihf': 4.60.0 + '@rollup/rollup-linux-arm64-gnu': 4.60.0 + '@rollup/rollup-linux-arm64-musl': 4.60.0 + '@rollup/rollup-linux-loong64-gnu': 4.60.0 + '@rollup/rollup-linux-loong64-musl': 4.60.0 + '@rollup/rollup-linux-ppc64-gnu': 4.60.0 + '@rollup/rollup-linux-ppc64-musl': 4.60.0 + '@rollup/rollup-linux-riscv64-gnu': 4.60.0 + '@rollup/rollup-linux-riscv64-musl': 4.60.0 + '@rollup/rollup-linux-s390x-gnu': 4.60.0 + '@rollup/rollup-linux-x64-gnu': 4.60.0 + '@rollup/rollup-linux-x64-musl': 4.60.0 + '@rollup/rollup-openbsd-x64': 4.60.0 + '@rollup/rollup-openharmony-arm64': 4.60.0 + '@rollup/rollup-win32-arm64-msvc': 4.60.0 + '@rollup/rollup-win32-ia32-msvc': 4.60.0 + '@rollup/rollup-win32-x64-gnu': 4.60.0 + '@rollup/rollup-win32-x64-msvc': 4.60.0 fsevents: 2.3.3 - safe-buffer@5.2.1: {} - schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.17.1 - ajv-formats: 2.1.1(ajv@8.17.1) - ajv-keywords: 5.1.0(ajv@8.17.1) + ajv: 8.18.0 + ajv-formats: 2.1.1(ajv@8.18.0) + ajv-keywords: 5.1.0(ajv@8.18.0) semver@7.7.4: {} - serialize-javascript@6.0.2: - dependencies: - randombytes: 2.1.0 - siginfo@2.0.0: {} signal-exit@4.1.0: {} @@ -1947,21 +1929,20 @@ snapshots: dependencies: has-flag: 4.0.0 - tapable@2.3.0: {} + tapable@2.3.1: {} - terser-webpack-plugin@5.3.16(webpack@5.105.2): + terser-webpack-plugin@5.4.0(webpack@5.105.4): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 - serialize-javascript: 6.0.2 - terser: 5.46.0 - webpack: 5.105.2 + terser: 5.46.1 + webpack: 5.105.4 - terser@5.46.0: + terser@5.46.1: dependencies: '@jridgewell/source-map': 0.3.11 - acorn: 8.15.0 + acorn: 8.16.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -1971,8 +1952,8 @@ snapshots: tinyglobby@0.2.15: dependencies: - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 tinypool@1.1.1: {} @@ -1980,29 +1961,29 @@ snapshots: tinyspy@4.0.4: {} - tldts-core@7.0.23: {} + tldts-core@7.0.27: {} - tldts@7.0.23: + tldts@7.0.27: dependencies: - tldts-core: 7.0.23 + tldts-core: 7.0.27 to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - tough-cookie@6.0.0: + tough-cookie@6.0.1: dependencies: - tldts: 7.0.23 + tldts: 7.0.27 - ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.2): + ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.4): dependencies: chalk: 4.1.2 - enhanced-resolve: 5.19.0 + enhanced-resolve: 5.20.1 micromatch: 4.0.8 semver: 7.7.4 source-map: 0.7.6 typescript: 5.7.3 - webpack: 5.105.2 + webpack: 5.105.4 type-fest@4.41.0: {} @@ -2016,13 +1997,13 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 - vite-node@3.2.4(@types/node@18.19.130)(terser@5.46.0): + vite-node@3.2.4(@types/node@18.19.130)(terser@5.46.1): dependencies: cac: 6.7.14 debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.1) transitivePeerDependencies: - '@types/node' - jiti @@ -2037,24 +2018,24 @@ snapshots: - tsx - yaml - vite@7.3.1(@types/node@18.19.130)(terser@5.46.0): + vite@7.3.1(@types/node@18.19.130)(terser@5.46.1): dependencies: - esbuild: 0.27.3 - fdir: 6.5.0(picomatch@4.0.3) - picomatch: 4.0.3 - postcss: 8.5.6 - rollup: 4.57.1 + esbuild: 0.27.4 + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + postcss: 8.5.8 + rollup: 4.60.0 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 18.19.130 fsevents: 2.3.3 - terser: 5.46.0 + terser: 5.46.1 - vitest@3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0): + vitest@3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.1): dependencies: '@types/chai': 5.2.3 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.0)) + '@vitest/mocker': 3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.1)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -2065,15 +2046,15 @@ snapshots: expect-type: 1.3.0 magic-string: 0.30.21 pathe: 2.0.3 - picomatch: 4.0.3 + picomatch: 4.0.4 std-env: 3.10.0 tinybench: 2.9.0 tinyexec: 0.3.2 tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) - vite-node: 3.2.4(@types/node@18.19.130)(terser@5.46.0) + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.1) + vite-node: 3.2.4(@types/node@18.19.130)(terser@5.46.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 18.19.130 @@ -2096,9 +2077,9 @@ snapshots: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - webpack-sources@3.3.3: {} + webpack-sources@3.3.4: {} - webpack@5.105.2: + webpack@5.105.4: dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.8 @@ -2106,11 +2087,11 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.15.0 - acorn-import-phases: 1.0.4(acorn@8.15.0) + acorn: 8.16.0 + acorn-import-phases: 1.0.4(acorn@8.16.0) browserslist: 4.28.1 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.19.0 + enhanced-resolve: 5.20.1 es-module-lexer: 2.0.0 eslint-scope: 5.1.1 events: 3.3.0 @@ -2121,10 +2102,10 @@ snapshots: mime-types: 2.1.35 neo-async: 2.6.2 schema-utils: 4.3.3 - tapable: 2.3.0 - terser-webpack-plugin: 5.3.16(webpack@5.105.2) + tapable: 2.3.1 + terser-webpack-plugin: 5.4.0(webpack@5.105.4) watchpack: 2.5.1 - webpack-sources: 3.3.3 + webpack-sources: 3.3.4 transitivePeerDependencies: - '@swc/core' - esbuild diff --git a/reference.md b/reference.md index 6309719..afdc72f 100644 --- a/reference.md +++ b/reference.md @@ -3638,22 +3638,16 @@ await client.webhooks.createWebhook({
- -To have it activated please send us a request and we will activate it for your account. + +This is an enterprise feature. Contact us to activate it for your account. -Exports webhook event history to CSV format for analysis and reporting. - -Use this to: -- Generate comprehensive webhook event reports -- Analyze webhook delivery patterns and success rates -- Export event data for external analysis tools -- Create historical reports for compliance and auditing -- Track webhook performance and reliability metrics +Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body. -Key information returned: -- Process ID for tracking export completion -- CSV file will be delivered to specified webhook URL +Use this endpoint to: +- Export webhook event history filtered by date range, event type, or email address +- Generate reports for compliance, auditing, or performance analysis +- Track delivery patterns and webhook reliability over time
@@ -4381,12 +4375,8 @@ await client.externalFeeds.deleteExternalFeed({
- -Custom objects are only available to Enterprise plans. - -This feature is in beta. These are subject to change. - - +Custom objects are only available to Enterprise plans. +This feature is in beta. These are subject to change. This API allows bulk upsert of object records in a single request. Each object record may include - Attributes - Identifiers @@ -4400,8 +4390,8 @@ This API allows bulk upsert of object records in a single request. Each object r - Max 500 attributes defined per object record upsert request - This is coherent with schema limitation: an object cannot have more than 500 attributes. - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - - Max 10 associations defined per object record upsert request - - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. + - Max 10 associations defined per associated object type, in each record of the request + - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests. **Errors:** - Make sure both object records exist before associating them, else the API will return an error. - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". @@ -4470,12 +4460,8 @@ await client.customObjects.upsertrecords({
- -Custom objects are only available to Enterprise plans. - -This feature is in beta. These are subject to change. - - +Custom objects are only available to Enterprise plans. +This feature is in beta. These are subject to change. This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint.
@@ -4606,26 +4592,6 @@ await client.customObjects.batchDeleteObjectRecords({
-#### 📝 Description - -
-
- -
-
- - -Accepted Number Formats - -91xxxxxxxxxx -+91xxxxxxxxxx -0091xxxxxxxxxx - -
-
-
-
- #### 🔌 Usage
@@ -4683,6 +4649,8 @@ await client.contacts.getContacts();
+Follow this format when passing a "SMS" phone number as an attribute. +Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx Creates new contacts on Brevo. Contacts can be created by passing either -

1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
@@ -5045,9 +5013,7 @@ await client.contacts.updateBatchContacts();
- -attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. - +attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.
@@ -5180,17 +5146,11 @@ await client.contacts.requestContactExport({
- -Ongoing changes for this endpoint - +Ongoing changes for this endpoint We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - These are non breaking changes. - The default value for the attributes will be 0. - -The uniqueSubscribers field is deprecated - +The uniqueSubscribers field is deprecated
@@ -5302,13 +5262,9 @@ await client.contacts.createFolder({});
- -Ongoing changes for this endpoint. - +Ongoing changes for this endpoint. We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - -These are non breaking changes. The default value for the attributes will be 0. - +These are non breaking changes. The default value for the attributes will be 0.
@@ -5476,13 +5432,9 @@ await client.contacts.deleteFolder({
- -Ongoing changes for this endpoint. - +Ongoing changes for this endpoint. We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - -These are non breaking changes. The default value for the attributes will be 0. - +These are non breaking changes. The default value for the attributes will be 0.
@@ -5610,13 +5562,9 @@ await client.contacts.importContacts();
- -Ongoing changes for this endpoint. - +Ongoing changes for this endpoint. We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - -These are non breaking changes. The default value for the attributes will be 0. - +These are non breaking changes. The default value for the attributes will be 0.
@@ -6092,14 +6040,8 @@ await client.contacts.getSegments();
- -Accepted Number Formats - -91xxxxxxxxxx -+91xxxxxxxxxx -0091xxxxxxxxxx - - +Follow this format when passing a "SMS" phone number as an attribute. +Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx There are 2 ways to get a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
@@ -6165,6 +6107,8 @@ await client.contacts.getContactInfo({
+Follow this format when passing a "SMS" phone number as an attribute. +Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx

If a blocklisted contact's email address is updated, it is going to remove that blocklisting from the contact and they will be resubscribed.
There are 2 ways to update a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
@@ -7525,8 +7469,7 @@ await client.ecommerce.createOrder({ id: "14", products: [{ price: 99.99, - productId: "P1", - quantity: 10 + productId: "P1" }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z" @@ -7600,8 +7543,7 @@ await client.ecommerce.createBatchOrder({ id: "14", products: [{ price: 99.99, - productId: "P1", - quantity: 10 + productId: "P1" }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z" @@ -8316,6 +8258,73 @@ await client.payments.deletePaymentRequest({ ## Event +
client.event.getEvents({ ...params }) -> Brevo.GetEventsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ + +This endpoint currently only supports custom events. + + +Retrieve a list of events filtered by various criteria. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.event.getEvents(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.GetEventsRequest` + +
+
+ +
+
+ +**requestOptions:** `EventClient.RequestOptions` + +
+
+
+
+ + +
+
+
+
client.event.createEvent({ ...params }) -> void
@@ -8378,6 +8387,72 @@ await client.event.createEvent({
+ +
+ + +
client.event.createBatchEvents({ ...params }) -> Brevo.BatchAcceptedResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create multiple events to track contacts' interactions in a single request. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.event.createBatchEvents([{ + event_name: "order_created", + identifiers: {} + }]); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.CreateBatchEventsRequestItem[]` + +
+
+ +
+
+ +**requestOptions:** `EventClient.RequestOptions` + +
+
+
+
+ +
@@ -9550,8 +9625,8 @@ Returns transaction history ```typescript await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id" + contactId: 1, + balanceDefinitionId: "balanceDefinitionId" }); ``` @@ -10238,6 +10313,72 @@ await client.program.getParameterSubscriptionInfo({ + + + + +
client.program.deleteContactSubscription({ ...params }) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete subscription for a contact +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteContactSubscriptionRequest` + +
+
+ +
+
+ +**requestOptions:** `ProgramClient.RequestOptions` + +
+
+
+
+ +
@@ -11844,11 +11985,8 @@ await client.tier.deleteTier({
- -The response payload for this endpoint has changed - -You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). - +The response payload for this endpoint has changed +You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
@@ -13172,19 +13310,11 @@ await client.whatsAppCampaigns.getWhatsAppCampaigns();
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - - - -This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - -[Get all the Segments](https://developers.brevo.com/reference/getsegments) - +[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -13252,11 +13382,8 @@ await client.whatsAppCampaigns.createWhatsAppCampaign({
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -13311,11 +13438,8 @@ await client.whatsAppCampaigns.getWhatsAppConfig();
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -13432,11 +13556,8 @@ await client.whatsAppCampaigns.getWhatsAppTemplates();
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -13501,11 +13622,11 @@ await client.whatsAppCampaigns.sendWhatsAppTemplateApproval({
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. +[Get all the Lists](https://developers.brevo.com/reference/getlists-1) +[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -13570,19 +13691,11 @@ await client.whatsAppCampaigns.getWhatsAppCampaign({
- -You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - -[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - - - -This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. - +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - -[Get all the Segments](https://developers.brevo.com/reference/getsegments) - +[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -14103,6 +14216,108 @@ await client.companies.createACompanyDealAttribute({ + + + + +
client.companies.deleteAnAttribute({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.deleteAnAttribute({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.DeleteCrmAttributesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.companies.updateAnAttribute({ ...params }) -> void +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.companies.updateAnAttribute({ + id: "id" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Brevo.PatchCrmAttributesIdRequest` + +
+
+ +
+
+ +**requestOptions:** `CompaniesClient.RequestOptions` + +
+
+
+
+ +
@@ -15527,7 +15742,8 @@ await client.tasks.getAllTaskTypes();
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account +You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. +[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**)
@@ -16262,13 +16478,9 @@ await client.transactionalEmails.getTransacEmailsList();
- -You can get the uuid using either of the following methods: - +You can get the uuid using either of the following methods: Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response. - -The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. - +The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL.
@@ -16918,15 +17130,9 @@ await client.transactionalEmails.sendTestTemplate({
- -If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. - -Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. - - - -Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. - +If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. +Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. +Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.
@@ -17228,3 +17434,4 @@ await client.smsTemplates.getSmsTemplates(); + diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 61cff76..f8e7177 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions} A standard Response object. + */ + public async fetch( + input: Request | string | URL, + init?: RequestInit, + requestOptions?: core.PassthroughRequest.RequestOptions, + ): Promise { + return core.makePassthroughRequest( + input, + init, + { + baseUrl: this._options.baseUrl ?? this._options.environment, + headers: this._options.headers, + timeoutInSeconds: this._options.timeoutInSeconds, + maxRetries: this._options.maxRetries, + fetch: this._options.fetch, + logging: this._options.logging, + getAuthHeaders: async () => (await this._options.authProvider.getAuthRequest()).headers, + }, + requestOptions, + ); + } } diff --git a/src/api/resources/account/exports.ts b/src/api/resources/account/exports.ts new file mode 100644 index 0000000..78289e9 --- /dev/null +++ b/src/api/resources/account/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { AccountClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/account/types/GetAccountResponse.ts b/src/api/resources/account/types/GetAccountResponse.ts index a0b751b..4816f3d 100644 --- a/src/api/resources/account/types/GetAccountResponse.ts +++ b/src/api/resources/account/types/GetAccountResponse.ts @@ -121,7 +121,7 @@ export namespace GetAccountResponse { /** Plan end date (Unix timestamp) */ endDate: string; /** User seat information for the plan */ - users: Item.Users; + users: Item.Users | null; /** Credits allocated for this plan category (optional, may not be present for all plan categories) */ credits?: string | undefined; } diff --git a/src/api/resources/balance/client/Client.ts b/src/api/resources/balance/client/Client.ts index 2b3775f..cdca428 100644 --- a/src/api/resources/balance/client/Client.ts +++ b/src/api/resources/balance/client/Client.ts @@ -60,6 +60,7 @@ export class BalanceClient { sort, contact_id: contactId, balance_definition_id: balanceDefinitionId, + includeInternal, } = request; const _queryParams: Record = { limit, @@ -68,6 +69,7 @@ export class BalanceClient { sort, contact_id: contactId, balance_definition_id: balanceDefinitionId, + includeInternal, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -990,7 +992,10 @@ export class BalanceClient { request: Brevo.GetContactBalancesRequest, requestOptions?: BalanceClient.RequestOptions, ): Promise> { - const { pid } = request; + const { pid, includeInternal } = request; + const _queryParams: Record = { + includeInternal, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1006,7 +1011,7 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1170,7 +1175,10 @@ export class BalanceClient { request: Brevo.GetSubscriptionBalancesRequest, requestOptions?: BalanceClient.RequestOptions, ): Promise> { - const { pid, cid } = request; + const { pid, cid, includeInternal } = request; + const _queryParams: Record = { + includeInternal, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1186,7 +1194,7 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1342,8 +1350,8 @@ export class BalanceClient { * @example * await client.balance.getTransactionHistoryApi({ * pid: "pid", - * contact_id: 1, - * balance_definition_id: "balance_definition_id" + * contactId: 1, + * balanceDefinitionId: "balanceDefinitionId" * }) */ public getTransactionHistoryApi( @@ -1361,20 +1369,24 @@ export class BalanceClient { pid, limit, offset, - sort_field: sortField, + sortField, sort, - contact_id: contactId, - balance_definition_id: balanceDefinitionId, + contactId, + balanceDefinitionId, filters, + status, + transactionType, } = request; const _queryParams: Record = { limit, offset, - sort_field: sortField != null ? sortField : undefined, + sortField: sortField != null ? sortField : undefined, sort: sort != null ? sort : undefined, - contact_id: contactId, - balance_definition_id: balanceDefinitionId, + contactId, + balanceDefinitionId, filters, + status: status != null ? status : undefined, + transactionType: transactionType != null ? transactionType : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( diff --git a/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts b/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts index 01d4037..676e240 100644 --- a/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts +++ b/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts @@ -9,4 +9,6 @@ export interface GetContactBalancesRequest { /** Loyalty Program Id */ pid: string; + /** Include balances tied to internal definitions. */ + includeInternal?: boolean; } diff --git a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts index 9dea331..cdced4d 100644 --- a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts +++ b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts @@ -23,4 +23,6 @@ export interface GetLoyaltyBalanceProgramsPidActiveBalanceRequest { contact_id: number; /** Balance Definition ID */ balance_definition_id: string; + /** Include balances tied to internal definitions. */ + includeInternal?: boolean; } diff --git a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts index 0f78401..915f95e 100644 --- a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts +++ b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts @@ -6,8 +6,8 @@ import type * as Brevo from "../../../../index.js"; * @example * { * pid: "pid", - * contact_id: 1, - * balance_definition_id: "balance_definition_id" + * contactId: 1, + * balanceDefinitionId: "balanceDefinitionId" * } */ export interface GetLoyaltyBalanceProgramsPidTransactionHistoryRequest { @@ -15,16 +15,20 @@ export interface GetLoyaltyBalanceProgramsPidTransactionHistoryRequest { pid: string; /** Limit the number of records returned */ limit?: number; - /** Skip a number of records */ + /** Page number to retrieve */ offset?: number; /** Field to sort by */ - sort_field?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField; + sortField?: "createdAt"; /** Sort order, either asc or desc */ sort?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort; /** Contact ID */ - contact_id: number; + contactId: number; /** Balance Definition ID */ - balance_definition_id: string; + balanceDefinitionId: string; /** Filters to apply */ filters?: string | string[]; + /** Transaction status filter. Allowed values: draft, completed, rejected, cancelled, expired */ + status?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus; + /** Transaction type filter. Allowed values: credit, debit */ + transactionType?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType; } diff --git a/src/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.ts b/src/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.ts index b939c3d..1d85750 100644 --- a/src/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.ts +++ b/src/api/resources/balance/client/requests/GetSubscriptionBalancesRequest.ts @@ -12,4 +12,6 @@ export interface GetSubscriptionBalancesRequest { pid: string; /** Contact Id */ cid: string; + /** Include balances tied to internal definitions. */ + includeInternal?: boolean; } diff --git a/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.ts b/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.ts index 705a0a5..6ac373a 100644 --- a/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.ts +++ b/src/api/resources/balance/client/requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.ts @@ -36,7 +36,7 @@ export interface PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest { /** Maximum debit allowed per operation. */ maxDebitAmountLimit?: number; /** Additional metadata for the balance definition. */ - meta?: Record; + meta?: PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.Meta; /** Minimum allowable balance amount. */ minAmount?: number; /** Name of the balance definition. */ @@ -86,6 +86,17 @@ export namespace PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest { } as const; export type BalanceOptionDebitRounding = (typeof BalanceOptionDebitRounding)[keyof typeof BalanceOptionDebitRounding]; + + /** + * Additional metadata for the balance definition. + */ + export interface Meta { + /** Indicates whether the balance definition is internal. */ + isInternal?: boolean | undefined; + /** Accepts any additional properties */ + [key: string]: any; + } + /** Unit of balance measurement. */ export const Unit = { Points: "POINTS", diff --git a/src/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.ts b/src/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.ts index 1c1970a..043ad53 100644 --- a/src/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.ts +++ b/src/api/resources/balance/client/requests/UpdateBalanceDefinitionRequest.ts @@ -39,7 +39,7 @@ export interface UpdateBalanceDefinitionRequest { /** Maximum debit allowed per operation. */ maxDebitAmountLimit?: number; /** Optional metadata for the balance definition. */ - meta?: Record; + meta?: UpdateBalanceDefinitionRequest.Meta; /** Minimum allowable balance amount. */ minAmount?: number; /** Name of the balance definition. */ @@ -89,6 +89,17 @@ export namespace UpdateBalanceDefinitionRequest { } as const; export type BalanceOptionDebitRounding = (typeof BalanceOptionDebitRounding)[keyof typeof BalanceOptionDebitRounding]; + + /** + * Optional metadata for the balance definition. + */ + export interface Meta { + /** Indicates whether the balance definition is internal. */ + isInternal?: boolean | undefined; + /** Accepts any additional properties */ + [key: string]: any; + } + /** Unit of balance measurement. */ export const Unit = { Points: "POINTS", diff --git a/src/api/resources/balance/exports.ts b/src/api/resources/balance/exports.ts new file mode 100644 index 0000000..7d8e9e6 --- /dev/null +++ b/src/api/resources/balance/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { BalanceClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.ts new file mode 100644 index 0000000..2b5f162 --- /dev/null +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus = { + Draft: "draft", + Completed: "completed", + Rejected: "rejected", + Cancelled: "cancelled", + Expired: "expired", +} as const; +export type GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus = + (typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus)[keyof typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus]; diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.ts similarity index 58% rename from src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts rename to src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.ts index 06c550c..8213b10 100644 --- a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.ts +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.ts @@ -1,9 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -export const GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField = { - Name: "name", - CreatedAt: "created_at", - UpdatedAt: "updated_at", +export const GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType = { + Credit: "credit", + Debit: "debit", } as const; -export type GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField = - (typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField)[keyof typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField]; +export type GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType = + (typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType)[keyof typeof GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType]; diff --git a/src/api/resources/balance/types/index.ts b/src/api/resources/balance/types/index.ts index 80b736d..5714e84 100644 --- a/src/api/resources/balance/types/index.ts +++ b/src/api/resources/balance/types/index.ts @@ -7,7 +7,8 @@ export * from "./GetBalanceDefinitionRequestVersion.js"; export * from "./GetBalanceLimitRequestVersion.js"; export * from "./GetContactBalancesResponse.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.js"; -export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.js"; +export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.js"; +export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.js"; export * from "./GetSubscriptionBalancesResponse.js"; export * from "./PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.js"; diff --git a/src/api/resources/companies/client/Client.ts b/src/api/resources/companies/client/Client.ts index e10046a..025cc1c 100644 --- a/src/api/resources/companies/client/Client.ts +++ b/src/api/resources/companies/client/Client.ts @@ -590,6 +590,145 @@ export class CompaniesClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/crm/attributes"); } + /** + * @param {Brevo.DeleteCrmAttributesIdRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.companies.deleteAnAttribute({ + * id: "id" + * }) + */ + public deleteAnAttribute( + request: Brevo.DeleteCrmAttributesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteAnAttribute(request, requestOptions)); + } + + private async __deleteAnAttribute( + request: Brevo.DeleteCrmAttributesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { id } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/attributes/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/crm/attributes/{id}"); + } + + /** + * @param {Brevo.PatchCrmAttributesIdRequest} request + * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * + * @example + * await client.companies.updateAnAttribute({ + * id: "id" + * }) + */ + public updateAnAttribute( + request: Brevo.PatchCrmAttributesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__updateAnAttribute(request, requestOptions)); + } + + private async __updateAnAttribute( + request: Brevo.PatchCrmAttributesIdRequest, + requestOptions?: CompaniesClient.RequestOptions, + ): Promise> { + const { id, ..._body } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `crm/attributes/${core.url.encodePathParam(id)}`, + ), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: _body, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/crm/attributes/{id}"); + } + /** * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * diff --git a/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts b/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts new file mode 100644 index 0000000..69f8d3e --- /dev/null +++ b/src/api/resources/companies/client/requests/DeleteCrmAttributesIdRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface DeleteCrmAttributesIdRequest { + /** Attribute ID */ + id: string; +} diff --git a/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts b/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts new file mode 100644 index 0000000..dce4554 --- /dev/null +++ b/src/api/resources/companies/client/requests/PatchCrmAttributesIdRequest.ts @@ -0,0 +1,38 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * id: "id" + * } + */ +export interface PatchCrmAttributesIdRequest { + /** Attribute ID */ + id: string; + /** Attribute display label */ + label?: string; + /** Updated labels for selectable options */ + optionsLabels?: PatchCrmAttributesIdRequest.OptionsLabels.Item[]; + /** The type of object the attribute belongs to, it cannot be updated after creation */ + objectType?: PatchCrmAttributesIdRequest.ObjectType; +} + +export namespace PatchCrmAttributesIdRequest { + export type OptionsLabels = OptionsLabels.Item[]; + + export namespace OptionsLabels { + export interface Item { + /** Internal option identifier */ + key: string; + /** Display label for the option */ + value: string; + } + } + + /** The type of object the attribute belongs to, it cannot be updated after creation */ + export const ObjectType = { + Companies: "companies", + Deals: "deals", + } as const; + export type ObjectType = (typeof ObjectType)[keyof typeof ObjectType]; +} diff --git a/src/api/resources/companies/client/requests/index.ts b/src/api/resources/companies/client/requests/index.ts index 0d519c9..d3b626f 100644 --- a/src/api/resources/companies/client/requests/index.ts +++ b/src/api/resources/companies/client/requests/index.ts @@ -1,8 +1,10 @@ export type { DeleteCompaniesIdRequest } from "./DeleteCompaniesIdRequest.js"; +export type { DeleteCrmAttributesIdRequest } from "./DeleteCrmAttributesIdRequest.js"; export type { GetCompaniesIdRequest } from "./GetCompaniesIdRequest.js"; export type { GetCompaniesRequest } from "./GetCompaniesRequest.js"; export type { PatchCompaniesIdRequest } from "./PatchCompaniesIdRequest.js"; export type { PatchCompaniesLinkUnlinkIdRequest } from "./PatchCompaniesLinkUnlinkIdRequest.js"; +export { PatchCrmAttributesIdRequest } from "./PatchCrmAttributesIdRequest.js"; export type { PostCompaniesImportRequest } from "./PostCompaniesImportRequest.js"; export type { PostCompaniesRequest } from "./PostCompaniesRequest.js"; export { PostCrmAttributesRequest } from "./PostCrmAttributesRequest.js"; diff --git a/src/api/resources/companies/exports.ts b/src/api/resources/companies/exports.ts new file mode 100644 index 0000000..2ca4d18 --- /dev/null +++ b/src/api/resources/companies/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CompaniesClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/contacts/client/Client.ts b/src/api/resources/contacts/client/Client.ts index 535274e..dca6cf5 100644 --- a/src/api/resources/contacts/client/Client.ts +++ b/src/api/resources/contacts/client/Client.ts @@ -23,14 +23,6 @@ export class ContactsClient { } /** - * - * Accepted Number Formats - * - * 91xxxxxxxxxx - * +91xxxxxxxxxx - * 0091xxxxxxxxxx - * - * * @param {Brevo.GetContactsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -110,6 +102,8 @@ export class ContactsClient { } /** + * Follow this format when passing a "SMS" phone number as an attribute. + * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx * Creates new contacts on Brevo. Contacts can be created by passing either -

1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
* * @param {Brevo.CreateContactRequest} request @@ -600,9 +594,7 @@ export class ContactsClient { } /** - * - * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. - * + * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings. * * @param {Brevo.CreateDoiContactRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -754,17 +746,11 @@ export class ContactsClient { } /** - * - * Ongoing changes for this endpoint - * + * Ongoing changes for this endpoint * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * * These are non breaking changes. - * * The default value for the attributes will be 0. - * - * The uniqueSubscribers field is deprecated - * + * The uniqueSubscribers field is deprecated * * @param {Brevo.GetFoldersRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -899,13 +885,9 @@ export class ContactsClient { } /** - * - * Ongoing changes for this endpoint. - * + * Ongoing changes for this endpoint. * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * - * These are non breaking changes. The default value for the attributes will be 0. - * + * These are non breaking changes. The default value for the attributes will be 0. * * @param {Brevo.GetFolderRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1120,13 +1102,9 @@ export class ContactsClient { } /** - * - * Ongoing changes for this endpoint. - * + * Ongoing changes for this endpoint. * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * - * These are non breaking changes. The default value for the attributes will be 0. - * + * These are non breaking changes. The default value for the attributes will be 0. * * @param {Brevo.GetFolderListsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1273,13 +1251,9 @@ export class ContactsClient { } /** - * - * Ongoing changes for this endpoint. - * + * Ongoing changes for this endpoint. * We're dropping support for the response attributes totalSubscribers and totalBlacklisted. - * - * These are non breaking changes. The default value for the attributes will be 0. - * + * These are non breaking changes. The default value for the attributes will be 0. * * @param {Brevo.GetListsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -1973,14 +1947,8 @@ export class ContactsClient { } /** - * - * Accepted Number Formats - * - * 91xxxxxxxxxx - * +91xxxxxxxxxx - * 0091xxxxxxxxxx - * - * + * Follow this format when passing a "SMS" phone number as an attribute. + * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx * There are 2 ways to get a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges. * * @param {Brevo.GetContactInfoRequest} request @@ -2056,6 +2024,8 @@ export class ContactsClient { } /** + * Follow this format when passing a "SMS" phone number as an attribute. + * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx

If a blocklisted contact's email address is updated, it is going to remove that blocklisting from the contact and they will be resubscribed.
* There are 2 ways to update a contact

Option 1- https://api.brevo.com/v3/contacts/{identifier}

Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}

Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.

Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute * * @param {Brevo.UpdateContactRequest} request diff --git a/src/api/resources/contacts/client/requests/AddContactToListRequest.ts b/src/api/resources/contacts/client/requests/AddContactToListRequest.ts index 0cfa627..2ce05f9 100644 --- a/src/api/resources/contacts/client/requests/AddContactToListRequest.ts +++ b/src/api/resources/contacts/client/requests/AddContactToListRequest.ts @@ -26,30 +26,6 @@ import type * as Brevo from "../../../../index.js"; * ids: [1, 2] * } * } - * - * @example - * { - * listId: 1000000, - * body: { - * emails: ["jeff32@example.com", "jim56@example.com"] - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * emails: ["jeff32@example.com", "jim56@example.com"] - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * emails: ["jeff32@example.com", "jim56@example.com"] - * } - * } */ export interface AddContactToListRequest { /** Id of the list */ diff --git a/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts b/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts index 860544a..edb52db 100644 --- a/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts +++ b/src/api/resources/contacts/client/requests/RemoveContactFromListRequest.ts @@ -34,38 +34,6 @@ import type * as Brevo from "../../../../index.js"; * ids: [1, 2] * } * } - * - * @example - * { - * listId: 1000000, - * body: { - * all: true - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * all: true - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * all: true - * } - * } - * - * @example - * { - * listId: 1000000, - * body: { - * all: true - * } - * } */ export interface RemoveContactFromListRequest { /** Id of the list */ diff --git a/src/api/resources/contacts/exports.ts b/src/api/resources/contacts/exports.ts new file mode 100644 index 0000000..657fdf5 --- /dev/null +++ b/src/api/resources/contacts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ContactsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/conversations/exports.ts b/src/api/resources/conversations/exports.ts new file mode 100644 index 0000000..82be4a7 --- /dev/null +++ b/src/api/resources/conversations/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ConversationsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/coupons/exports.ts b/src/api/resources/coupons/exports.ts new file mode 100644 index 0000000..8bd048a --- /dev/null +++ b/src/api/resources/coupons/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CouponsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/customObjects/client/Client.ts b/src/api/resources/customObjects/client/Client.ts index 4d8d8ff..012c9ad 100644 --- a/src/api/resources/customObjects/client/Client.ts +++ b/src/api/resources/customObjects/client/Client.ts @@ -23,12 +23,8 @@ export class CustomObjectsClient { } /** - * - * Custom objects are only available to Enterprise plans. - * - * This feature is in beta. These are subject to change. - * - * + * Custom objects are only available to Enterprise plans. + * This feature is in beta. These are subject to change. * This API allows bulk upsert of object records in a single request. Each object record may include * - Attributes * - Identifiers @@ -42,8 +38,8 @@ export class CustomObjectsClient { * - Max 500 attributes defined per object record upsert request * - This is coherent with schema limitation: an object cannot have more than 500 attributes. * - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - * - Max 10 associations defined per object record upsert request - * - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. + * - Max 10 associations defined per associated object type, in each record of the request + * - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests. * **Errors:** * - Make sure both object records exist before associating them, else the API will return an error. * - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". @@ -131,12 +127,8 @@ export class CustomObjectsClient { } /** - * - * Custom objects are only available to Enterprise plans. - * - * This feature is in beta. These are subject to change. - * - * + * Custom objects are only available to Enterprise plans. + * This feature is in beta. These are subject to change. * This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint. * * @param {Brevo.GetrecordsRequest} request diff --git a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts index faf7fb5..36e0ce2 100644 --- a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts +++ b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts @@ -20,7 +20,7 @@ export namespace UpsertrecordsRequest { export namespace Records { export interface Item { associations?: Item.Associations.Item[] | undefined; - /** Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required. */ + /** Attributes attached with the object record. Only the already created attributes will be used with records. Pass the value with the attributes key you want to set or update for the object record. Minimum 1 attribute is required. */ attributes?: Record | undefined; /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request. */ identifiers?: Item.Identifiers | undefined; diff --git a/src/api/resources/customObjects/exports.ts b/src/api/resources/customObjects/exports.ts new file mode 100644 index 0000000..5be143e --- /dev/null +++ b/src/api/resources/customObjects/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomObjectsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts index bc889e6..d7b1c12 100644 --- a/src/api/resources/customObjects/types/UpsertrecordsResponse.ts +++ b/src/api/resources/customObjects/types/UpsertrecordsResponse.ts @@ -2,6 +2,6 @@ export interface UpsertrecordsResponse { message?: string | undefined; - /** Unique Id for the batch process used to track the status of the batch. */ + /** Unique Id for the batch process used to track the status of the batch. **How to use this processId:** Refer to the [Get process status API](https://developers.brevo.com/reference/get-process) to check the execution status of this batch using the returned `processId`. */ processId?: number | undefined; } diff --git a/src/api/resources/deals/client/Client.ts b/src/api/resources/deals/client/Client.ts index ffb26c4..d0e428b 100644 --- a/src/api/resources/deals/client/Client.ts +++ b/src/api/resources/deals/client/Client.ts @@ -584,6 +584,8 @@ export class DealsClient { } /** + * @deprecated + * * This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. * * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/deals/exports.ts b/src/api/resources/deals/exports.ts new file mode 100644 index 0000000..1c1e9ee --- /dev/null +++ b/src/api/resources/deals/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { DealsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts b/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts index 7b80387..b5071d8 100644 --- a/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts +++ b/src/api/resources/domains/client/requests/AuthenticateDomainRequest.ts @@ -1,11 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * domainName: "domainName" - * } - * * @example * { * domainName: "domainName" diff --git a/src/api/resources/domains/client/requests/CreateDomainRequest.ts b/src/api/resources/domains/client/requests/CreateDomainRequest.ts index acb9725..09e38e9 100644 --- a/src/api/resources/domains/client/requests/CreateDomainRequest.ts +++ b/src/api/resources/domains/client/requests/CreateDomainRequest.ts @@ -15,16 +15,6 @@ * { * name: "test.example.com" * } - * - * @example - * { - * name: "mycompany.com" - * } - * - * @example - * { - * name: "mycompany.com" - * } */ export interface CreateDomainRequest { /** Domain name to be added */ diff --git a/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts b/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts index 03b367f..a9880eb 100644 --- a/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts +++ b/src/api/resources/domains/client/requests/GetDomainConfigurationRequest.ts @@ -1,11 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * domainName: "domainName" - * } - * * @example * { * domainName: "domainName" diff --git a/src/api/resources/domains/exports.ts b/src/api/resources/domains/exports.ts new file mode 100644 index 0000000..7752741 --- /dev/null +++ b/src/api/resources/domains/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { DomainsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index a3b3a4a..b85d222 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -856,8 +856,7 @@ export class EcommerceClient { * id: "14", * products: [{ * price: 99.99, - * productId: "P1", - * quantity: 10 + * productId: "P1" * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" @@ -935,8 +934,7 @@ export class EcommerceClient { * id: "14", * products: [{ * price: 99.99, - * productId: "P1", - * quantity: 10 + * productId: "P1" * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" diff --git a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts index fcecd5a..62a9c47 100644 --- a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts @@ -11,8 +11,7 @@ import type * as Brevo from "../../../../index.js"; * id: "14", * products: [{ * price: 99.99, - * productId: "P1", - * quantity: 10 + * productId: "P1" * }], * status: "completed", * updatedAt: "2021-07-30T10:59:23.383Z" diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts index 003168d..b34e33b 100644 --- a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts @@ -21,17 +21,21 @@ export namespace CreateUpdateBatchProductsRequest { export namespace Products { export interface Item { + /** Brand of the product */ + brand?: string | undefined; /** Category ID-s of the product */ categories?: string[] | undefined; /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database */ deletedAt?: string | undefined; + /** Description of the product */ + description?: string | undefined; /** Product ID for which you requested the details */ id: string; /** Absolute URL to the cover image of the product */ imageUrl?: string | undefined; /** product deleted from the shop's database */ isDeleted?: boolean | undefined; - /** Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20. */ + /** Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**. */ metaInfo?: Record | undefined; /** Mandatory in case of creation**. Name of the product for which you requested the details */ name: string; diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts index 0e471a0..68fe8d9 100644 --- a/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts @@ -8,17 +8,21 @@ * } */ export interface CreateUpdateProductRequest { + /** Brand of the product */ + brand?: string; /** Category ID-s of the product */ categories?: string[]; /** UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database */ deletedAt?: string; + /** Description of the product */ + description?: string; /** Product ID for which you requested the details */ id: string; /** Absolute URL to the cover image of the product */ imageUrl?: string; /** product deleted from the shop's database */ isDeleted?: boolean; - /** Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20. */ + /** Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**. */ metaInfo?: Record; /** Mandatory in case of creation**. Name of the product for which you requested the details */ name: string; diff --git a/src/api/resources/ecommerce/exports.ts b/src/api/resources/ecommerce/exports.ts new file mode 100644 index 0000000..924f6e2 --- /dev/null +++ b/src/api/resources/ecommerce/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EcommerceClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/emailCampaigns/client/Client.ts b/src/api/resources/emailCampaigns/client/Client.ts index 29f1aa1..d9758c5 100644 --- a/src/api/resources/emailCampaigns/client/Client.ts +++ b/src/api/resources/emailCampaigns/client/Client.ts @@ -23,11 +23,8 @@ export class EmailCampaignsClient { } /** - * - * The response payload for this endpoint has changed - * - * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). - * + * The response payload for this endpoint has changed + * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). * * @param {Brevo.GetEmailCampaignsRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -270,9 +267,10 @@ export class EmailCampaignsClient { request: Brevo.GetEmailCampaignRequest, requestOptions?: EmailCampaignsClient.RequestOptions, ): Promise> { - const { campaignId, statistics } = request; + const { campaignId, statistics, excludeHtmlContent } = request; const _queryParams: Record = { statistics: statistics != null ? statistics : undefined, + excludeHtmlContent, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( diff --git a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts index d77d4ef..d176a52 100644 --- a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts +++ b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts @@ -13,4 +13,6 @@ export interface GetEmailCampaignRequest { campaignId: number; /** Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. */ statistics?: Brevo.GetEmailCampaignRequestStatistics; + /** Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body */ + excludeHtmlContent?: boolean; } diff --git a/src/api/resources/emailCampaigns/exports.ts b/src/api/resources/emailCampaigns/exports.ts new file mode 100644 index 0000000..d63193f --- /dev/null +++ b/src/api/resources/emailCampaigns/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EmailCampaignsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts index 990d630..a6642f8 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts @@ -3,6 +3,8 @@ import type * as Brevo from "../../../index.js"; export interface GetEmailCampaignResponse { + /** Url of the attachment file. Only available if the campaign has an attachment. */ + attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -58,6 +60,8 @@ export interface GetEmailCampaignResponse { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; + /** List of tags of the campaign */ + tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -82,6 +86,9 @@ export namespace GetEmailCampaignResponse { Queued: "queued", Suspended: "suspended", InProcess: "in_process", + InReview: "in_review", + Cancelling: "cancelling", + Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts index a7f4447..7e4058e 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsRequestStatus.ts @@ -8,6 +8,8 @@ export const GetEmailCampaignsRequestStatus = { Draft: "draft", InProcess: "inProcess", InReview: "inReview", + Cancelling: "cancelling", + Cancelled: "cancelled", } as const; export type GetEmailCampaignsRequestStatus = (typeof GetEmailCampaignsRequestStatus)[keyof typeof GetEmailCampaignsRequestStatus]; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts index 4811eba..71d563b 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts @@ -13,6 +13,8 @@ export namespace GetEmailCampaignsResponse { export namespace Campaigns { export interface Item { + /** Url of the attachment file. Only available if the campaign has an attachment. */ + attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -68,6 +70,8 @@ export namespace GetEmailCampaignsResponse { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; + /** List of tags of the campaign */ + tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -92,6 +96,9 @@ export namespace GetEmailCampaignsResponse { Queued: "queued", Suspended: "suspended", InProcess: "in_process", + InReview: "in_review", + Cancelling: "cancelling", + Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/resources/event/client/Client.ts b/src/api/resources/event/client/Client.ts index 3d70be3..0025fc4 100644 --- a/src/api/resources/event/client/Client.ts +++ b/src/api/resources/event/client/Client.ts @@ -22,6 +22,98 @@ export class EventClient { this._options = normalizeClientOptionsWithAuth(options); } + /** + * + * This endpoint currently only supports custom events. + * + * + * Retrieve a list of events filtered by various criteria. + * + * @param {Brevo.GetEventsRequest} request + * @param {EventClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.event.getEvents() + */ + public getEvents( + request: Brevo.GetEventsRequest = {}, + requestOptions?: EventClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getEvents(request, requestOptions)); + } + + private async __getEvents( + request: Brevo.GetEventsRequest = {}, + requestOptions?: EventClient.RequestOptions, + ): Promise> { + const { + contact_id: contactId, + event_name: eventName, + object_type: objectType, + startDate, + endDate, + limit, + offset, + } = request; + const _queryParams: Record = { + contact_id: contactId, + event_name: eventName, + object_type: objectType, + startDate, + endDate, + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "events", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.GetEventsList, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/events"); + } + /** * Create an event to track a contact's interaction. * @@ -94,4 +186,77 @@ export class EventClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/events"); } + + /** + * Create multiple events to track contacts' interactions in a single request. + * + * @param {Brevo.CreateBatchEventsRequestItem[]} request + * @param {EventClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * + * @example + * await client.event.createBatchEvents([{ + * event_name: "order_created", + * identifiers: {} + * }]) + */ + public createBatchEvents( + request: Brevo.CreateBatchEventsRequestItem[], + requestOptions?: EventClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createBatchEvents(request, requestOptions)); + } + + private async __createBatchEvents( + request: Brevo.CreateBatchEventsRequestItem[], + requestOptions?: EventClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + "events/batch", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Brevo.BatchAcceptedResponse, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/events/batch"); + } } diff --git a/src/api/resources/event/client/requests/GetEventsRequest.ts b/src/api/resources/event/client/requests/GetEventsRequest.ts new file mode 100644 index 0000000..9ee8015 --- /dev/null +++ b/src/api/resources/event/client/requests/GetEventsRequest.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetEventsRequest { + /** Filter by contact ID (repeatable) */ + contact_id?: number | number[]; + /** Filter by event name (repeatable) */ + event_name?: string | string[]; + /** Filter by object type (repeatable) */ + object_type?: string | string[]; + /** Mandatory if endDate is used. Start of date range (YYYY-MM-DD or RFC3339). Defaults to 6 months ago when omitted alongside endDate. Must be ≤ endDate. */ + startDate?: string; + /** Mandatory if startDate is used. End of date range (YYYY-MM-DD or RFC3339). Must be ≥ startDate. */ + endDate?: string; + /** Max events to return. Default 100, min 1, max 10000. */ + limit?: number; + /** Events to skip for pagination. Default 0, min 0. */ + offset?: number; +} diff --git a/src/api/resources/event/client/requests/index.ts b/src/api/resources/event/client/requests/index.ts index dff2344..471011e 100644 --- a/src/api/resources/event/client/requests/index.ts +++ b/src/api/resources/event/client/requests/index.ts @@ -1 +1,2 @@ export type { CreateEventRequest } from "./CreateEventRequest.js"; +export type { GetEventsRequest } from "./GetEventsRequest.js"; diff --git a/src/api/resources/event/exports.ts b/src/api/resources/event/exports.ts new file mode 100644 index 0000000..f341a0f --- /dev/null +++ b/src/api/resources/event/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EventClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/event/index.ts b/src/api/resources/event/index.ts index 914b8c3..d9adb1a 100644 --- a/src/api/resources/event/index.ts +++ b/src/api/resources/event/index.ts @@ -1 +1,2 @@ export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/event/types/CreateBatchEventsRequestItem.ts b/src/api/resources/event/types/CreateBatchEventsRequestItem.ts new file mode 100644 index 0000000..2ccc0ac --- /dev/null +++ b/src/api/resources/event/types/CreateBatchEventsRequestItem.ts @@ -0,0 +1,66 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CreateBatchEventsRequestItem { + /** Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **"FIRSTNAME": "Jane" , "AGE": 37** */ + contact_properties?: Record | undefined; + /** Timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used. */ + event_date?: string | undefined; + /** The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. */ + event_name: string; + /** Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. */ + event_properties?: Record | undefined; + /** Identifies the contact associated with the event. At least one identifier is required. */ + identifiers: CreateBatchEventsRequestItem.Identifiers; + /** Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. */ + object?: CreateBatchEventsRequestItem.Object_ | undefined; +} + +export namespace CreateBatchEventsRequestItem { + export namespace ContactProperties { + export type Value = string | number; + } + + export namespace EventProperties { + export type Value = string | number | Record | unknown[]; + } + + /** + * Identifies the contact associated with the event. At least one identifier is required. + */ + export interface Identifiers { + /** Internal unique contact ID. When present, this takes priority over all other identifiers for event attribution and contact resolution. */ + contact_id?: number | undefined; + /** Email Id associated with the event */ + email_id?: string | undefined; + /** ext_id associated with the event */ + ext_id?: string | undefined; + /** landline_number associated with the event */ + landline_number_id?: string | undefined; + /** SMS associated with the event */ + phone_id?: string | undefined; + /** whatsapp associated with the event */ + whatsapp_id?: string | undefined; + } + + /** + * Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. + */ + export interface Object_ { + /** Identifiers for the object. */ + identifiers?: Object_.Identifiers | undefined; + /** Type of object (e.g., subscription, vehicle, etc.) */ + type?: string | undefined; + } + + export namespace Object_ { + /** + * Identifiers for the object. + */ + export interface Identifiers { + /** External object ID */ + ext_id?: string | undefined; + /** Internal object ID */ + id?: string | undefined; + } + } +} diff --git a/src/api/resources/event/types/index.ts b/src/api/resources/event/types/index.ts new file mode 100644 index 0000000..b2fea88 --- /dev/null +++ b/src/api/resources/event/types/index.ts @@ -0,0 +1 @@ +export * from "./CreateBatchEventsRequestItem.js"; diff --git a/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts b/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts index 4f01391..bd3f468 100644 --- a/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts +++ b/src/api/resources/externalFeeds/client/requests/GetExternalFeedByUuidRequest.ts @@ -1,16 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" - * } - * - * @example - * { - * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" - * } - * * @example * { * uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" diff --git a/src/api/resources/externalFeeds/exports.ts b/src/api/resources/externalFeeds/exports.ts new file mode 100644 index 0000000..c87b185 --- /dev/null +++ b/src/api/resources/externalFeeds/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ExternalFeedsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/files/exports.ts b/src/api/resources/files/exports.ts new file mode 100644 index 0000000..679b539 --- /dev/null +++ b/src/api/resources/files/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { FilesClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/inboundParsing/client/Client.ts b/src/api/resources/inboundParsing/client/Client.ts index c33ce9e..1691671 100644 --- a/src/api/resources/inboundParsing/client/Client.ts +++ b/src/api/resources/inboundParsing/client/Client.ts @@ -167,6 +167,7 @@ export class InboundParsingClient { /** * This endpoint will retrieve inbound attachment with download token. + * * @throws {@link Brevo.BadRequestError} * @throws {@link Brevo.NotFoundError} */ diff --git a/src/api/resources/inboundParsing/exports.ts b/src/api/resources/inboundParsing/exports.ts new file mode 100644 index 0000000..e380874 --- /dev/null +++ b/src/api/resources/inboundParsing/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { InboundParsingClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index b4c41cb..7252a47 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -33,6 +33,7 @@ export * as emailCampaigns from "./emailCampaigns/index.js"; export * from "./emailCampaigns/types/index.js"; export * from "./event/client/requests/index.js"; export * as event from "./event/index.js"; +export * from "./event/types/index.js"; export * from "./externalFeeds/client/requests/index.js"; export * as externalFeeds from "./externalFeeds/index.js"; export * from "./externalFeeds/types/index.js"; diff --git a/src/api/resources/masterAccount/exports.ts b/src/api/resources/masterAccount/exports.ts new file mode 100644 index 0000000..2eeb5e1 --- /dev/null +++ b/src/api/resources/masterAccount/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { MasterAccountClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/notes/exports.ts b/src/api/resources/notes/exports.ts new file mode 100644 index 0000000..13f20ba --- /dev/null +++ b/src/api/resources/notes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { NotesClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/payments/exports.ts b/src/api/resources/payments/exports.ts new file mode 100644 index 0000000..8e9673c --- /dev/null +++ b/src/api/resources/payments/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PaymentsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/process/client/requests/GetProcessRequest.ts b/src/api/resources/process/client/requests/GetProcessRequest.ts index 8ead15f..3e45723 100644 --- a/src/api/resources/process/client/requests/GetProcessRequest.ts +++ b/src/api/resources/process/client/requests/GetProcessRequest.ts @@ -1,21 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * processId: 1000000 - * } - * - * @example - * { - * processId: 1000000 - * } - * - * @example - * { - * processId: 1000000 - * } - * * @example * { * processId: 1000000 diff --git a/src/api/resources/process/exports.ts b/src/api/resources/process/exports.ts new file mode 100644 index 0000000..0b1e905 --- /dev/null +++ b/src/api/resources/process/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ProcessClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/program/client/Client.ts b/src/api/resources/program/client/Client.ts index 35e679a..43facb8 100644 --- a/src/api/resources/program/client/Client.ts +++ b/src/api/resources/program/client/Client.ts @@ -584,11 +584,12 @@ export class ProgramClient { request: Brevo.GetParameterSubscriptionInfoRequest, requestOptions?: ProgramClient.RequestOptions, ): Promise> { - const { pid, contactId, params, loyaltySubscriptionId } = request; + const { pid, contactId, params, loyaltySubscriptionId, includeInternal } = request; const _queryParams: Record = { contactId, params, loyaltySubscriptionId, + includeInternal, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -651,6 +652,97 @@ export class ProgramClient { ); } + /** + * Delete subscription for a contact + * + * @param {Brevo.DeleteContactSubscriptionRequest} request + * @param {ProgramClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.UnauthorizedError} + * @throws {@link Brevo.ForbiddenError} + * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.UnprocessableEntityError} + * @throws {@link Brevo.InternalServerError} + * + * @example + * await client.program.deleteContactSubscription({ + * pid: "pid", + * cid: 1 + * }) + */ + public deleteContactSubscription( + request: Brevo.DeleteContactSubscriptionRequest, + requestOptions?: ProgramClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__deleteContactSubscription(request, requestOptions)); + } + + private async __deleteContactSubscription( + request: Brevo.DeleteContactSubscriptionRequest, + requestOptions?: ProgramClient.RequestOptions, + ): Promise> { + const { pid, cid } = request; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.BrevoEnvironment.Default, + `loyalty/config/programs/${core.url.encodePathParam(pid)}/contact/${core.url.encodePathParam(cid)}`, + ), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Brevo.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 422: + throw new Brevo.UnprocessableEntityError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); + case 500: + throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/loyalty/config/programs/{pid}/contact/{cid}", + ); + } + /** * Publishes loyalty program * diff --git a/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts b/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts new file mode 100644 index 0000000..947fb1a --- /dev/null +++ b/src/api/resources/program/client/requests/DeleteContactSubscriptionRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * pid: "pid", + * cid: 1 + * } + */ +export interface DeleteContactSubscriptionRequest { + /** Loyalty Program ID. A unique identifier for the loyalty program. */ + pid: string; + /** Contact ID. */ + cid: number; +} diff --git a/src/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.ts b/src/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.ts index 1ddb913..e45150d 100644 --- a/src/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.ts +++ b/src/api/resources/program/client/requests/GetParameterSubscriptionInfoRequest.ts @@ -15,4 +15,6 @@ export interface GetParameterSubscriptionInfoRequest { params?: string; /** The loyalty subscription ID to filter by. */ loyaltySubscriptionId?: string; + /** Include balances tied to internal definitions. */ + includeInternal?: boolean; } diff --git a/src/api/resources/program/client/requests/index.ts b/src/api/resources/program/client/requests/index.ts index 1bac46c..277ff1d 100644 --- a/src/api/resources/program/client/requests/index.ts +++ b/src/api/resources/program/client/requests/index.ts @@ -1,5 +1,6 @@ export type { CreateNewLpRequest } from "./CreateNewLpRequest.js"; export type { DeleteContactMembersRequest } from "./DeleteContactMembersRequest.js"; +export type { DeleteContactSubscriptionRequest } from "./DeleteContactSubscriptionRequest.js"; export type { DeleteLoyaltyProgramRequest } from "./DeleteLoyaltyProgramRequest.js"; export type { GetLoyaltyProgramInfoRequest } from "./GetLoyaltyProgramInfoRequest.js"; export type { GetLpListRequest } from "./GetLpListRequest.js"; diff --git a/src/api/resources/program/exports.ts b/src/api/resources/program/exports.ts new file mode 100644 index 0000000..ca64af9 --- /dev/null +++ b/src/api/resources/program/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ProgramClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/reward/exports.ts b/src/api/resources/reward/exports.ts new file mode 100644 index 0000000..606509a --- /dev/null +++ b/src/api/resources/reward/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { RewardClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/senders/client/requests/CreateSenderRequest.ts b/src/api/resources/senders/client/requests/CreateSenderRequest.ts index 9fc4ae9..d6566d4 100644 --- a/src/api/resources/senders/client/requests/CreateSenderRequest.ts +++ b/src/api/resources/senders/client/requests/CreateSenderRequest.ts @@ -32,18 +32,6 @@ * }], * name: "Newsletter" * } - * - * @example - * { - * email: "support@example.com", - * name: "Support Team" - * } - * - * @example - * { - * email: "support@example.com", - * name: "Support Team" - * } */ export interface CreateSenderRequest { /** diff --git a/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts b/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts index c90da79..82259b1 100644 --- a/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts +++ b/src/api/resources/senders/client/requests/GetIpsFromSenderRequest.ts @@ -1,11 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * { - * senderId: 1000000 - * } - * * @example * { * senderId: 1000000 diff --git a/src/api/resources/senders/client/requests/GetSendersRequest.ts b/src/api/resources/senders/client/requests/GetSendersRequest.ts index 78e6525..2538f7b 100644 --- a/src/api/resources/senders/client/requests/GetSendersRequest.ts +++ b/src/api/resources/senders/client/requests/GetSendersRequest.ts @@ -1,9 +1,6 @@ // This file was auto-generated by Fern from our API Definition. /** - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/senders/exports.ts b/src/api/resources/senders/exports.ts new file mode 100644 index 0000000..5e2aeb8 --- /dev/null +++ b/src/api/resources/senders/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SendersClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/smsCampaigns/exports.ts b/src/api/resources/smsCampaigns/exports.ts new file mode 100644 index 0000000..470a71e --- /dev/null +++ b/src/api/resources/smsCampaigns/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SmsCampaignsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/smsTemplates/exports.ts b/src/api/resources/smsTemplates/exports.ts new file mode 100644 index 0000000..0fcb7e5 --- /dev/null +++ b/src/api/resources/smsTemplates/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SmsTemplatesClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/tasks/exports.ts b/src/api/resources/tasks/exports.ts new file mode 100644 index 0000000..f7e668f --- /dev/null +++ b/src/api/resources/tasks/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TasksClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts b/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts index 844e4bc..642d878 100644 --- a/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts +++ b/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts @@ -14,6 +14,8 @@ export interface CreateTierGroupRequest { downgradeStrategy?: CreateTierGroupRequest.DowngradeStrategy; /** Name of the tier group */ name: string; + /** Additional metadata for the tier group. */ + meta?: CreateTierGroupRequest.Meta; /** Order of the tiers in the group in ascending order */ tierOrder?: string[]; /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ @@ -28,6 +30,17 @@ export namespace CreateTierGroupRequest { TierAnniversary: "tier_anniversary", } as const; export type DowngradeStrategy = (typeof DowngradeStrategy)[keyof typeof DowngradeStrategy]; + + /** + * Additional metadata for the tier group. + */ + export interface Meta { + /** Indicates whether the tier group is internal. */ + isInternal?: boolean | undefined; + /** Accepts any additional properties */ + [key: string]: any; + } + /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ export const UpgradeStrategy = { RealTime: "real_time", diff --git a/src/api/resources/tier/client/requests/UpdateTierGroupRequest.ts b/src/api/resources/tier/client/requests/UpdateTierGroupRequest.ts index db20de7..b989e14 100644 --- a/src/api/resources/tier/client/requests/UpdateTierGroupRequest.ts +++ b/src/api/resources/tier/client/requests/UpdateTierGroupRequest.ts @@ -20,6 +20,8 @@ export interface UpdateTierGroupRequest { downgradeStrategy: UpdateTierGroupRequest.DowngradeStrategy; /** Name of the tier group */ name: string; + /** Additional metadata for the tier group. */ + meta?: UpdateTierGroupRequest.Meta; /** Order of the tiers in the group in ascending order */ tierOrder: string[]; /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ @@ -34,6 +36,17 @@ export namespace UpdateTierGroupRequest { TierAnniversary: "tier_anniversary", } as const; export type DowngradeStrategy = (typeof DowngradeStrategy)[keyof typeof DowngradeStrategy]; + + /** + * Additional metadata for the tier group. + */ + export interface Meta { + /** Indicates whether the tier group is internal. */ + isInternal?: boolean | undefined; + /** Accepts any additional properties */ + [key: string]: any; + } + /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ export const UpgradeStrategy = { RealTime: "real_time", diff --git a/src/api/resources/tier/exports.ts b/src/api/resources/tier/exports.ts new file mode 100644 index 0000000..32def3d --- /dev/null +++ b/src/api/resources/tier/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TierClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/transactionalEmails/client/Client.ts b/src/api/resources/transactionalEmails/client/Client.ts index 45e8cb4..4d7da71 100644 --- a/src/api/resources/transactionalEmails/client/Client.ts +++ b/src/api/resources/transactionalEmails/client/Client.ts @@ -761,13 +761,9 @@ export class TransactionalEmailsClient { } /** - * - * You can get the uuid using either of the following methods: - * + * You can get the uuid using either of the following methods: * Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response. - * - * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. - * + * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL. * * @param {Brevo.GetTransacEmailContentRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts index 235c13c..1f724df 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts @@ -3,13 +3,6 @@ import type * as Brevo from "../../../../index.js"; /** - * @example - * { - * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", - * startDate: "2022-02-02", - * endDate: "2022-03-02" - * } - * * @example * { * identifier: "4320f270-a4e3-4a2e-b591-edfe30a5e627", diff --git a/src/api/resources/transactionalEmails/exports.ts b/src/api/resources/transactionalEmails/exports.ts new file mode 100644 index 0000000..88be674 --- /dev/null +++ b/src/api/resources/transactionalEmails/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TransactionalEmailsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/transactionalSms/client/Client.ts b/src/api/resources/transactionalSms/client/Client.ts index e945006..3ad1b61 100644 --- a/src/api/resources/transactionalSms/client/Client.ts +++ b/src/api/resources/transactionalSms/client/Client.ts @@ -23,15 +23,9 @@ export class TransactionalSmsClient { } /** - * - * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. - * - * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. - * - * - * - * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. - * + * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code. + * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number. + * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays. * * @param {Brevo.SendTransacSms} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -104,6 +98,8 @@ export class TransactionalSmsClient { } /** + * @deprecated + * * @param {Brevo.SendTransacSms} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. * diff --git a/src/api/resources/transactionalSms/exports.ts b/src/api/resources/transactionalSms/exports.ts new file mode 100644 index 0000000..7605e1e --- /dev/null +++ b/src/api/resources/transactionalSms/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TransactionalSmsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/transactionalWhatsApp/client/Client.ts b/src/api/resources/transactionalWhatsApp/client/Client.ts index f50da6e..9ef4c07 100644 --- a/src/api/resources/transactionalWhatsApp/client/Client.ts +++ b/src/api/resources/transactionalWhatsApp/client/Client.ts @@ -23,7 +23,8 @@ export class TransactionalWhatsAppClient { } /** - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**) * * @param {Brevo.SendWhatsappMessageRequest} request diff --git a/src/api/resources/transactionalWhatsApp/exports.ts b/src/api/resources/transactionalWhatsApp/exports.ts new file mode 100644 index 0000000..361c1d0 --- /dev/null +++ b/src/api/resources/transactionalWhatsApp/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TransactionalWhatsAppClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/user/exports.ts b/src/api/resources/user/exports.ts new file mode 100644 index 0000000..8f9b9cd --- /dev/null +++ b/src/api/resources/user/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { UserClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index b995b0b..1ce80b5 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -187,22 +187,16 @@ export class WebhooksClient { } /** - * - * To have it activated please send us a request and we will activate it for your account. + * + * This is an enterprise feature. Contact us to activate it for your account. * * - * Exports webhook event history to CSV format for analysis and reporting. + * Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body. * - * Use this to: - * - Generate comprehensive webhook event reports - * - Analyze webhook delivery patterns and success rates - * - Export event data for external analysis tools - * - Create historical reports for compliance and auditing - * - Track webhook performance and reliability metrics - * - * Key information returned: - * - Process ID for tracking export completion - * - CSV file will be delivered to specified webhook URL + * Use this endpoint to: + * - Export webhook event history filtered by date range, event type, or email address + * - Generate reports for compliance, auditing, or performance analysis + * - Track delivery patterns and webhook reliability over time * * @param {Brevo.ExportWebhooksHistoryRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts index cb52650..0c734aa 100644 --- a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts @@ -37,6 +37,7 @@ export interface CreateWebhookRequest { * type **Marketing** channel **SMS** #### * `sent`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`, * `subscribe`,`skip` + * #### `reply` */ events: CreateWebhookRequest.Events.Item[]; /** Custom headers to be send with webhooks */ @@ -85,6 +86,7 @@ export namespace CreateWebhookRequest { ContactUpdated: "contactUpdated", ContactDeleted: "contactDeleted", InboundEmailProcessed: "inboundEmailProcessed", + Reply: "reply", } as const; export type Item = (typeof Item)[keyof typeof Item]; } diff --git a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts index 49745bb..d736e28 100644 --- a/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/UpdateWebhookRequest.ts @@ -26,6 +26,7 @@ export interface UpdateWebhookRequest { * #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, * `unsubscribed`, `listAddition` & `delivered` - Possible values * for **Inbound** type webhook: #### `inboundEmailProcessed` + * #### `reply` */ events?: UpdateWebhookRequest.Events.Item[]; /** Custom headers to be send with webhooks */ @@ -66,6 +67,7 @@ export namespace UpdateWebhookRequest { ContactUpdated: "contactUpdated", ContactDeleted: "contactDeleted", InboundEmailProcessed: "inboundEmailProcessed", + Reply: "reply", } as const; export type Item = (typeof Item)[keyof typeof Item]; } diff --git a/src/api/resources/webhooks/exports.ts b/src/api/resources/webhooks/exports.ts new file mode 100644 index 0000000..7773e64 --- /dev/null +++ b/src/api/resources/webhooks/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WebhooksClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/whatsAppCampaigns/client/Client.ts b/src/api/resources/whatsAppCampaigns/client/Client.ts index b9becb7..aa9e3b8 100644 --- a/src/api/resources/whatsAppCampaigns/client/Client.ts +++ b/src/api/resources/whatsAppCampaigns/client/Client.ts @@ -93,19 +93,11 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * - * - * - * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - * - * [Get all the Segments](https://developers.brevo.com/reference/getsegments) - * + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) * * @param {Brevo.CreateWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -177,11 +169,8 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -242,11 +231,8 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * * @param {Brevo.CreateWhatsAppTemplateRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -394,11 +380,8 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account * * @param {Brevo.SendWhatsAppTemplateApprovalRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -470,11 +453,11 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. + * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) * * @param {Brevo.GetWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -549,19 +532,11 @@ export class WhatsAppCampaignsClient { } /** - * - * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. - * - * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account - * - * - * - * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information. - * + * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. + * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account + * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information. * [Get all the Lists](https://developers.brevo.com/reference/getlists-1) - * - * [Get all the Segments](https://developers.brevo.com/reference/getsegments) - * + * [Get all the Segments](https://developers.brevo.com/reference/getsegments) * * @param {Brevo.UpdateWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. diff --git a/src/api/resources/whatsAppCampaigns/exports.ts b/src/api/resources/whatsAppCampaigns/exports.ts new file mode 100644 index 0000000..35b77f8 --- /dev/null +++ b/src/api/resources/whatsAppCampaigns/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WhatsAppCampaignsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/types/BatchAcceptedResponse.ts b/src/api/types/BatchAcceptedResponse.ts new file mode 100644 index 0000000..6a5bfd6 --- /dev/null +++ b/src/api/types/BatchAcceptedResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Response returned when all events in the batch are accepted for async processing + */ +export interface BatchAcceptedResponse { + /** Confirmation message indicating the batch was accepted */ + message: string; + /** Number of events queued for processing */ + count: number; +} diff --git a/src/api/types/BatchEventsResponse.ts b/src/api/types/BatchEventsResponse.ts new file mode 100644 index 0000000..0b745e8 --- /dev/null +++ b/src/api/types/BatchEventsResponse.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Response returned when a batch of events is processed + */ +export interface BatchEventsResponse { + /** Status of the batch request */ + status: string; + /** Total number of events submitted in the batch */ + total_events: number; + /** Number of events that were successfully processed */ + successful_events: number; + /** Number of events that failed to be processed */ + failed_events: number; + /** List of errors for the failed events */ + errors: BatchEventsResponse.Errors.Item[]; +} + +export namespace BatchEventsResponse { + export type Errors = Errors.Item[]; + + export namespace Errors { + export interface Item { + /** Index positions (0-based) of the events that caused the error */ + eventIndex?: number[] | undefined; + /** Description of the error */ + message?: string | undefined; + } + } +} diff --git a/src/api/types/GetCampaignStats.ts b/src/api/types/GetCampaignStats.ts index 618a403..76f44c9 100644 --- a/src/api/types/GetCampaignStats.ts +++ b/src/api/types/GetCampaignStats.ts @@ -2,7 +2,7 @@ export interface GetCampaignStats { /** Numbers of times your email has been opened automatically through Apple MPP. */ - appleMppOpens: number; + appleMppOpens: number | null; /** Number of total clicks for the campaign */ clickers: number; /** Number of complaints (Spam reports) for the campaign */ @@ -18,7 +18,7 @@ export interface GetCampaignStats { /** List Id of email campaign (only in case of get email campaign(s)(not for global stats)) */ listId?: number | undefined; /** Percentage of recipients who open the email out of your total number of recipients. Depending on your Campaign settings, they may include Apple MPP opens. */ - opensRate: number; + opensRate: number | null; /** Total number of non-delivered campaigns for a particular campaign id. */ returnBounce?: number | undefined; /** Number of sent emails for the campaign */ diff --git a/src/api/types/GetEventsList.ts b/src/api/types/GetEventsList.ts new file mode 100644 index 0000000..5388d5d --- /dev/null +++ b/src/api/types/GetEventsList.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Response containing a list of events and the total count for pagination + */ +export interface GetEventsList { + /** List of matching events ordered by event_date descending */ + events?: GetEventsList.Events.Item[] | undefined; + /** Total count of events matching the filters (use for pagination) */ + count: number; +} + +export namespace GetEventsList { + export type Events = Events.Item[]; + + export namespace Events { + export interface Item { + /** Contact ID associated with the event */ + contact_id?: number | undefined; + /** Date and time of the event */ + event_date?: string | undefined; + /** Name of the event */ + event_name?: string | undefined; + /** Filter ID of the event */ + event_filter_id?: string | undefined; + /** Source of the event */ + source?: string | undefined; + /** Object type associated with the event */ + object_type?: string | undefined; + /** Event-level custom properties */ + event_properties?: Record | undefined; + /** Contact-level properties at time of event */ + contact_properties?: Record | undefined; + } + } +} diff --git a/src/api/types/GetExtendedCampaignOverview.ts b/src/api/types/GetExtendedCampaignOverview.ts index 0b4c7e7..114e7e6 100644 --- a/src/api/types/GetExtendedCampaignOverview.ts +++ b/src/api/types/GetExtendedCampaignOverview.ts @@ -1,6 +1,8 @@ // This file was auto-generated by Fern from our API Definition. export interface GetExtendedCampaignOverview { + /** Url of the attachment file. Only available if the campaign has an attachment. */ + attachmentFile?: string | undefined; /** Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. */ abTesting?: boolean | undefined; /** ID of the campaign */ @@ -56,6 +58,8 @@ export interface GetExtendedCampaignOverview { shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; + /** List of tags of the campaign */ + tags?: string[] | undefined; /** Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) */ testSent: boolean; /** Customisation of the "to" field of the campaign */ @@ -78,6 +82,9 @@ export namespace GetExtendedCampaignOverview { Queued: "queued", Suspended: "suspended", InProcess: "in_process", + InReview: "in_review", + Cancelling: "cancelling", + Cancelled: "cancelled", } as const; export type Status = (typeof Status)[keyof typeof Status]; /** Type of campaign */ diff --git a/src/api/types/GetProductDetails.ts b/src/api/types/GetProductDetails.ts index 464093b..ae430f8 100644 --- a/src/api/types/GetProductDetails.ts +++ b/src/api/types/GetProductDetails.ts @@ -1,10 +1,14 @@ // This file was auto-generated by Fern from our API Definition. export interface GetProductDetails { + /** Brand of the product */ + brand?: string | undefined; /** Category ID-s of the product */ categories?: string[] | undefined; /** Creation UTC date-time of the product (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; + /** Description of the product */ + description?: string | undefined; /** Product ID for which you requested the details */ id: string; /** Absolute URL to the cover image of the product */ diff --git a/src/api/types/InternalServerErrorBody.ts b/src/api/types/InternalServerErrorBody.ts new file mode 100644 index 0000000..628e74b --- /dev/null +++ b/src/api/types/InternalServerErrorBody.ts @@ -0,0 +1,51 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface InternalServerErrorBody { + /** Error code displayed in case of a failure */ + code: InternalServerErrorBody.Code; + /** Readable message associated to the failure */ + message: string; +} + +export namespace InternalServerErrorBody { + /** Error code displayed in case of a failure */ + export const Code = { + InvalidParameter: "invalid_parameter", + MissingParameter: "missing_parameter", + OutOfRange: "out_of_range", + CampaignProcessing: "campaign_processing", + CampaignSent: "campaign_sent", + DocumentNotFound: "document_not_found", + NotEnoughCredits: "not_enough_credits", + PermissionDenied: "permission_denied", + DuplicateParameter: "duplicate_parameter", + DuplicateRequest: "duplicate_request", + MethodNotAllowed: "method_not_allowed", + Unauthorized: "unauthorized", + AccountUnderValidation: "account_under_validation", + NotAcceptable: "not_acceptable", + BadRequest: "bad_request", + UnprocessableEntity: "unprocessable_entity", + DomainDoesNotExist: "Domain does not exist", + ContactEmailNotFound: "Contact email not found", + AttributeNotFound: "Attribute not found", + CategoryIdNotFound: "Category id not found", + InvalidParametersPassed: "Invalid parameters passed", + RecordSForIdentifierNotFound: "Record(s) for identifier not found", + ReturnedWhenQueryParamsAreInvalid: "Returned when query params are invalid", + ReturnedWhenInvalidDataPosted: "Returned when invalid data posted", + FeedNotFound: "Feed not found", + CampaignIdNotFound: "Campaign ID not found", + ApiKeyNotFound: "api-key not found", + DmarcPolicyRequiresDomainAuthentication: "DMARC policy requires domain authentication", + DnsRecordsNotProperlyConfigured: "DNS records not properly configured", + InvalidOtpCodeProvided: "Invalid OTP code provided", + OtpCodeHasExpired: "OTP code has expired", + DomainAlreadyExistsInYourAccount: "Domain already exists in your account", + TheSumOfAllIpWeightsMustEqual100: "The sum of all IP weights must equal 100", + AuthenticationFailed: "Authentication failed", + InsufficientCredits: "Insufficient credits", + RequestAlreadyProcessed: "Request already processed", + } as const; + export type Code = (typeof Code)[keyof typeof Code]; +} diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 1753e35..34a51e7 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -76,10 +76,20 @@ export namespace Order { price: number; /** ID of the product. */ productId: string; - /** How many pieces of the product the visitor has added to the cart. */ - quantity: number; /** Product ID of the red color shirts. */ variantId?: string | undefined; + /** + * **Required if quantityFloat is empty.** + * + * Number of product units added to the cart (whole numbers only, e.g., 10) + */ + quantity?: number | undefined; + /** + * **Required if quantity is empty.** + * + * Number of product units added to the cart(supports decimals, e.g., 20.52) + */ + quantityFloat?: number | undefined; } } } diff --git a/src/api/types/UpdateCampaignStatus.ts b/src/api/types/UpdateCampaignStatus.ts index a978877..f3ef1d3 100644 --- a/src/api/types/UpdateCampaignStatus.ts +++ b/src/api/types/UpdateCampaignStatus.ts @@ -18,6 +18,7 @@ export namespace UpdateCampaignStatus { Queued: "queued", Replicate: "replicate", ReplicateTemplate: "replicateTemplate", + Cancel: "cancel", Draft: "draft", } as const; export type Status = (typeof Status)[keyof typeof Status]; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 28b4c8d..94dbe93 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -4,6 +4,8 @@ export * from "./AbTestVersionStats.js"; export * from "./BadRequestErrorBody.js"; export * from "./BalanceDefinition.js"; export * from "./BalanceLimit.js"; +export * from "./BatchAcceptedResponse.js"; +export * from "./BatchEventsResponse.js"; export * from "./Cart.js"; export * from "./Company.js"; export * from "./Configuration.js"; @@ -22,6 +24,7 @@ export * from "./GetContactDetails.js"; export * from "./GetContacts.js"; export * from "./GetCouponCollection.js"; export * from "./GetDeviceBrowserStats.js"; +export * from "./GetEventsList.js"; export * from "./GetExtendedCampaignOverview.js"; export * from "./GetExtendedCampaignStats.js"; export * from "./GetFolder.js"; @@ -32,6 +35,7 @@ export * from "./GetSmsCampaignStats.js"; export * from "./GetSmtpTemplateOverview.js"; export * from "./GetSsoToken.js"; export * from "./GetWebhook.js"; +export * from "./InternalServerErrorBody.js"; export * from "./Inviteuser.js"; export * from "./LoyaltyProgram.js"; export * from "./NodeResponse.js"; diff --git a/src/core/fetcher/BinaryResponse.ts b/src/core/fetcher/BinaryResponse.ts index bca7f4c..b9e40fb 100644 --- a/src/core/fetcher/BinaryResponse.ts +++ b/src/core/fetcher/BinaryResponse.ts @@ -14,7 +14,7 @@ export type BinaryResponse = { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) * Some versions of the Fetch API may not support this method. */ - bytes?(): ReturnType; + bytes?(): Promise; }; export function getBinaryResponse(response: Response): BinaryResponse { diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 5e5058a..764d2e1 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -282,6 +282,7 @@ export async function fetcherImpl(args: Fetcher.Args): Promise; + /** Abort signal for this request. */ + abortSignal?: AbortSignal; + } + + /** + * SDK client configuration used by the passthrough fetch method. + */ + export interface ClientOptions { + /** The base URL or environment for the client. */ + environment?: Supplier; + /** Override the base URL. */ + baseUrl?: Supplier; + /** Default headers to include in requests. */ + headers?: Record; + /** Default maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** Default number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A custom fetch function. */ + fetch?: typeof fetch; + /** Logging configuration. */ + logging?: LogConfig | Logger; + /** A function that returns auth headers. */ + getAuthHeaders?: () => Promise>; + } +} + +/** + * Makes a passthrough HTTP request using the SDK's configuration (auth, retry, logging, etc.) + * while mimicking the standard `fetch` API. + * + * @param input - The URL, path, or Request object. If a relative path, it will be resolved against the configured base URL. + * @param init - Standard RequestInit options (method, headers, body, signal, etc.) + * @param clientOptions - SDK client options (auth, default headers, logging, etc.) + * @param requestOptions - Per-request overrides (timeout, retries, extra headers, abort signal). + * @returns A standard Response object. + */ +export async function makePassthroughRequest( + input: Request | string | URL, + init: RequestInit | undefined, + clientOptions: PassthroughRequest.ClientOptions, + requestOptions?: PassthroughRequest.RequestOptions, +): Promise { + const logger = createLogger(clientOptions.logging); + + // Extract URL and default init properties from Request object if provided + let url: string; + let effectiveInit: RequestInit | undefined = init; + if (input instanceof Request) { + url = input.url; + // If no explicit init provided, extract properties from the Request object + if (init == null) { + effectiveInit = { + method: input.method, + headers: Object.fromEntries(input.headers.entries()), + body: input.body, + signal: input.signal, + credentials: input.credentials, + cache: input.cache as RequestCache, + redirect: input.redirect, + referrer: input.referrer, + integrity: input.integrity, + mode: input.mode, + }; + } + } else { + url = input instanceof URL ? input.toString() : input; + } + + // Resolve the base URL + const baseUrl = + (clientOptions.baseUrl != null ? await Supplier.get(clientOptions.baseUrl) : undefined) ?? + (clientOptions.environment != null ? await Supplier.get(clientOptions.environment) : undefined); + + // Determine the full URL + let fullUrl: string; + if (url.startsWith("http://") || url.startsWith("https://")) { + fullUrl = url; + } else if (baseUrl != null) { + fullUrl = join(baseUrl, url); + } else { + fullUrl = url; + } + + // Merge headers: SDK default headers -> auth headers -> user-provided headers + const mergedHeaders: Record = {}; + + // Apply SDK default headers (resolve suppliers) + if (clientOptions.headers != null) { + for (const [key, value] of Object.entries(clientOptions.headers)) { + const resolved = await EndpointSupplier.get(value, { endpointMetadata: {} }); + if (resolved != null) { + mergedHeaders[key.toLowerCase()] = `${resolved}`; + } + } + } + + // Apply auth headers + if (clientOptions.getAuthHeaders != null) { + const authHeaders = await clientOptions.getAuthHeaders(); + for (const [key, value] of Object.entries(authHeaders)) { + mergedHeaders[key.toLowerCase()] = value; + } + } + + // Apply user-provided headers from init + if (effectiveInit?.headers != null) { + const initHeaders = + effectiveInit.headers instanceof Headers + ? Object.fromEntries(effectiveInit.headers.entries()) + : Array.isArray(effectiveInit.headers) + ? Object.fromEntries(effectiveInit.headers) + : effectiveInit.headers; + for (const [key, value] of Object.entries(initHeaders)) { + if (value != null) { + mergedHeaders[key.toLowerCase()] = value; + } + } + } + + // Apply per-request option headers (highest priority) + if (requestOptions?.headers != null) { + for (const [key, value] of Object.entries(requestOptions.headers)) { + mergedHeaders[key.toLowerCase()] = value; + } + } + + const method = effectiveInit?.method ?? "GET"; + const body = effectiveInit?.body; + const timeoutInSeconds = requestOptions?.timeoutInSeconds ?? clientOptions.timeoutInSeconds; + const timeoutMs = timeoutInSeconds != null ? timeoutInSeconds * 1000 : undefined; + const maxRetries = requestOptions?.maxRetries ?? clientOptions.maxRetries; + const abortSignal = requestOptions?.abortSignal ?? effectiveInit?.signal ?? undefined; + const fetchFn = clientOptions.fetch ?? (await getFetchFn()); + + if (logger.isDebug()) { + logger.debug("Making passthrough HTTP request", { + method, + url: fullUrl, + hasBody: body != null, + }); + } + + const response = await requestWithRetries( + async () => + makeRequest( + fetchFn, + fullUrl, + method, + mergedHeaders, + body ?? undefined, + timeoutMs, + abortSignal, + effectiveInit?.credentials === "include", + undefined, // duplex + false, // disableCache + ), + maxRetries, + ); + + if (logger.isDebug()) { + logger.debug("Passthrough HTTP request completed", { + method, + url: fullUrl, + statusCode: response.status, + }); + } + + return response; +} diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts index 921565e..360a86d 100644 --- a/src/core/fetcher/makeRequest.ts +++ b/src/core/fetcher/makeRequest.ts @@ -1,5 +1,31 @@ import { anySignal, getTimeoutSignal } from "./signals.js"; +/** + * Cached result of checking whether the current runtime supports + * the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers) + * throw a TypeError when this option is used. + */ +let _cacheNoStoreSupported: boolean | undefined; +export function isCacheNoStoreSupported(): boolean { + if (_cacheNoStoreSupported != null) { + return _cacheNoStoreSupported; + } + try { + new Request("http://localhost", { cache: "no-store" }); + _cacheNoStoreSupported = true; + } catch { + _cacheNoStoreSupported = false; + } + return _cacheNoStoreSupported; +} + +/** + * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only. + */ +export function resetCacheNoStoreSupported(): void { + _cacheNoStoreSupported = undefined; +} + export const makeRequest = async ( fetchFn: (url: string, init: RequestInit) => Promise, url: string, @@ -10,6 +36,7 @@ export const makeRequest = async ( abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", + disableCache?: boolean, ): Promise => { const signals: AbortSignal[] = []; @@ -32,6 +59,7 @@ export const makeRequest = async ( credentials: withCredentials ? "include" : undefined, // @ts-ignore duplex, + ...(disableCache && isCacheNoStoreSupported() ? { cache: "no-store" as RequestCache } : {}), }); if (timeoutAbortId != null) { diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts index 56ebbb8..e6e66b2 100644 --- a/src/core/runtime/runtime.ts +++ b/src/core/runtime/runtime.ts @@ -113,18 +113,18 @@ function evaluateRuntime(): Runtime { /** * A constant that indicates whether the environment the code is running is Node.JS. + * + * We assign `process` to a local variable first to avoid being flagged by + * bundlers that perform static analysis on `process.versions` (e.g. Next.js + * Edge Runtime warns about Node.js APIs even when they are guarded). */ - const isNode = - typeof process !== "undefined" && - "version" in process && - !!process.version && - "versions" in process && - !!process.versions?.node; + const _process = typeof process !== "undefined" ? process : undefined; + const isNode = typeof _process !== "undefined" && typeof _process.versions?.node === "string"; if (isNode) { return { type: "node", - version: process.versions.node, - parsedVersion: Number(process.versions.node.split(".")[0]), + version: _process.versions.node, + parsedVersion: Number(_process.versions.node.split(".")[0]), }; } diff --git a/src/version.ts b/src/version.ts index 3185aec..689c8fc 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "5.0.2"; +export const SDK_VERSION = "5.0.3"; diff --git a/tests/mock-server/MockServerPool.ts b/tests/mock-server/MockServerPool.ts index e1a90f7..d7d891a 100644 --- a/tests/mock-server/MockServerPool.ts +++ b/tests/mock-server/MockServerPool.ts @@ -103,4 +103,4 @@ class MockServerPool { } } -export const mockServerPool = new MockServerPool(); +export const mockServerPool: MockServerPool = new MockServerPool(); diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 78985e7..3e8540a 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -2,7 +2,7 @@ import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponse import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; -import { withFormUrlEncoded } from "./withFormUrlEncoded"; +import { type WithFormUrlEncodedOptions, withFormUrlEncoded } from "./withFormUrlEncoded"; import { withHeaders } from "./withHeaders"; import { type WithJsonOptions, withJson } from "./withJson"; @@ -27,7 +27,7 @@ interface RequestHeadersStage extends RequestBodyStage, ResponseStage { interface RequestBodyStage extends ResponseStage { jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage; - formUrlEncodedBody(body: unknown): ResponseStage; + formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage; } interface ResponseStage { @@ -44,6 +44,7 @@ interface ResponseHeaderStage extends ResponseBodyStage, BuildStage { interface ResponseBodyStage { jsonBody(body: unknown): BuildStage; + sseBody(body: string): BuildStage; } interface BuildStage { @@ -137,13 +138,13 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta return this; } - formUrlEncodedBody(body: unknown): ResponseStage { + formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage { if (body === undefined) { throw new Error( "Undefined is not valid for form-urlencoded. Do not call formUrlEncodedBody if you want an empty body.", ); } - this.predicates.push((resolver) => withFormUrlEncoded(body, resolver)); + this.predicates.push((resolver) => withFormUrlEncoded(body, resolver, options)); return this; } @@ -201,6 +202,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo return this; } + public sseBody(body: string): BuildStage { + this.responseHeaders["Content-Type"] = "text/event-stream"; + this.responseBody = body; + return this; + } + public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { const response = new HttpResponse(this.responseBody, { diff --git a/tests/mock-server/withFormUrlEncoded.ts b/tests/mock-server/withFormUrlEncoded.ts index e250cb3..2b23448 100644 --- a/tests/mock-server/withFormUrlEncoded.ts +++ b/tests/mock-server/withFormUrlEncoded.ts @@ -2,12 +2,26 @@ import { type HttpResponseResolver, passthrough } from "msw"; import { toJson } from "../../src/core/json"; +export interface WithFormUrlEncodedOptions { + /** + * List of field names to ignore when comparing request bodies. + * This is useful for pagination cursor fields that change between requests. + */ + ignoredFields?: string[]; +} + /** * Creates a request matcher that validates if the request form-urlencoded body exactly matches the expected object * @param expectedBody - The exact body object to match against * @param resolver - Response resolver to execute if body matches + * @param options - Optional configuration including fields to ignore */ -export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { +export function withFormUrlEncoded( + expectedBody: unknown, + resolver: HttpResponseResolver, + options?: WithFormUrlEncodedOptions, +): HttpResponseResolver { + const ignoredFields = options?.ignoredFields ?? []; return async (args) => { const { request } = args; @@ -41,7 +55,8 @@ export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponse } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).length > 0) { + const filteredMismatches = Object.keys(mismatches).filter((key) => !ignoredFields.includes(key)); + if (filteredMismatches.length > 0) { console.error("Form-urlencoded body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } diff --git a/tests/tsconfig.json b/tests/tsconfig.json index a477df4..ac39744 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -3,7 +3,6 @@ "compilerOptions": { "outDir": null, "rootDir": "..", - "baseUrl": "..", "types": ["vitest/globals"] }, "include": ["../src", "../tests"], diff --git a/tests/unit/fetcher/makePassthroughRequest.test.ts b/tests/unit/fetcher/makePassthroughRequest.test.ts new file mode 100644 index 0000000..1850d1f --- /dev/null +++ b/tests/unit/fetcher/makePassthroughRequest.test.ts @@ -0,0 +1,398 @@ +import type { Mock } from "vitest"; +import { makePassthroughRequest } from "../../../src/core/fetcher/makePassthroughRequest"; + +describe("makePassthroughRequest", () => { + let mockFetch: Mock; + + beforeEach(() => { + mockFetch = vi.fn(); + mockFetch.mockResolvedValue(new Response(JSON.stringify({ ok: true }), { status: 200 })); + }); + + describe("URL resolution", () => { + it("should use absolute URL directly", async () => { + await makePassthroughRequest("https://api.example.com/v1/users", undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + + it("should resolve relative path against baseUrl", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: "https://api.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + + it("should resolve relative path against environment when baseUrl is not set", async () => { + await makePassthroughRequest("/v1/users", undefined, { + environment: "https://env.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://env.example.com/v1/users"); + }); + + it("should prefer baseUrl over environment", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: "https://base.example.com", + environment: "https://env.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://base.example.com/v1/users"); + }); + + it("should pass relative URL through as-is when no baseUrl or environment", async () => { + await makePassthroughRequest("/v1/users", undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("/v1/users"); + }); + + it("should resolve baseUrl supplier", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: () => "https://dynamic.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://dynamic.example.com/v1/users"); + }); + + it("should ignore absolute URL even when baseUrl is set", async () => { + await makePassthroughRequest("https://other.example.com/path", undefined, { + baseUrl: "https://base.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://other.example.com/path"); + }); + + it("should accept a URL object", async () => { + await makePassthroughRequest(new URL("https://api.example.com/v1/users"), undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + }); + + describe("header merge order", () => { + it("should merge headers in correct priority: SDK defaults < auth < init < requestOptions", async () => { + await makePassthroughRequest( + "https://api.example.com", + { + headers: { "X-Custom": "from-init", Authorization: "from-init" }, + }, + { + headers: { + "X-Custom": "from-sdk", + "X-SDK-Only": "sdk-value", + Authorization: "from-sdk", + }, + getAuthHeaders: async () => ({ + Authorization: "Bearer auth-token", + "X-Auth-Only": "auth-value", + }), + fetch: mockFetch, + }, + { + headers: { Authorization: "from-request-options" }, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + const headers = calledOptions.headers; + + // requestOptions.headers wins for Authorization (highest priority) + expect(headers.authorization).toBe("from-request-options"); + // init.headers wins over SDK defaults for X-Custom + expect(headers["x-custom"]).toBe("from-init"); + // SDK-only header is preserved + expect(headers["x-sdk-only"]).toBe("sdk-value"); + // Auth-only header is preserved + expect(headers["x-auth-only"]).toBe("auth-value"); + }); + + it("should lowercase all header keys", async () => { + await makePassthroughRequest( + "https://api.example.com", + { + headers: { "Content-Type": "application/json" }, + }, + { + headers: { "X-Fern-Language": "JavaScript" }, + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + const headers = calledOptions.headers; + expect(headers["content-type"]).toBe("application/json"); + expect(headers["x-fern-language"]).toBe("JavaScript"); + expect(headers["Content-Type"]).toBeUndefined(); + expect(headers["X-Fern-Language"]).toBeUndefined(); + }); + + it("should handle Headers object in init", async () => { + const initHeaders = new Headers(); + initHeaders.set("X-From-Headers-Object", "value"); + await makePassthroughRequest("https://api.example.com", { headers: initHeaders }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-from-headers-object"]).toBe("value"); + }); + + it("should handle array-style headers in init", async () => { + await makePassthroughRequest( + "https://api.example.com", + { headers: [["X-Array-Header", "array-value"]] }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-array-header"]).toBe("array-value"); + }); + + it("should skip null SDK default header values", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + headers: { "X-Present": "value", "X-Null": null }, + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-present"]).toBe("value"); + expect(calledOptions.headers["x-null"]).toBeUndefined(); + }); + }); + + describe("auth headers", () => { + it("should include auth headers when getAuthHeaders is provided", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer my-token"); + }); + + it("should work without auth headers", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBeUndefined(); + }); + + it("should allow init headers to override auth headers", async () => { + await makePassthroughRequest( + "https://api.example.com", + { headers: { Authorization: "Bearer override" } }, + { + getAuthHeaders: async () => ({ Authorization: "Bearer sdk-auth" }), + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer override"); + }); + }); + + describe("method and body", () => { + it("should default to GET when no method specified", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("GET"); + }); + + it("should use the method from init", async () => { + await makePassthroughRequest( + "https://api.example.com", + { method: "POST", body: JSON.stringify({ key: "value" }) }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("POST"); + expect(calledOptions.body).toBe(JSON.stringify({ key: "value" })); + }); + + it("should pass body as undefined when not provided", async () => { + await makePassthroughRequest("https://api.example.com", { method: "GET" }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.body).toBeUndefined(); + }); + }); + + describe("timeout and retries", () => { + it("should use requestOptions timeout over client timeout", async () => { + await makePassthroughRequest( + "https://api.example.com", + undefined, + { timeoutInSeconds: 30, fetch: mockFetch }, + { timeoutInSeconds: 10 }, + ); + // The timeout is passed to makeRequest which converts to ms + // We verify via the signal timing behavior (indirectly tested through makeRequest) + expect(mockFetch).toHaveBeenCalledTimes(1); + }); + + it("should use client timeout when requestOptions timeout is not set", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + timeoutInSeconds: 30, + fetch: mockFetch, + }); + expect(mockFetch).toHaveBeenCalledTimes(1); + }); + + it("should use requestOptions maxRetries over client maxRetries", async () => { + mockFetch.mockResolvedValue(new Response("", { status: 500 })); + vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + await makePassthroughRequest( + "https://api.example.com", + undefined, + { maxRetries: 5, fetch: mockFetch }, + { maxRetries: 1 }, + ); + // 1 initial + 1 retry = 2 calls + expect(mockFetch).toHaveBeenCalledTimes(2); + + vi.restoreAllMocks(); + }); + }); + + describe("abort signal", () => { + it("should use requestOptions.abortSignal over init.signal", async () => { + const initController = new AbortController(); + const requestController = new AbortController(); + + await makePassthroughRequest( + "https://api.example.com", + { signal: initController.signal }, + { fetch: mockFetch }, + { abortSignal: requestController.signal }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + // The signal passed to makeRequest is combined with timeout signal via anySignal, + // but the requestOptions.abortSignal should be the one that's used (not init.signal) + expect(calledOptions.signal).toBeDefined(); + }); + + it("should use init.signal when requestOptions.abortSignal is not set", async () => { + const initController = new AbortController(); + + await makePassthroughRequest( + "https://api.example.com", + { signal: initController.signal }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.signal).toBeDefined(); + }); + }); + + describe("credentials", () => { + it("should pass credentials include when set", async () => { + await makePassthroughRequest("https://api.example.com", { credentials: "include" }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.credentials).toBe("include"); + }); + + it("should not pass credentials when not set to include", async () => { + await makePassthroughRequest( + "https://api.example.com", + { credentials: "same-origin" }, + { + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.credentials).toBeUndefined(); + }); + }); + + describe("response", () => { + it("should return the Response object from fetch", async () => { + const mockResponse = new Response(JSON.stringify({ data: "test" }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + mockFetch.mockResolvedValue(mockResponse); + + const response = await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + expect(response).toBe(mockResponse); + expect(response.status).toBe(200); + }); + + it("should return error responses without throwing", async () => { + const errorResponse = new Response("Not Found", { status: 404 }); + mockFetch.mockResolvedValue(errorResponse); + + const response = await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + expect(response.status).toBe(404); + }); + }); + + describe("Request object input", () => { + it("should extract URL from Request object", async () => { + const request = new Request("https://api.example.com/v1/resource", { method: "POST" }); + await makePassthroughRequest(request, undefined, { + fetch: mockFetch, + }); + const [calledUrl, calledOptions] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/resource"); + expect(calledOptions.method).toBe("POST"); + }); + + it("should extract headers from Request object when no init provided", async () => { + const request = new Request("https://api.example.com", { + headers: { "X-From-Request": "request-value" }, + }); + await makePassthroughRequest(request, undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-from-request"]).toBe("request-value"); + }); + + it("should use explicit init over Request object properties", async () => { + const request = new Request("https://api.example.com", { + method: "POST", + headers: { "X-From-Request": "request-value" }, + }); + await makePassthroughRequest( + request, + { method: "PUT", headers: { "X-From-Init": "init-value" } }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("PUT"); + expect(calledOptions.headers["x-from-init"]).toBe("init-value"); + // Request headers should NOT be present since explicit init was provided + expect(calledOptions.headers["x-from-request"]).toBeUndefined(); + }); + }); + + describe("SDK default header suppliers", () => { + it("should resolve supplier functions for SDK default headers", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + headers: { + "X-Static": "static-value", + "X-Dynamic": () => "dynamic-value", + }, + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-static"]).toBe("static-value"); + expect(calledOptions.headers["x-dynamic"]).toBe("dynamic-value"); + }); + }); +}); diff --git a/tests/unit/fetcher/makeRequest.test.ts b/tests/unit/fetcher/makeRequest.test.ts index ea49466..bde1945 100644 --- a/tests/unit/fetcher/makeRequest.test.ts +++ b/tests/unit/fetcher/makeRequest.test.ts @@ -1,5 +1,9 @@ import type { Mock } from "vitest"; -import { makeRequest } from "../../../src/core/fetcher/makeRequest"; +import { + isCacheNoStoreSupported, + makeRequest, + resetCacheNoStoreSupported, +} from "../../../src/core/fetcher/makeRequest"; describe("Test makeRequest", () => { const mockPostUrl = "https://httpbin.org/post"; @@ -12,6 +16,7 @@ describe("Test makeRequest", () => { beforeEach(() => { mockFetch = vi.fn(); mockFetch.mockResolvedValue(new Response(JSON.stringify({ test: "successful" }), { status: 200 })); + resetCacheNoStoreSupported(); }); it("should handle POST request correctly", async () => { @@ -51,4 +56,103 @@ describe("Test makeRequest", () => { expect(calledOptions.signal).toBeDefined(); expect(calledOptions.signal).toBeInstanceOf(AbortSignal); }); + + it("should not include cache option when disableCache is not set", async () => { + await makeRequest(mockFetch, mockGetUrl, "GET", mockHeaders, undefined); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + }); + + it("should not include cache option when disableCache is false", async () => { + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + false, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + }); + + it("should include cache: no-store when disableCache is true and runtime supports it", async () => { + // In Node.js test environment, Request supports the cache option + expect(isCacheNoStoreSupported()).toBe(true); + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + true, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBe("no-store"); + }); + + it("should cache the result of isCacheNoStoreSupported", () => { + const first = isCacheNoStoreSupported(); + const second = isCacheNoStoreSupported(); + expect(first).toBe(second); + }); + + it("should reset cache detection state with resetCacheNoStoreSupported", () => { + // First call caches the result + const first = isCacheNoStoreSupported(); + expect(first).toBe(true); + + // Reset clears the cache + resetCacheNoStoreSupported(); + + // After reset, it should re-detect (and still return true in Node.js) + const second = isCacheNoStoreSupported(); + expect(second).toBe(true); + }); + + it("should not include cache option when runtime does not support it (e.g. Cloudflare Workers)", async () => { + // Mock Request constructor to throw when cache option is passed, + // simulating runtimes like Cloudflare Workers + const OriginalRequest = globalThis.Request; + globalThis.Request = class MockRequest { + constructor(_url: string, init?: RequestInit) { + if (init?.cache != null) { + throw new TypeError("The 'cache' field on 'RequestInitializerDict' is not implemented."); + } + } + } as unknown as typeof Request; + + try { + // Reset so the detection runs fresh with the mocked Request + resetCacheNoStoreSupported(); + expect(isCacheNoStoreSupported()).toBe(false); + + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + true, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + } finally { + // Restore original Request + globalThis.Request = OriginalRequest; + resetCacheNoStoreSupported(); + } + }); }); diff --git a/tests/wire/account.test.ts b/tests/wire/account.test.ts index 507359a..6902f7d 100644 --- a/tests/wire/account.test.ts +++ b/tests/wire/account.test.ts @@ -67,6 +67,7 @@ describe("AccountClient", () => { enabled: true, }, }; + server.mockEndpoint().get("/account").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.account.getAccount(); @@ -183,6 +184,7 @@ describe("AccountClient", () => { }, ], }; + server .mockEndpoint() .get("/organization/activities") @@ -217,6 +219,7 @@ describe("AccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/organization/activities") diff --git a/tests/wire/balance.test.ts b/tests/wire/balance.test.ts index 7d005b7..7acf454 100644 --- a/tests/wire/balance.test.ts +++ b/tests/wire/balance.test.ts @@ -21,6 +21,7 @@ describe("BalanceClient", () => { updatedAt: "updatedAt", value: 1, }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/active-balance") @@ -53,6 +54,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/active-balance") @@ -75,6 +77,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/active-balance") @@ -97,6 +100,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/active-balance") @@ -119,6 +123,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/active-balance") @@ -141,6 +146,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/active-balance") @@ -188,6 +194,7 @@ describe("BalanceClient", () => { }, ], }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions") @@ -234,6 +241,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions") @@ -254,6 +262,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions") @@ -274,6 +283,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions") @@ -294,6 +304,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions") @@ -335,6 +346,7 @@ describe("BalanceClient", () => { unit: "unit", updatedAt: "updatedAt", }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions") @@ -380,6 +392,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions") @@ -403,6 +416,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions") @@ -426,6 +440,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions") @@ -449,6 +464,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions") @@ -472,6 +488,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions") @@ -516,6 +533,7 @@ describe("BalanceClient", () => { unit: "unit", updatedAt: "updatedAt", }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -559,6 +577,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -580,6 +599,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -601,6 +621,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -622,6 +643,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -643,6 +665,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -685,6 +708,7 @@ describe("BalanceClient", () => { unit: "unit", updatedAt: "updatedAt", }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -731,6 +755,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -755,6 +780,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -779,6 +805,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -803,6 +830,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -827,6 +855,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -851,6 +880,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -893,6 +923,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -914,6 +945,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -935,6 +967,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -956,6 +989,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -977,6 +1011,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid") @@ -1015,6 +1050,7 @@ describe("BalanceClient", () => { updatedAt: "updatedAt", value: 1, }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") @@ -1058,6 +1094,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") @@ -1091,6 +1128,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") @@ -1124,6 +1162,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") @@ -1157,6 +1196,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") @@ -1190,6 +1230,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/balance-definitions/bdid/limits") @@ -1228,6 +1269,7 @@ describe("BalanceClient", () => { updatedAt: "updatedAt", value: 1, }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1260,6 +1302,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1282,6 +1325,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1304,6 +1348,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1326,6 +1371,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1348,6 +1394,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1387,6 +1434,7 @@ describe("BalanceClient", () => { updatedAt: "updatedAt", value: 1, }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1431,6 +1479,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1465,6 +1514,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1499,6 +1549,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1533,6 +1584,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1567,6 +1619,7 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1614,6 +1667,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1636,6 +1690,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1658,6 +1713,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1680,6 +1736,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1702,6 +1759,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid") @@ -1731,6 +1789,7 @@ describe("BalanceClient", () => { count: 1, loyaltyProgramId: "loyaltyProgramId", }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/contact-balances") @@ -1762,6 +1821,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/contact-balances") @@ -1782,6 +1842,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/contact-balances") @@ -1802,6 +1863,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/contact-balances") @@ -1822,6 +1884,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/contact-balances") @@ -1842,6 +1905,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/contact-balances") @@ -1881,6 +1945,7 @@ describe("BalanceClient", () => { transactionid: "transactionid", updatedAt: "updatedAt", }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/create-order") @@ -1927,6 +1992,7 @@ describe("BalanceClient", () => { source: "source", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/create-order") @@ -1959,6 +2025,7 @@ describe("BalanceClient", () => { source: "source", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/create-order") @@ -1991,6 +2058,7 @@ describe("BalanceClient", () => { source: "source", }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/create-order") @@ -2023,6 +2091,7 @@ describe("BalanceClient", () => { source: "source", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/create-order") @@ -2049,6 +2118,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { balance: [{ balanceDefinitionId: "balanceDefinitionId", value: 1.1 }] }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2076,6 +2146,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2097,6 +2168,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2118,6 +2190,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2139,6 +2212,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2160,6 +2234,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2191,6 +2266,7 @@ describe("BalanceClient", () => { loyaltyProgramId: "loyaltyProgramId", organizationId: 1, }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2223,6 +2299,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2246,6 +2323,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2269,6 +2347,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2292,6 +2371,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2315,6 +2395,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/subscriptions/cid/balances") @@ -2357,6 +2438,7 @@ describe("BalanceClient", () => { }, ], }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/transaction-history") @@ -2367,8 +2449,8 @@ describe("BalanceClient", () => { const response = await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); expect(response).toEqual({ balanceDefinitionId: "balanceDefinitionId", @@ -2399,6 +2481,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/transaction-history") @@ -2410,8 +2493,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnauthorizedError); }); @@ -2421,6 +2504,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/transaction-history") @@ -2432,8 +2516,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.ForbiddenError); }); @@ -2443,6 +2527,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/transaction-history") @@ -2454,8 +2539,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.NotFoundError); }); @@ -2465,6 +2550,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/transaction-history") @@ -2476,8 +2562,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnprocessableEntityError); }); @@ -2487,6 +2573,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/balance/programs/pid/transaction-history") @@ -2498,8 +2585,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.InternalServerError); }); @@ -2525,6 +2612,7 @@ describe("BalanceClient", () => { status: "status", updatedAt: "updatedAt", }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions") @@ -2565,6 +2653,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions") @@ -2588,6 +2677,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions") @@ -2611,6 +2701,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions") @@ -2634,6 +2725,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions") @@ -2657,6 +2749,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions") @@ -2696,6 +2789,7 @@ describe("BalanceClient", () => { status: "status", updatedAt: "updatedAt", }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/cancel") @@ -2734,6 +2828,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/cancel") @@ -2755,6 +2850,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/cancel") @@ -2776,6 +2872,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/cancel") @@ -2797,6 +2894,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/cancel") @@ -2818,6 +2916,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/cancel") @@ -2855,6 +2954,7 @@ describe("BalanceClient", () => { status: "status", updatedAt: "updatedAt", }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/complete") @@ -2893,6 +2993,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/complete") @@ -2914,6 +3015,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/complete") @@ -2935,6 +3037,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/complete") @@ -2956,6 +3059,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/complete") @@ -2977,6 +3081,7 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/balance/programs/pid/transactions/tid/complete") diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts index 9fcb13f..ee90cfc 100644 --- a/tests/wire/companies.test.ts +++ b/tests/wire/companies.test.ts @@ -33,6 +33,7 @@ describe("CompaniesClient", () => { }, ], }; + server.mockEndpoint().get("/companies").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.getAllCompanies(); @@ -67,6 +68,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/companies").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -79,6 +81,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "company" }; const rawResponseBody = { id: "61a5cd07ca1347c82306ad06" }; + server .mockEndpoint() .post("/companies") @@ -101,6 +104,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/companies") @@ -141,6 +145,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/companies/link-unlink/id") @@ -177,6 +182,7 @@ describe("CompaniesClient", () => { linkedContactsIds: [1, 2, 3], linkedDealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], }; + server.mockEndpoint().get("/companies/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.getACompany({ @@ -205,6 +211,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/companies/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -219,6 +226,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/companies/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -245,6 +253,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/companies/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -259,6 +268,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/companies/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -288,6 +298,7 @@ describe("CompaniesClient", () => { linkedContactsIds: [1, 2, 3], linkedDealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], }; + server .mockEndpoint() .patch("/companies/id") @@ -323,6 +334,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/companies/id") @@ -344,6 +356,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/companies/id") @@ -365,6 +378,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { attributeType: "text", label: "Attribute Label", objectType: "companies" }; const rawResponseBody = { id: "61a5cd07ca1347c82306ad07" }; + server .mockEndpoint() .post("/crm/attributes") @@ -389,6 +403,7 @@ describe("CompaniesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { attributeType: "text", label: "label", objectType: "companies" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/crm/attributes") @@ -407,6 +422,123 @@ describe("CompaniesClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); + test("deleteAnAttribute (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/crm/attributes/id").respondWith().statusCode(200).build(); + + const response = await client.companies.deleteAnAttribute({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("deleteAnAttribute (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/crm/attributes/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.deleteAnAttribute({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteAnAttribute (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/crm/attributes/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.deleteAnAttribute({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("updateAnAttribute (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + + server + .mockEndpoint() + .patch("/crm/attributes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.companies.updateAnAttribute({ + id: "id", + }); + expect(response).toEqual(undefined); + }); + + test("updateAnAttribute (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/crm/attributes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.updateAnAttribute({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("updateAnAttribute (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .patch("/crm/attributes/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.updateAnAttribute({ + id: "id", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + test("getCompanyAttributes", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -420,6 +552,7 @@ describe("CompaniesClient", () => { label: "Company Name", }, ]; + server .mockEndpoint() .get("/crm/attributes/companies") diff --git a/tests/wire/contacts.test.ts b/tests/wire/contacts.test.ts index b5f5d35..3a16f97 100644 --- a/tests/wire/contacts.test.ts +++ b/tests/wire/contacts.test.ts @@ -36,6 +36,7 @@ describe("ContactsClient", () => { ], count: 3, }; + server.mockEndpoint().get("/contacts").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.contacts.getContacts(); @@ -73,6 +74,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/contacts").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -85,6 +87,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server.mockEndpoint().get("/contacts").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -97,6 +100,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { id: 21 }; + server .mockEndpoint() .post("/contacts") @@ -117,6 +121,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts") @@ -136,6 +141,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { code: "invalid_parameter", message: "message" }; + server .mockEndpoint() .post("/contacts") @@ -210,6 +216,7 @@ describe("ContactsClient", () => { }, ], }; + server .mockEndpoint() .get("/contacts/attributes") @@ -336,6 +343,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/attributes/normal/attributeName") @@ -378,6 +386,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/contacts/attributes/category/attributeName") @@ -400,6 +409,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/contacts/attributes/category/attributeName") @@ -435,6 +445,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/attributes/normal/attributeName") @@ -456,6 +467,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/attributes/normal/attributeName") @@ -496,6 +508,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/attributes/multiple-choice/multipleChoiceAttribute/multipleChoiceAttributeOption") @@ -518,6 +531,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/attributes/multiple-choice/multipleChoiceAttribute/multipleChoiceAttributeOption") @@ -551,6 +565,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/batch") @@ -602,6 +617,7 @@ describe("ContactsClient", () => { templateId: 1000000, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/doubleOptinConfirmation") @@ -626,6 +642,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { customContactFilter: {} }; const rawResponseBody = { processId: 78 }; + server .mockEndpoint() .post("/contacts/export") @@ -648,6 +665,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { customContactFilter: {} }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/export") @@ -669,6 +687,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { customContactFilter: {} }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/contacts/export") @@ -696,6 +715,7 @@ describe("ContactsClient", () => { { id: 29, name: "Prestashop", totalBlacklisted: 10, totalSubscribers: 6543, uniqueSubscribers: 6553 }, ], }; + server.mockEndpoint().get("/contacts/folders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.contacts.getFolders(); @@ -725,6 +745,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/contacts/folders").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -737,6 +758,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { id: 5 }; + server .mockEndpoint() .post("/contacts/folders") @@ -757,6 +779,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/folders") @@ -782,6 +805,7 @@ describe("ContactsClient", () => { totalSubscribers: 16778, uniqueSubscribers: 17765, }; + server .mockEndpoint() .get("/contacts/folders/1000000") @@ -807,6 +831,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/folders/1000000") @@ -827,6 +852,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/folders/1000000") @@ -867,6 +893,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/contacts/folders/1000000") @@ -889,6 +916,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/contacts/folders/1000000") @@ -923,6 +951,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/folders/1000000") @@ -943,6 +972,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/folders/1000000") @@ -970,6 +1000,7 @@ describe("ContactsClient", () => { { id: 22, name: "VIP_Customer", totalBlacklisted: 72, totalSubscribers: 8753, uniqueSubscribers: 8826 }, ], }; + server .mockEndpoint() .get("/contacts/folders/1000000/lists") @@ -1014,6 +1045,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/folders/1000000/lists") @@ -1034,6 +1066,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/folders/1000000/lists") @@ -1054,6 +1087,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { processId: 78 }; + server .mockEndpoint() .post("/contacts/import") @@ -1074,6 +1108,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/import") @@ -1113,6 +1148,7 @@ describe("ContactsClient", () => { }, ], }; + server.mockEndpoint().get("/contacts/lists").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.contacts.getLists(); @@ -1144,6 +1180,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/contacts/lists").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1156,6 +1193,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { folderId: 2, name: "Magento Customer - ES" }; const rawResponseBody = { id: 5 }; + server .mockEndpoint() .post("/contacts/lists") @@ -1179,6 +1217,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { folderId: 1000000, name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/lists") @@ -1258,6 +1297,7 @@ describe("ContactsClient", () => { dynamicList: false, folderId: 1, }; + server .mockEndpoint() .get("/contacts/lists/1000000") @@ -1334,6 +1374,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/lists/1000000") @@ -1354,6 +1395,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/lists/1000000") @@ -1393,6 +1435,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/contacts/lists/1000000") @@ -1414,6 +1457,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/contacts/lists/1000000") @@ -1447,6 +1491,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/lists/1000000") @@ -1467,6 +1512,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/lists/1000000") @@ -1524,6 +1570,7 @@ describe("ContactsClient", () => { ], count: 17655, }; + server .mockEndpoint() .get("/contacts/lists/1000000/contacts") @@ -1580,6 +1627,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/lists/1000000/contacts") @@ -1600,6 +1648,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/lists/1000000/contacts") @@ -1627,6 +1676,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/add") @@ -1664,6 +1714,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/add") @@ -1701,6 +1752,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/add") @@ -1738,6 +1790,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/add") @@ -1775,6 +1828,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/add") @@ -1812,6 +1866,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/add") @@ -1842,6 +1897,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/add") @@ -1864,6 +1920,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/add") @@ -1893,6 +1950,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -1930,6 +1988,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -1967,6 +2026,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -2004,6 +2064,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -2041,6 +2102,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -2078,6 +2140,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -2115,6 +2178,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -2152,6 +2216,7 @@ describe("ContactsClient", () => { total: 27, }, }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -2182,6 +2247,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -2204,6 +2270,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/contacts/lists/1000000/contacts/remove") @@ -2232,6 +2299,7 @@ describe("ContactsClient", () => { { categoryName: "Name2", id: 50, segmentName: "Segment2", updatedAt: "2017-03-12T12:30:00Z" }, ], }; + server.mockEndpoint().get("/contacts/segments").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.contacts.getSegments(); @@ -2259,6 +2327,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/contacts/segments").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -2313,6 +2382,7 @@ describe("ContactsClient", () => { }, }, }; + server .mockEndpoint() .get("/contacts/identifier") @@ -2421,6 +2491,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/identifier") @@ -2441,6 +2512,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/identifier") @@ -2480,6 +2552,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/contacts/identifier") @@ -2501,6 +2574,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/contacts/identifier") @@ -2522,6 +2596,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { code: "invalid_parameter", message: "message" }; + server .mockEndpoint() .put("/contacts/identifier") @@ -2555,6 +2630,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/identifier") @@ -2575,6 +2651,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/contacts/identifier") @@ -2595,6 +2672,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .delete("/contacts/identifier") @@ -2647,6 +2725,7 @@ describe("ContactsClient", () => { userUnsubscription: [{ campaignId: 3, eventTime: "2017-03-12T20:15:13Z", ip: "165.87.3.15" }], }, }; + server .mockEndpoint() .get("/contacts/identifier/campaignStats") @@ -2754,6 +2833,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/identifier/campaignStats") @@ -2774,6 +2854,7 @@ describe("ContactsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/contacts/identifier/campaignStats") diff --git a/tests/wire/conversations.test.ts b/tests/wire/conversations.test.ts index 5c7a79e..cba337d 100644 --- a/tests/wire/conversations.test.ts +++ b/tests/wire/conversations.test.ts @@ -54,6 +54,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/conversations/agentOnlinePing") @@ -125,6 +126,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .post("/conversations/messages") @@ -275,6 +277,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .post("/conversations/messages") @@ -426,6 +429,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .post("/conversations/messages") @@ -523,6 +527,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: { key: "value" }, visitorId: { key: "value" } }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/conversations/messages") @@ -597,6 +602,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .get("/conversations/messages/id") @@ -690,6 +696,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/conversations/messages/id") @@ -710,6 +717,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/conversations/messages/id") @@ -778,6 +786,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .put("/conversations/messages/id") @@ -873,6 +882,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "text" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/conversations/messages/id") @@ -895,6 +905,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "text" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/conversations/messages/id") @@ -929,6 +940,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/conversations/messages/id") @@ -949,6 +961,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/conversations/messages/id") @@ -1021,6 +1034,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .post("/conversations/pushedMessages") @@ -1168,6 +1182,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .post("/conversations/pushedMessages") @@ -1315,6 +1330,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .post("/conversations/pushedMessages") @@ -1411,6 +1427,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: { key: "value" }, visitorId: { key: "value" } }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/conversations/pushedMessages") @@ -1485,6 +1502,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .get("/conversations/pushedMessages/id") @@ -1578,6 +1596,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/conversations/pushedMessages/id") @@ -1598,6 +1617,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/conversations/pushedMessages/id") @@ -1668,6 +1688,7 @@ describe("ConversationsClient", () => { type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; + server .mockEndpoint() .put("/conversations/pushedMessages/id") @@ -1763,6 +1784,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "text" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/conversations/pushedMessages/id") @@ -1785,6 +1807,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "text" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/conversations/pushedMessages/id") @@ -1819,6 +1842,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/conversations/pushedMessages/id") @@ -1839,6 +1863,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/conversations/pushedMessages/id") @@ -1859,6 +1884,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { groupId: "PjRBMhWGen6aRHjif" }; const rawResponseBody = { groupId: "PjRBMhWGen6aRHjif", visitorId: "AXCR3k9bpSY7bpuh7" }; + server .mockEndpoint() .put("/conversations/visitorGroup") @@ -1882,6 +1908,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { groupId: { key: "value" } }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/conversations/visitorGroup") @@ -1905,6 +1932,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { groupId: { key: "value" } }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/conversations/visitorGroup") diff --git a/tests/wire/coupons.test.ts b/tests/wire/coupons.test.ts index 9d5a22b..09de542 100644 --- a/tests/wire/coupons.test.ts +++ b/tests/wire/coupons.test.ts @@ -20,6 +20,7 @@ describe("CouponsClient", () => { remainingDaysAlert: 5, totalCoupons: 10000, }; + server.mockEndpoint().get("/couponCollections").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.coupons.getCouponCollections(); @@ -41,6 +42,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/couponCollections").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -53,6 +55,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/couponCollections").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -65,6 +68,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { defaultCoupon: "Winter", name: "10%OFF" }; const rawResponseBody = { id: "23befbae-1505-47a8-bd27-e30ef739f32c" }; + server .mockEndpoint() .post("/couponCollections") @@ -88,6 +92,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { defaultCoupon: "defaultCoupon", name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/couponCollections") @@ -110,6 +115,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { defaultCoupon: "defaultCoupon", name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/couponCollections") @@ -142,6 +148,7 @@ describe("CouponsClient", () => { remainingDaysAlert: 5, totalCoupons: 10000, }; + server .mockEndpoint() .get("/couponCollections/id") @@ -171,6 +178,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/couponCollections/id") @@ -191,6 +199,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/couponCollections/id") @@ -211,6 +220,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/couponCollections/id") @@ -235,6 +245,7 @@ describe("CouponsClient", () => { id: "23befbae-1505-47a8-bd27-e30ef739f32c", name: "SummerPromotions", }; + server .mockEndpoint() .patch("/couponCollections/id") @@ -259,6 +270,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/couponCollections/id") @@ -280,6 +292,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/couponCollections/id") @@ -315,6 +328,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { collectionId: "collectionId", coupons: ["coupons", "coupons"] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/coupons") @@ -337,6 +351,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { collectionId: "collectionId", coupons: ["coupons", "coupons"] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/coupons") @@ -359,6 +374,7 @@ describe("CouponsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { collectionId: "collectionId", coupons: ["coupons", "coupons"] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/coupons") diff --git a/tests/wire/customObjects.test.ts b/tests/wire/customObjects.test.ts index d1a829e..e4342da 100644 --- a/tests/wire/customObjects.test.ts +++ b/tests/wire/customObjects.test.ts @@ -10,6 +10,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}] }; const rawResponseBody = { message: "Batch object records are being processed", processId: 21 }; + server .mockEndpoint() .post("/objects/vehicle/batch/upsert") @@ -34,6 +35,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/objects/object_type/batch/upsert") @@ -56,6 +58,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/objects/object_type/batch/upsert") @@ -78,6 +81,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/objects/object_type/batch/upsert") @@ -100,6 +104,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/objects/object_type/batch/upsert") @@ -133,6 +138,7 @@ describe("CustomObjectsClient", () => { }, ], }; + server .mockEndpoint() .get("/objects/vehicle/records") @@ -185,6 +191,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/objects/object_type/records") @@ -207,6 +214,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/objects/object_type/records") @@ -229,6 +237,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/objects/object_type/records") @@ -251,6 +260,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/objects/object_type/records") @@ -273,6 +283,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { identifiers: { ext_ids: ["ext-001", "ext-002"] } }; const rawResponseBody = { processId: 21, message: "Batch object records are being processed for deletion." }; + server .mockEndpoint() .post("/objects/vehicle/batch/delete") @@ -299,6 +310,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/objects/object_type/batch/delete") @@ -320,6 +332,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/objects/object_type/batch/delete") @@ -341,6 +354,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/objects/object_type/batch/delete") @@ -362,6 +376,7 @@ describe("CustomObjectsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/objects/object_type/batch/delete") diff --git a/tests/wire/deals.test.ts b/tests/wire/deals.test.ts index 9827fb8..2c98dfc 100644 --- a/tests/wire/deals.test.ts +++ b/tests/wire/deals.test.ts @@ -18,6 +18,7 @@ describe("DealsClient", () => { label: "Deal Name", }, ]; + server .mockEndpoint() .get("/crm/attributes/deals") @@ -73,6 +74,7 @@ describe("DealsClient", () => { }, ], }; + server.mockEndpoint().get("/crm/deals").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.deals.getAllDeals(); @@ -109,6 +111,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/deals").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -121,6 +124,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "Deal: Connect with company" }; const rawResponseBody = { id: "61a5cd07ca1347c82306ad06" }; + server .mockEndpoint() .post("/crm/deals") @@ -143,6 +147,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/crm/deals") @@ -183,6 +188,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/crm/deals/link-unlink/id") @@ -222,6 +228,7 @@ describe("DealsClient", () => { linkedCompaniesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], linkedContactsIds: [1, 2, 3], }; + server.mockEndpoint().get("/crm/deals/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.deals.getADeal({ @@ -255,6 +262,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/deals/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -269,6 +277,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/deals/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -295,6 +304,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/deals/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -309,6 +319,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/deals/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -336,6 +347,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/crm/deals/id") @@ -357,6 +369,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/crm/deals/id") @@ -382,6 +395,7 @@ describe("DealsClient", () => { pipeline_name: "Sales Pipeline", stages: [{ id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", name: "New" }], }; + server .mockEndpoint() .get("/crm/pipeline/details") @@ -414,6 +428,7 @@ describe("DealsClient", () => { stages: [{ id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", name: "New" }], }, ]; + server .mockEndpoint() .get("/crm/pipeline/details/all") @@ -442,6 +457,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/crm/pipeline/details/all") @@ -466,6 +482,7 @@ describe("DealsClient", () => { stages: [{ id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", name: "New" }], }, ]; + server .mockEndpoint() .get("/crm/pipeline/details/pipelineID") @@ -496,6 +513,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/crm/pipeline/details/pipelineID") diff --git a/tests/wire/domains.test.ts b/tests/wire/domains.test.ts index e0e42c6..fe2911e 100644 --- a/tests/wire/domains.test.ts +++ b/tests/wire/domains.test.ts @@ -53,6 +53,7 @@ describe("DomainsClient", () => { current_page: 1, total_pages: 1, }; + server.mockEndpoint().get("/senders/domains").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.domains.getDomains(); @@ -107,6 +108,7 @@ describe("DomainsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/senders/domains").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -139,6 +141,7 @@ describe("DomainsClient", () => { }, }, }; + server .mockEndpoint() .post("/senders/domains") @@ -204,6 +207,7 @@ describe("DomainsClient", () => { }, }, }; + server .mockEndpoint() .post("/senders/domains") @@ -269,6 +273,7 @@ describe("DomainsClient", () => { }, }, }; + server .mockEndpoint() .post("/senders/domains") @@ -334,6 +339,7 @@ describe("DomainsClient", () => { }, }, }; + server .mockEndpoint() .post("/senders/domains") @@ -399,6 +405,7 @@ describe("DomainsClient", () => { }, }, }; + server .mockEndpoint() .post("/senders/domains") @@ -444,6 +451,7 @@ describe("DomainsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/senders/domains") @@ -484,6 +492,7 @@ describe("DomainsClient", () => { }, }, }; + server .mockEndpoint() .get("/senders/domains/domainName") @@ -546,6 +555,7 @@ describe("DomainsClient", () => { }, }, }; + server .mockEndpoint() .get("/senders/domains/domainName") @@ -589,6 +599,7 @@ describe("DomainsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/senders/domains/domainName") @@ -609,6 +620,7 @@ describe("DomainsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/senders/domains/domainName") @@ -641,6 +653,7 @@ describe("DomainsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/senders/domains/domainName") @@ -661,6 +674,7 @@ describe("DomainsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/senders/domains/domainName") @@ -684,6 +698,7 @@ describe("DomainsClient", () => { domain_name: "mycompany.com", message: "Domain has been authenticated successfully.", }; + server .mockEndpoint() .put("/senders/domains/domainName/authenticate") @@ -709,6 +724,7 @@ describe("DomainsClient", () => { domain_name: "newsletter.example.com", message: "Domain authentication completed. Your domain is now ready for sending.", }; + server .mockEndpoint() .put("/senders/domains/domainName/authenticate") @@ -731,6 +747,7 @@ describe("DomainsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/senders/domains/domainName/authenticate") @@ -751,6 +768,7 @@ describe("DomainsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/senders/domains/domainName/authenticate") diff --git a/tests/wire/ecommerce.test.ts b/tests/wire/ecommerce.test.ts index 24535a9..83a27c3 100644 --- a/tests/wire/ecommerce.test.ts +++ b/tests/wire/ecommerce.test.ts @@ -30,6 +30,7 @@ describe("EcommerceClient", () => { ], count: 2, }; + server.mockEndpoint().get("/categories").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.ecommerce.getCategories(); @@ -61,6 +62,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/categories").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -73,6 +75,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: "CAT123" }; const rawResponseBody = { id: 21 }; + server .mockEndpoint() .post("/categories") @@ -95,6 +98,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: "id" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/categories") @@ -116,6 +120,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { categories: [{ id: "CAT123" }] }; const rawResponseBody = { createdCount: 2, updatedCount: 7 }; + server .mockEndpoint() .post("/categories/batch") @@ -143,6 +148,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { categories: [{ id: "id" }, { id: "id" }] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/categories/batch") @@ -178,6 +184,7 @@ describe("EcommerceClient", () => { name: "Electronics", url: "http://mydomain.com/category/clothing", }; + server.mockEndpoint().get("/categories/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.ecommerce.getCategoryInfo({ @@ -198,6 +205,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/categories/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -212,6 +220,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/categories/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -236,6 +245,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/ecommerce/activate") @@ -254,6 +264,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/ecommerce/activate") @@ -278,6 +289,7 @@ describe("EcommerceClient", () => { ], totals: { averageBasket: 3.4, ordersCount: 500, revenue: 1700 }, }; + server .mockEndpoint() .get("/ecommerce/attribution/metrics") @@ -320,6 +332,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/ecommerce/attribution/metrics") @@ -345,6 +358,7 @@ describe("EcommerceClient", () => { revenue: 1.1, newCustomersCount: 1.1, }; + server .mockEndpoint() .get("/ecommerce/attribution/metrics/email_campaign/sale") @@ -372,6 +386,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/ecommerce/attribution/metrics/email_campaign/conversionSourceId") @@ -406,6 +421,7 @@ describe("EcommerceClient", () => { }, ], }; + server .mockEndpoint() .get("/ecommerce/attribution/products/email_campaign/sale") @@ -439,6 +455,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/ecommerce/attribution/products/email_campaign/conversionSourceId") @@ -460,6 +477,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { code: "EUR" }; + server .mockEndpoint() .get("/ecommerce/config/displayCurrency") @@ -479,6 +497,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/ecommerce/config/displayCurrency") @@ -497,6 +516,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/ecommerce/config/displayCurrency") @@ -515,6 +535,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/ecommerce/config/displayCurrency") @@ -533,6 +554,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { code: "EUR" }; const rawResponseBody = { code: "EUR" }; + server .mockEndpoint() .post("/ecommerce/config/displayCurrency") @@ -555,6 +577,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { code: "code" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/ecommerce/config/displayCurrency") @@ -576,6 +599,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { code: "code" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/ecommerce/config/displayCurrency") @@ -597,6 +621,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { code: "code" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/ecommerce/config/displayCurrency") @@ -618,6 +643,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { code: "code" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/ecommerce/config/displayCurrency") @@ -660,8 +686,8 @@ describe("EcommerceClient", () => { id: "order1803", identifiers: { ext_id: "ab12", loyalty_subscription_id: "1234" }, products: [ - { price: 100, productId: 21, quantity: 2, variantId: "P100" }, - { price: 100, productId: 21, quantity: 2, variantId: "P15756" }, + { price: 100, productId: 21, quantity: 2, quantityFloat: 0, variantId: "P100" }, + { price: 100, productId: 21, quantity: 0, quantityFloat: 2.52, variantId: "P15756" }, ], status: "complete", storeId: "123", @@ -669,6 +695,7 @@ describe("EcommerceClient", () => { }, ], }; + server.mockEndpoint().get("/orders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.ecommerce.getOrders(); @@ -701,12 +728,14 @@ describe("EcommerceClient", () => { price: 100, productId: 21, quantity: 2, + quantityFloat: 0, variantId: "P100", }, { price: 100, productId: 21, - quantity: 2, + quantity: 0, + quantityFloat: 2.52, variantId: "P15756", }, ], @@ -723,6 +752,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/orders").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -737,7 +767,7 @@ describe("EcommerceClient", () => { amount: 308.42, createdAt: "2021-07-29T20:59:23.383Z", id: "14", - products: [{ price: 99.99, productId: "P1", quantity: 10 }], + products: [{ price: 99.99, productId: "P1" }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z", }; @@ -752,7 +782,6 @@ describe("EcommerceClient", () => { { price: 99.99, productId: "P1", - quantity: 10, }, ], status: "completed", @@ -769,13 +798,14 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId", quantity: 1.1 }, - { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId" }, ], status: "status", updatedAt: "updatedAt", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/orders/status") @@ -794,12 +824,10 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", - quantity: 1.1, }, { price: 1.1, productId: "productId", - quantity: 1.1, }, ], status: "status", @@ -817,13 +845,14 @@ describe("EcommerceClient", () => { amount: 308.42, createdAt: "2021-07-29T20:59:23.383Z", id: "14", - products: [{ price: 99.99, productId: "P1", quantity: 10 }], + products: [{ price: 99.99, productId: "P1" }], status: "completed", updatedAt: "2021-07-30T10:59:23.383Z", }, ], }; const rawResponseBody = { batchId: 1.1, count: 17655 }; + server .mockEndpoint() .post("/orders/status/batch") @@ -843,7 +872,6 @@ describe("EcommerceClient", () => { { price: 99.99, productId: "P1", - quantity: 10, }, ], status: "completed", @@ -867,8 +895,8 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId", quantity: 1.1 }, - { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId" }, ], status: "status", updatedAt: "updatedAt", @@ -878,8 +906,8 @@ describe("EcommerceClient", () => { createdAt: "createdAt", id: "id", products: [ - { price: 1.1, productId: "productId", quantity: 1.1 }, - { price: 1.1, productId: "productId", quantity: 1.1 }, + { price: 1.1, productId: "productId" }, + { price: 1.1, productId: "productId" }, ], status: "status", updatedAt: "updatedAt", @@ -887,6 +915,7 @@ describe("EcommerceClient", () => { ], }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/orders/status/batch") @@ -907,12 +936,10 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", - quantity: 1.1, }, { price: 1.1, productId: "productId", - quantity: 1.1, }, ], status: "status", @@ -926,12 +953,10 @@ describe("EcommerceClient", () => { { price: 1.1, productId: "productId", - quantity: 1.1, }, { price: 1.1, productId: "productId", - quantity: 1.1, }, ], status: "status", @@ -950,8 +975,10 @@ describe("EcommerceClient", () => { count: 2, products: [ { + brand: "Adidas", categories: ["279638835374", "279502848174"], createdAt: "2022-06-30T10:29:16.078Z", + description: "Shoes for sports", id: "P11", imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", isDeleted: true, @@ -968,8 +995,10 @@ describe("EcommerceClient", () => { url: "https://mydomain.com/products/alpina-panoma-classic", }, { + brand: "Adidas", categories: ["2d79638835374", "27d9502848174"], createdAt: "2022-06-30T10:29:16.078Z", + description: "Shoes for sports", id: "P11", imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", isDeleted: true, @@ -987,6 +1016,7 @@ describe("EcommerceClient", () => { }, ], }; + server.mockEndpoint().get("/products").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.ecommerce.getProducts(); @@ -994,8 +1024,10 @@ describe("EcommerceClient", () => { count: 2, products: [ { + brand: "Adidas", categories: ["279638835374", "279502848174"], createdAt: "2022-06-30T10:29:16.078Z", + description: "Shoes for sports", id: "P11", imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", isDeleted: true, @@ -1015,8 +1047,10 @@ describe("EcommerceClient", () => { url: "https://mydomain.com/products/alpina-panoma-classic", }, { + brand: "Adidas", categories: ["2d79638835374", "27d9502848174"], createdAt: "2022-06-30T10:29:16.078Z", + description: "Shoes for sports", id: "P11", imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", isDeleted: true, @@ -1044,6 +1078,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/products").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1056,6 +1091,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: "P11", name: "Iphone 11" }; const rawResponseBody = { id: 21 }; + server .mockEndpoint() .post("/products") @@ -1079,6 +1115,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: "id", name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/products") @@ -1101,6 +1138,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { products: [{ id: "P11", name: "Iphone 11" }] }; const rawResponseBody = { createdCount: 2, updatedCount: 7 }; + server .mockEndpoint() .post("/products/batch") @@ -1134,6 +1172,7 @@ describe("EcommerceClient", () => { ], }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/products/batch") @@ -1164,8 +1203,10 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { + brand: "Adidas", categories: ["categories"], createdAt: "2017-05-12T12:30:00Z", + description: "Shoes for sports", id: "P11", imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", isDeleted: true, @@ -1181,14 +1222,17 @@ describe("EcommerceClient", () => { stock: 100, url: "http://mydomain.com/product/electronics/product1", }; + server.mockEndpoint().get("/products/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.ecommerce.getProductInfo({ id: "id", }); expect(response).toEqual({ + brand: "Adidas", categories: ["categories"], createdAt: "2017-05-12T12:30:00Z", + description: "Shoes for sports", id: "P11", imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", isDeleted: true, @@ -1214,6 +1258,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/products/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1228,6 +1273,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/products/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1262,6 +1308,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/products/id/alerts/back_in_stock") @@ -1284,6 +1331,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/products/id/alerts/back_in_stock") @@ -1306,6 +1354,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/products/id/alerts/back_in_stock") @@ -1328,6 +1377,7 @@ describe("EcommerceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/products/id/alerts/back_in_stock") diff --git a/tests/wire/emailCampaigns.test.ts b/tests/wire/emailCampaigns.test.ts index cf7e061..fe1ffa4 100644 --- a/tests/wire/emailCampaigns.test.ts +++ b/tests/wire/emailCampaigns.test.ts @@ -12,6 +12,7 @@ describe("EmailCampaignsClient", () => { const rawResponseBody = { campaigns: [ { + attachmentFile: "http://mydomain.com/campaign/attachment/file.pdf", abTesting: true, id: 12, name: "EN - Sales Summer 2017", @@ -40,6 +41,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["tag1", "tag2"], testSent: true, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -142,6 +144,7 @@ describe("EmailCampaignsClient", () => { }, }, { + attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -170,6 +173,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -274,12 +278,14 @@ describe("EmailCampaignsClient", () => { ], count: 2, }; + server.mockEndpoint().get("/emailCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.emailCampaigns.getEmailCampaigns(); expect(response).toEqual({ campaigns: [ { + attachmentFile: "http://mydomain.com/campaign/attachment/file.pdf", abTesting: true, id: 12, name: "EN - Sales Summer 2017", @@ -312,6 +318,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["tag1", "tag2"], testSent: true, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -422,6 +429,7 @@ describe("EmailCampaignsClient", () => { }, }, { + attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -454,6 +462,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://example.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -573,6 +582,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/emailCampaigns").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -585,6 +595,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "Newsletter - May 2017", sender: {} }; const rawResponseBody = { id: 5 }; + server .mockEndpoint() .post("/emailCampaigns") @@ -608,6 +619,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", sender: {} }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns") @@ -632,6 +644,7 @@ describe("EmailCampaignsClient", () => { const rawResponseBody = { url: "https://img.mailinblue.com/100000/images/rnb/original/62casdase8wewq9df1c2f27c.jpeg", }; + server .mockEndpoint() .post("/emailCampaigns/images") @@ -654,6 +667,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { imageUrl: "imageUrl" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/images") @@ -675,6 +689,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { + attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -703,6 +718,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -794,6 +810,7 @@ describe("EmailCampaignsClient", () => { }, }, }; + server .mockEndpoint() .get("/emailCampaigns/1000000") @@ -806,6 +823,7 @@ describe("EmailCampaignsClient", () => { campaignId: 1000000, }); expect(response).toEqual({ + attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", abTesting: true, id: 22, name: "Weekly - 1", @@ -838,6 +856,7 @@ describe("EmailCampaignsClient", () => { sentDate: "2018-12-01T16:30:00Z", shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", tag: "Newsletter", + tags: ["Newsletter", "Weekly"], testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", @@ -985,6 +1004,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/emailCampaigns/1000000") @@ -1005,6 +1025,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/emailCampaigns/1000000") @@ -1044,6 +1065,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/emailCampaigns/1000000") @@ -1065,6 +1087,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/emailCampaigns/1000000") @@ -1098,6 +1121,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/emailCampaigns/1000000") @@ -1118,6 +1142,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/emailCampaigns/1000000") @@ -1163,6 +1188,7 @@ describe("EmailCampaignsClient", () => { winningVersion: "B", winningVersionRate: "0%", }; + server .mockEndpoint() .get("/emailCampaigns/1000000/abTestCampaignResult") @@ -1241,6 +1267,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/emailCampaigns/1000000/abTestCampaignResult") @@ -1261,6 +1288,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/emailCampaigns/1000000/abTestCampaignResult") @@ -1281,6 +1309,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipientsType: "all" }; const rawResponseBody = { processId: 78 }; + server .mockEndpoint() .post("/emailCampaigns/1000000/exportRecipients") @@ -1304,6 +1333,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipientsType: "all" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/exportRecipients") @@ -1326,6 +1356,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipientsType: "all" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/exportRecipients") @@ -1360,6 +1391,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/sendNow") @@ -1380,6 +1412,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/sendNow") @@ -1400,6 +1433,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/sendNow") @@ -1450,6 +1484,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: { body: "body", to: ["to", "to"] } }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/sendReport") @@ -1477,6 +1512,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: { body: "body", to: ["to", "to"] } }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/sendReport") @@ -1524,6 +1560,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/sendTest") @@ -1546,6 +1583,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/emailCampaigns/1000000/sendTest") @@ -1570,6 +1608,7 @@ describe("EmailCampaignsClient", () => { const rawResponseBody = { sharedUrl: "https://my.brevo.com/pt2YU7R5W_guXlowgumy_VX4pFsKu._zd0Gjj96x1_GMmzc1Qps5ZIpj6nx-", }; + server .mockEndpoint() .get("/emailCampaigns/1000000/sharedUrl") @@ -1591,6 +1630,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/emailCampaigns/1000000/sharedUrl") @@ -1611,6 +1651,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/emailCampaigns/1000000/sharedUrl") @@ -1631,6 +1672,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/emailCampaigns/1000000/sharedUrl") @@ -1671,6 +1713,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/emailCampaigns/1000000/status") @@ -1693,6 +1736,7 @@ describe("EmailCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/emailCampaigns/1000000/status") diff --git a/tests/wire/event.test.ts b/tests/wire/event.test.ts index 80ed7f0..0cc7b84 100644 --- a/tests/wire/event.test.ts +++ b/tests/wire/event.test.ts @@ -5,6 +5,91 @@ import { BrevoClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("EventClient", () => { + test("getEvents (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + events: [ + { + contact_id: 211, + event_date: "2024-02-06T20:59:23Z", + event_name: "order_created", + event_filter_id: "abc123", + source: "api", + object_type: "subscription", + event_properties: { duration: 142, video_title: "Brevo — The most approachable CRM suite" }, + contact_properties: { AGE: 32, GENDER: "FEMALE" }, + }, + ], + count: 2, + }; + + server.mockEndpoint().get("/events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.event.getEvents(); + expect(response).toEqual({ + events: [ + { + contact_id: 211, + event_date: "2024-02-06T20:59:23Z", + event_name: "order_created", + event_filter_id: "abc123", + source: "api", + object_type: "subscription", + event_properties: { + duration: 142, + video_title: "Brevo \u2014 The most approachable CRM suite", + }, + contact_properties: { + AGE: 32, + GENDER: "FEMALE", + }, + }, + ], + count: 2, + }); + }); + + test("getEvents (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/events").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.event.getEvents(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getEvents (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/events").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.event.getEvents(); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("getEvents (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/events").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.event.getEvents(); + }).rejects.toThrow(Brevo.InternalServerError); + }); + test("createEvent (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -24,6 +109,7 @@ describe("EventClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event_name: "event_name", identifiers: {} }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/events") @@ -46,6 +132,7 @@ describe("EventClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event_name: "event_name", identifiers: {} }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/events") @@ -62,4 +149,98 @@ describe("EventClient", () => { }); }).rejects.toThrow(Brevo.UnauthorizedError); }); + + test("createBatchEvents (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = [{ event_name: "order_created", identifiers: {} }]; + const rawResponseBody = { + message: "Batch accepted. Valid events have been added to the processing queue.", + count: 7, + }; + + server + .mockEndpoint() + .post("/events/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.event.createBatchEvents([ + { + event_name: "order_created", + identifiers: {}, + }, + ]); + expect(response).toEqual({ + message: "Batch accepted. Valid events have been added to the processing queue.", + count: 7, + }); + }); + + test("createBatchEvents (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = [ + { event_name: "event_name", identifiers: {} }, + { event_name: "event_name", identifiers: {} }, + ]; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/events/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.event.createBatchEvents([ + { + event_name: "event_name", + identifiers: {}, + }, + { + event_name: "event_name", + identifiers: {}, + }, + ]); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("createBatchEvents (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = [ + { event_name: "event_name", identifiers: {} }, + { event_name: "event_name", identifiers: {} }, + ]; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .post("/events/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.event.createBatchEvents([ + { + event_name: "event_name", + identifiers: {}, + }, + { + event_name: "event_name", + identifiers: {}, + }, + ]); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); }); diff --git a/tests/wire/externalFeeds.test.ts b/tests/wire/externalFeeds.test.ts index 0022c4a..810d814 100644 --- a/tests/wire/externalFeeds.test.ts +++ b/tests/wire/externalFeeds.test.ts @@ -62,6 +62,7 @@ describe("ExternalFeedsClient", () => { }, ], }; + server.mockEndpoint().get("/feeds").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.externalFeeds.getAllExternalFeeds({ @@ -144,6 +145,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/feeds").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -156,6 +158,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/feeds").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -174,6 +177,7 @@ describe("ExternalFeedsClient", () => { cache: true, }; const rawResponseBody = { id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" }; + server .mockEndpoint() .post("/feeds") @@ -206,6 +210,7 @@ describe("ExternalFeedsClient", () => { cache: true, }; const rawResponseBody = { id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" }; + server .mockEndpoint() .post("/feeds") @@ -238,6 +243,7 @@ describe("ExternalFeedsClient", () => { cache: true, }; const rawResponseBody = { id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6" }; + server .mockEndpoint() .post("/feeds") @@ -264,6 +270,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", url: "url" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/feeds") @@ -298,6 +305,7 @@ describe("ExternalFeedsClient", () => { createdAt: "2025-09-18T13:29:27Z", modifiedAt: "2025-09-18T13:29:27Z", }; + server .mockEndpoint() .get("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") @@ -341,6 +349,7 @@ describe("ExternalFeedsClient", () => { createdAt: "2025-09-17T16:03:25Z", modifiedAt: "2025-09-17T16:03:25Z", }; + server .mockEndpoint() .get("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") @@ -384,6 +393,7 @@ describe("ExternalFeedsClient", () => { createdAt: "2025-09-05T09:06:42Z", modifiedAt: "2025-09-05T09:06:42Z", }; + server .mockEndpoint() .get("/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6") @@ -415,6 +425,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/feeds/uuid").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -429,6 +440,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/feeds/uuid").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -586,6 +598,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/feeds/uuid") @@ -607,6 +620,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/feeds/uuid") @@ -645,6 +659,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/feeds/uuid").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -659,6 +674,7 @@ describe("ExternalFeedsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/feeds/uuid").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tests/wire/files.test.ts b/tests/wire/files.test.ts index 98795fa..dff749e 100644 --- a/tests/wire/files.test.ts +++ b/tests/wire/files.test.ts @@ -20,6 +20,7 @@ describe("FilesClient", () => { size: 10, }, ]; + server.mockEndpoint().get("/crm/files").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.files.getAllFiles(); @@ -41,6 +42,7 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -53,6 +55,7 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { fileUrl: "https://storage.googleapis.com/brevo-app-crm.......-sample.pdf" }; + server.mockEndpoint().get("/crm/files/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.files.downloadAFile({ @@ -68,6 +71,7 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -82,6 +86,7 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -108,6 +113,7 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/files/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -122,6 +128,7 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/files/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -144,6 +151,7 @@ describe("FilesClient", () => { name: "example.png", size: 10, }; + server.mockEndpoint().get("/crm/files/id/data").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.files.getFileDetails({ @@ -165,6 +173,7 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files/id/data").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -179,6 +188,7 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/files/id/data").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tests/wire/inboundParsing.test.ts b/tests/wire/inboundParsing.test.ts index 4445cc0..aeb985f 100644 --- a/tests/wire/inboundParsing.test.ts +++ b/tests/wire/inboundParsing.test.ts @@ -25,6 +25,7 @@ describe("InboundParsingClient", () => { }, ], }; + server.mockEndpoint().get("/inbound/events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.inboundParsing.getInboundEmailEvents(); @@ -51,6 +52,7 @@ describe("InboundParsingClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/inbound/events").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -76,6 +78,7 @@ describe("InboundParsingClient", () => { sender: "alice@example.com", subject: "Re: Question about your API", }; + server .mockEndpoint() .get("/inbound/events/uuid") @@ -123,6 +126,7 @@ describe("InboundParsingClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/inbound/events/uuid") diff --git a/tests/wire/masterAccount.test.ts b/tests/wire/masterAccount.test.ts index bf32fb1..770a3c8 100644 --- a/tests/wire/masterAccount.test.ts +++ b/tests/wire/masterAccount.test.ts @@ -10,6 +10,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { groupName: "My group" }; const rawResponseBody = { id: "659xxxxxxxxxxxxxxxx6ef9c8" }; + server .mockEndpoint() .post("/corporate/group") @@ -32,6 +33,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { groupName: "groupName" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/group") @@ -73,6 +75,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { subAccountIds: [1000000, 1000000] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/group/unlink/groupId/subAccounts") @@ -105,6 +108,7 @@ describe("MasterAccountClient", () => { { email: "your-user@your-org.com", firstName: "firstName", lastName: "lastName" }, ], }; + server .mockEndpoint() .get("/corporate/group/id") @@ -167,6 +171,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/group/id") @@ -200,6 +205,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/corporate/group/id") @@ -224,6 +230,7 @@ describe("MasterAccountClient", () => { { groupName: "My group 2", id: "a5b192a709d6ed67ef8fd922" }, { groupName: "My group 3", id: "bbb142c709d6ed67ef1cd910" }, ]; + server.mockEndpoint().get("/corporate/groups").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.masterAccount.getSubAccountGroups(); @@ -283,6 +290,7 @@ describe("MasterAccountClient", () => { }, ], }; + server .mockEndpoint() .get("/corporate/invited/users") @@ -344,6 +352,7 @@ describe("MasterAccountClient", () => { { domain: "example.com", ip: "192.168.1.1", transactional: true }, { domain: "example.com", ip: "192.168.1.2", transactional: false }, ]; + server.mockEndpoint().get("/corporate/ip").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.masterAccount.listOfAllIPs(); @@ -398,6 +407,7 @@ describe("MasterAccountClient", () => { }, timezone: "Europe/Paris", }; + server .mockEndpoint() .get("/corporate/masterAccount") @@ -480,6 +490,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/corporate/masterAccount") @@ -498,6 +509,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "vipin+ent-user@brevo.com" }; const rawResponseBody = { token: "5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0" }; + server .mockEndpoint() .post("/corporate/ssoToken") @@ -520,6 +532,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "email" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/ssoToken") @@ -541,6 +554,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "email" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/ssoToken") @@ -578,6 +592,7 @@ describe("MasterAccountClient", () => { { active: true, companyName: "Company3", createdAt: 1614713641, groups: [{}], id: 3524191 }, ], }; + server .mockEndpoint() .get("/corporate/subAccount") @@ -632,6 +647,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/corporate/subAccount") @@ -659,6 +675,7 @@ describe("MasterAccountClient", () => { timezone: "Europe/Paris", }; const rawResponseBody = { id: 4109344 }; + server .mockEndpoint() .post("/corporate/subAccount") @@ -685,6 +702,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { companyName: "companyName", email: "email" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/subAccount") @@ -707,6 +725,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { ids: [234322, 325553, 893432], ip: "103.11.32.88" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/subAccount/ip/associate") @@ -730,6 +749,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { ids: [1000000, 1000000], ip: "ip" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/subAccount/ip/associate") @@ -772,6 +792,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { ids: [1000000, 1000000], ip: "ip" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/subAccount/ip/dissociate") @@ -794,6 +815,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: 3232323, name: "My Api Key" }; const rawResponseBody = { key: "xkeysib-21881axxxxxcc92e04-mIrexxxx7z", status: "success" }; + server .mockEndpoint() .post("/corporate/subAccount/key") @@ -818,6 +840,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: 1000000, name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/subAccount/key") @@ -840,6 +863,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: 3232323 }; const rawResponseBody = { token: "5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0" }; + server .mockEndpoint() .post("/corporate/subAccount/ssoToken") @@ -862,6 +886,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: 1000000 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/subAccount/ssoToken") @@ -883,6 +908,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: 1000000 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/subAccount/ssoToken") @@ -928,6 +954,7 @@ describe("MasterAccountClient", () => { planType: "paid", }, }; + server .mockEndpoint() .get("/corporate/subAccount/1000000") @@ -1004,6 +1031,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/corporate/subAccount/1000000") @@ -1036,6 +1064,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/corporate/subAccount/1000000") @@ -1056,6 +1085,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/corporate/subAccount/1000000") @@ -1106,6 +1136,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/subAccount/1000000/applications/toggle") @@ -1127,6 +1158,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/subAccount/1000000/applications/toggle") @@ -1183,6 +1215,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/subAccount/1000000/plan") @@ -1204,6 +1237,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/subAccount/1000000/plan") @@ -1260,6 +1294,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/subAccounts/plan") @@ -1279,6 +1314,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/subAccounts/plan") @@ -1298,6 +1334,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { all_features_access: true, email: "inviteuser@example.com", privileges: [{}] }; const rawResponseBody = { id: "659xxxxxxxxxxxxxxxx6ef9c8" }; + server .mockEndpoint() .post("/corporate/user/invitation/send") @@ -1322,6 +1359,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { all_features_access: true, email: "email", privileges: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/corporate/user/invitation/send") @@ -1345,6 +1383,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "Invitation resent successfully" }; + server .mockEndpoint() .put("/corporate/user/invitation/resend/email") @@ -1367,6 +1406,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/user/invitation/resend/email") @@ -1400,6 +1440,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/corporate/user/revoke/email") @@ -1437,6 +1478,7 @@ describe("MasterAccountClient", () => { ], status: "active", }; + server .mockEndpoint() .get("/corporate/user/email/permissions") @@ -1479,6 +1521,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/corporate/user/email/permissions") @@ -1570,6 +1613,7 @@ describe("MasterAccountClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { all_features_access: true, privileges: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/corporate/user/email/permissions") diff --git a/tests/wire/notes.test.ts b/tests/wire/notes.test.ts index 545c01c..419d88f 100644 --- a/tests/wire/notes.test.ts +++ b/tests/wire/notes.test.ts @@ -26,6 +26,7 @@ describe("NotesClient", () => { updatedAt: "2017-05-01T17:05:03Z", }, ]; + server.mockEndpoint().get("/crm/notes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.notes.getAllNotes(); @@ -55,6 +56,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/notes").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -67,6 +69,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "In communication with client_dev for resolution of queries." }; const rawResponseBody = { id: "61a5cd07ca1347c82306ad09" }; + server .mockEndpoint() .post("/crm/notes") @@ -89,6 +92,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "x" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/crm/notes") @@ -110,6 +114,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "x" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/crm/notes") @@ -145,6 +150,7 @@ describe("NotesClient", () => { text: "In communication with client_dev for resolution of queries.", updatedAt: "2017-05-01T17:05:03Z", }; + server.mockEndpoint().get("/crm/notes/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.notes.getANote({ @@ -174,6 +180,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/notes/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -188,6 +195,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/notes/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -214,6 +222,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/notes/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -228,6 +237,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/notes/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -258,6 +268,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "x" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/crm/notes/id") @@ -282,6 +293,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "x" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/crm/notes/id") @@ -306,6 +318,7 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { text: "x" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .patch("/crm/notes/id") diff --git a/tests/wire/payments.test.ts b/tests/wire/payments.test.ts index 8e9056b..8ca42e3 100644 --- a/tests/wire/payments.test.ts +++ b/tests/wire/payments.test.ts @@ -14,6 +14,7 @@ describe("PaymentsClient", () => { reference: "Invoice #INV0001", }; const rawResponseBody = { id: 122, url: "https://pay.brevo.com/payment/6d4ec0b2b48ef803df4103ve" }; + server .mockEndpoint() .post("/payments/requests") @@ -46,6 +47,7 @@ describe("PaymentsClient", () => { reference: "reference", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/payments/requests") @@ -76,6 +78,7 @@ describe("PaymentsClient", () => { reference: "reference", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/payments/requests") @@ -106,6 +109,7 @@ describe("PaymentsClient", () => { reference: "reference", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/payments/requests") @@ -140,6 +144,7 @@ describe("PaymentsClient", () => { reference: "Invoice #INV0001\n", status: "paid", }; + server .mockEndpoint() .get("/payments/requests/050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc") @@ -175,6 +180,7 @@ describe("PaymentsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/payments/requests/id") @@ -195,6 +201,7 @@ describe("PaymentsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/payments/requests/id") @@ -215,6 +222,7 @@ describe("PaymentsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/payments/requests/id") @@ -235,6 +243,7 @@ describe("PaymentsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/payments/requests/id") @@ -272,6 +281,7 @@ describe("PaymentsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/payments/requests/id") @@ -292,6 +302,7 @@ describe("PaymentsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/payments/requests/id") @@ -312,6 +323,7 @@ describe("PaymentsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/payments/requests/id") diff --git a/tests/wire/process.test.ts b/tests/wire/process.test.ts index fdb41ab..141be90 100644 --- a/tests/wire/process.test.ts +++ b/tests/wire/process.test.ts @@ -41,6 +41,7 @@ describe("ProcessClient", () => { }, ], }; + server.mockEndpoint().get("/processes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.process.getProcesses(); @@ -83,6 +84,7 @@ describe("ProcessClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/processes").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -115,6 +117,7 @@ describe("ProcessClient", () => { created_at: "2024-01-15T10:30:00Z", completed_at: "2024-01-15T10:32:15Z", }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.process.getProcess({ @@ -160,6 +163,7 @@ describe("ProcessClient", () => { created_at: "2024-01-15T10:30:00Z", completed_at: "2024-01-15T10:32:15Z", }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.process.getProcess({ @@ -207,6 +211,7 @@ describe("ProcessClient", () => { created_at: "2024-01-15T10:30:00Z", completed_at: "2024-01-15T10:32:15Z", }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.process.getProcess({ @@ -263,6 +268,7 @@ describe("ProcessClient", () => { created_at: "2024-01-15T10:30:00Z", completed_at: "2024-01-15T10:32:15Z", }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.process.getProcess({ @@ -299,6 +305,7 @@ describe("ProcessClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -313,6 +320,7 @@ describe("ProcessClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { diff --git a/tests/wire/program.test.ts b/tests/wire/program.test.ts index 44e2bcc..fe78dfd 100644 --- a/tests/wire/program.test.ts +++ b/tests/wire/program.test.ts @@ -27,6 +27,7 @@ describe("ProgramClient", () => { }, ], }; + server .mockEndpoint() .get("/loyalty/config/programs") @@ -63,6 +64,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs") @@ -81,6 +83,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs") @@ -99,6 +102,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs") @@ -117,6 +121,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs") @@ -135,6 +140,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/config/programs") @@ -153,6 +159,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs") @@ -184,6 +191,7 @@ describe("ProgramClient", () => { subscriptionPoolId: "subscriptionPoolId", updatedAt: "updatedAt", }; + server .mockEndpoint() .post("/loyalty/config/programs") @@ -219,6 +227,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs") @@ -240,6 +249,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs") @@ -261,6 +271,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/config/programs") @@ -282,6 +293,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/config/programs") @@ -303,6 +315,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs") @@ -337,6 +350,7 @@ describe("ProgramClient", () => { subscriptionPoolId: "subscriptionPoolId", updatedAt: "updatedAt", }; + server .mockEndpoint() .get("/loyalty/config/programs/pid") @@ -371,6 +385,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid") @@ -391,6 +406,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid") @@ -411,6 +427,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid") @@ -431,6 +448,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid") @@ -451,6 +469,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid") @@ -484,6 +503,7 @@ describe("ProgramClient", () => { subscriptionPoolId: "subscriptionPoolId", updatedAt: "updatedAt", }; + server .mockEndpoint() .put("/loyalty/config/programs/pid") @@ -520,6 +540,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/config/programs/pid") @@ -542,6 +563,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/config/programs/pid") @@ -564,6 +586,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/config/programs/pid") @@ -586,6 +609,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .put("/loyalty/config/programs/pid") @@ -608,6 +632,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .put("/loyalty/config/programs/pid") @@ -630,6 +655,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/config/programs/pid") @@ -664,6 +690,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid") @@ -684,6 +711,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid") @@ -704,6 +732,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid") @@ -724,6 +753,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid") @@ -744,6 +774,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid") @@ -777,6 +808,7 @@ describe("ProgramClient", () => { subscriptionPoolId: "subscriptionPoolId", updatedAt: "updatedAt", }; + server .mockEndpoint() .patch("/loyalty/config/programs/pid") @@ -812,6 +844,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/loyalty/config/programs/pid") @@ -833,6 +866,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/loyalty/config/programs/pid") @@ -854,6 +888,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/loyalty/config/programs/pid") @@ -875,6 +910,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .patch("/loyalty/config/programs/pid") @@ -896,6 +932,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .patch("/loyalty/config/programs/pid") @@ -917,6 +954,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/loyalty/config/programs/pid") @@ -965,6 +1003,7 @@ describe("ProgramClient", () => { }, ], }; + server .mockEndpoint() .get("/loyalty/config/programs/pid/account-info") @@ -1025,6 +1064,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid/account-info") @@ -1045,6 +1085,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid/account-info") @@ -1065,6 +1106,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid/account-info") @@ -1085,6 +1127,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid/account-info") @@ -1105,6 +1148,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/config/programs/pid/account-info") @@ -1120,6 +1164,151 @@ describe("ProgramClient", () => { }).rejects.toThrow(Brevo.InternalServerError); }); + test("deleteContactSubscription (1)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/loyalty/config/programs/pid/contact/1").respondWith().statusCode(200).build(); + + const response = await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + expect(response).toEqual(undefined); + }); + + test("deleteContactSubscription (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("deleteContactSubscription (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.UnauthorizedError); + }); + + test("deleteContactSubscription (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteContactSubscription (5)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + + test("deleteContactSubscription (6)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.UnprocessableEntityError); + }); + + test("deleteContactSubscription (7)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/loyalty/config/programs/pid/contact/1") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.program.deleteContactSubscription({ + pid: "pid", + cid: 1, + }); + }).rejects.toThrow(Brevo.InternalServerError); + }); + test("publishLoyaltyProgram (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -1137,6 +1326,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/publish") @@ -1157,6 +1347,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/publish") @@ -1177,6 +1368,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/publish") @@ -1197,6 +1389,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/publish") @@ -1217,6 +1410,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/publish") @@ -1243,6 +1437,7 @@ describe("ProgramClient", () => { ownerContactId: 1, updatedAt: "updatedAt", }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscription-members") @@ -1270,6 +1465,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { memberContactIds: [1, 1] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscription-members") @@ -1292,6 +1488,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { memberContactIds: [1, 1] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscription-members") @@ -1314,6 +1511,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { memberContactIds: [1, 1] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscription-members") @@ -1336,6 +1534,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { memberContactIds: [1, 1] }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscription-members") @@ -1358,6 +1557,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { memberContactIds: [1, 1] }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscription-members") @@ -1380,6 +1580,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { memberContactIds: [1, 1] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscription-members") @@ -1420,6 +1621,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid/subscription-members") @@ -1441,6 +1643,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid/subscription-members") @@ -1462,6 +1665,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid/subscription-members") @@ -1483,6 +1687,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid/subscription-members") @@ -1504,6 +1709,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid/subscription-members") @@ -1525,6 +1731,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/config/programs/pid/subscription-members") @@ -1554,6 +1761,7 @@ describe("ProgramClient", () => { updatedAt: "updatedAt", versionId: 1, }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscriptions") @@ -1583,6 +1791,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contactId: 1 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscriptions") @@ -1605,6 +1814,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contactId: 1 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscriptions") @@ -1627,6 +1837,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contactId: 1 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscriptions") @@ -1649,6 +1860,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contactId: 1 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscriptions") @@ -1671,6 +1883,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contactId: 1 }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscriptions") @@ -1693,6 +1906,7 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contactId: 1 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/config/programs/pid/subscriptions") diff --git a/tests/wire/reward.test.ts b/tests/wire/reward.test.ts index d3a03e2..476fc18 100644 --- a/tests/wire/reward.test.ts +++ b/tests/wire/reward.test.ts @@ -10,6 +10,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { count: 1000000 }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") @@ -32,6 +33,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") @@ -53,6 +55,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") @@ -74,6 +77,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") @@ -95,6 +99,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") @@ -116,6 +121,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/code-pools/cpid/codes-count") @@ -152,6 +158,7 @@ describe("RewardClient", () => { ], totalCount: 1, }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/offers") @@ -186,6 +193,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/offers") @@ -206,6 +214,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/offers") @@ -226,6 +235,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/offers") @@ -246,6 +256,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/offers") @@ -266,6 +277,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/offers") @@ -286,6 +298,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/offers") @@ -315,6 +328,7 @@ describe("RewardClient", () => { publicName: "publicName", updatedAt: "updatedAt", }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/offers") @@ -345,6 +359,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/offers") @@ -367,6 +382,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/offers") @@ -389,6 +405,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/offers") @@ -411,6 +428,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/offers") @@ -445,6 +463,7 @@ describe("RewardClient", () => { updatedAt: "2024-01-15T09:30:00Z", value: 1.1, }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/attribute") @@ -480,6 +499,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { rewardId: "rewardId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/attribute") @@ -502,6 +522,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { rewardId: "rewardId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/attribute") @@ -524,6 +545,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { rewardId: "rewardId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/attribute") @@ -546,6 +568,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { rewardId: "rewardId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/attribute") @@ -568,6 +591,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { rewardId: "rewardId" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/attribute") @@ -590,6 +614,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { rewardId: "rewardId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/attribute") @@ -627,6 +652,7 @@ describe("RewardClient", () => { status: "status", updatedAt: "2024-01-15T09:30:00Z", }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -664,6 +690,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -685,6 +712,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -706,6 +734,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -727,6 +756,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -748,6 +778,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -769,6 +800,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -790,6 +822,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -811,6 +844,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem") @@ -847,6 +881,7 @@ describe("RewardClient", () => { status: "status", updatedAt: "2024-01-15T09:30:00Z", }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -884,6 +919,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -905,6 +941,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -926,6 +963,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -947,6 +985,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -968,6 +1007,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -989,6 +1029,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -1010,6 +1051,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -1031,6 +1073,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/redeem/tid/complete") @@ -1069,6 +1112,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/offer/programs/pid/rewards/revoke") @@ -1089,6 +1133,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/offer/programs/pid/rewards/revoke") @@ -1109,6 +1154,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { authorize: true }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/validate") @@ -1131,6 +1177,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/validate") @@ -1152,6 +1199,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/validate") @@ -1173,6 +1221,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/validate") @@ -1194,6 +1243,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/validate") @@ -1215,6 +1265,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/validate") @@ -1236,6 +1287,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/offer/programs/pid/rewards/validate") @@ -1330,6 +1382,7 @@ describe("RewardClient", () => { value: 1.1, valueType: "valueType", }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/rewards/rid") @@ -1443,6 +1496,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/rewards/rid") @@ -1464,6 +1518,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/rewards/rid") @@ -1485,6 +1540,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/rewards/rid") @@ -1506,6 +1562,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/rewards/rid") @@ -1527,6 +1584,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/rewards/rid") @@ -1548,6 +1606,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/rewards/rid") @@ -1588,6 +1647,7 @@ describe("RewardClient", () => { loyaltyProgramId: "loyaltyProgramId", loyaltySubscriptionId: "loyaltySubscriptionId", }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/vouchers") @@ -1629,6 +1689,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/vouchers") @@ -1650,6 +1711,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/vouchers") @@ -1671,6 +1733,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/vouchers") @@ -1692,6 +1755,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/vouchers") @@ -1713,6 +1777,7 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/offer/programs/pid/vouchers") diff --git a/tests/wire/senders.test.ts b/tests/wire/senders.test.ts index 183fc00..f463646 100644 --- a/tests/wire/senders.test.ts +++ b/tests/wire/senders.test.ts @@ -34,6 +34,7 @@ describe("SendersClient", () => { }, ], }; + server.mockEndpoint().get("/senders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.senders.getSenders(); @@ -107,6 +108,7 @@ describe("SendersClient", () => { }, ], }; + server.mockEndpoint().get("/senders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.senders.getSenders(); @@ -152,6 +154,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/senders").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -164,6 +167,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "support@example.com", name: "Support Team" }; const rawResponseBody = { dkimError: false, id: 15, spfError: false }; + server .mockEndpoint() .post("/senders") @@ -193,6 +197,7 @@ describe("SendersClient", () => { name: "Marketing Team", }; const rawResponseBody = { dkimError: false, id: 15, spfError: false }; + server .mockEndpoint() .post("/senders") @@ -232,6 +237,7 @@ describe("SendersClient", () => { name: "Newsletter", }; const rawResponseBody = { dkimError: false, id: 15, spfError: false }; + server .mockEndpoint() .post("/senders") @@ -269,6 +275,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "support@example.com", name: "Support Team" }; const rawResponseBody = { dkimError: false, id: 15, spfError: false }; + server .mockEndpoint() .post("/senders") @@ -294,6 +301,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "support@example.com", name: "Support Team" }; const rawResponseBody = { dkimError: true, id: 16, spfError: false }; + server .mockEndpoint() .post("/senders") @@ -319,6 +327,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: "email", name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/senders") @@ -343,6 +352,7 @@ describe("SendersClient", () => { const rawResponseBody = { ips: [{ active: true, domain: "mailing.enterprise.com", id: 3, ip: "192.168.1.100" }], }; + server.mockEndpoint().get("/senders/ips").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.senders.getIps(); @@ -369,6 +379,7 @@ describe("SendersClient", () => { { active: false, domain: "notifications.enterprise.com", id: 6, ip: "192.168.1.102" }, ], }; + server.mockEndpoint().get("/senders/ips").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.senders.getIps(); @@ -401,6 +412,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/senders/ips").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -516,6 +528,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/senders/1000000") @@ -537,6 +550,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/senders/1000000") @@ -570,6 +584,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/senders/1000000") @@ -590,6 +605,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/senders/1000000") @@ -610,6 +626,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { ips: [{ domain: "mailing.enterprise.com", id: 3, ip: "192.168.1.100", weight: 75 }] }; + server .mockEndpoint() .get("/senders/1000000/ips") @@ -643,6 +660,7 @@ describe("SendersClient", () => { { domain: "newsletter.enterprise.com", id: 5, ip: "192.168.1.101", weight: 60 }, ], }; + server .mockEndpoint() .get("/senders/1000000/ips") @@ -677,6 +695,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/senders/1000000/ips") @@ -697,6 +716,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/senders/1000000/ips") @@ -757,6 +777,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { otp: 999999 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/senders/1000000/validate") @@ -779,6 +800,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { otp: 999999 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/senders/1000000/validate") diff --git a/tests/wire/smsCampaigns.test.ts b/tests/wire/smsCampaigns.test.ts index 8892932..6298783 100644 --- a/tests/wire/smsCampaigns.test.ts +++ b/tests/wire/smsCampaigns.test.ts @@ -54,6 +54,7 @@ describe("SmsCampaignsClient", () => { ], count: 12, }; + server.mockEndpoint().get("/smsCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.smsCampaigns.getSmsCampaigns(); @@ -115,6 +116,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/smsCampaigns").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -131,6 +133,7 @@ describe("SmsCampaignsClient", () => { sender: "MyShop", }; const rawResponseBody = { id: 5 }; + server .mockEndpoint() .post("/smsCampaigns") @@ -155,6 +158,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { content: "content", name: "name", sender: "sender" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns") @@ -197,6 +201,7 @@ describe("SmsCampaignsClient", () => { unsubscriptions: 3, }, }; + server .mockEndpoint() .get("/smsCampaigns/1000000") @@ -238,6 +243,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smsCampaigns/1000000") @@ -258,6 +264,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smsCampaigns/1000000") @@ -297,6 +304,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/smsCampaigns/1000000") @@ -318,6 +326,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/smsCampaigns/1000000") @@ -351,6 +360,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smsCampaigns/1000000") @@ -371,6 +381,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smsCampaigns/1000000") @@ -391,6 +402,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipientsType: "all" }; const rawResponseBody = { processId: 78 }; + server .mockEndpoint() .post("/smsCampaigns/1000000/exportRecipients") @@ -414,6 +426,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipientsType: "all" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/exportRecipients") @@ -436,6 +449,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipientsType: "all" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/exportRecipients") @@ -470,6 +484,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/sendNow") @@ -490,6 +505,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/sendNow") @@ -510,6 +526,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/sendNow") @@ -560,6 +577,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: { body: "body", to: ["to", "to"] } }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/sendReport") @@ -587,6 +605,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { email: { body: "body", to: ["to", "to"] } }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/sendReport") @@ -633,6 +652,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/sendTest") @@ -654,6 +674,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smsCampaigns/1000000/sendTest") @@ -695,6 +716,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/smsCampaigns/1000000/status") @@ -717,6 +739,7 @@ describe("SmsCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/smsCampaigns/1000000/status") diff --git a/tests/wire/smsTemplates.test.ts b/tests/wire/smsTemplates.test.ts index 00e6d68..7338e8b 100644 --- a/tests/wire/smsTemplates.test.ts +++ b/tests/wire/smsTemplates.test.ts @@ -29,6 +29,7 @@ describe("SmsTemplatesClient", () => { }, ], }; + server .mockEndpoint() .get("/transactionalSMS/templates") @@ -69,6 +70,7 @@ describe("SmsTemplatesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/transactionalSMS/templates") diff --git a/tests/wire/tasks.test.ts b/tests/wire/tasks.test.ts index 3803039..1f74b0b 100644 --- a/tests/wire/tasks.test.ts +++ b/tests/wire/tasks.test.ts @@ -21,6 +21,7 @@ describe("TasksClient", () => { }, ], }; + server.mockEndpoint().get("/crm/tasks").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.tasks.getAllTasks({ @@ -45,6 +46,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/tasks").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -61,6 +63,7 @@ describe("TasksClient", () => { taskTypeId: "61a5cd07ca1347c82306ad09", }; const rawResponseBody = { id: "61a5cd07ca1347c82306ad06" }; + server .mockEndpoint() .post("/crm/tasks") @@ -85,6 +88,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { date: "2024-01-15T09:30:00Z", name: "name", taskTypeId: "taskTypeId" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/crm/tasks") @@ -115,6 +119,7 @@ describe("TasksClient", () => { name: "Task: Connect with client_dev", taskTypeId: "61a5cd07ca1347c82306ad09", }; + server.mockEndpoint().get("/crm/tasks/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.tasks.getATask({ @@ -135,6 +140,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/tasks/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -149,6 +155,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/crm/tasks/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -175,6 +182,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/tasks/id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -189,6 +197,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().delete("/crm/tasks/id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -216,6 +225,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/crm/tasks/id") @@ -237,6 +247,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .patch("/crm/tasks/id") @@ -258,6 +269,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { id: "61a88a2eb7a574180261234", title: "Email" }; + server.mockEndpoint().get("/crm/tasktypes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.tasks.getAllTaskTypes(); diff --git a/tests/wire/tier.test.ts b/tests/wire/tier.test.ts index a182bcd..e14d4ff 100644 --- a/tests/wire/tier.test.ts +++ b/tests/wire/tier.test.ts @@ -18,6 +18,7 @@ describe("TierClient", () => { meta: { key: "value" }, updatedAt: "2024-01-15T09:30:00Z", }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") @@ -49,6 +50,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") @@ -71,6 +73,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") @@ -93,6 +96,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") @@ -115,6 +119,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") @@ -137,6 +142,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") @@ -159,6 +165,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") @@ -181,6 +188,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/contacts/cid/tiers/tid") @@ -216,6 +224,7 @@ describe("TierClient", () => { }, ], }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups") @@ -248,6 +257,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups") @@ -268,6 +278,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups") @@ -288,6 +299,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups") @@ -308,6 +320,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups") @@ -328,6 +341,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups") @@ -357,6 +371,7 @@ describe("TierClient", () => { updatedAt: "2024-01-15T09:30:00Z", upgradeStrategy: "real_time", }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups") @@ -387,6 +402,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups") @@ -409,6 +425,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups") @@ -431,6 +448,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups") @@ -453,6 +471,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups") @@ -475,6 +494,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups") @@ -497,6 +517,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups") @@ -528,6 +549,7 @@ describe("TierClient", () => { updatedAt: "2024-01-15T09:30:00Z", upgradeStrategy: "real_time", }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups/gid") @@ -557,6 +579,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups/gid") @@ -578,6 +601,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups/gid") @@ -599,6 +623,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups/gid") @@ -620,6 +645,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups/gid") @@ -641,6 +667,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tier-groups/gid") @@ -676,6 +703,7 @@ describe("TierClient", () => { updatedAt: "2024-01-15T09:30:00Z", upgradeStrategy: "real_time", }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tier-groups/gid") @@ -715,6 +743,7 @@ describe("TierClient", () => { upgradeStrategy: "real_time", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tier-groups/gid") @@ -746,6 +775,7 @@ describe("TierClient", () => { upgradeStrategy: "real_time", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tier-groups/gid") @@ -777,6 +807,7 @@ describe("TierClient", () => { upgradeStrategy: "real_time", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tier-groups/gid") @@ -808,6 +839,7 @@ describe("TierClient", () => { upgradeStrategy: "real_time", }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tier-groups/gid") @@ -839,6 +871,7 @@ describe("TierClient", () => { upgradeStrategy: "real_time", }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tier-groups/gid") @@ -883,6 +916,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tier-groups/gid") @@ -904,6 +938,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tier-groups/gid") @@ -925,6 +960,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tier-groups/gid") @@ -946,6 +982,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tier-groups/gid") @@ -967,6 +1004,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tier-groups/gid") @@ -988,6 +1026,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tier-groups/gid") @@ -1028,6 +1067,7 @@ describe("TierClient", () => { ], updatedAt: "2024-01-15T09:30:00Z", }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") @@ -1074,6 +1114,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") @@ -1098,6 +1139,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") @@ -1122,6 +1164,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") @@ -1146,6 +1189,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") @@ -1170,6 +1214,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/loyalty/tier/programs/pid/tier-groups/gid/tiers") @@ -1208,6 +1253,7 @@ describe("TierClient", () => { }, ], }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tiers") @@ -1241,6 +1287,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tiers") @@ -1261,6 +1308,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tiers") @@ -1281,6 +1329,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tiers") @@ -1301,6 +1350,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tiers") @@ -1321,6 +1371,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/loyalty/tier/programs/pid/tiers") @@ -1360,6 +1411,7 @@ describe("TierClient", () => { ], updatedAt: "2024-01-15T09:30:00Z", }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tiers/tid") @@ -1407,6 +1459,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tiers/tid") @@ -1432,6 +1485,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tiers/tid") @@ -1457,6 +1511,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tiers/tid") @@ -1482,6 +1537,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tiers/tid") @@ -1507,6 +1563,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { accessConditions: [{}, {}], name: "name", tierRewards: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/loyalty/tier/programs/pid/tiers/tid") @@ -1545,6 +1602,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tiers/tid") @@ -1566,6 +1624,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tiers/tid") @@ -1587,6 +1646,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tiers/tid") @@ -1608,6 +1668,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { message: "message" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tiers/tid") @@ -1629,6 +1690,7 @@ describe("TierClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/loyalty/tier/programs/pid/tiers/tid") diff --git a/tests/wire/transactionalEmails.test.ts b/tests/wire/transactionalEmails.test.ts index f09df6f..fa2f407 100644 --- a/tests/wire/transactionalEmails.test.ts +++ b/tests/wire/transactionalEmails.test.ts @@ -20,6 +20,7 @@ describe("TransactionalEmailsClient", () => { ], count: 1, }; + server .mockEndpoint() .get("/smtp/blockedContacts") @@ -50,6 +51,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smtp/blockedContacts") @@ -80,6 +82,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/blockedContacts/email") @@ -100,6 +103,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/blockedContacts/email") @@ -120,6 +124,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { domains: ["example.com", "testdomain.com"] }; + server .mockEndpoint() .get("/smtp/blockedDomains") @@ -158,6 +163,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { domain: "domain" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smtp/blockedDomains") @@ -191,6 +197,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/blockedDomains/domain") @@ -211,6 +218,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/blockedDomains/domain") @@ -248,6 +256,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smtp/deleteHardbounces") @@ -273,6 +282,7 @@ describe("TransactionalEmailsClient", () => { to: [{ email: "johndoe@example.com", name: "John Doe" }], }; const rawResponseBody = { messageId: "<201798300811.5787683@relay.domain.com>", messageIds: ["messageIds"] }; + server .mockEndpoint() .post("/smtp/email") @@ -315,6 +325,7 @@ describe("TransactionalEmailsClient", () => { to: [{ email: "johndoe@example.com", name: "John Doe" }], }; const rawResponseBody = { messageId: "<201798300811.5787683@relay.domain.com>", messageIds: ["messageIds"] }; + server .mockEndpoint() .post("/smtp/email") @@ -354,6 +365,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smtp/email") @@ -390,6 +402,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/email/identifier") @@ -410,6 +423,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/email/identifier") @@ -437,6 +451,7 @@ describe("TransactionalEmailsClient", () => { ], count: 3, }; + server .mockEndpoint() .get("/smtp/emailStatus/4320f270-a4e3-4a2e-b591-edfe30a5e627") @@ -481,6 +496,7 @@ describe("TransactionalEmailsClient", () => { scheduledAt: "2022-02-28T11:36:43Z", status: "queued", }; + server .mockEndpoint() .get("/smtp/emailStatus/4320f270-a4e3-4a2e-b591-edfe30a5e627") @@ -506,6 +522,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smtp/emailStatus/identifier") @@ -526,6 +543,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smtp/emailStatus/identifier") @@ -570,6 +588,7 @@ describe("TransactionalEmailsClient", () => { }, ], }; + server.mockEndpoint().get("/smtp/emails").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.transactionalEmails.getTransacEmailsList(); @@ -605,6 +624,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/smtp/emails").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -629,6 +649,7 @@ describe("TransactionalEmailsClient", () => { subject: "Summer Camps", templateId: 12, }; + server.mockEndpoint().get("/smtp/emails/uuid").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.transactionalEmails.getTransacEmailContent({ @@ -675,6 +696,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/log/identifier") @@ -695,6 +717,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/log/identifier") @@ -729,6 +752,7 @@ describe("TransactionalEmailsClient", () => { uniqueOpens: 13688, unsubscribed: 2, }; + server .mockEndpoint() .get("/smtp/statistics/aggregatedReport") @@ -760,6 +784,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smtp/statistics/aggregatedReport") @@ -807,6 +832,7 @@ describe("TransactionalEmailsClient", () => { }, ], }; + server .mockEndpoint() .get("/smtp/statistics/events") @@ -853,6 +879,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smtp/statistics/events") @@ -904,6 +931,7 @@ describe("TransactionalEmailsClient", () => { }, ], }; + server .mockEndpoint() .get("/smtp/statistics/reports") @@ -954,6 +982,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smtp/statistics/reports") @@ -979,6 +1008,7 @@ describe("TransactionalEmailsClient", () => { subject: "subject", usedFeedNames: ["usedFeedNames", "usedFeedNames"], }; + server .mockEndpoint() .post("/smtp/template/preview") @@ -1006,6 +1036,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { key: "value" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smtp/template/preview") @@ -1061,6 +1092,7 @@ describe("TransactionalEmailsClient", () => { }, ], }; + server.mockEndpoint().get("/smtp/templates").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.transactionalEmails.getSmtpTemplates(); @@ -1114,6 +1146,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/smtp/templates").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -1130,6 +1163,7 @@ describe("TransactionalEmailsClient", () => { templateName: "Order Confirmation - EN", }; const rawResponseBody = { id: 5 }; + server .mockEndpoint() .post("/smtp/templates") @@ -1154,6 +1188,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { sender: {}, subject: "subject", templateName: "templateName" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smtp/templates") @@ -1191,6 +1226,7 @@ describe("TransactionalEmailsClient", () => { testSent: false, toField: "", }; + server .mockEndpoint() .get("/smtp/templates/1000000") @@ -1228,6 +1264,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smtp/templates/1000000") @@ -1248,6 +1285,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/smtp/templates/1000000") @@ -1287,6 +1325,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/smtp/templates/1000000") @@ -1308,6 +1347,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/smtp/templates/1000000") @@ -1341,6 +1381,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/templates/1000000") @@ -1361,6 +1402,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/smtp/templates/1000000") @@ -1401,6 +1443,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smtp/templates/1000000/sendTest") @@ -1423,6 +1466,7 @@ describe("TransactionalEmailsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/smtp/templates/1000000/sendTest") diff --git a/tests/wire/transactionalSms.test.ts b/tests/wire/transactionalSms.test.ts index 2e36cb9..d0c301b 100644 --- a/tests/wire/transactionalSms.test.ts +++ b/tests/wire/transactionalSms.test.ts @@ -10,6 +10,7 @@ describe("TransactionalSmsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipient: "33689965433", sender: "MyShop" }; const rawResponseBody = { messageId: 1511882900176220 }; + server .mockEndpoint() .post("/transactionalSMS/send") @@ -33,6 +34,7 @@ describe("TransactionalSmsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipient: "recipient", sender: "sender" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/transactionalSMS/send") @@ -61,6 +63,7 @@ describe("TransactionalSmsClient", () => { smsCount: 2, usedCredits: 0.7, }; + server .mockEndpoint() .post("/transactionalSMS/sms") @@ -88,6 +91,7 @@ describe("TransactionalSmsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipient: "recipient", sender: "sender" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/transactionalSMS/sms") @@ -110,6 +114,7 @@ describe("TransactionalSmsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { recipient: "recipient", sender: "sender" }; const rawResponseBody = { message: "message" }; + server .mockEndpoint() .post("/transactionalSMS/sms") @@ -144,6 +149,7 @@ describe("TransactionalSmsClient", () => { softBounces: 26, unsubscribed: 10, }; + server .mockEndpoint() .get("/transactionalSMS/statistics/aggregatedReport") @@ -173,6 +179,7 @@ describe("TransactionalSmsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/transactionalSMS/statistics/aggregatedReport") @@ -212,6 +219,7 @@ describe("TransactionalSmsClient", () => { }, ], }; + server .mockEndpoint() .get("/transactionalSMS/statistics/events") @@ -250,6 +258,7 @@ describe("TransactionalSmsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/transactionalSMS/statistics/events") @@ -310,6 +319,7 @@ describe("TransactionalSmsClient", () => { }, ], }; + server .mockEndpoint() .get("/transactionalSMS/statistics/reports") @@ -369,6 +379,7 @@ describe("TransactionalSmsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/transactionalSMS/statistics/reports") diff --git a/tests/wire/transactionalWhatsApp.test.ts b/tests/wire/transactionalWhatsApp.test.ts index 8c193c4..f286603 100644 --- a/tests/wire/transactionalWhatsApp.test.ts +++ b/tests/wire/transactionalWhatsApp.test.ts @@ -10,6 +10,7 @@ describe("TransactionalWhatsAppClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { contactNumbers: ["contactNumbers"], senderNumber: "senderNumber", templateId: 123 }; const rawResponseBody = { messageId: "23befbae-1505-47a8-bd27-e30ef739f32c" }; + server .mockEndpoint() .post("/whatsapp/sendMessage") @@ -38,6 +39,7 @@ describe("TransactionalWhatsAppClient", () => { templateId: 1, }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/whatsapp/sendMessage") @@ -104,6 +106,7 @@ describe("TransactionalWhatsAppClient", () => { }, ], }; + server .mockEndpoint() .get("/whatsapp/statistics/events") @@ -164,6 +167,7 @@ describe("TransactionalWhatsAppClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/whatsapp/statistics/events") diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index 5e4812d..32928ab 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -31,6 +31,7 @@ describe("UserClient", () => { }, ], }; + server .mockEndpoint() .get("/organization/invited/users") @@ -81,6 +82,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/organization/invited/users") @@ -99,6 +101,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { credit_notes: ["TEST-123"], status: "OK" }; + server .mockEndpoint() .put("/organization/user/invitation/revoke/email") @@ -121,6 +124,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/organization/user/invitation/revoke/email") @@ -141,6 +145,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { all_features_access: true, email: "inviteuser@example.com", privileges: [{}] }; const rawResponseBody = { invoice_id: "invoice_id", status: "OK" }; + server .mockEndpoint() .post("/organization/user/invitation/send") @@ -166,6 +171,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { all_features_access: true, email: "email", privileges: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/organization/user/invitation/send") @@ -189,6 +195,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { credit_notes: ["TEST-123"], status: "OK" }; + server .mockEndpoint() .put("/organization/user/invitation/resend/email") @@ -212,6 +219,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/organization/user/invitation/resend/email") @@ -233,6 +241,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { all_features_access: true, email: "inviteuser@example.com", privileges: [{}] }; const rawResponseBody = { credit_notes: ["TEST-123"], invoice_id: "invoice_id", status: "OK" }; + server .mockEndpoint() .post("/organization/user/update/permissions") @@ -259,6 +268,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { all_features_access: true, email: "email", privileges: [{}, {}] }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/organization/user/update/permissions") @@ -319,6 +329,7 @@ describe("UserClient", () => { ], status: "active", }; + server .mockEndpoint() .get("/organization/user/email/permissions") @@ -408,6 +419,7 @@ describe("UserClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/organization/user/email/permissions") diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts index f9ad007..207ac1a 100644 --- a/tests/wire/webhooks.test.ts +++ b/tests/wire/webhooks.test.ts @@ -39,6 +39,7 @@ describe("WebhooksClient", () => { }, ], }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.webhooks.getWebhooks(); @@ -95,6 +96,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/webhooks").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -107,6 +109,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { events: ["sent"], url: "http://requestb.in/173lyyx1" }; const rawResponseBody = { id: 5 }; + server .mockEndpoint() .post("/webhooks") @@ -130,6 +133,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { events: ["sent", "sent"], url: "url" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/webhooks") @@ -152,6 +156,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event: "invalid_parameter", notifyURL: "https://brevo.com", type: "transactional" }; const rawResponseBody = { processId: 78 }; + server .mockEndpoint() .post("/webhooks/export") @@ -176,6 +181,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { event: "invalid_parameter", notifyURL: "notifyURL", type: "transactional" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/webhooks/export") @@ -211,6 +217,7 @@ describe("WebhooksClient", () => { type: "marketing", url: "http://example.domain.com/1brxxxxxx5p1", }; + server.mockEndpoint().get("/webhooks/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.webhooks.getWebhook({ @@ -244,6 +251,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/webhooks/1000000").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -258,6 +266,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/webhooks/1000000").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -285,6 +294,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/webhooks/1000000") @@ -306,6 +316,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/webhooks/1000000") @@ -339,6 +350,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/webhooks/1000000") @@ -359,6 +371,7 @@ describe("WebhooksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/webhooks/1000000") diff --git a/tests/wire/whatsAppCampaigns.test.ts b/tests/wire/whatsAppCampaigns.test.ts index ede5fac..0e9a43a 100644 --- a/tests/wire/whatsAppCampaigns.test.ts +++ b/tests/wire/whatsAppCampaigns.test.ts @@ -27,6 +27,7 @@ describe("WhatsAppCampaignsClient", () => { ], count: 23, }; + server.mockEndpoint().get("/whatsappCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.whatsAppCampaigns.getWhatsAppCampaigns(); @@ -61,6 +62,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server.mockEndpoint().get("/whatsappCampaigns").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); await expect(async () => { @@ -78,6 +80,7 @@ describe("WhatsAppCampaignsClient", () => { templateId: 19, }; const rawResponseBody = { id: 5 }; + server .mockEndpoint() .post("/whatsappCampaigns") @@ -103,6 +106,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", recipients: {}, scheduledAt: "scheduledAt", templateId: 1 }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/whatsappCampaigns") @@ -134,6 +138,7 @@ describe("WhatsAppCampaignsClient", () => { whatsappBusinessAccountId: "whatsappBusinessAccountId", whatsappBusinessAccountStatus: "APPROVED", }; + server .mockEndpoint() .get("/whatsappCampaigns/config") @@ -158,6 +163,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/whatsappCampaigns/config") @@ -181,6 +187,7 @@ describe("WhatsAppCampaignsClient", () => { name: "Test template", }; const rawResponseBody = { id: 5 }; + server .mockEndpoint() .post("/whatsappCampaigns/template") @@ -206,6 +213,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { bodyText: "bodyText", category: "MARKETING", language: "language", name: "name" }; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/whatsappCampaigns/template") @@ -254,6 +262,7 @@ describe("WhatsAppCampaignsClient", () => { }, ], }; + server .mockEndpoint() .get("/whatsappCampaigns/template-list") @@ -295,6 +304,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/whatsappCampaigns/template-list") @@ -330,6 +340,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .post("/whatsappCampaigns/template/approval/1000000") @@ -375,6 +386,7 @@ describe("WhatsAppCampaignsClient", () => { name: "official_campaign8", }, }; + server .mockEndpoint() .get("/whatsappCampaigns/1000000") @@ -443,6 +455,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/whatsappCampaigns/1000000") @@ -463,6 +476,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .get("/whatsappCampaigns/1000000") @@ -502,6 +516,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; + server .mockEndpoint() .put("/whatsappCampaigns/1000000") @@ -535,6 +550,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/whatsappCampaigns/1000000") @@ -555,6 +571,7 @@ describe("WhatsAppCampaignsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/whatsappCampaigns/1000000") diff --git a/tsconfig.base.json b/tsconfig.base.json index d762767..93a92c0 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -9,7 +9,6 @@ "declaration": true, "outDir": "dist", "rootDir": "src", - "baseUrl": "src", "isolatedModules": true, "isolatedDeclarations": true }, diff --git a/vitest.config.mts b/vitest.config.mts index ba2ec4f..0dee5a7 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,6 +1,10 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { + typecheck: { + enabled: true, + tsconfig: "./tests/tsconfig.json", + }, projects: [ { test: { From ab39279b3404ecbd16646c978d37a711b54085d1 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 14:13:17 +0000 Subject: [PATCH 32/33] SDK regeneration --- .fern/metadata.json | 8 +- biome.json | 2 +- package.json | 14 +- pnpm-lock.yaml | 1219 +++++++---------- reference.md | 6 +- src/BaseClient.ts | 4 +- src/api/resources/contacts/client/Client.ts | 9 +- .../client/requests/CreateContactRequest.ts | 2 +- .../client/requests/UpdateContactRequest.ts | 2 +- src/api/resources/ecommerce/client/Client.ts | 18 +- .../client/requests/CreateEventRequest.ts | 4 +- .../types/CreateBatchEventsRequestItem.ts | 4 +- .../process/types/GetProcessResponse.ts | 5 +- .../process/types/GetProcessesResponse.ts | 5 +- src/core/auth/BasicAuth.ts | 11 +- src/core/fetcher/Fetcher.ts | 6 + src/core/file/file.ts | 4 +- src/core/form-data-utils/FormDataWrapper.ts | 6 +- src/errors/BrevoError.ts | 6 + src/errors/BrevoTimeoutError.ts | 7 +- src/errors/handleNonStatusCodeError.ts | 5 +- src/version.ts | 2 +- tests/unit/auth/BasicAuth.test.ts | 26 +- tests/wire/account.test.ts | 109 +- tests/wire/balance.test.ts | 291 +--- tests/wire/companies.test.ts | 82 +- tests/wire/contacts.test.ts | 639 +-------- tests/wire/conversations.test.ts | 819 +---------- tests/wire/coupons.test.ts | 34 +- tests/wire/customObjects.test.ts | 43 +- tests/wire/deals.test.ts | 105 +- tests/wire/domains.test.ts | 242 +--- tests/wire/ecommerce.test.ts | 233 +--- tests/wire/emailCampaigns.test.ts | 547 +------- tests/wire/event.test.ts | 27 +- tests/wire/externalFeeds.test.ts | 123 +- tests/wire/files.test.ts | 26 +- tests/wire/inboundParsing.test.ts | 47 +- tests/wire/masterAccount.test.ts | 323 +---- tests/wire/notes.test.ts | 42 +- tests/wire/payments.test.ts | 23 +- tests/wire/process.test.ts | 130 +- tests/wire/program.test.ts | 150 +- tests/wire/reward.test.ts | 208 +-- tests/wire/senders.test.ts | 172 +-- tests/wire/smsCampaigns.test.ts | 84 +- tests/wire/smsTemplates.test.ts | 25 +- tests/wire/tasks.test.ts | 31 +- tests/wire/tier.test.ts | 126 +- tests/wire/transactionalEmails.test.ts | 264 +--- tests/wire/transactionalSms.test.ts | 93 +- tests/wire/transactionalWhatsApp.test.ts | 49 +- tests/wire/user.test.ts | 128 +- tests/wire/webhooks.test.ts | 77 +- tests/wire/whatsAppCampaigns.test.ts | 119 +- 55 files changed, 864 insertions(+), 5922 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index a4f544f..fc438ba 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "4.43.1", + "cliVersion": "4.65.2", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.59.4", + "generatorVersion": "3.63.3", "generatorConfig": { "generateWireTests": true, "namespaceExport": "Brevo", @@ -15,6 +15,6 @@ } } }, - "originGitCommit": "7d08ac3fbe2aa66ba3d56077e8582739d530298b", - "sdkVersion": "5.0.3" + "originGitCommit": "d2e18d0bd27160206c8251e11269b139a3b4ea10", + "sdkVersion": "5.0.4" } diff --git a/biome.json b/biome.json index 5084b70..6b89164 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.4.3/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.10/schema.json", "root": true, "vcs": { "enabled": false diff --git a/package.json b/package.json index 08a3db8..a3986f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "5.0.3", + "version": "5.0.4", "private": false, "repository": { "type": "git", @@ -398,13 +398,13 @@ }, "dependencies": {}, "devDependencies": { - "webpack": "^5.97.1", - "ts-loader": "^9.5.1", - "vitest": "^3.2.4", + "webpack": "^5.105.4", + "ts-loader": "^9.5.4", + "vitest": "^4.1.1", "msw": "2.11.2", "@types/node": "^18.19.70", - "typescript": "~5.7.2", - "@biomejs/biome": "2.4.3" + "typescript": "~5.9.3", + "@biomejs/biome": "2.4.10" }, "browser": { "fs": false, @@ -413,7 +413,7 @@ "stream": false, "crypto": false }, - "packageManager": "pnpm@10.20.0", + "packageManager": "pnpm@10.33.0", "engines": { "node": ">=18.0.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 410054a..255bd14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,78 +9,82 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: 2.4.3 - version: 2.4.3 + specifier: 2.4.10 + version: 2.4.10 '@types/node': specifier: ^18.19.70 version: 18.19.130 msw: specifier: 2.11.2 - version: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) + version: 2.11.2(@types/node@18.19.130)(typescript@5.9.3) ts-loader: - specifier: ^9.5.1 - version: 9.5.4(typescript@5.7.3)(webpack@5.105.4) + specifier: ^9.5.4 + version: 9.5.7(typescript@5.9.3)(webpack@5.106.0) typescript: - specifier: ~5.7.2 - version: 5.7.3 + specifier: ~5.9.3 + version: 5.9.3 vitest: - specifier: ^3.2.4 - version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.1) + specifier: ^4.1.1 + version: 4.1.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3))(vite@8.0.8(@types/node@18.19.130)(terser@5.46.1)) webpack: - specifier: ^5.97.1 - version: 5.105.4 + specifier: ^5.105.4 + version: 5.106.0 packages: - '@biomejs/biome@2.4.3': - resolution: {integrity: sha512-cBrjf6PNF6yfL8+kcNl85AjiK2YHNsbU0EvDOwiZjBPbMbQ5QcgVGFpjD0O52p8nec5O8NYw7PKw3xUR7fPAkQ==} + '@biomejs/biome@2.4.10': + resolution: {integrity: sha512-xxA3AphFQ1geij4JTHXv4EeSTda1IFn22ye9LdyVPoJU19fNVl0uzfEuhsfQ4Yue/0FaLs2/ccVi4UDiE7R30w==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.4.3': - resolution: {integrity: sha512-eOafSFlI/CF4id2tlwq9CVHgeEqvTL5SrhWff6ZORp6S3NL65zdsR3ugybItkgF8Pf4D9GSgtbB6sE3UNgOM9w==} + '@biomejs/cli-darwin-arm64@2.4.10': + resolution: {integrity: sha512-vuzzI1cWqDVzOMIkYyHbKqp+AkQq4K7k+UCXWpkYcY/HDn1UxdsbsfgtVpa40shem8Kax4TLDLlx8kMAecgqiw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.4.3': - resolution: {integrity: sha512-V2+av4ilbWcBMNufTtMMXVW00nPwyIjI5qf7n9wSvUaZ+tt0EvMGk46g9sAFDJBEDOzSyoRXiSP6pCvKTOEbPA==} + '@biomejs/cli-darwin-x64@2.4.10': + resolution: {integrity: sha512-14fzASRo+BPotwp7nWULy2W5xeUyFnTaq1V13Etrrxkrih+ez/2QfgFm5Ehtf5vSjtgx/IJycMMpn5kPd5ZNaA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.4.3': - resolution: {integrity: sha512-QuFzvsGo8BA4Xm7jGX5idkw6BqFblcCPySMTvq0AhGYnhUej5VJIDJbmTKfHqwjHepZiC4fA+T5i6wmiZolZNw==} + '@biomejs/cli-linux-arm64-musl@2.4.10': + resolution: {integrity: sha512-WrJY6UuiSD/Dh+nwK2qOTu8kdMDlLV3dLMmychIghHPAysWFq1/DGC1pVZx8POE3ZkzKR3PUUnVrtZfMfaJjyQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] + libc: [musl] - '@biomejs/cli-linux-arm64@2.4.3': - resolution: {integrity: sha512-0m+O0x9FgK99FAwDK+fiDtjs2wnqq7bvfj17KJVeCkTwT/liI+Q9njJG7lwXK0iSJVXeFNRIxukpVI3SifMYAA==} + '@biomejs/cli-linux-arm64@2.4.10': + resolution: {integrity: sha512-7MH1CMW5uuxQ/s7FLST63qF8B3Hgu2HRdZ7tA1X1+mk+St4JOuIrqdhIBnnyqeyWJNI+Bww7Es5QZ0wIc1Cmkw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] + libc: [glibc] - '@biomejs/cli-linux-x64-musl@2.4.3': - resolution: {integrity: sha512-qEc0OCpj/uytruQ4wLM0yWNJLZy0Up8H1Er5MW3SrstqM6J2d4XqdNA86xzCy8MQCHpoVZ3lFye3GBlIL4/ljw==} + '@biomejs/cli-linux-x64-musl@2.4.10': + resolution: {integrity: sha512-kDTi3pI6PBN6CiczsWYOyP2zk0IJI08EWEQyDMQWW221rPaaEz6FvjLhnU07KMzLv8q3qSuoB93ua6inSQ55Tw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] + libc: [musl] - '@biomejs/cli-linux-x64@2.4.3': - resolution: {integrity: sha512-NVqh0saIU0u5OfOp/0jFdlKRE59+XyMvWmtx0f6Nm/2OpdxBl04coRIftBbY9d1gfu+23JVv4CItAqPYrjYh5w==} + '@biomejs/cli-linux-x64@2.4.10': + resolution: {integrity: sha512-tZLvEEi2u9Xu1zAqRjTcpIDGVtldigVvzug2fTuPG0ME/g8/mXpRPcNgLB22bGn6FvLJpHHnqLnwliOu8xjYrg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] + libc: [glibc] - '@biomejs/cli-win32-arm64@2.4.3': - resolution: {integrity: sha512-gRO96vrIARilv/Cp2ZnmNNL5LSZg3RO75GPp13hsLO3N4YVpE7saaMDp2bcyV48y2N2Pbit1brkGVGta0yd6VQ==} + '@biomejs/cli-win32-arm64@2.4.10': + resolution: {integrity: sha512-umwQU6qPzH+ISTf/eHyJ/QoQnJs3V9Vpjz2OjZXe9MVBZ7prgGafMy7yYeRGnlmDAn87AKTF3Q6weLoMGpeqdQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.4.3': - resolution: {integrity: sha512-vSm/vOJe06pf14aGHfHl3Ar91Nlx4YYmohElDJ+17UbRwe99n987S/MhAlQOkONqf1utJor04ChkCPmKb8SWdw==} + '@biomejs/cli-win32-x64@2.4.10': + resolution: {integrity: sha512-aW/JU5GuyH4uxMrNYpoC2kjaHlyJGLgIa3XkhPEZI0uKhZhJZU8BuEyJmvgzSPQNGozBwWjC972RaNdcJ9KyJg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -91,161 +95,14 @@ packages: '@bundled-es-modules/statuses@1.0.1': resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} - '@esbuild/aix-ppc64@0.27.4': - resolution: {integrity: sha512-cQPwL2mp2nSmHHJlCyoXgHGhbEPMrEEU5xhkcy3Hs/O7nGZqEpZ2sUtLaL9MORLtDfRvVl2/3PAuEkYZH0Ty8Q==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - - '@esbuild/android-arm64@0.27.4': - resolution: {integrity: sha512-gdLscB7v75wRfu7QSm/zg6Rx29VLdy9eTr2t44sfTW7CxwAtQghZ4ZnqHk3/ogz7xao0QAgrkradbBzcqFPasw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm@0.27.4': - resolution: {integrity: sha512-X9bUgvxiC8CHAGKYufLIHGXPJWnr0OCdR0anD2e21vdvgCI8lIfqFbnoeOz7lBjdrAGUhqLZLcQo6MLhTO2DKQ==} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - - '@esbuild/android-x64@0.27.4': - resolution: {integrity: sha512-PzPFnBNVF292sfpfhiyiXCGSn9HZg5BcAz+ivBuSsl6Rk4ga1oEXAamhOXRFyMcjwr2DVtm40G65N3GLeH1Lvw==} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - - '@esbuild/darwin-arm64@0.27.4': - resolution: {integrity: sha512-b7xaGIwdJlht8ZFCvMkpDN6uiSmnxxK56N2GDTMYPr2/gzvfdQN8rTfBsvVKmIVY/X7EM+/hJKEIbbHs9oA4tQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-x64@0.27.4': - resolution: {integrity: sha512-sR+OiKLwd15nmCdqpXMnuJ9W2kpy0KigzqScqHI3Hqwr7IXxBp3Yva+yJwoqh7rE8V77tdoheRYataNKL4QrPw==} - engines: {node: '>=18'} - cpu: [x64] - os: [darwin] + '@emnapi/core@1.9.2': + resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==} - '@esbuild/freebsd-arm64@0.27.4': - resolution: {integrity: sha512-jnfpKe+p79tCnm4GVav68A7tUFeKQwQyLgESwEAUzyxk/TJr4QdGog9sqWNcUbr/bZt/O/HXouspuQDd9JxFSw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] + '@emnapi/runtime@1.9.2': + resolution: {integrity: sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==} - '@esbuild/freebsd-x64@0.27.4': - resolution: {integrity: sha512-2kb4ceA/CpfUrIcTUl1wrP/9ad9Atrp5J94Lq69w7UwOMolPIGrfLSvAKJp0RTvkPPyn6CIWrNy13kyLikZRZQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - - '@esbuild/linux-arm64@0.27.4': - resolution: {integrity: sha512-7nQOttdzVGth1iz57kxg9uCz57dxQLHWxopL6mYuYthohPKEK0vU0C3O21CcBK6KDlkYVcnDXY099HcCDXd9dA==} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm@0.27.4': - resolution: {integrity: sha512-aBYgcIxX/wd5n2ys0yESGeYMGF+pv6g0DhZr3G1ZG4jMfruU9Tl1i2Z+Wnj9/KjGz1lTLCcorqE2viePZqj4Eg==} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-ia32@0.27.4': - resolution: {integrity: sha512-oPtixtAIzgvzYcKBQM/qZ3R+9TEUd1aNJQu0HhGyqtx6oS7qTpvjheIWBbes4+qu1bNlo2V4cbkISr8q6gRBFA==} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-loong64@0.27.4': - resolution: {integrity: sha512-8mL/vh8qeCoRcFH2nM8wm5uJP+ZcVYGGayMavi8GmRJjuI3g1v6Z7Ni0JJKAJW+m0EtUuARb6Lmp4hMjzCBWzA==} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-mips64el@0.27.4': - resolution: {integrity: sha512-1RdrWFFiiLIW7LQq9Q2NES+HiD4NyT8Itj9AUeCl0IVCA459WnPhREKgwrpaIfTOe+/2rdntisegiPWn/r/aAw==} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-ppc64@0.27.4': - resolution: {integrity: sha512-tLCwNG47l3sd9lpfyx9LAGEGItCUeRCWeAx6x2Jmbav65nAwoPXfewtAdtbtit/pJFLUWOhpv0FpS6GQAmPrHA==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-riscv64@0.27.4': - resolution: {integrity: sha512-BnASypppbUWyqjd1KIpU4AUBiIhVr6YlHx/cnPgqEkNoVOhHg+YiSVxM1RLfiy4t9cAulbRGTNCKOcqHrEQLIw==} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-s390x@0.27.4': - resolution: {integrity: sha512-+eUqgb/Z7vxVLezG8bVB9SfBie89gMueS+I0xYh2tJdw3vqA/0ImZJ2ROeWwVJN59ihBeZ7Tu92dF/5dy5FttA==} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-x64@0.27.4': - resolution: {integrity: sha512-S5qOXrKV8BQEzJPVxAwnryi2+Iq5pB40gTEIT69BQONqR7JH1EPIcQ/Uiv9mCnn05jff9umq/5nqzxlqTOg9NA==} - engines: {node: '>=18'} - cpu: [x64] - os: [linux] - - '@esbuild/netbsd-arm64@0.27.4': - resolution: {integrity: sha512-xHT8X4sb0GS8qTqiwzHqpY00C95DPAq7nAwX35Ie/s+LO9830hrMd3oX0ZMKLvy7vsonee73x0lmcdOVXFzd6Q==} - engines: {node: '>=18'} - cpu: [arm64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.27.4': - resolution: {integrity: sha512-RugOvOdXfdyi5Tyv40kgQnI0byv66BFgAqjdgtAKqHoZTbTF2QqfQrFwa7cHEORJf6X2ht+l9ABLMP0dnKYsgg==} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - - '@esbuild/openbsd-arm64@0.27.4': - resolution: {integrity: sha512-2MyL3IAaTX+1/qP0O1SwskwcwCoOI4kV2IBX1xYnDDqthmq5ArrW94qSIKCAuRraMgPOmG0RDTA74mzYNQA9ow==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.27.4': - resolution: {integrity: sha512-u8fg/jQ5aQDfsnIV6+KwLOf1CmJnfu1ShpwqdwC0uA7ZPwFws55Ngc12vBdeUdnuWoQYx/SOQLGDcdlfXhYmXQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] - - '@esbuild/openharmony-arm64@0.27.4': - resolution: {integrity: sha512-JkTZrl6VbyO8lDQO3yv26nNr2RM2yZzNrNHEsj9bm6dOwwu9OYN28CjzZkH57bh4w0I2F7IodpQvUAEd1mbWXg==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openharmony] - - '@esbuild/sunos-x64@0.27.4': - resolution: {integrity: sha512-/gOzgaewZJfeJTlsWhvUEmUG4tWEY2Spp5M20INYRg2ZKl9QPO3QEEgPeRtLjEWSW8FilRNacPOg8R1uaYkA6g==} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - - '@esbuild/win32-arm64@0.27.4': - resolution: {integrity: sha512-Z9SExBg2y32smoDQdf1HRwHRt6vAHLXcxD2uGgO/v2jK7Y718Ix4ndsbNMU/+1Qiem9OiOdaqitioZwxivhXYg==} - engines: {node: '>=18'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-ia32@0.27.4': - resolution: {integrity: sha512-DAyGLS0Jz5G5iixEbMHi5KdiApqHBWMGzTtMiJ72ZOLhbu/bzxgAe8Ue8CTS3n3HbIUHQz/L51yMdGMeoxXNJw==} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-x64@0.27.4': - resolution: {integrity: sha512-+knoa0BDoeXgkNvvV1vvbZX4+hizelrkwmGJBdT17t8FNPwG2lKemmuMZlmaNQ3ws3DKKCxpb4zRZEIp3UxFCg==} - engines: {node: '>=18'} - cpu: [x64] - os: [win32] + '@emnapi/wasi-threads@1.2.1': + resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} '@inquirer/ansi@1.0.2': resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==} @@ -302,6 +159,12 @@ packages: resolution: {integrity: sha512-2+BzZbjRO7Ct61k8fMNHEtoKjeWI9pIlHFTqBwZ5icHpqszIgEZbjb1MW5Z0+bITTCTl3gk4PDBxs9tA/csXvA==} engines: {node: '>=18'} + '@napi-rs/wasm-runtime@1.1.3': + resolution: {integrity: sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + '@open-draft/deferred-promise@2.2.0': resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} @@ -311,130 +174,112 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@rollup/rollup-android-arm-eabi@4.60.0': - resolution: {integrity: sha512-WOhNW9K8bR3kf4zLxbfg6Pxu2ybOUbB2AjMDHSQx86LIF4rH4Ft7vmMwNt0loO0eonglSNy4cpD3MKXXKQu0/A==} - cpu: [arm] - os: [android] + '@oxc-project/types@0.124.0': + resolution: {integrity: sha512-VBFWMTBvHxS11Z5Lvlr3IWgrwhMTXV+Md+EQF0Xf60+wAdsGFTBx7X7K/hP4pi8N7dcm1RvcHwDxZ16Qx8keUg==} - '@rollup/rollup-android-arm64@4.60.0': - resolution: {integrity: sha512-u6JHLll5QKRvjciE78bQXDmqRqNs5M/3GVqZeMwvmjaNODJih/WIrJlFVEihvV0MiYFmd+ZyPr9wxOVbPAG2Iw==} + '@rolldown/binding-android-arm64@1.0.0-rc.15': + resolution: {integrity: sha512-YYe6aWruPZDtHNpwu7+qAHEMbQ/yRl6atqb/AhznLTnD3UY99Q1jE7ihLSahNWkF4EqRPVC4SiR4O0UkLK02tA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.60.0': - resolution: {integrity: sha512-qEF7CsKKzSRc20Ciu2Zw1wRrBz4g56F7r/vRwY430UPp/nt1x21Q/fpJ9N5l47WWvJlkNCPJz3QRVw008fi7yA==} + '@rolldown/binding-darwin-arm64@1.0.0-rc.15': + resolution: {integrity: sha512-oArR/ig8wNTPYsXL+Mzhs0oxhxfuHRfG7Ikw7jXsw8mYOtk71W0OkF2VEVh699pdmzjPQsTjlD1JIOoHkLP1Fg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.60.0': - resolution: {integrity: sha512-WADYozJ4QCnXCH4wPB+3FuGmDPoFseVCUrANmA5LWwGmC6FL14BWC7pcq+FstOZv3baGX65tZ378uT6WG8ynTw==} + '@rolldown/binding-darwin-x64@1.0.0-rc.15': + resolution: {integrity: sha512-YzeVqOqjPYvUbJSWJ4EDL8ahbmsIXQpgL3JVipmN+MX0XnXMeWomLN3Fb+nwCmP/jfyqte5I3XRSm7OfQrbyxw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.60.0': - resolution: {integrity: sha512-6b8wGHJlDrGeSE3aH5mGNHBjA0TTkxdoNHik5EkvPHCt351XnigA4pS7Wsj/Eo9Y8RBU6f35cjN9SYmCFBtzxw==} - cpu: [arm64] - os: [freebsd] - - '@rollup/rollup-freebsd-x64@4.60.0': - resolution: {integrity: sha512-h25Ga0t4jaylMB8M/JKAyrvvfxGRjnPQIR8lnCayyzEjEOx2EJIlIiMbhpWxDRKGKF8jbNH01NnN663dH638mA==} + '@rolldown/binding-freebsd-x64@1.0.0-rc.15': + resolution: {integrity: sha512-9Erhx956jeQ0nNTyif1+QWAXDRD38ZNjr//bSHrt6wDwB+QkAfl2q6Mn1k6OBPerznjRmbM10lgRb1Pli4xZPw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.60.0': - resolution: {integrity: sha512-RzeBwv0B3qtVBWtcuABtSuCzToo2IEAIQrcyB/b2zMvBWVbjo8bZDjACUpnaafaxhTw2W+imQbP2BD1usasK4g==} - cpu: [arm] - os: [linux] - - '@rollup/rollup-linux-arm-musleabihf@4.60.0': - resolution: {integrity: sha512-Sf7zusNI2CIU1HLzuu9Tc5YGAHEZs5Lu7N1ssJG4Tkw6e0MEsN7NdjUDDfGNHy2IU+ENyWT+L2obgWiguWibWQ==} + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.15': + resolution: {integrity: sha512-cVwk0w8QbZJGTnP/AHQBs5yNwmpgGYStL88t4UIaqcvYJWBfS0s3oqVLZPwsPU6M0zlW4GqjP0Zq5MnAGwFeGA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.60.0': - resolution: {integrity: sha512-DX2x7CMcrJzsE91q7/O02IJQ5/aLkVtYFryqCjduJhUfGKG6yJV8hxaw8pZa93lLEpPTP/ohdN4wFz7yp/ry9A==} + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.15': + resolution: {integrity: sha512-eBZ/u8iAK9SoHGanqe/jrPnY0JvBN6iXbVOsbO38mbz+ZJsaobExAm1Iu+rxa4S1l2FjG0qEZn4Rc6X8n+9M+w==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.60.0': - resolution: {integrity: sha512-09EL+yFVbJZlhcQfShpswwRZ0Rg+z/CsSELFCnPt3iK+iqwGsI4zht3secj5vLEs957QvFFXnzAT0FFPIxSrkQ==} + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': + resolution: {integrity: sha512-ZvRYMGrAklV9PEkgt4LQM6MjQX2P58HPAuecwYObY2DhS2t35R0I810bKi0wmaYORt6m/2Sm+Z+nFgb0WhXNcQ==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.60.0': - resolution: {integrity: sha512-i9IcCMPr3EXm8EQg5jnja0Zyc1iFxJjZWlb4wr7U2Wx/GrddOuEafxRdMPRYVaXjgbhvqalp6np07hN1w9kAKw==} - cpu: [loong64] - os: [linux] - - '@rollup/rollup-linux-loong64-musl@4.60.0': - resolution: {integrity: sha512-DGzdJK9kyJ+B78MCkWeGnpXJ91tK/iKA6HwHxF4TAlPIY7GXEvMe8hBFRgdrR9Ly4qebR/7gfUs9y2IoaVEyog==} - cpu: [loong64] - os: [linux] - - '@rollup/rollup-linux-ppc64-gnu@4.60.0': - resolution: {integrity: sha512-RwpnLsqC8qbS8z1H1AxBA1H6qknR4YpPR9w2XX0vo2Sz10miu57PkNcnHVaZkbqyw/kUWfKMI73jhmfi9BRMUQ==} - cpu: [ppc64] - os: [linux] - - '@rollup/rollup-linux-ppc64-musl@4.60.0': - resolution: {integrity: sha512-Z8pPf54Ly3aqtdWC3G4rFigZgNvd+qJlOE52fmko3KST9SoGfAdSRCwyoyG05q1HrrAblLbk1/PSIV+80/pxLg==} + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': + resolution: {integrity: sha512-VDpgGBzgfg5hLg+uBpCLoFG5kVvEyafmfxGUV0UHLcL5irxAK7PKNeC2MwClgk6ZAiNhmo9FLhRYgvMmedLtnQ==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-riscv64-gnu@4.60.0': - resolution: {integrity: sha512-3a3qQustp3COCGvnP4SvrMHnPQ9d1vzCakQVRTliaz8cIp/wULGjiGpbcqrkv0WrHTEp8bQD/B3HBjzujVWLOA==} - cpu: [riscv64] - os: [linux] - - '@rollup/rollup-linux-riscv64-musl@4.60.0': - resolution: {integrity: sha512-pjZDsVH/1VsghMJ2/kAaxt6dL0psT6ZexQVrijczOf+PeP2BUqTHYejk3l6TlPRydggINOeNRhvpLa0AYpCWSQ==} - cpu: [riscv64] - os: [linux] - - '@rollup/rollup-linux-s390x-gnu@4.60.0': - resolution: {integrity: sha512-3ObQs0BhvPgiUVZrN7gqCSvmFuMWvWvsjG5ayJ3Lraqv+2KhOsp+pUbigqbeWqueGIsnn+09HBw27rJ+gYK4VQ==} + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': + resolution: {integrity: sha512-y1uXY3qQWCzcPgRJATPSOUP4tCemh4uBdY7e3EZbVwCJTY3gLJWnQABgeUetvED+bt1FQ01OeZwvhLS2bpNrAQ==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.60.0': - resolution: {integrity: sha512-EtylprDtQPdS5rXvAayrNDYoJhIz1/vzN2fEubo3yLE7tfAw+948dO0g4M0vkTVFhKojnF+n6C8bDNe+gDRdTg==} + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': + resolution: {integrity: sha512-023bTPBod7J3Y/4fzAN6QtpkSABR0rigtrwaP+qSEabUh5zf6ELr9Nc7GujaROuPY3uwdSIXWrvhn1KxOvurWA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.60.0': - resolution: {integrity: sha512-k09oiRCi/bHU9UVFqD17r3eJR9bn03TyKraCrlz5ULFJGdJGi7VOmm9jl44vOJvRJ6P7WuBi/s2A97LxxHGIdw==} + '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': + resolution: {integrity: sha512-witB2O0/hU4CgfOOKUoeFgQ4GktPi1eEbAhaLAIpgD6+ZnhcPkUtPsoKKHRzmOoWPZue46IThdSgdo4XneOLYw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] - '@rollup/rollup-openbsd-x64@4.60.0': - resolution: {integrity: sha512-1o/0/pIhozoSaDJoDcec+IVLbnRtQmHwPV730+AOD29lHEEo4F5BEUB24H0OBdhbBBDwIOSuf7vgg0Ywxdfiiw==} - cpu: [x64] - os: [openbsd] - - '@rollup/rollup-openharmony-arm64@4.60.0': - resolution: {integrity: sha512-pESDkos/PDzYwtyzB5p/UoNU/8fJo68vcXM9ZW2V0kjYayj1KaaUfi1NmTUTUpMn4UhU4gTuK8gIaFO4UGuMbA==} + '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': + resolution: {integrity: sha512-UCL68NJ0Ud5zRipXZE9dF5PmirzJE4E4BCIOOssEnM7wLDsxjc6Qb0sGDxTNRTP53I6MZpygyCpY8Aa8sPfKPg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.60.0': - resolution: {integrity: sha512-hj1wFStD7B1YBeYmvY+lWXZ7ey73YGPcViMShYikqKT1GtstIKQAtfUI6yrzPjAy/O7pO0VLXGmUVWXQMaYgTQ==} - cpu: [arm64] - os: [win32] + '@rolldown/binding-wasm32-wasi@1.0.0-rc.15': + resolution: {integrity: sha512-ApLruZq/ig+nhaE7OJm4lDjayUnOHVUa77zGeqnqZ9pn0ovdVbbNPerVibLXDmWeUZXjIYIT8V3xkT58Rm9u5Q==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] - '@rollup/rollup-win32-ia32-msvc@4.60.0': - resolution: {integrity: sha512-SyaIPFoxmUPlNDq5EHkTbiKzmSEmq/gOYFI/3HHJ8iS/v1mbugVa7dXUzcJGQfoytp9DJFLhHH4U3/eTy2Bq4w==} - cpu: [ia32] + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': + resolution: {integrity: sha512-KmoUoU7HnN+Si5YWJigfTws1jz1bKBYDQKdbLspz0UaqjjFkddHsqorgiW1mxcAj88lYUE6NC/zJNwT+SloqtA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.60.0': - resolution: {integrity: sha512-RdcryEfzZr+lAr5kRm2ucN9aVlCCa2QNq4hXelZxb8GG0NJSazq44Z3PCCc8wISRuCVnGs0lQJVX5Vp6fKA+IA==} + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.15': + resolution: {integrity: sha512-3P2A8L+x75qavWLe/Dll3EYBJLQmtkJN8rfh+U/eR3MqMgL/h98PhYI+JFfXuDPgPeCB7iZAKiqii5vqOvnA0g==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.60.0': - resolution: {integrity: sha512-PrsWNQ8BuE00O3Xsx3ALh2Df8fAj9+cvvX9AIA6o4KpATR98c9mud4XtDWVvsEuyia5U4tVSTKygawyJkjm60w==} - cpu: [x64] - os: [win32] + '@rolldown/pluginutils@1.0.0-rc.15': + resolution: {integrity: sha512-UromN0peaE53IaBRe9W7CjrZgXl90fqGpK+mIZbA3qSTeYqg3pqpROBdIPvOG3F5ereDHNwoHBI2e50n1BDr1g==} + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@tybys/wasm-util@0.10.1': + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} @@ -463,34 +308,34 @@ packages: '@types/statuses@2.0.6': resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==} - '@vitest/expect@3.2.4': - resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + '@vitest/expect@4.1.4': + resolution: {integrity: sha512-iPBpra+VDuXmBFI3FMKHSFXp3Gx5HfmSCE8X67Dn+bwephCnQCaB7qWK2ldHa+8ncN8hJU8VTMcxjPpyMkUjww==} - '@vitest/mocker@3.2.4': - resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + '@vitest/mocker@4.1.4': + resolution: {integrity: sha512-R9HTZBhW6yCSGbGQnDnH3QHfJxokKN4KB+Yvk9Q1le7eQNYwiCyKxmLmurSpFy6BzJanSLuEUDrD+j97Q+ZLPg==} peerDependencies: msw: ^2.4.9 - vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: msw: optional: true vite: optional: true - '@vitest/pretty-format@3.2.4': - resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + '@vitest/pretty-format@4.1.4': + resolution: {integrity: sha512-ddmDHU0gjEUyEVLxtZa7xamrpIefdEETu3nZjWtHeZX4QxqJ7tRxSteHVXJOcr8jhiLoGAhkK4WJ3WqBpjx42A==} - '@vitest/runner@3.2.4': - resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + '@vitest/runner@4.1.4': + resolution: {integrity: sha512-xTp7VZ5aXP5ZJrn15UtJUWlx6qXLnGtF6jNxHepdPHpMfz/aVPx+htHtgcAL2mDXJgKhpoo2e9/hVJsIeFbytQ==} - '@vitest/snapshot@3.2.4': - resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + '@vitest/snapshot@4.1.4': + resolution: {integrity: sha512-MCjCFgaS8aZz+m5nTcEcgk/xhWv0rEH4Yl53PPlMXOZ1/Ka2VcZU6CJ+MgYCZbcJvzGhQRjVrGQNZqkGPttIKw==} - '@vitest/spy@3.2.4': - resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + '@vitest/spy@4.1.4': + resolution: {integrity: sha512-XxNdAsKW7C+FLydqFJLb5KhJtl3PGCMmYwFRfhvIgxJvLSXhhVI1zM8f1qD3Zg7RCjTSzDVyct6sghs9UEgBEQ==} - '@vitest/utils@3.2.4': - resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + '@vitest/utils@4.1.4': + resolution: {integrity: sha512-13QMT+eysM5uVGa1rG4kegGYNp6cnQcsTc67ELFbhNLQO+vgsygtYJx2khvdt4gVQqSSpC/KT5FZZxUpP3Oatw==} '@webassemblyjs/ast@1.14.1': resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} @@ -582,8 +427,8 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - baseline-browser-mapping@2.10.10: - resolution: {integrity: sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ==} + baseline-browser-mapping@2.10.17: + resolution: {integrity: sha512-HdrkN8eVG2CXxeifv/VdJ4A4RSra1DTW8dc/hdxzhGHN8QePs6gKaWM9pHPcpCoxYZJuOZ8drHmbdpLHjCYjLA==} engines: {node: '>=6.0.0'} hasBin: true @@ -591,33 +436,25 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.28.1: - resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} + browserslist@4.28.2: + resolution: {integrity: sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - cac@6.7.14: - resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} - engines: {node: '>=8'} - - caniuse-lite@1.0.30001781: - resolution: {integrity: sha512-RdwNCyMsNBftLjW6w01z8bKEvT6e/5tpPVEgtn22TiLGlstHOVecsX2KHFkD5e/vRnIE4EGzpuIODb3mtswtkw==} + caniuse-lite@1.0.30001787: + resolution: {integrity: sha512-mNcrMN9KeI68u7muanUpEejSLghOKlVhRqS/Za2IeyGllJ9I9otGpR9g3nsw7n4W378TE/LyIteA0+/FOZm4Kg==} - chai@5.3.3: - resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + chai@6.2.2: + resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - check-error@2.1.3: - resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} - engines: {node: '>= 16'} - chrome-trace-event@1.0.4: resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} engines: {node: '>=6.0'} @@ -640,25 +477,19 @@ packages: commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + cookie@0.7.2: resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} engines: {node: '>= 0.6'} - debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - deep-eql@5.0.2: - resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} - engines: {node: '>=6'} + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} - electron-to-chromium@1.5.321: - resolution: {integrity: sha512-L2C7Q279W2D/J4PLZLk7sebOILDSWos7bMsMNN06rK482umHUrh/3lM8G7IlHFOYip2oAg5nha1rCMxr/rs6ZQ==} + electron-to-chromium@1.5.334: + resolution: {integrity: sha512-mgjZAz7Jyx1SRCwEpy9wefDS7GvNPazLthHg8eQMJ76wBdGQQDW33TCrUTvQ4wzpmOrv2zrFoD3oNufMdyMpog==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -667,17 +498,9 @@ packages: resolution: {integrity: sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==} engines: {node: '>=10.13.0'} - es-module-lexer@1.7.0: - resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} - es-module-lexer@2.0.0: resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} - esbuild@0.27.4: - resolution: {integrity: sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ==} - engines: {node: '>=18'} - hasBin: true - escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -743,8 +566,8 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphql@16.13.1: - resolution: {integrity: sha512-gGgrVCoDKlIZ8fIqXBBb0pPKqDgki0Z/FSKNiQzSGj2uEYHr1tq5wmBegGwJx6QB5S5cM0khSBpi/JFHMCvsmQ==} + graphql@16.13.2: + resolution: {integrity: sha512-5bJ+nf/UCpAjHM8i06fl7eLyVC9iuNAjm9qzkiu2ZGhM0VscSvS6WDPfAwkdkBuoXGM9FJSbKl6wylMwP9Ktig==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} has-flag@4.0.0: @@ -769,22 +592,90 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} - js-tokens@9.0.1: - resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} - json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + loader-runner@4.3.1: resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} engines: {node: '>=6.11.5'} - loupe@3.2.1: - resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} - magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -803,9 +694,6 @@ packages: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - msw@2.11.2: resolution: {integrity: sha512-MI54hLCsrMwiflkcqlgYYNJJddY5/+S0SnONvhv1owOplvqohKSQyGejpNdUGyCwgs4IH7PqaNbPw/sKOEze9Q==} engines: {node: '>=18'} @@ -828,8 +716,11 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - node-releases@2.0.36: - resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} + node-releases@2.0.37: + resolution: {integrity: sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==} + + obug@2.1.1: + resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} outvariant@1.4.3: resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} @@ -840,10 +731,6 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - pathval@2.0.1: - resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} - engines: {node: '>= 14.16'} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -855,8 +742,8 @@ packages: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} - postcss@8.5.8: - resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} + postcss@8.5.9: + resolution: {integrity: sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==} engines: {node: ^10 || ^12 || >=14} require-directory@2.1.1: @@ -870,9 +757,9 @@ packages: rettime@0.7.0: resolution: {integrity: sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==} - rollup@4.60.0: - resolution: {integrity: sha512-yqjxruMGBQJ2gG4HtjZtAfXArHomazDHoFwFFmZZl0r7Pdo7qCIXKqKHZc8yeoMgzJJ+pO6pEEHa+V7uzWlrAQ==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} + rolldown@1.0.0-rc.15: + resolution: {integrity: sha512-Ff31guA5zT6WjnGp0SXw76X6hzGRk/OQq2hE+1lcDe+lJdHSgnSX6nK3erbONHyCbpSj9a9E+uX/OvytZoWp2g==} + engines: {node: ^20.19.0 || >=22.12.0} hasBin: true schema-utils@4.3.3: @@ -913,8 +800,8 @@ packages: resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} engines: {node: '>= 0.8'} - std-env@3.10.0: - resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + std-env@4.0.0: + resolution: {integrity: sha512-zUMPtQ/HBY3/50VbpkupYHbRroTRZJPRLvreamgErJVys0ceuzMkD44J/QjqhHjOzK42GQ3QZIeFG1OYfOtKqQ==} strict-event-emitter@0.5.1: resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} @@ -927,9 +814,6 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} - strip-literal@3.1.0: - resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} - supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -938,8 +822,8 @@ packages: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} - tapable@2.3.1: - resolution: {integrity: sha512-b+u3CEM6FjDHru+nhUSjDofpWSBp2rINziJWgApm72wwGasQ/wKXftZe4tI2Y5HPv6OpzXSZHOFq87H4vfsgsw==} + tapable@2.3.2: + resolution: {integrity: sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA==} engines: {node: '>=6'} terser-webpack-plugin@5.4.0: @@ -966,30 +850,23 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@0.3.2: - resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyexec@1.1.1: + resolution: {integrity: sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg==} + engines: {node: '>=18'} - tinyglobby@0.2.15: - resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + tinyglobby@0.2.16: + resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} engines: {node: '>=12.0.0'} - tinypool@1.1.1: - resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} - engines: {node: ^18.0.0 || >=20.0.0} - - tinyrainbow@2.0.0: - resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} - engines: {node: '>=14.0.0'} - - tinyspy@4.0.4: - resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} + tinyrainbow@3.1.0: + resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} engines: {node: '>=14.0.0'} - tldts-core@7.0.27: - resolution: {integrity: sha512-YQ7uPjgWUibIK6DW5lrKujGwUKhLevU4hcGbP5O6TcIUb+oTjJYJVWPS4nZsIHrEEEG6myk/oqAJUEQmpZrHsg==} + tldts-core@7.0.28: + resolution: {integrity: sha512-7W5Efjhsc3chVdFhqtaU0KtK32J37Zcr9RKtID54nG+tIpcY79CQK/veYPODxtD/LJ4Lue66jvrQzIX2Z2/pUQ==} - tldts@7.0.27: - resolution: {integrity: sha512-I4FZcVFcqCRuT0ph6dCDpPuO4Xgzvh+spkcTr1gK7peIvxWauoloVO0vuy1FQnijT63ss6AsHB6+OIM4aXHbPg==} + tldts@7.0.28: + resolution: {integrity: sha512-+Zg3vWhRUv8B1maGSTFdev9mjoo8Etn2Ayfs4cnjlD3CsGkxXX4QyW3j2WJ0wdjYcYmy7Lx2RDsZMhgCWafKIw==} hasBin: true to-regex-range@5.0.1: @@ -1000,19 +877,22 @@ packages: resolution: {integrity: sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw==} engines: {node: '>=16'} - ts-loader@9.5.4: - resolution: {integrity: sha512-nCz0rEwunlTZiy6rXFByQU1kVVpCIgUpc/psFiKVrUwrizdnIbRFu8w7bxhUF0X613DYwT4XzrZHpVyMe758hQ==} + ts-loader@9.5.7: + resolution: {integrity: sha512-/ZNrKgA3K3PtpMYOC71EeMWIloGw3IYEa5/t1cyz2r5/PyUwTXGzYJvcD3kfUvmhlfpz1rhV8B2O6IVTQ0avsg==} engines: {node: '>=12.0.0'} peerDependencies: typescript: '*' webpack: ^5.0.0 + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + type-fest@4.41.0: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} - typescript@5.7.3: - resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} hasBin: true @@ -1025,20 +905,16 @@ packages: peerDependencies: browserslist: '>= 4.21.0' - vite-node@3.2.4: - resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - hasBin: true - - vite@7.3.1: - resolution: {integrity: sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==} + vite@8.0.8: + resolution: {integrity: sha512-dbU7/iLVa8KZALJyLOBOQ88nOXtNG8vxKuOT4I2mD+Ya70KPceF4IAmDsmU0h1Qsn5bPrvsY9HJstCRh3hG6Uw==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.1.0 + esbuild: ^0.27.0 || ^0.28.0 jiti: '>=1.21.0' less: ^4.0.0 - lightningcss: ^1.21.0 sass: ^1.70.0 sass-embedded: ^1.70.0 stylus: '>=0.54.8' @@ -1049,12 +925,14 @@ packages: peerDependenciesMeta: '@types/node': optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true jiti: optional: true less: optional: true - lightningcss: - optional: true sass: optional: true sass-embedded: @@ -1070,26 +948,39 @@ packages: yaml: optional: true - vitest@3.2.4: - resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + vitest@4.1.4: + resolution: {integrity: sha512-tFuJqTxKb8AvfyqMfnavXdzfy3h3sWZRWwfluGbkeR7n0HUev+FmNgZ8SDrRBTVrVCjgH5cA21qGbCffMNtWvg==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@types/debug': ^4.1.12 - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.2.4 - '@vitest/ui': 3.2.4 + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.1.4 + '@vitest/browser-preview': 4.1.4 + '@vitest/browser-webdriverio': 4.1.4 + '@vitest/coverage-istanbul': 4.1.4 + '@vitest/coverage-v8': 4.1.4 + '@vitest/ui': 4.1.4 happy-dom: '*' jsdom: '*' + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: '@edge-runtime/vm': optional: true - '@types/debug': + '@opentelemetry/api': optional: true '@types/node': optional: true - '@vitest/browser': + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': optional: true '@vitest/ui': optional: true @@ -1106,8 +997,8 @@ packages: resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} engines: {node: '>=10.13.0'} - webpack@5.105.4: - resolution: {integrity: sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==} + webpack@5.106.0: + resolution: {integrity: sha512-Pkx5joZ9RrdgO5LBkyX1L2ZAJeK/Taz3vqZ9CbcP0wS5LEMx5QkKsEwLl29QJfihZ+DKRBFldzy1O30pJ1MDpA==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -1147,39 +1038,39 @@ packages: snapshots: - '@biomejs/biome@2.4.3': + '@biomejs/biome@2.4.10': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.4.3 - '@biomejs/cli-darwin-x64': 2.4.3 - '@biomejs/cli-linux-arm64': 2.4.3 - '@biomejs/cli-linux-arm64-musl': 2.4.3 - '@biomejs/cli-linux-x64': 2.4.3 - '@biomejs/cli-linux-x64-musl': 2.4.3 - '@biomejs/cli-win32-arm64': 2.4.3 - '@biomejs/cli-win32-x64': 2.4.3 - - '@biomejs/cli-darwin-arm64@2.4.3': + '@biomejs/cli-darwin-arm64': 2.4.10 + '@biomejs/cli-darwin-x64': 2.4.10 + '@biomejs/cli-linux-arm64': 2.4.10 + '@biomejs/cli-linux-arm64-musl': 2.4.10 + '@biomejs/cli-linux-x64': 2.4.10 + '@biomejs/cli-linux-x64-musl': 2.4.10 + '@biomejs/cli-win32-arm64': 2.4.10 + '@biomejs/cli-win32-x64': 2.4.10 + + '@biomejs/cli-darwin-arm64@2.4.10': optional: true - '@biomejs/cli-darwin-x64@2.4.3': + '@biomejs/cli-darwin-x64@2.4.10': optional: true - '@biomejs/cli-linux-arm64-musl@2.4.3': + '@biomejs/cli-linux-arm64-musl@2.4.10': optional: true - '@biomejs/cli-linux-arm64@2.4.3': + '@biomejs/cli-linux-arm64@2.4.10': optional: true - '@biomejs/cli-linux-x64-musl@2.4.3': + '@biomejs/cli-linux-x64-musl@2.4.10': optional: true - '@biomejs/cli-linux-x64@2.4.3': + '@biomejs/cli-linux-x64@2.4.10': optional: true - '@biomejs/cli-win32-arm64@2.4.3': + '@biomejs/cli-win32-arm64@2.4.10': optional: true - '@biomejs/cli-win32-x64@2.4.3': + '@biomejs/cli-win32-x64@2.4.10': optional: true '@bundled-es-modules/cookie@2.0.1': @@ -1190,82 +1081,20 @@ snapshots: dependencies: statuses: 2.0.2 - '@esbuild/aix-ppc64@0.27.4': - optional: true - - '@esbuild/android-arm64@0.27.4': - optional: true - - '@esbuild/android-arm@0.27.4': - optional: true - - '@esbuild/android-x64@0.27.4': - optional: true - - '@esbuild/darwin-arm64@0.27.4': - optional: true - - '@esbuild/darwin-x64@0.27.4': - optional: true - - '@esbuild/freebsd-arm64@0.27.4': - optional: true - - '@esbuild/freebsd-x64@0.27.4': - optional: true - - '@esbuild/linux-arm64@0.27.4': - optional: true - - '@esbuild/linux-arm@0.27.4': - optional: true - - '@esbuild/linux-ia32@0.27.4': - optional: true - - '@esbuild/linux-loong64@0.27.4': - optional: true - - '@esbuild/linux-mips64el@0.27.4': - optional: true - - '@esbuild/linux-ppc64@0.27.4': - optional: true - - '@esbuild/linux-riscv64@0.27.4': - optional: true - - '@esbuild/linux-s390x@0.27.4': - optional: true - - '@esbuild/linux-x64@0.27.4': - optional: true - - '@esbuild/netbsd-arm64@0.27.4': - optional: true - - '@esbuild/netbsd-x64@0.27.4': - optional: true - - '@esbuild/openbsd-arm64@0.27.4': - optional: true - - '@esbuild/openbsd-x64@0.27.4': - optional: true - - '@esbuild/openharmony-arm64@0.27.4': - optional: true - - '@esbuild/sunos-x64@0.27.4': - optional: true - - '@esbuild/win32-arm64@0.27.4': + '@emnapi/core@1.9.2': + dependencies: + '@emnapi/wasi-threads': 1.2.1 + tslib: 2.8.1 optional: true - '@esbuild/win32-ia32@0.27.4': + '@emnapi/runtime@1.9.2': + dependencies: + tslib: 2.8.1 optional: true - '@esbuild/win32-x64@0.27.4': + '@emnapi/wasi-threads@1.2.1': + dependencies: + tslib: 2.8.1 optional: true '@inquirer/ansi@1.0.2': {} @@ -1324,6 +1153,13 @@ snapshots: outvariant: 1.4.3 strict-event-emitter: 0.5.1 + '@napi-rs/wasm-runtime@1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)': + dependencies: + '@emnapi/core': 1.9.2 + '@emnapi/runtime': 1.9.2 + '@tybys/wasm-util': 0.10.1 + optional: true + '@open-draft/deferred-promise@2.2.0': {} '@open-draft/logger@0.3.0': @@ -1333,79 +1169,64 @@ snapshots: '@open-draft/until@2.1.0': {} - '@rollup/rollup-android-arm-eabi@4.60.0': - optional: true - - '@rollup/rollup-android-arm64@4.60.0': - optional: true - - '@rollup/rollup-darwin-arm64@4.60.0': - optional: true - - '@rollup/rollup-darwin-x64@4.60.0': - optional: true - - '@rollup/rollup-freebsd-arm64@4.60.0': - optional: true - - '@rollup/rollup-freebsd-x64@4.60.0': - optional: true + '@oxc-project/types@0.124.0': {} - '@rollup/rollup-linux-arm-gnueabihf@4.60.0': + '@rolldown/binding-android-arm64@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.60.0': + '@rolldown/binding-darwin-arm64@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-arm64-gnu@4.60.0': + '@rolldown/binding-darwin-x64@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-arm64-musl@4.60.0': + '@rolldown/binding-freebsd-x64@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-loong64-gnu@4.60.0': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-loong64-musl@4.60.0': + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.60.0': + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-ppc64-musl@4.60.0': + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.60.0': + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-riscv64-musl@4.60.0': + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-s390x-gnu@4.60.0': + '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-x64-gnu@4.60.0': + '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': optional: true - '@rollup/rollup-linux-x64-musl@4.60.0': + '@rolldown/binding-wasm32-wasi@1.0.0-rc.15': + dependencies: + '@emnapi/core': 1.9.2 + '@emnapi/runtime': 1.9.2 + '@napi-rs/wasm-runtime': 1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2) optional: true - '@rollup/rollup-openbsd-x64@4.60.0': + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': optional: true - '@rollup/rollup-openharmony-arm64@4.60.0': + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.15': optional: true - '@rollup/rollup-win32-arm64-msvc@4.60.0': - optional: true + '@rolldown/pluginutils@1.0.0-rc.15': {} - '@rollup/rollup-win32-ia32-msvc@4.60.0': - optional: true - - '@rollup/rollup-win32-x64-gnu@4.60.0': - optional: true + '@standard-schema/spec@1.1.0': {} - '@rollup/rollup-win32-x64-msvc@4.60.0': + '@tybys/wasm-util@0.10.1': + dependencies: + tslib: 2.8.1 optional: true '@types/chai@5.2.3': @@ -1437,48 +1258,47 @@ snapshots: '@types/statuses@2.0.6': {} - '@vitest/expect@3.2.4': + '@vitest/expect@4.1.4': dependencies: + '@standard-schema/spec': 1.1.0 '@types/chai': 5.2.3 - '@vitest/spy': 3.2.4 - '@vitest/utils': 3.2.4 - chai: 5.3.3 - tinyrainbow: 2.0.0 + '@vitest/spy': 4.1.4 + '@vitest/utils': 4.1.4 + chai: 6.2.2 + tinyrainbow: 3.1.0 - '@vitest/mocker@3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.1))': + '@vitest/mocker@4.1.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3))(vite@8.0.8(@types/node@18.19.130)(terser@5.46.1))': dependencies: - '@vitest/spy': 3.2.4 + '@vitest/spy': 4.1.4 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - msw: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) - vite: 7.3.1(@types/node@18.19.130)(terser@5.46.1) + msw: 2.11.2(@types/node@18.19.130)(typescript@5.9.3) + vite: 8.0.8(@types/node@18.19.130)(terser@5.46.1) - '@vitest/pretty-format@3.2.4': + '@vitest/pretty-format@4.1.4': dependencies: - tinyrainbow: 2.0.0 + tinyrainbow: 3.1.0 - '@vitest/runner@3.2.4': + '@vitest/runner@4.1.4': dependencies: - '@vitest/utils': 3.2.4 + '@vitest/utils': 4.1.4 pathe: 2.0.3 - strip-literal: 3.1.0 - '@vitest/snapshot@3.2.4': + '@vitest/snapshot@4.1.4': dependencies: - '@vitest/pretty-format': 3.2.4 + '@vitest/pretty-format': 4.1.4 + '@vitest/utils': 4.1.4 magic-string: 0.30.21 pathe: 2.0.3 - '@vitest/spy@3.2.4': - dependencies: - tinyspy: 4.0.4 + '@vitest/spy@4.1.4': {} - '@vitest/utils@3.2.4': + '@vitest/utils@4.1.4': dependencies: - '@vitest/pretty-format': 3.2.4 - loupe: 3.2.1 - tinyrainbow: 2.0.0 + '@vitest/pretty-format': 4.1.4 + convert-source-map: 2.0.0 + tinyrainbow: 3.1.0 '@webassemblyjs/ast@1.14.1': dependencies: @@ -1590,41 +1410,31 @@ snapshots: assertion-error@2.0.1: {} - baseline-browser-mapping@2.10.10: {} + baseline-browser-mapping@2.10.17: {} braces@3.0.3: dependencies: fill-range: 7.1.1 - browserslist@4.28.1: + browserslist@4.28.2: dependencies: - baseline-browser-mapping: 2.10.10 - caniuse-lite: 1.0.30001781 - electron-to-chromium: 1.5.321 - node-releases: 2.0.36 - update-browserslist-db: 1.2.3(browserslist@4.28.1) + baseline-browser-mapping: 2.10.17 + caniuse-lite: 1.0.30001787 + electron-to-chromium: 1.5.334 + node-releases: 2.0.37 + update-browserslist-db: 1.2.3(browserslist@4.28.2) buffer-from@1.1.2: {} - cac@6.7.14: {} - - caniuse-lite@1.0.30001781: {} + caniuse-lite@1.0.30001787: {} - chai@5.3.3: - dependencies: - assertion-error: 2.0.1 - check-error: 2.1.3 - deep-eql: 5.0.2 - loupe: 3.2.1 - pathval: 2.0.1 + chai@6.2.2: {} chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - check-error@2.1.3: {} - chrome-trace-event@1.0.4: {} cli-width@4.1.0: {} @@ -1643,56 +1453,23 @@ snapshots: commander@2.20.3: {} - cookie@0.7.2: {} + convert-source-map@2.0.0: {} - debug@4.4.3: - dependencies: - ms: 2.1.3 + cookie@0.7.2: {} - deep-eql@5.0.2: {} + detect-libc@2.1.2: {} - electron-to-chromium@1.5.321: {} + electron-to-chromium@1.5.334: {} emoji-regex@8.0.0: {} enhanced-resolve@5.20.1: dependencies: graceful-fs: 4.2.11 - tapable: 2.3.1 - - es-module-lexer@1.7.0: {} + tapable: 2.3.2 es-module-lexer@2.0.0: {} - esbuild@0.27.4: - optionalDependencies: - '@esbuild/aix-ppc64': 0.27.4 - '@esbuild/android-arm': 0.27.4 - '@esbuild/android-arm64': 0.27.4 - '@esbuild/android-x64': 0.27.4 - '@esbuild/darwin-arm64': 0.27.4 - '@esbuild/darwin-x64': 0.27.4 - '@esbuild/freebsd-arm64': 0.27.4 - '@esbuild/freebsd-x64': 0.27.4 - '@esbuild/linux-arm': 0.27.4 - '@esbuild/linux-arm64': 0.27.4 - '@esbuild/linux-ia32': 0.27.4 - '@esbuild/linux-loong64': 0.27.4 - '@esbuild/linux-mips64el': 0.27.4 - '@esbuild/linux-ppc64': 0.27.4 - '@esbuild/linux-riscv64': 0.27.4 - '@esbuild/linux-s390x': 0.27.4 - '@esbuild/linux-x64': 0.27.4 - '@esbuild/netbsd-arm64': 0.27.4 - '@esbuild/netbsd-x64': 0.27.4 - '@esbuild/openbsd-arm64': 0.27.4 - '@esbuild/openbsd-x64': 0.27.4 - '@esbuild/openharmony-arm64': 0.27.4 - '@esbuild/sunos-x64': 0.27.4 - '@esbuild/win32-arm64': 0.27.4 - '@esbuild/win32-ia32': 0.27.4 - '@esbuild/win32-x64': 0.27.4 - escalade@3.2.0: {} eslint-scope@5.1.1: @@ -1737,7 +1514,7 @@ snapshots: graceful-fs@4.2.11: {} - graphql@16.13.1: {} + graphql@16.13.2: {} has-flag@4.0.0: {} @@ -1755,15 +1532,60 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - js-tokens@9.0.1: {} - json-parse-even-better-errors@2.3.1: {} json-schema-traverse@1.0.0: {} - loader-runner@4.3.1: {} + lightningcss-android-arm64@1.32.0: + optional: true - loupe@3.2.1: {} + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + + loader-runner@4.3.1: {} magic-string@0.30.21: dependencies: @@ -1782,9 +1604,7 @@ snapshots: dependencies: mime-db: 1.52.0 - ms@2.1.3: {} - - msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3): + msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3): dependencies: '@bundled-es-modules/cookie': 2.0.1 '@bundled-es-modules/statuses': 1.0.1 @@ -1794,7 +1614,7 @@ snapshots: '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 '@types/statuses': 2.0.6 - graphql: 16.13.1 + graphql: 16.13.2 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 @@ -1806,7 +1626,7 @@ snapshots: type-fest: 4.41.0 yargs: 17.7.2 optionalDependencies: - typescript: 5.7.3 + typescript: 5.9.3 transitivePeerDependencies: - '@types/node' @@ -1816,7 +1636,9 @@ snapshots: neo-async@2.6.2: {} - node-releases@2.0.36: {} + node-releases@2.0.37: {} + + obug@2.1.1: {} outvariant@1.4.3: {} @@ -1824,15 +1646,13 @@ snapshots: pathe@2.0.3: {} - pathval@2.0.1: {} - picocolors@1.1.1: {} picomatch@2.3.2: {} picomatch@4.0.4: {} - postcss@8.5.8: + postcss@8.5.9: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 @@ -1844,36 +1664,26 @@ snapshots: rettime@0.7.0: {} - rollup@4.60.0: + rolldown@1.0.0-rc.15: dependencies: - '@types/estree': 1.0.8 + '@oxc-project/types': 0.124.0 + '@rolldown/pluginutils': 1.0.0-rc.15 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.60.0 - '@rollup/rollup-android-arm64': 4.60.0 - '@rollup/rollup-darwin-arm64': 4.60.0 - '@rollup/rollup-darwin-x64': 4.60.0 - '@rollup/rollup-freebsd-arm64': 4.60.0 - '@rollup/rollup-freebsd-x64': 4.60.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.60.0 - '@rollup/rollup-linux-arm-musleabihf': 4.60.0 - '@rollup/rollup-linux-arm64-gnu': 4.60.0 - '@rollup/rollup-linux-arm64-musl': 4.60.0 - '@rollup/rollup-linux-loong64-gnu': 4.60.0 - '@rollup/rollup-linux-loong64-musl': 4.60.0 - '@rollup/rollup-linux-ppc64-gnu': 4.60.0 - '@rollup/rollup-linux-ppc64-musl': 4.60.0 - '@rollup/rollup-linux-riscv64-gnu': 4.60.0 - '@rollup/rollup-linux-riscv64-musl': 4.60.0 - '@rollup/rollup-linux-s390x-gnu': 4.60.0 - '@rollup/rollup-linux-x64-gnu': 4.60.0 - '@rollup/rollup-linux-x64-musl': 4.60.0 - '@rollup/rollup-openbsd-x64': 4.60.0 - '@rollup/rollup-openharmony-arm64': 4.60.0 - '@rollup/rollup-win32-arm64-msvc': 4.60.0 - '@rollup/rollup-win32-ia32-msvc': 4.60.0 - '@rollup/rollup-win32-x64-gnu': 4.60.0 - '@rollup/rollup-win32-x64-msvc': 4.60.0 - fsevents: 2.3.3 + '@rolldown/binding-android-arm64': 1.0.0-rc.15 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.15 + '@rolldown/binding-darwin-x64': 1.0.0-rc.15 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.15 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.15 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.15 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.15 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.15 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.15 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.15 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.15 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.15 + '@rolldown/binding-wasm32-wasi': 1.0.0-rc.15 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.15 + '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.15 schema-utils@4.3.3: dependencies: @@ -1903,7 +1713,7 @@ snapshots: statuses@2.0.2: {} - std-env@3.10.0: {} + std-env@4.0.0: {} strict-event-emitter@0.5.1: {} @@ -1917,10 +1727,6 @@ snapshots: dependencies: ansi-regex: 5.0.1 - strip-literal@3.1.0: - dependencies: - js-tokens: 9.0.1 - supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -1929,15 +1735,15 @@ snapshots: dependencies: has-flag: 4.0.0 - tapable@2.3.1: {} + tapable@2.3.2: {} - terser-webpack-plugin@5.4.0(webpack@5.105.4): + terser-webpack-plugin@5.4.0(webpack@5.106.0): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 terser: 5.46.1 - webpack: 5.105.4 + webpack: 5.106.0 terser@5.46.1: dependencies: @@ -1948,24 +1754,20 @@ snapshots: tinybench@2.9.0: {} - tinyexec@0.3.2: {} + tinyexec@1.1.1: {} - tinyglobby@0.2.15: + tinyglobby@0.2.16: dependencies: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 - tinypool@1.1.1: {} + tinyrainbow@3.1.0: {} - tinyrainbow@2.0.0: {} + tldts-core@7.0.28: {} - tinyspy@4.0.4: {} - - tldts-core@7.0.27: {} - - tldts@7.0.27: + tldts@7.0.28: dependencies: - tldts-core: 7.0.27 + tldts-core: 7.0.28 to-regex-range@5.0.1: dependencies: @@ -1973,104 +1775,71 @@ snapshots: tough-cookie@6.0.1: dependencies: - tldts: 7.0.27 + tldts: 7.0.28 - ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.4): + ts-loader@9.5.7(typescript@5.9.3)(webpack@5.106.0): dependencies: chalk: 4.1.2 enhanced-resolve: 5.20.1 micromatch: 4.0.8 semver: 7.7.4 source-map: 0.7.6 - typescript: 5.7.3 - webpack: 5.105.4 + typescript: 5.9.3 + webpack: 5.106.0 + + tslib@2.8.1: + optional: true type-fest@4.41.0: {} - typescript@5.7.3: {} + typescript@5.9.3: {} undici-types@5.26.5: {} - update-browserslist-db@1.2.3(browserslist@4.28.1): + update-browserslist-db@1.2.3(browserslist@4.28.2): dependencies: - browserslist: 4.28.1 + browserslist: 4.28.2 escalade: 3.2.0 picocolors: 1.1.1 - vite-node@3.2.4(@types/node@18.19.130)(terser@5.46.1): + vite@8.0.8(@types/node@18.19.130)(terser@5.46.1): dependencies: - cac: 6.7.14 - debug: 4.4.3 - es-module-lexer: 1.7.0 - pathe: 2.0.3 - vite: 7.3.1(@types/node@18.19.130)(terser@5.46.1) - transitivePeerDependencies: - - '@types/node' - - jiti - - less - - lightningcss - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml - - vite@7.3.1(@types/node@18.19.130)(terser@5.46.1): - dependencies: - esbuild: 0.27.4 - fdir: 6.5.0(picomatch@4.0.4) + lightningcss: 1.32.0 picomatch: 4.0.4 - postcss: 8.5.8 - rollup: 4.60.0 - tinyglobby: 0.2.15 + postcss: 8.5.9 + rolldown: 1.0.0-rc.15 + tinyglobby: 0.2.16 optionalDependencies: '@types/node': 18.19.130 fsevents: 2.3.3 terser: 5.46.1 - vitest@3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.1): + vitest@4.1.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3))(vite@8.0.8(@types/node@18.19.130)(terser@5.46.1)): dependencies: - '@types/chai': 5.2.3 - '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.1)) - '@vitest/pretty-format': 3.2.4 - '@vitest/runner': 3.2.4 - '@vitest/snapshot': 3.2.4 - '@vitest/spy': 3.2.4 - '@vitest/utils': 3.2.4 - chai: 5.3.3 - debug: 4.4.3 + '@vitest/expect': 4.1.4 + '@vitest/mocker': 4.1.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3))(vite@8.0.8(@types/node@18.19.130)(terser@5.46.1)) + '@vitest/pretty-format': 4.1.4 + '@vitest/runner': 4.1.4 + '@vitest/snapshot': 4.1.4 + '@vitest/spy': 4.1.4 + '@vitest/utils': 4.1.4 + es-module-lexer: 2.0.0 expect-type: 1.3.0 magic-string: 0.30.21 + obug: 2.1.1 pathe: 2.0.3 picomatch: 4.0.4 - std-env: 3.10.0 + std-env: 4.0.0 tinybench: 2.9.0 - tinyexec: 0.3.2 - tinyglobby: 0.2.15 - tinypool: 1.1.1 - tinyrainbow: 2.0.0 - vite: 7.3.1(@types/node@18.19.130)(terser@5.46.1) - vite-node: 3.2.4(@types/node@18.19.130)(terser@5.46.1) + tinyexec: 1.1.1 + tinyglobby: 0.2.16 + tinyrainbow: 3.1.0 + vite: 8.0.8(@types/node@18.19.130)(terser@5.46.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 18.19.130 transitivePeerDependencies: - - jiti - - less - - lightningcss - msw - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml watchpack@2.5.1: dependencies: @@ -2079,7 +1848,7 @@ snapshots: webpack-sources@3.3.4: {} - webpack@5.105.4: + webpack@5.106.0: dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.8 @@ -2089,7 +1858,7 @@ snapshots: '@webassemblyjs/wasm-parser': 1.14.1 acorn: 8.16.0 acorn-import-phases: 1.0.4(acorn@8.16.0) - browserslist: 4.28.1 + browserslist: 4.28.2 chrome-trace-event: 1.0.4 enhanced-resolve: 5.20.1 es-module-lexer: 2.0.0 @@ -2102,8 +1871,8 @@ snapshots: mime-types: 2.1.35 neo-async: 2.6.2 schema-utils: 4.3.3 - tapable: 2.3.1 - terser-webpack-plugin: 5.4.0(webpack@5.105.4) + tapable: 2.3.2 + terser-webpack-plugin: 5.4.0(webpack@5.106.0) watchpack: 2.5.1 webpack-sources: 3.3.4 transitivePeerDependencies: diff --git a/reference.md b/reference.md index afdc72f..0932e24 100644 --- a/reference.md +++ b/reference.md @@ -4637,7 +4637,7 @@ await client.contacts.getContacts(); -
client.contacts.createContact({ ...params }) -> Brevo.CreateContactResponse +
client.contacts.createContact({ ...params }) -> Brevo.CreateContactResponse | undefined
@@ -6915,7 +6915,7 @@ await client.ecommerce.getCategories();
-
client.ecommerce.createUpdateCategory({ ...params }) -> Brevo.CreateUpdateCategoryResponse +
client.ecommerce.createUpdateCategory({ ...params }) -> Brevo.CreateUpdateCategoryResponse | undefined
@@ -7633,7 +7633,7 @@ await client.ecommerce.getProducts();
-
client.ecommerce.createUpdateProduct({ ...params }) -> Brevo.CreateUpdateProductResponse +
client.ecommerce.createUpdateProduct({ ...params }) -> Brevo.CreateUpdateProductResponse | undefined
diff --git a/src/BaseClient.ts b/src/BaseClient.ts index f8e7177..00b1d03 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createContact(request, requestOptions)); } private async __createContact( request: Brevo.CreateContactRequest = {}, requestOptions?: ContactsClient.RequestOptions, - ): Promise> { + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -152,7 +152,10 @@ export class ContactsClient { logging: this._options.logging, }); if (_response.ok) { - return { data: _response.body as Brevo.CreateContactResponse, rawResponse: _response.rawResponse }; + return { + data: _response.body as Brevo.CreateContactResponse | undefined, + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/contacts/client/requests/CreateContactRequest.ts b/src/api/resources/contacts/client/requests/CreateContactRequest.ts index c9ca9e7..85077ff 100644 --- a/src/api/resources/contacts/client/requests/CreateContactRequest.ts +++ b/src/api/resources/contacts/client/requests/CreateContactRequest.ts @@ -25,6 +25,6 @@ export interface CreateContactRequest { export namespace CreateContactRequest { export namespace Attributes { - export type Value = number | string | boolean | string[]; + export type Value = number | number | string | boolean | string[]; } } diff --git a/src/api/resources/contacts/client/requests/UpdateContactRequest.ts b/src/api/resources/contacts/client/requests/UpdateContactRequest.ts index 3ef5221..c67887b 100644 --- a/src/api/resources/contacts/client/requests/UpdateContactRequest.ts +++ b/src/api/resources/contacts/client/requests/UpdateContactRequest.ts @@ -31,6 +31,6 @@ export interface UpdateContactRequest { export namespace UpdateContactRequest { export namespace Attributes { - export type Value = number | string | boolean | string[]; + export type Value = number | number | string | boolean | string[]; } } diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index b85d222..1a92a4c 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -109,14 +109,14 @@ export class EcommerceClient { public createUpdateCategory( request: Brevo.CreateUpdateCategoryRequest, requestOptions?: EcommerceClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createUpdateCategory(request, requestOptions)); } private async __createUpdateCategory( request: Brevo.CreateUpdateCategoryRequest, requestOptions?: EcommerceClient.RequestOptions, - ): Promise> { + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -143,7 +143,10 @@ export class EcommerceClient { logging: this._options.logging, }); if (_response.ok) { - return { data: _response.body as Brevo.CreateUpdateCategoryResponse, rawResponse: _response.rawResponse }; + return { + data: _response.body as Brevo.CreateUpdateCategoryResponse | undefined, + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { @@ -1108,14 +1111,14 @@ export class EcommerceClient { public createUpdateProduct( request: Brevo.CreateUpdateProductRequest, requestOptions?: EcommerceClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createUpdateProduct(request, requestOptions)); } private async __createUpdateProduct( request: Brevo.CreateUpdateProductRequest, requestOptions?: EcommerceClient.RequestOptions, - ): Promise> { + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1142,7 +1145,10 @@ export class EcommerceClient { logging: this._options.logging, }); if (_response.ok) { - return { data: _response.body as Brevo.CreateUpdateProductResponse, rawResponse: _response.rawResponse }; + return { + data: _response.body as Brevo.CreateUpdateProductResponse | undefined, + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/event/client/requests/CreateEventRequest.ts b/src/api/resources/event/client/requests/CreateEventRequest.ts index 78a6315..5729e3e 100644 --- a/src/api/resources/event/client/requests/CreateEventRequest.ts +++ b/src/api/resources/event/client/requests/CreateEventRequest.ts @@ -24,11 +24,11 @@ export interface CreateEventRequest { export namespace CreateEventRequest { export namespace ContactProperties { - export type Value = string | number; + export type Value = string | number | boolean; } export namespace EventProperties { - export type Value = string | number | Record | unknown[]; + export type Value = string | number | boolean | Record | unknown[]; } /** diff --git a/src/api/resources/event/types/CreateBatchEventsRequestItem.ts b/src/api/resources/event/types/CreateBatchEventsRequestItem.ts index 2ccc0ac..88da2d1 100644 --- a/src/api/resources/event/types/CreateBatchEventsRequestItem.ts +++ b/src/api/resources/event/types/CreateBatchEventsRequestItem.ts @@ -17,11 +17,11 @@ export interface CreateBatchEventsRequestItem { export namespace CreateBatchEventsRequestItem { export namespace ContactProperties { - export type Value = string | number; + export type Value = string | number | boolean; } export namespace EventProperties { - export type Value = string | number | Record | unknown[]; + export type Value = string | number | boolean | Record | unknown[]; } /** diff --git a/src/api/resources/process/types/GetProcessResponse.ts b/src/api/resources/process/types/GetProcessResponse.ts index 75de873..8ce6ad6 100644 --- a/src/api/resources/process/types/GetProcessResponse.ts +++ b/src/api/resources/process/types/GetProcessResponse.ts @@ -34,6 +34,7 @@ export namespace GetProcessResponse { /** Current status of the process */ export const Status = { Queued: "queued", + InProcess: "in_process", Processing: "processing", Completed: "completed", Failed: "failed", @@ -62,8 +63,8 @@ export namespace GetProcessResponse { duplicate_contact_id?: (number | null) | undefined; /** Number of duplicate external IDs */ duplicate_ext_id?: (number | null) | undefined; - /** Number of duplicate email IDs */ - duplicate_email_id?: (number | null) | undefined; + /** URL to CSV file containing duplicate email IDs, or null if none */ + duplicate_email_id?: (string | null) | undefined; /** Number of duplicate phone numbers */ duplicate_phone_id?: (number | null) | undefined; /** Number of duplicate WhatsApp numbers */ diff --git a/src/api/resources/process/types/GetProcessesResponse.ts b/src/api/resources/process/types/GetProcessesResponse.ts index b034580..7187111 100644 --- a/src/api/resources/process/types/GetProcessesResponse.ts +++ b/src/api/resources/process/types/GetProcessesResponse.ts @@ -45,6 +45,7 @@ export namespace GetProcessesResponse { /** Current status of the process */ export const Status = { Queued: "queued", + InProcess: "in_process", Processing: "processing", Completed: "completed", Failed: "failed", @@ -73,8 +74,8 @@ export namespace GetProcessesResponse { duplicate_contact_id?: (number | null) | undefined; /** Number of duplicate external IDs */ duplicate_ext_id?: (number | null) | undefined; - /** Number of duplicate email IDs */ - duplicate_email_id?: (number | null) | undefined; + /** URL to CSV file containing duplicate email IDs, or null if none */ + duplicate_email_id?: (string | null) | undefined; /** Number of duplicate phone numbers */ duplicate_phone_id?: (number | null) | undefined; /** Number of duplicate WhatsApp numbers */ diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts index a642359..f34fca5 100644 --- a/src/core/auth/BasicAuth.ts +++ b/src/core/auth/BasicAuth.ts @@ -1,8 +1,8 @@ import { base64Decode, base64Encode } from "../base64.js"; export interface BasicAuth { - username: string; - password: string; + username?: string; + password?: string; } const BASIC_AUTH_HEADER_PREFIX = /^Basic /i; @@ -12,7 +12,12 @@ export const BasicAuth = { if (basicAuth == null) { return undefined; } - const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`); + const username = basicAuth.username ?? ""; + const password = basicAuth.password ?? ""; + if (username === "" && password === "") { + return undefined; + } + const token = base64Encode(`${username}:${password}`); return `Basic ${token}`; }, fromAuthorizationHeader: (header: string): BasicAuth => { diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 764d2e1..928dfea 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -56,11 +56,13 @@ export declare namespace Fetcher { export interface TimeoutError { reason: "timeout"; + cause?: unknown; } export interface UnknownError { reason: "unknown"; errorMessage: string; + cause?: unknown; } } @@ -338,6 +340,7 @@ export async function fetcherImpl(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise { try { const fs = await import("fs"); - if (!fs || !fs.promises || !fs.promises.stat) { + if (!fs?.promises?.stat) { return undefined; } const fileStat = await fs.promises.stat(path); diff --git a/src/core/form-data-utils/FormDataWrapper.ts b/src/core/form-data-utils/FormDataWrapper.ts index bea0cf8..c4ae3f4 100644 --- a/src/core/form-data-utils/FormDataWrapper.ts +++ b/src/core/form-data-utils/FormDataWrapper.ts @@ -109,7 +109,7 @@ async function streamToBuffer(stream: unknown): Promise { async function convertToBlob(value: unknown, contentType?: string): Promise { if (isStreamLike(value) || isReadableStream(value)) { const buffer = await streamToBuffer(value); - return new Blob([buffer], { type: contentType }); + return new Blob([buffer as BlobPart], { type: contentType }); } if (value instanceof Blob) { @@ -117,7 +117,7 @@ async function convertToBlob(value: unknown, contentType?: string): Promise { interface ToHeaderTestCase { description: string; - input: { username: string; password: string }; - expected: string; + input: { username?: string; password?: string }; + expected: string | undefined; } interface FromHeaderTestCase { @@ -22,10 +22,30 @@ describe("BasicAuth", () => { describe("toAuthorizationHeader", () => { const toHeaderTests: ToHeaderTestCase[] = [ { - description: "correctly converts to header", + description: "correctly converts to header with both username and password", input: { username: "username", password: "password" }, expected: "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", }, + { + description: "encodes username only with trailing colon", + input: { username: "username" }, + expected: "Basic dXNlcm5hbWU6", + }, + { + description: "encodes password only with leading colon", + input: { password: "password" }, + expected: "Basic OnBhc3N3b3Jk", + }, + { + description: "returns undefined when neither provided", + input: {}, + expected: undefined, + }, + { + description: "returns undefined when both are empty strings", + input: { username: "", password: "" }, + expected: undefined, + }, ]; toHeaderTests.forEach(({ description, input, expected }) => { diff --git a/tests/wire/account.test.ts b/tests/wire/account.test.ts index 6902f7d..130fc50 100644 --- a/tests/wire/account.test.ts +++ b/tests/wire/account.test.ts @@ -71,95 +71,7 @@ describe("AccountClient", () => { server.mockEndpoint().get("/account").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.account.getAccount(); - expect(response).toEqual({ - organization_id: "5fa2b8c123456789abcdef01", - user_id: 1234567, - enterprise: false, - companyName: "Acme Marketing Corp", - email: "michael.davis@example.com", - firstName: "Michael", - lastName: "Davis", - address: { - city: "New York", - country: "United States", - street: "456 Business Ave", - zipCode: "10001", - }, - dateTimePreferences: { - timezone: "America/New_York", - timeFormat: "12", - dateFormat: "mm-dd-yyyy", - }, - marketingAutomation: { - enabled: true, - key: "ma8k2x9v4h7p3d6f1c5e8b2a", - }, - plan: [ - { - credits: 250, - creditsType: "sendLimit", - endDate: "1753826567", - startDate: "1751234567", - type: "free", - }, - { - credits: 15, - creditsType: "sendLimit", - endDate: "1753826567", - startDate: "1751234567", - type: "sms", - }, - ], - planVerticals: [ - { - planCategory: "Marketing", - planType: "free", - name: "Free", - status: "active", - startDate: "1751234567", - endDate: "1753826567", - users: { - purchasedSeats: "1", - usedSeats: "1", - }, - credits: "250", - }, - { - planCategory: "Chat", - planType: "free", - name: "Free", - status: "active", - startDate: "1735678901", - endDate: "1767214901", - users: { - purchasedSeats: "1", - usedSeats: "1", - }, - credits: "250", - }, - { - planCategory: "CRM", - planType: "free", - name: "Free", - status: "active", - startDate: "1735678900", - endDate: "1767214900", - users: { - purchasedSeats: "1", - usedSeats: "1", - }, - credits: "250", - }, - ], - relay: { - data: { - port: 587, - relay: "smtp-relay.brevo.com", - userName: "michael.davis@example.com", - }, - enabled: true, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getAccountActivity (1)", async () => { @@ -194,24 +106,7 @@ describe("AccountClient", () => { .build(); const response = await client.account.getAccountActivity(); - expect(response).toEqual({ - logs: [ - { - action: "login-success", - date: "2023-03-16T16:49:23+05:30", - user_agent: "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)", - user_email: "test@mycompany.com", - user_ip: "192.158.1.34", - }, - { - action: "update-profile", - date: "2023-03-15T16:49:23+05:30", - user_agent: "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)", - user_email: "test@myexample.com", - user_ip: "192.158.1.38", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getAccountActivity (2)", async () => { diff --git a/tests/wire/balance.test.ts b/tests/wire/balance.test.ts index 7acf454..e7649d2 100644 --- a/tests/wire/balance.test.ts +++ b/tests/wire/balance.test.ts @@ -35,18 +35,7 @@ describe("BalanceClient", () => { contact_id: 1, balance_definition_id: "balance_definition_id", }); - expect(response).toEqual({ - balanceDefinitionId: "balanceDefinitionId", - constraintType: "constraintType", - createdAt: "createdAt", - durationUnit: "durationUnit", - durationValue: 1, - id: "id", - slidingSchedule: true, - transactionType: "transactionType", - updatedAt: "updatedAt", - value: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("getActiveBalancesApi (2)", async () => { @@ -206,34 +195,7 @@ describe("BalanceClient", () => { const response = await client.balance.getBalanceDefinitionList({ pid: "pid", }); - expect(response).toEqual({ - items: [ - { - balanceAvailabilityDurationModifier: "startOfPeriod", - balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", - balanceAvailabilityDurationValue: 1, - balanceExpirationDate: "2024-01-15T09:30:00Z", - balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", - balanceOptionCreditRounding: "balanceOptionCreditRounding", - balanceOptionDebitRounding: "balanceOptionDebitRounding", - createdAt: "2024-01-15T09:30:00Z", - deletedAt: "deletedAt", - description: "description", - id: "id", - imageRef: "imageRef", - maxAmount: 1.1, - maxCreditAmountLimit: 1.1, - maxDebitAmountLimit: 1.1, - meta: { - key: "value", - }, - minAmount: 1.1, - name: "name", - unit: "unit", - updatedAt: "updatedAt", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getBalanceDefinitionList (2)", async () => { @@ -361,30 +323,7 @@ describe("BalanceClient", () => { name: "name", unit: "POINTS", }); - expect(response).toEqual({ - balanceAvailabilityDurationModifier: "startOfPeriod", - balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", - balanceAvailabilityDurationValue: 1, - balanceExpirationDate: "2024-01-15T09:30:00Z", - balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", - balanceOptionCreditRounding: "balanceOptionCreditRounding", - balanceOptionDebitRounding: "balanceOptionDebitRounding", - createdAt: "2024-01-15T09:30:00Z", - deletedAt: "deletedAt", - description: "description", - id: "id", - imageRef: "imageRef", - maxAmount: 1.1, - maxCreditAmountLimit: 1.1, - maxDebitAmountLimit: 1.1, - meta: { - key: "value", - }, - minAmount: 1.1, - name: "name", - unit: "unit", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("createBalanceDefinition (2)", async () => { @@ -546,30 +485,7 @@ describe("BalanceClient", () => { pid: "pid", bdid: "bdid", }); - expect(response).toEqual({ - balanceAvailabilityDurationModifier: "startOfPeriod", - balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", - balanceAvailabilityDurationValue: 1, - balanceExpirationDate: "2024-01-15T09:30:00Z", - balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", - balanceOptionCreditRounding: "balanceOptionCreditRounding", - balanceOptionDebitRounding: "balanceOptionDebitRounding", - createdAt: "2024-01-15T09:30:00Z", - deletedAt: "deletedAt", - description: "description", - id: "id", - imageRef: "imageRef", - maxAmount: 1.1, - maxCreditAmountLimit: 1.1, - maxDebitAmountLimit: 1.1, - meta: { - key: "value", - }, - minAmount: 1.1, - name: "name", - unit: "unit", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("getBalanceDefinition (2)", async () => { @@ -724,30 +640,7 @@ describe("BalanceClient", () => { name: "name", unit: "POINTS", }); - expect(response).toEqual({ - balanceAvailabilityDurationModifier: "startOfPeriod", - balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", - balanceAvailabilityDurationValue: 1, - balanceExpirationDate: "2024-01-15T09:30:00Z", - balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", - balanceOptionCreditRounding: "balanceOptionCreditRounding", - balanceOptionDebitRounding: "balanceOptionDebitRounding", - createdAt: "2024-01-15T09:30:00Z", - deletedAt: "deletedAt", - description: "description", - id: "id", - imageRef: "imageRef", - maxAmount: 1.1, - maxCreditAmountLimit: 1.1, - maxDebitAmountLimit: 1.1, - meta: { - key: "value", - }, - minAmount: 1.1, - name: "name", - unit: "unit", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("updateBalanceDefinition (2)", async () => { @@ -1069,18 +962,7 @@ describe("BalanceClient", () => { transactionType: "credit", value: 1, }); - expect(response).toEqual({ - balanceDefinitionId: "balanceDefinitionId", - constraintType: "constraintType", - createdAt: "createdAt", - durationUnit: "durationUnit", - durationValue: 1, - id: "id", - slidingSchedule: true, - transactionType: "transactionType", - updatedAt: "updatedAt", - value: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("createBalanceLimit (2)", async () => { @@ -1283,18 +1165,7 @@ describe("BalanceClient", () => { bdid: "bdid", blid: "blid", }); - expect(response).toEqual({ - balanceDefinitionId: "balanceDefinitionId", - constraintType: "constraintType", - createdAt: "createdAt", - durationUnit: "durationUnit", - durationValue: 1, - id: "id", - slidingSchedule: true, - transactionType: "transactionType", - updatedAt: "updatedAt", - value: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("getBalanceLimit (2)", async () => { @@ -1454,18 +1325,7 @@ describe("BalanceClient", () => { transactionType: "credit", value: 1, }); - expect(response).toEqual({ - balanceDefinitionId: "balanceDefinitionId", - constraintType: "constraintType", - createdAt: "createdAt", - durationUnit: "durationUnit", - durationValue: 1, - id: "id", - slidingSchedule: true, - transactionType: "transactionType", - updatedAt: "updatedAt", - value: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("updateBalanceLimit (2)", async () => { @@ -1801,19 +1661,7 @@ describe("BalanceClient", () => { const response = await client.balance.getContactBalances({ pid: "pid", }); - expect(response).toEqual({ - balanceDefinitionId: "balanceDefinitionId", - balances: [ - { - contactId: 1, - loyaltySubscriptionId: "loyaltySubscriptionId", - updatedAt: "updatedAt", - value: 1.1, - }, - ], - count: 1, - loyaltyProgramId: "loyaltyProgramId", - }); + expect(response).toEqual(rawResponseBody); }); test("getContactBalances (2)", async () => { @@ -1963,22 +1811,7 @@ describe("BalanceClient", () => { dueAt: "dueAt", source: "source", }); - expect(response).toEqual({ - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - contactId: 1, - createdAt: "createdAt", - dueAt: "dueAt", - expiresAt: "expiresAt", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - processedAt: "processedAt", - transactionid: "transactionid", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("createBalanceOrder (2)", async () => { @@ -2131,14 +1964,7 @@ describe("BalanceClient", () => { pid: "pid", cid: "cid", }); - expect(response).toEqual({ - balance: [ - { - balanceDefinitionId: "balanceDefinitionId", - value: 1.1, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getSubscriptionBalances (2)", async () => { @@ -2281,17 +2107,7 @@ describe("BalanceClient", () => { cid: "cid", balanceDefinitionId: "balanceDefinitionId", }); - expect(response).toEqual({ - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - consumedAt: "consumedAt", - contactId: 1, - createdAt: "createdAt", - expiresAt: "expiresAt", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - organizationId: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("createSubscriptionBalances (2)", async () => { @@ -2452,28 +2268,7 @@ describe("BalanceClient", () => { contactId: 1, balanceDefinitionId: "balanceDefinitionId", }); - expect(response).toEqual({ - balanceDefinitionId: "balanceDefinitionId", - contactId: 1, - count: 1, - loyaltyProgramId: "loyaltyProgramId", - transactionHistory: [ - { - amount: 1.1, - balanceExpirationDate: "balanceExpirationDate", - cancelledAt: "cancelledAt", - completedAt: "completedAt", - createdAt: "createdAt", - id: "id", - meta: { - key: "value", - }, - rejectReason: "rejectReason", - rejectedAt: "rejectedAt", - status: "status", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getTransactionHistoryApi (2)", async () => { @@ -2627,25 +2422,7 @@ describe("BalanceClient", () => { amount: 1.1, balanceDefinitionId: "balanceDefinitionId", }); - expect(response).toEqual({ - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - cancelledAt: "cancelledAt", - completedAt: "completedAt", - contactId: 1, - createdAt: "createdAt", - eventTime: "eventTime", - expirationDate: "expirationDate", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - rejectReason: "rejectReason", - rejectedAt: "rejectedAt", - status: "status", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("beginTransaction (2)", async () => { @@ -2802,25 +2579,7 @@ describe("BalanceClient", () => { pid: "pid", tid: "tid", }); - expect(response).toEqual({ - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - cancelledAt: "cancelledAt", - completedAt: "completedAt", - contactId: 1, - createdAt: "createdAt", - eventTime: "eventTime", - expirationDate: "expirationDate", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - rejectReason: "rejectReason", - rejectedAt: "rejectedAt", - status: "status", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("cancelTransaction (2)", async () => { @@ -2967,25 +2726,7 @@ describe("BalanceClient", () => { pid: "pid", tid: "tid", }); - expect(response).toEqual({ - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - cancelledAt: "cancelledAt", - completedAt: "completedAt", - contactId: 1, - createdAt: "createdAt", - eventTime: "eventTime", - expirationDate: "expirationDate", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - rejectReason: "rejectReason", - rejectedAt: "rejectedAt", - status: "status", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("completeTransaction (2)", async () => { diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts index ee90cfc..0913181 100644 --- a/tests/wire/companies.test.ts +++ b/tests/wire/companies.test.ts @@ -37,30 +37,7 @@ describe("CompaniesClient", () => { server.mockEndpoint().get("/companies").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.getAllCompanies(); - expect(response).toEqual({ - items: [ - { - attributes: { - created_at: "2022-01-13T19:04:24.376+05:30", - domain: "xyz", - last_updated_at: "2022-04-01T18:47:48.283+05:30", - name: "text", - number_of_contacts: 0, - owner: "62260474111b1101704a9d85", - owner_assign_date: "2022-04-01T18:21:13.379+05:30", - phone_number: 8171844192, - revenue: 10, - }, - id: "629475917295261d9b1f4403", - linkedContactsIds: [1, 2, 3], - linkedDealsIds: [ - "61a5ce58c5d4795761045990", - "61a5ce58c5d4795761045991", - "61a5ce58c5d4795761045992", - ], - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getAllCompanies (2)", async () => { @@ -94,9 +71,7 @@ describe("CompaniesClient", () => { const response = await client.companies.createACompany({ name: "company", }); - expect(response).toEqual({ - id: "61a5cd07ca1347c82306ad06", - }); + expect(response).toEqual(rawResponseBody); }); test("createACompany (2)", async () => { @@ -188,22 +163,7 @@ describe("CompaniesClient", () => { const response = await client.companies.getACompany({ id: "id", }); - expect(response).toEqual({ - attributes: { - created_at: "2022-01-13T19:04:24.376+05:30", - domain: "xyz", - last_updated_at: "2022-04-01T18:47:48.283+05:30", - name: "text", - number_of_contacts: 0, - owner: "62260474111b1101704a9d85", - owner_assign_date: "2022-04-01T18:21:13.379+05:30", - phone_number: 8171844192, - revenue: 10, - }, - id: "629475917295261d9b1f4403", - linkedContactsIds: [1, 2, 3], - linkedDealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - }); + expect(response).toEqual(rawResponseBody); }); test("getACompany (2)", async () => { @@ -311,22 +271,7 @@ describe("CompaniesClient", () => { const response = await client.companies.updateACompany({ id: "id", }); - expect(response).toEqual({ - attributes: { - created_at: "2022-01-13T19:04:24.376+05:30", - domain: "xyz", - last_updated_at: "2022-04-01T18:47:48.283+05:30", - name: "text", - number_of_contacts: 0, - owner: "62260474111b1101704a9d85", - owner_assign_date: "2022-04-01T18:21:13.379+05:30", - phone_number: 8171844192, - revenue: 10, - }, - id: "629475917295261d9b1f4403", - linkedContactsIds: [1, 2, 3], - linkedDealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - }); + expect(response).toEqual(rawResponseBody); }); test("updateACompany (2)", async () => { @@ -393,9 +338,7 @@ describe("CompaniesClient", () => { label: "Attribute Label", objectType: "companies", }); - expect(response).toEqual({ - id: "61a5cd07ca1347c82306ad07", - }); + expect(response).toEqual(rawResponseBody); }); test("createACompanyDealAttribute (2)", async () => { @@ -562,19 +505,6 @@ describe("CompaniesClient", () => { .build(); const response = await client.companies.getCompanyAttributes(); - expect(response).toEqual([ - { - attributeOptions: [ - { - key: "custom key", - value: "custom label", - }, - ], - attributeTypeName: "text", - internalName: "name", - isRequired: true, - label: "Company Name", - }, - ]); + expect(response).toEqual(rawResponseBody); }); }); diff --git a/tests/wire/contacts.test.ts b/tests/wire/contacts.test.ts index 3a16f97..2eb22f7 100644 --- a/tests/wire/contacts.test.ts +++ b/tests/wire/contacts.test.ts @@ -40,33 +40,7 @@ describe("ContactsClient", () => { server.mockEndpoint().get("/contacts").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.contacts.getContacts(); - expect(response).toEqual({ - contacts: [ - { - attributes: {}, - createdAt: "2017-05-01T17:05:03Z", - email: "contact1@example.com", - emailBlacklisted: true, - id: 247, - listIds: [43, 58], - listUnsubscribed: [1000000], - modifiedAt: "2017-05-01T17:05:03Z", - smsBlacklisted: true, - }, - { - attributes: {}, - createdAt: "2017-05-01T17:05:03Z", - email: "33058407248@mailin-sms.com", - emailBlacklisted: true, - id: 245, - listIds: [43, 61, 58], - listUnsubscribed: [1000000], - modifiedAt: "2017-05-01T17:05:03Z", - smsBlacklisted: false, - }, - ], - count: 3, - }); + expect(response).toEqual(rawResponseBody); }); test("getContacts (2)", async () => { @@ -111,9 +85,7 @@ describe("ContactsClient", () => { .build(); const response = await client.contacts.createContact(); - expect(response).toEqual({ - id: 21, - }); + expect(response).toEqual(rawResponseBody); }); test("createContact (2)", async () => { @@ -226,96 +198,7 @@ describe("ContactsClient", () => { .build(); const response = await client.contacts.getAttributes(); - expect(response).toEqual({ - attributes: [ - { - calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", - category: "normal", - enumeration: [ - { - label: "Women", - value: 1, - }, - ], - multiCategoryOptions: ["USA"], - name: "LASTNAME", - type: "text", - }, - { - calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", - category: "normal", - enumeration: [ - { - label: "Women", - value: 1, - }, - ], - multiCategoryOptions: ["USA"], - name: "FIRSTNAME", - type: "text", - }, - { - calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", - category: "normal", - enumeration: [ - { - label: "Women", - value: 1, - }, - ], - multiCategoryOptions: ["USA"], - name: "DOB", - type: "date", - }, - { - calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", - category: "category", - enumeration: [ - { - label: "Men", - value: 1, - }, - { - label: "Women", - value: 2, - }, - { - label: "Kid", - value: 3, - }, - ], - multiCategoryOptions: ["USA"], - name: "GENDER", - type: "text", - }, - { - calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", - category: "normal", - enumeration: [ - { - label: "Women", - value: 1, - }, - ], - multiCategoryOptions: ["USA"], - name: "BDO", - type: "user", - }, - { - calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", - category: "normal", - enumeration: [ - { - label: "Women", - value: 1, - }, - ], - multiCategoryOptions: ["USA", "India", "France"], - name: "COUNTRY", - type: "multiple-choice", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("createAttribute (1)", async () => { @@ -655,9 +538,7 @@ describe("ContactsClient", () => { const response = await client.contacts.requestContactExport({ customContactFilter: {}, }); - expect(response).toEqual({ - processId: 78, - }); + expect(response).toEqual(rawResponseBody); }); test("requestContactExport (2)", async () => { @@ -719,25 +600,7 @@ describe("ContactsClient", () => { server.mockEndpoint().get("/contacts/folders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.contacts.getFolders(); - expect(response).toEqual({ - count: 2, - folders: [ - { - id: 42, - name: "Ninja_Form", - totalBlacklisted: 98, - totalSubscribers: 4567, - uniqueSubscribers: 4665, - }, - { - id: 29, - name: "Prestashop", - totalBlacklisted: 10, - totalSubscribers: 6543, - uniqueSubscribers: 6553, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getFolders (2)", async () => { @@ -769,9 +632,7 @@ describe("ContactsClient", () => { .build(); const response = await client.contacts.createFolder({}); - expect(response).toEqual({ - id: 5, - }); + expect(response).toEqual(rawResponseBody); }); test("createFolder (2)", async () => { @@ -817,13 +678,7 @@ describe("ContactsClient", () => { const response = await client.contacts.getFolder({ folderId: 1000000, }); - expect(response).toEqual({ - id: 1, - name: "Client_Folder", - totalBlacklisted: 987, - totalSubscribers: 16778, - uniqueSubscribers: 17765, - }); + expect(response).toEqual(rawResponseBody); }); test("getFolder (2)", async () => { @@ -1012,32 +867,7 @@ describe("ContactsClient", () => { const response = await client.contacts.getFolderLists({ folderId: 1000000, }); - expect(response).toEqual({ - count: 3, - lists: [ - { - id: 46, - name: "Reactiv", - totalBlacklisted: 0, - totalSubscribers: 7655, - uniqueSubscribers: 7655, - }, - { - id: 41, - name: "NY_Area", - totalBlacklisted: 23, - totalSubscribers: 3654, - uniqueSubscribers: 3677, - }, - { - id: 22, - name: "VIP_Customer", - totalBlacklisted: 72, - totalSubscribers: 8753, - uniqueSubscribers: 8826, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getFolderLists (2)", async () => { @@ -1098,9 +928,7 @@ describe("ContactsClient", () => { .build(); const response = await client.contacts.importContacts(); - expect(response).toEqual({ - processId: 78, - }); + expect(response).toEqual(rawResponseBody); }); test("importContacts (2)", async () => { @@ -1152,27 +980,7 @@ describe("ContactsClient", () => { server.mockEndpoint().get("/contacts/lists").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.contacts.getLists(); - expect(response).toEqual({ - count: 2, - lists: [ - { - id: 53, - name: "Spanish_Speakers", - totalBlacklisted: 65, - totalSubscribers: 5432, - uniqueSubscribers: 5497, - folderId: 1, - }, - { - id: 50, - name: "Other", - totalBlacklisted: 765, - totalSubscribers: 10976, - uniqueSubscribers: 11741, - folderId: 2, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getLists (2)", async () => { @@ -1207,9 +1015,7 @@ describe("ContactsClient", () => { folderId: 2, name: "Magento Customer - ES", }); - expect(response).toEqual({ - id: 5, - }); + expect(response).toEqual(rawResponseBody); }); test("createList (2)", async () => { @@ -1309,64 +1115,7 @@ describe("ContactsClient", () => { const response = await client.contacts.getList({ listId: 1000000, }); - expect(response).toEqual({ - id: 12, - name: "Newsletter_Weekly", - totalBlacklisted: 63, - totalSubscribers: 6533, - uniqueSubscribers: 6596, - campaignStats: [ - { - campaignId: 15, - stats: { - appleMppOpens: 10, - clickers: 789, - complaints: 0, - deferred: 0, - delivered: 6632, - estimatedViews: 560, - hardBounces: 4, - listId: 2, - opensRate: 29.54, - returnBounce: 5, - sent: 6645, - softBounces: 34, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 701, - uniqueViews: 3442, - unsubscriptions: 4, - viewed: 4322, - }, - }, - { - campaignId: 45, - stats: { - appleMppOpens: 10, - clickers: 788, - complaints: 1, - deferred: 0, - delivered: 4078, - estimatedViews: 560, - hardBounces: 2, - listId: 2, - opensRate: 29.54, - returnBounce: 5, - sent: 4334, - softBounces: 18, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 654, - uniqueViews: 987, - unsubscriptions: 4, - viewed: 1555, - }, - }, - ], - createdAt: "2016-02-26T11:56:08Z", - dynamicList: false, - folderId: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("getList (2)", async () => { @@ -1582,44 +1331,7 @@ describe("ContactsClient", () => { const response = await client.contacts.getContactsFromList({ listId: 1000000, }); - expect(response).toEqual({ - contacts: [ - { - attributes: {}, - createdAt: "2017-05-12T12:30:00Z", - email: "alex.pain@example.com", - emailBlacklisted: false, - id: 45, - listIds: [12, 9, 20], - listUnsubscribed: [1, 2], - modifiedAt: "2017-05-12T12:30:00Z", - smsBlacklisted: true, - }, - { - attributes: {}, - createdAt: "2017-05-12T12:30:00Z", - email: "john.smith@example.com", - emailBlacklisted: true, - id: 32, - listIds: [12], - listUnsubscribed: [1], - modifiedAt: "2017-05-12T12:30:00Z", - smsBlacklisted: false, - }, - { - attributes: {}, - createdAt: "2017-05-12T12:30:00Z", - email: "helen.rose@example.com", - emailBlacklisted: true, - id: 65, - listIds: [12, 9, 20], - listUnsubscribed: [1], - modifiedAt: "2017-05-12T12:30:00Z", - smsBlacklisted: false, - }, - ], - count: 17655, - }); + expect(response).toEqual(rawResponseBody); }); test("getContactsFromList (2)", async () => { @@ -1692,14 +1404,7 @@ describe("ContactsClient", () => { emails: ["jeff32@example.com", "jim56@example.com"], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("addContactToList (2)", async () => { @@ -1730,14 +1435,7 @@ describe("ContactsClient", () => { extIds: ["ext234", "ext456"], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("addContactToList (3)", async () => { @@ -1768,14 +1466,7 @@ describe("ContactsClient", () => { ids: [1, 2], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("addContactToList (4)", async () => { @@ -1806,14 +1497,7 @@ describe("ContactsClient", () => { emails: ["jeff32@example.com", "jim56@example.com"], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("addContactToList (5)", async () => { @@ -1844,14 +1528,7 @@ describe("ContactsClient", () => { emails: ["jeff32@example.com", "jim56@example.com"], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("addContactToList (6)", async () => { @@ -1882,14 +1559,7 @@ describe("ContactsClient", () => { emails: ["jeff32@example.com", "jim56@example.com"], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("addContactToList (7)", async () => { @@ -1966,14 +1636,7 @@ describe("ContactsClient", () => { all: true, }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("removeContactFromList (2)", async () => { @@ -2004,14 +1667,7 @@ describe("ContactsClient", () => { emails: ["jeff32@example.com", "jim56@example.com"], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("removeContactFromList (3)", async () => { @@ -2042,14 +1698,7 @@ describe("ContactsClient", () => { extIds: ["ext234", "ext456"], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("removeContactFromList (4)", async () => { @@ -2080,14 +1729,7 @@ describe("ContactsClient", () => { ids: [1, 2], }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("removeContactFromList (5)", async () => { @@ -2118,14 +1760,7 @@ describe("ContactsClient", () => { all: true, }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("removeContactFromList (6)", async () => { @@ -2156,14 +1791,7 @@ describe("ContactsClient", () => { all: true, }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("removeContactFromList (7)", async () => { @@ -2194,14 +1822,7 @@ describe("ContactsClient", () => { all: true, }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("removeContactFromList (8)", async () => { @@ -2232,14 +1853,7 @@ describe("ContactsClient", () => { all: true, }, }); - expect(response).toEqual({ - contacts: { - failure: ["jeff32@example.com, jim56@example.com"], - processId: 78, - success: ["success"], - total: 27, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("removeContactFromList (9)", async () => { @@ -2303,23 +1917,7 @@ describe("ContactsClient", () => { server.mockEndpoint().get("/contacts/segments").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.contacts.getSegments(); - expect(response).toEqual({ - count: 2, - segments: [ - { - categoryName: "Name1", - id: 53, - segmentName: "Segment1", - updatedAt: "2017-03-12T12:30:00Z", - }, - { - categoryName: "Name2", - id: 50, - segmentName: "Segment2", - updatedAt: "2017-03-12T12:30:00Z", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getSegments (2)", async () => { @@ -2394,96 +1992,7 @@ describe("ContactsClient", () => { const response = await client.contacts.getContactInfo({ identifier: "identifier", }); - expect(response).toEqual({ - attributes: {}, - createdAt: "2017-05-02T16:40:31Z", - email: "peggy.rain@example.com", - emailBlacklisted: false, - id: 42, - listIds: [40], - listUnsubscribed: [1000000], - modifiedAt: "2017-05-02T16:40:31Z", - smsBlacklisted: false, - statistics: { - clicked: [ - { - campaignId: 21, - links: [ - { - count: 2, - eventTime: "2016-05-03T21:25:01Z", - ip: "66.249.93.118", - url: "https://url.domain.com/fbe5387ec717e333628380454f68670010b205ff/1/go?uid={EMAIL}&utm_source=brevo&utm_campaign=test_camp&utm_medium=email", - }, - ], - }, - ], - complaints: [ - { - campaignId: 3, - eventTime: "2017-03-12T20:15:13Z", - }, - ], - delivered: [ - { - campaignId: 21, - eventTime: "2016-05-03T21:24:56Z", - }, - ], - hardBounces: [ - { - campaignId: 3, - eventTime: "2017-03-12T20:15:13Z", - }, - ], - messagesSent: [ - { - campaignId: 21, - eventTime: "2016-05-03T20:15:13Z", - }, - { - campaignId: 42, - eventTime: "2016-10-17T10:30:01Z", - }, - ], - opened: [ - { - campaignId: 21, - count: 2, - eventTime: "2016-05-03T21:24:56Z", - ip: "66.249.93.118", - }, - { - campaignId: 68, - count: 1, - eventTime: "2017-01-30T13:56:40Z", - ip: "66.249.93.217", - }, - ], - softBounces: [ - { - campaignId: 3, - eventTime: "2017-03-12T20:15:13Z", - }, - ], - transacAttributes: [{}], - unsubscriptions: { - adminUnsubscription: [ - { - eventTime: "2017-03-12T20:15:13Z", - ip: "165.87.3.15", - }, - ], - userUnsubscription: [ - { - campaignId: 3, - eventTime: "2017-03-12T20:15:13Z", - ip: "165.87.3.15", - }, - ], - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getContactInfo (2)", async () => { @@ -2737,95 +2246,7 @@ describe("ContactsClient", () => { const response = await client.contacts.getContactStats({ identifier: "identifier", }); - expect(response).toEqual({ - clicked: [ - { - campaignId: 21, - links: [ - { - count: 2, - eventTime: "2016-05-03T21:25:01Z", - ip: "66.249.93.118", - url: "https://url.domain.com/fbe5387ec717e333628380454f68670010b205ff/1/go?uid={EMAIL}&utm_source=brevo&utm_campaign=test_camp&utm_medium=email", - }, - ], - }, - ], - complaints: [ - { - campaignId: 3, - eventTime: "2017-03-12T20:15:13Z", - }, - ], - delivered: [ - { - campaignId: 21, - eventTime: "2016-05-03T21:24:56Z", - }, - ], - hardBounces: [ - { - campaignId: 3, - eventTime: "2017-03-12T20:15:13Z", - }, - ], - messagesSent: [ - { - campaignId: 21, - eventTime: "2016-05-03T20:15:13Z", - }, - { - campaignId: 42, - eventTime: "2016-10-17T10:30:01Z", - }, - { - campaignId: 45, - eventTime: "2016-11-09T11:45:02Z", - }, - ], - opened: [ - { - campaignId: 21, - count: 2, - eventTime: "2016-05-03T21:24:56Z", - ip: "66.249.93.118", - }, - { - campaignId: 45, - count: 1, - eventTime: "2017-01-30T13:56:40Z", - ip: "66.249.93.217", - }, - ], - softBounces: [ - { - campaignId: 3, - eventTime: "2017-03-12T20:15:13Z", - }, - ], - transacAttributes: [ - { - orderDate: "2017-03-12", - orderId: 248, - orderPrice: 24.99, - }, - ], - unsubscriptions: { - adminUnsubscription: [ - { - eventTime: "2017-03-12T20:15:13Z", - ip: "165.87.3.15", - }, - ], - userUnsubscription: [ - { - campaignId: 3, - eventTime: "2017-03-12T20:15:13Z", - ip: "165.87.3.15", - }, - ], - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getContactStats (2)", async () => { diff --git a/tests/wire/conversations.test.ts b/tests/wire/conversations.test.ts index cba337d..964985e 100644 --- a/tests/wire/conversations.test.ts +++ b/tests/wire/conversations.test.ts @@ -141,81 +141,7 @@ describe("ConversationsClient", () => { text: "Hello! How can I help you?", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1482512803740, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Hello! How can I help you?", - id: "eYBEm3gq3zc5ayE2g", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: false, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Hello! How can I help you?", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("sendAMessageAsAnAgent (2)", async () => { @@ -294,81 +220,7 @@ describe("ConversationsClient", () => { text: "Hello! How can I help you?", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1482512803740, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Hello! How can I help you?", - id: "eYBEm3gq3zc5ayE2g", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: false, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Hello! How can I help you?", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("sendAMessageAsAnAgent (3)", async () => { @@ -445,81 +297,7 @@ describe("ConversationsClient", () => { text: "Hello! How can I help you?", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1482512803740, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Hello! How can I help you?", - id: "eYBEm3gq3zc5ayE2g", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: false, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Hello! How can I help you?", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("sendAMessageAsAnAgent (4)", async () => { @@ -614,81 +392,7 @@ describe("ConversationsClient", () => { const response = await client.conversations.getAMessage({ id: "id", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1482512803740, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Hello! How can I help you?", - id: "eYBEm3gq3zc5ayE2g", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: false, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Hello! How can I help you?", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("getAMessage (2)", async () => { @@ -800,81 +504,7 @@ describe("ConversationsClient", () => { id: "id", text: "Good morning! How can I help you?", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1482512803740, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Hello! How can I help you?", - id: "eYBEm3gq3zc5ayE2g", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: false, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Hello! How can I help you?", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("updateAMessageSentByAnAgent (2)", async () => { @@ -982,74 +612,10 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { groupId: "PjRBMhWGen6aRHjif", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }; - const rawResponseBody = { - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [{ email: "email", name: "name" }], - cc: [{ email: "email", name: "name" }], - createdAt: 1470222622433, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { error: "error", isSuccess: true }, - from: { email: "email", name: "name" }, - html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", - id: "AXCR3k9bpSY7bpuh7", - integrations: { key: "value" }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: true, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { email: "email", name: "name" }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", - to: [{ email: "email", name: "name" }], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }; - - server - .mockEndpoint() - .post("/conversations/pushedMessages") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.conversations.sendAnAutomatedMessageToAVisitor({ - groupId: "PjRBMhWGen6aRHjif", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); - expect(response).toEqual({ + }; + const rawResponseBody = { agentId: "d9nKoegKSjmCtyK78", agentName: "Liz", agentUserpic: "https://www.brevo.com/", @@ -1063,18 +629,8 @@ describe("ConversationsClient", () => { url: "url", }, ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], + bcc: [{ email: "email", name: "name" }], + cc: [{ email: "email", name: "name" }], createdAt: 1470222622433, file: { filename: "conversations.png", @@ -1088,19 +644,11 @@ describe("ConversationsClient", () => { size: 15538, url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + forwardedToSourceStatus: { error: "error", isSuccess: true }, + from: { email: "email", name: "name" }, + html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", id: "AXCR3k9bpSY7bpuh7", - integrations: { - key: "value", - }, + integrations: { key: "value" }, isBot: true, isMissed: false, isMissedByVisitor: false, @@ -1108,22 +656,30 @@ describe("ConversationsClient", () => { isTrigger: false, rawUnsafeHtml: "Good morning!
How can I help you?", receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, + replyTo: { email: "email", name: "name" }, sourceMessageId: "sourceMessageId", subject: "Invitation to a meeting", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", - to: [ - { - email: "email", - name: "name", - }, - ], + text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + to: [{ email: "email", name: "name" }], type: "agent", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", + }; + + server + .mockEndpoint() + .post("/conversations/pushedMessages") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.conversations.sendAnAutomatedMessageToAVisitor({ + groupId: "PjRBMhWGen6aRHjif", + text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); + expect(response).toEqual(rawResponseBody); }); test("sendAnAutomatedMessageToAVisitor (2)", async () => { @@ -1196,81 +752,7 @@ describe("ConversationsClient", () => { text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1470222622433, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", - id: "AXCR3k9bpSY7bpuh7", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: true, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("sendAnAutomatedMessageToAVisitor (3)", async () => { @@ -1345,81 +827,7 @@ describe("ConversationsClient", () => { text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1470222622433, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", - id: "AXCR3k9bpSY7bpuh7", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: true, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("sendAnAutomatedMessageToAVisitor (4)", async () => { @@ -1514,81 +922,7 @@ describe("ConversationsClient", () => { const response = await client.conversations.getAnAutomatedMessage({ id: "id", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1470222622433, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", - id: "AXCR3k9bpSY7bpuh7", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: true, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("getAnAutomatedMessage (2)", async () => { @@ -1702,81 +1036,7 @@ describe("ConversationsClient", () => { id: "id", text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54", }); - expect(response).toEqual({ - agentId: "d9nKoegKSjmCtyK78", - agentName: "Liz", - agentUserpic: "https://www.brevo.com/", - attachments: [ - { - fileName: "fileName", - inlineId: "inlineId", - isImage: true, - isInline: "isInline", - size: 1000000, - url: "url", - }, - ], - bcc: [ - { - email: "email", - name: "name", - }, - ], - cc: [ - { - email: "email", - name: "name", - }, - ], - createdAt: 1470222622433, - file: { - filename: "conversations.png", - imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", - width: 1129, - }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", - }, - forwardedToSourceStatus: { - error: "error", - isSuccess: true, - }, - from: { - email: "email", - name: "name", - }, - html: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54", - id: "AXCR3k9bpSY7bpuh7", - integrations: { - key: "value", - }, - isBot: true, - isMissed: false, - isMissedByVisitor: false, - isPushed: true, - isTrigger: false, - rawUnsafeHtml: "Good morning!
How can I help you?", - receivedFrom: "SuperAwesomeHelpdesk", - replyTo: { - email: "email", - name: "name", - }, - sourceMessageId: "sourceMessageId", - subject: "Invitation to a meeting", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54", - to: [ - { - email: "email", - name: "name", - }, - ], - type: "agent", - visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", - }); + expect(response).toEqual(rawResponseBody); }); test("updateAnAutomatedMessage (2)", async () => { @@ -1897,10 +1157,7 @@ describe("ConversationsClient", () => { const response = await client.conversations.setVisitorGroupAssignment({ groupId: "PjRBMhWGen6aRHjif", }); - expect(response).toEqual({ - groupId: "PjRBMhWGen6aRHjif", - visitorId: "AXCR3k9bpSY7bpuh7", - }); + expect(response).toEqual(rawResponseBody); }); test("setVisitorGroupAssignment (2)", async () => { diff --git a/tests/wire/coupons.test.ts b/tests/wire/coupons.test.ts index 09de542..2451260 100644 --- a/tests/wire/coupons.test.ts +++ b/tests/wire/coupons.test.ts @@ -24,17 +24,7 @@ describe("CouponsClient", () => { server.mockEndpoint().get("/couponCollections").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.coupons.getCouponCollections(); - expect(response).toEqual({ - createdAt: "2023-01-06T05:03:47Z", - defaultCoupon: "10 OFF", - expirationDate: "2024-01-01T00:00:00Z", - id: "23befbae-1505-47a8-bd27-e30ef739f32c", - name: "SummerPromotions", - remainingCoupons: 5000, - remainingCouponsAlert: 5, - remainingDaysAlert: 5, - totalCoupons: 10000, - }); + expect(response).toEqual(rawResponseBody); }); test("getCouponCollections (2)", async () => { @@ -82,9 +72,7 @@ describe("CouponsClient", () => { defaultCoupon: "Winter", name: "10%OFF", }); - expect(response).toEqual({ - id: "23befbae-1505-47a8-bd27-e30ef739f32c", - }); + expect(response).toEqual(rawResponseBody); }); test("createCouponCollection (2)", async () => { @@ -160,17 +148,7 @@ describe("CouponsClient", () => { const response = await client.coupons.getCouponCollection({ id: "id", }); - expect(response).toEqual({ - createdAt: "2023-01-06T05:03:47Z", - defaultCoupon: "10 OFF", - expirationDate: "2024-01-01T00:00:00Z", - id: "23befbae-1505-47a8-bd27-e30ef739f32c", - name: "SummerPromotions", - remainingCoupons: 5000, - remainingCouponsAlert: 5, - remainingDaysAlert: 5, - totalCoupons: 10000, - }); + expect(response).toEqual(rawResponseBody); }); test("getCouponCollection (2)", async () => { @@ -258,11 +236,7 @@ describe("CouponsClient", () => { const response = await client.coupons.updateCouponCollection({ id: "id", }); - expect(response).toEqual({ - defaultCoupon: "10 OFF", - id: "23befbae-1505-47a8-bd27-e30ef739f32c", - name: "SummerPromotions", - }); + expect(response).toEqual(rawResponseBody); }); test("updateCouponCollection (2)", async () => { diff --git a/tests/wire/customObjects.test.ts b/tests/wire/customObjects.test.ts index e4342da..6a6779b 100644 --- a/tests/wire/customObjects.test.ts +++ b/tests/wire/customObjects.test.ts @@ -24,10 +24,7 @@ describe("CustomObjectsClient", () => { object_type: "vehicle", records: [{}], }); - expect(response).toEqual({ - message: "Batch object records are being processed", - processId: 21, - }); + expect(response).toEqual(rawResponseBody); }); test("upsertrecords (2)", async () => { @@ -152,38 +149,7 @@ describe("CustomObjectsClient", () => { limit: 1000000, page_num: 1000000, }); - expect(response).toEqual({ - count: 350, - records: [ - { - associations: [ - { - object_type: "garage", - records: [ - { - identifiers: { - id: 12345, - }, - }, - ], - }, - ], - attributes: { - color: "Black", - engine_type: "Hybrid", - make: "Toyoto", - model: "Corolla", - year: 2020, - }, - createdAt: "2025-07-22T10:20:30Z", - identifiers: { - ext_id: "507f1f77bc", - id: 16789, - }, - updatedAt: "2025-07-22T10:20:30Z", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getrecords (2)", async () => { @@ -299,10 +265,7 @@ describe("CustomObjectsClient", () => { ext_ids: ["ext-001", "ext-002"], }, }); - expect(response).toEqual({ - processId: 21, - message: "Batch object records are being processed for deletion.", - }); + expect(response).toEqual(rawResponseBody); }); test("batchDeleteObjectRecords (2)", async () => { diff --git a/tests/wire/deals.test.ts b/tests/wire/deals.test.ts index 2c98dfc..a22f7fb 100644 --- a/tests/wire/deals.test.ts +++ b/tests/wire/deals.test.ts @@ -28,20 +28,7 @@ describe("DealsClient", () => { .build(); const response = await client.deals.getDealAttributes(); - expect(response).toEqual([ - { - attributeOptions: [ - { - key: "custom key", - value: "custom label", - }, - ], - attributeTypeName: "text", - internalName: "deal_name", - isRequired: true, - label: "Deal Name", - }, - ]); + expect(response).toEqual(rawResponseBody); }); test("getAllDeals (1)", async () => { @@ -78,32 +65,7 @@ describe("DealsClient", () => { server.mockEndpoint().get("/crm/deals").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.deals.getAllDeals(); - expect(response).toEqual({ - items: [ - { - attributes: { - amount: 12, - created_at: "2022-05-30T07:42:05.671Z", - deal_name: "testname", - deal_owner: "6093d2425a9b436e9519d034", - deal_stage: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", - last_activity_date: "2022-06-06T08:38:36.000Z", - last_updated_date: "2022-06-06T08:38:36.761Z", - number_of_activities: 0, - number_of_contacts: 1, - pipeline: "6093d296ad1e9c5cf2140a58", - stage_updated_at: "2022-05-30T07:42:05.671Z", - }, - id: "629475917295261d9b1f4403", - linkedCompaniesIds: [ - "61a5ce58c5d4795761045990", - "61a5ce58c5d4795761045991", - "61a5ce58c5d4795761045992", - ], - linkedContactsIds: [1, 2, 3], - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getAllDeals (2)", async () => { @@ -137,9 +99,7 @@ describe("DealsClient", () => { const response = await client.deals.createADeal({ name: "Deal: Connect with company", }); - expect(response).toEqual({ - id: "61a5cd07ca1347c82306ad06", - }); + expect(response).toEqual(rawResponseBody); }); test("createADeal (2)", async () => { @@ -234,27 +194,7 @@ describe("DealsClient", () => { const response = await client.deals.getADeal({ id: "id", }); - expect(response).toEqual({ - attributes: { - amount: 12, - created_at: "2022-05-30T07:42:05.671Z", - deal_name: "testname", - deal_owner: "6093d2425a9b436e9519d034", - deal_stage: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", - last_activity_date: "2022-06-06T08:38:36.000Z", - last_updated_date: "2022-06-06T08:38:36.761Z", - next_activity_date: { - key: "value", - }, - number_of_activities: 0, - number_of_contacts: 1, - pipeline: "6093d296ad1e9c5cf2140a58", - stage_updated_at: "2022-05-30T07:42:05.671Z", - }, - id: "629475917295261d9b1f4403", - linkedCompaniesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - linkedContactsIds: [1, 2, 3], - }); + expect(response).toEqual(rawResponseBody); }); test("getADeal (2)", async () => { @@ -405,16 +345,7 @@ describe("DealsClient", () => { .build(); const response = await client.deals.getPipelineStages(); - expect(response).toEqual({ - pipeline: "5ea675e3da0dd085acaea610", - pipeline_name: "Sales Pipeline", - stages: [ - { - id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", - name: "New", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getAllPipelines (1)", async () => { @@ -438,18 +369,7 @@ describe("DealsClient", () => { .build(); const response = await client.deals.getAllPipelines(); - expect(response).toEqual([ - { - pipeline: "5ea675e3da0dd085acaea610", - pipeline_name: "Sales Pipeline", - stages: [ - { - id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", - name: "New", - }, - ], - }, - ]); + expect(response).toEqual(rawResponseBody); }); test("getAllPipelines (2)", async () => { @@ -494,18 +414,7 @@ describe("DealsClient", () => { const response = await client.deals.getAPipeline({ pipelineID: "pipelineID", }); - expect(response).toEqual([ - { - pipeline: "5ea675e3da0dd085acaea610", - pipeline_name: "Sales Pipeline", - stages: [ - { - id: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", - name: "New", - }, - ], - }, - ]); + expect(response).toEqual(rawResponseBody); }); test("getAPipeline (2)", async () => { diff --git a/tests/wire/domains.test.ts b/tests/wire/domains.test.ts index fe2911e..1a563e7 100644 --- a/tests/wire/domains.test.ts +++ b/tests/wire/domains.test.ts @@ -57,50 +57,7 @@ describe("DomainsClient", () => { server.mockEndpoint().get("/senders/domains").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.domains.getDomains(); - expect(response).toEqual({ - domains: [ - { - id: "67e57b40130375f045064c45", - domain_name: "mycompany.com", - authenticated: true, - verified: true, - ip: "192.168.1.100", - provider: "Cloudflare", - creator: { - id: "62e4fce597550d0b0177cb0c", - email: "admin@mycompany.com", - creationDate: "2025-03-27T16:22:24Z", - }, - }, - { - id: "67f778570dd65f97c70910ed", - domain_name: "newsletter.mycompany.com", - authenticated: false, - verified: true, - provider: "GoDaddy", - creator: { - id: "62e4fce597550d0b0177cb0c", - email: "admin@mycompany.com", - creationDate: "2025-04-10T07:50:47Z", - }, - }, - { - id: "688cd306d8893504e50ea615", - domain_name: "test.example.com", - authenticated: false, - verified: false, - provider: "Other", - creator: { - id: "62e4fce597550d0b0177cb0c", - email: "admin@mycompany.com", - creationDate: "2025-08-01T14:45:26Z", - }, - }, - ], - count: 3, - current_page: 1, - total_pages: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("getDomains (2)", async () => { @@ -154,32 +111,7 @@ describe("DomainsClient", () => { const response = await client.domains.createDomain({ name: "mycompany.com", }); - expect(response).toEqual({ - id: 5, - domain_name: "mycompany.com", - domain_provider: "Cloudflare", - message: "Domain added successfully. To authenticate it, add following DNS records", - dns_records: { - brevo_code: { - host_name: "@", - type: "TXT", - value: "brevo-code=abc123def456", - status: false, - }, - dkim_record: { - host_name: "mail._domainkey", - type: "TXT", - value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", - status: false, - }, - dmarc_record: { - host_name: "_dmarc", - type: "TXT", - value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", - status: false, - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("createDomain (2)", async () => { @@ -220,32 +152,7 @@ describe("DomainsClient", () => { const response = await client.domains.createDomain({ name: "newsletter.mycompany.com", }); - expect(response).toEqual({ - id: 5, - domain_name: "mycompany.com", - domain_provider: "Cloudflare", - message: "Domain added successfully. To authenticate it, add following DNS records", - dns_records: { - brevo_code: { - host_name: "@", - type: "TXT", - value: "brevo-code=abc123def456", - status: false, - }, - dkim_record: { - host_name: "mail._domainkey", - type: "TXT", - value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", - status: false, - }, - dmarc_record: { - host_name: "_dmarc", - type: "TXT", - value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", - status: false, - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("createDomain (3)", async () => { @@ -286,32 +193,7 @@ describe("DomainsClient", () => { const response = await client.domains.createDomain({ name: "test.example.com", }); - expect(response).toEqual({ - id: 5, - domain_name: "mycompany.com", - domain_provider: "Cloudflare", - message: "Domain added successfully. To authenticate it, add following DNS records", - dns_records: { - brevo_code: { - host_name: "@", - type: "TXT", - value: "brevo-code=abc123def456", - status: false, - }, - dkim_record: { - host_name: "mail._domainkey", - type: "TXT", - value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", - status: false, - }, - dmarc_record: { - host_name: "_dmarc", - type: "TXT", - value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", - status: false, - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("createDomain (4)", async () => { @@ -352,32 +234,7 @@ describe("DomainsClient", () => { const response = await client.domains.createDomain({ name: "mycompany.com", }); - expect(response).toEqual({ - id: 5, - domain_name: "mycompany.com", - domain_provider: "Cloudflare", - message: "Domain added successfully. To authenticate it, add following DNS records", - dns_records: { - brevo_code: { - host_name: "@", - type: "TXT", - value: "brevo-code=abc123def456", - status: false, - }, - dkim_record: { - host_name: "mail._domainkey", - type: "TXT", - value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", - status: false, - }, - dmarc_record: { - host_name: "_dmarc", - type: "TXT", - value: "v=DMARC1; p=none; rua=mailto:dmarc@mycompany.com", - status: false, - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("createDomain (5)", async () => { @@ -418,32 +275,7 @@ describe("DomainsClient", () => { const response = await client.domains.createDomain({ name: "mycompany.com", }); - expect(response).toEqual({ - id: 6, - domain_name: "example.com", - domain_provider: "GoDaddy", - message: "Domain added successfully. To authenticate it, add following DNS records", - dns_records: { - brevo_code: { - host_name: "@", - type: "TXT", - value: "brevo-code=xyz789abc123", - status: false, - }, - dkim_record: { - host_name: "mail._domainkey", - type: "TXT", - value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", - status: false, - }, - dmarc_record: { - host_name: "_dmarc", - type: "TXT", - value: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com", - status: false, - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("createDomain (6)", async () => { @@ -504,31 +336,7 @@ describe("DomainsClient", () => { const response = await client.domains.getDomainConfiguration({ domainName: "domainName", }); - expect(response).toEqual({ - domain: "mycompany.com", - verified: true, - authenticated: true, - dns_records: { - brevo_code: { - host_name: "@", - type: "TXT", - value: "brevo-code=abc123def456", - status: true, - }, - dkim_record: { - host_name: "mail._domainkey", - type: "TXT", - value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", - status: true, - }, - dmarc_record: { - host_name: "_dmarc", - type: "TXT", - value: "v=DMARC1; p=quarantine; rua=mailto:dmarc@mycompany.com", - status: true, - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getDomainConfiguration (2)", async () => { @@ -567,31 +375,7 @@ describe("DomainsClient", () => { const response = await client.domains.getDomainConfiguration({ domainName: "domainName", }); - expect(response).toEqual({ - domain: "test.example.com", - verified: false, - authenticated: false, - dns_records: { - brevo_code: { - host_name: "@", - type: "TXT", - value: "brevo-code=xyz789abc123", - status: false, - }, - dkim_record: { - host_name: "mail._domainkey", - type: "TXT", - value: "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...", - status: true, - }, - dmarc_record: { - host_name: "_dmarc", - type: "TXT", - value: "v=DMARC1; p=none; rua=mailto:dmarc@example.com", - status: false, - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getDomainConfiguration (3)", async () => { @@ -710,10 +494,7 @@ describe("DomainsClient", () => { const response = await client.domains.authenticateDomain({ domainName: "domainName", }); - expect(response).toEqual({ - domain_name: "mycompany.com", - message: "Domain has been authenticated successfully.", - }); + expect(response).toEqual(rawResponseBody); }); test("authenticateDomain (2)", async () => { @@ -736,10 +517,7 @@ describe("DomainsClient", () => { const response = await client.domains.authenticateDomain({ domainName: "domainName", }); - expect(response).toEqual({ - domain_name: "newsletter.example.com", - message: "Domain authentication completed. Your domain is now ready for sending.", - }); + expect(response).toEqual(rawResponseBody); }); test("authenticateDomain (3)", async () => { diff --git a/tests/wire/ecommerce.test.ts b/tests/wire/ecommerce.test.ts index 83a27c3..0235741 100644 --- a/tests/wire/ecommerce.test.ts +++ b/tests/wire/ecommerce.test.ts @@ -34,27 +34,7 @@ describe("EcommerceClient", () => { server.mockEndpoint().get("/categories").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.ecommerce.getCategories(); - expect(response).toEqual({ - categories: [ - { - createdAt: "2021-12-31T11:42:35.638Z", - id: "C19", - isDeleted: true, - modifiedAt: "2022-03-03T14:48:31.867Z", - name: "Food", - url: "http://mydomain.com/category/food", - }, - { - createdAt: "2021-12-31T11:42:35.638Z", - id: "C20", - isDeleted: true, - modifiedAt: "2022-03-03T14:48:31.867Z", - name: "clothing", - url: "http://mydomain.com/category/clothing", - }, - ], - count: 2, - }); + expect(response).toEqual(rawResponseBody); }); test("getCategories (2)", async () => { @@ -88,9 +68,7 @@ describe("EcommerceClient", () => { const response = await client.ecommerce.createUpdateCategory({ id: "CAT123", }); - expect(response).toEqual({ - id: 21, - }); + expect(response).toEqual(rawResponseBody); }); test("createUpdateCategory (2)", async () => { @@ -137,10 +115,7 @@ describe("EcommerceClient", () => { }, ], }); - expect(response).toEqual({ - createdCount: 2, - updatedCount: 7, - }); + expect(response).toEqual(rawResponseBody); }); test("createUpdateBatchCategory (2)", async () => { @@ -190,14 +165,7 @@ describe("EcommerceClient", () => { const response = await client.ecommerce.getCategoryInfo({ id: "id", }); - expect(response).toEqual({ - createdAt: "2017-05-12T12:30:00Z", - id: "C11", - isDeleted: true, - modifiedAt: "2017-05-12T12:30:00Z", - name: "Electronics", - url: "http://mydomain.com/category/clothing", - }); + expect(response).toEqual(rawResponseBody); }); test("getCategoryInfo (2)", async () => { @@ -302,29 +270,7 @@ describe("EcommerceClient", () => { periodFrom: "2022-01-02T00:00:00Z", periodTo: "2022-01-03T00:00:00Z", }); - expect(response).toEqual({ - results: [ - { - averageBasket: 3, - conversionSource: "email_campaign", - id: 1.1, - ordersCount: 300, - revenue: 900, - }, - { - averageBasket: 4, - conversionSource: "email_campaign", - id: 1.1, - ordersCount: 200, - revenue: 800, - }, - ], - totals: { - averageBasket: 3.4, - ordersCount: 500, - revenue: 1700, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows (2)", async () => { @@ -371,14 +317,7 @@ describe("EcommerceClient", () => { conversionSource: "email_campaign", conversionSourceId: "sale", }); - expect(response).toEqual({ - averageBasket: 1.1, - conversionSource: "email_campaign", - id: 1.1, - ordersCount: 1.1, - revenue: 1.1, - newCustomersCount: 1.1, - }); + expect(response).toEqual(rawResponseBody); }); test("getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow (2)", async () => { @@ -434,20 +373,7 @@ describe("EcommerceClient", () => { conversionSource: "email_campaign", conversionSourceId: "sale", }); - expect(response).toEqual({ - products: [ - { - id: "1", - imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", - name: "Milky Way Galaxy", - ordersCount: 200, - price: 1000, - revenue: 999.99, - sku: "sku-1", - url: "https://mydomain.com/products/alpina-panoma-classic", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getAttributedProductSalesForASingleBrevoCampaignOrWorkflow (2)", async () => { @@ -487,9 +413,7 @@ describe("EcommerceClient", () => { .build(); const response = await client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(); - expect(response).toEqual({ - code: "EUR", - }); + expect(response).toEqual(rawResponseBody); }); test("getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount (2)", async () => { @@ -567,9 +491,7 @@ describe("EcommerceClient", () => { const response = await client.ecommerce.setConfigDisplayCurrency({ code: "EUR", }); - expect(response).toEqual({ - code: "EUR", - }); + expect(response).toEqual(rawResponseBody); }); test("setConfigDisplayCurrency (2)", async () => { @@ -699,52 +621,7 @@ describe("EcommerceClient", () => { server.mockEndpoint().get("/orders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.ecommerce.getOrders(); - expect(response).toEqual({ - count: 1, - orders: [ - { - amount: 2000, - billing: { - address: "Sec 62, Noida", - city: "Noida", - country: "India", - countryCode: "IN", - paymentMethod: "Net banking", - phone: 9238283982, - postCode: 110001, - region: "North India", - }, - contact_id: 2, - coupons: ["flat50", "flat40"], - createdAt: "2021-12-31T11:42:35.638Z", - email: "testvisitor@sendinblue.com", - id: "order1803", - identifiers: { - ext_id: "ab12", - loyalty_subscription_id: "1234", - }, - products: [ - { - price: 100, - productId: 21, - quantity: 2, - quantityFloat: 0, - variantId: "P100", - }, - { - price: 100, - productId: 21, - quantity: 0, - quantityFloat: 2.52, - variantId: "P15756", - }, - ], - status: "complete", - storeId: "123", - updatedAt: "2022-03-03T14:48:31.867Z", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getOrders (2)", async () => { @@ -879,10 +756,7 @@ describe("EcommerceClient", () => { }, ], }); - expect(response).toEqual({ - batchId: 1.1, - count: 17655, - }); + expect(response).toEqual(rawResponseBody); }); test("createBatchOrder (2)", async () => { @@ -1020,57 +894,7 @@ describe("EcommerceClient", () => { server.mockEndpoint().get("/products").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.ecommerce.getProducts(); - expect(response).toEqual({ - count: 2, - products: [ - { - brand: "Adidas", - categories: ["279638835374", "279502848174"], - createdAt: "2022-06-30T10:29:16.078Z", - description: "Shoes for sports", - id: "P11", - imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", - isDeleted: true, - metaInfo: { - brand: "addidas", - description: "Shoes for sports", - }, - modifiedAt: "2022-06-30T10:29:16.078Z", - name: "Alpina Panoma Classic", - parentId: "parentId", - price: 49.95, - s3Original: "https://img-ecom.mailinblue.com/path-to-original/img.jpg", - s3ThumbAnalytics: "https://img-ecom.mailinblue.com/path-to-analytics/img.jpg", - s3ThumbEditor: "https://img-ecom.mailinblue.com/path-to-editor/img.jpg", - sku: "186622-9", - stock: 100, - url: "https://mydomain.com/products/alpina-panoma-classic", - }, - { - brand: "Adidas", - categories: ["2d79638835374", "27d9502848174"], - createdAt: "2022-06-30T10:29:16.078Z", - description: "Shoes for sports", - id: "P11", - imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", - isDeleted: true, - metaInfo: { - brand: "addidas", - description: "Shoes for sports", - }, - modifiedAt: "2022-06-30T10:29:16.078Z", - name: "Alpina Panoma Classic2", - parentId: "parentId", - price: 49.95, - s3Original: "https://img-ecom.mailinblue.com/path-to-original/img.jpg", - s3ThumbAnalytics: "https://img-ecom.mailinblue.com/path-to-analytics/img.jpg", - s3ThumbEditor: "https://img-ecom.mailinblue.com/path-to-editor/img.jpg", - sku: "186622-9", - stock: 350, - url: "https://mydomain.com/products/alpina-panoma-classic2", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getProducts (2)", async () => { @@ -1105,9 +929,7 @@ describe("EcommerceClient", () => { id: "P11", name: "Iphone 11", }); - expect(response).toEqual({ - id: 21, - }); + expect(response).toEqual(rawResponseBody); }); test("createUpdateProduct (2)", async () => { @@ -1156,10 +978,7 @@ describe("EcommerceClient", () => { }, ], }); - expect(response).toEqual({ - createdCount: 2, - updatedCount: 7, - }); + expect(response).toEqual(rawResponseBody); }); test("createUpdateBatchProducts (2)", async () => { @@ -1228,29 +1047,7 @@ describe("EcommerceClient", () => { const response = await client.ecommerce.getProductInfo({ id: "id", }); - expect(response).toEqual({ - brand: "Adidas", - categories: ["categories"], - createdAt: "2017-05-12T12:30:00Z", - description: "Shoes for sports", - id: "P11", - imageUrl: "http://mydomain.com/product-absoulte-url/img.jpeg", - isDeleted: true, - metaInfo: { - brand: "addidas", - description: "Shoes for sports", - }, - modifiedAt: "2017-05-12T12:30:00Z", - name: "Iphone 11", - parentId: "parentId", - price: 1.1, - s3Original: "s3Original", - s3ThumbAnalytics: "s3ThumbAnalytics", - s3ThumbEditor: "s3ThumbEditor", - sku: "sku", - stock: 100, - url: "http://mydomain.com/product/electronics/product1", - }); + expect(response).toEqual(rawResponseBody); }); test("getProductInfo (2)", async () => { diff --git a/tests/wire/emailCampaigns.test.ts b/tests/wire/emailCampaigns.test.ts index fe1ffa4..2571a78 100644 --- a/tests/wire/emailCampaigns.test.ts +++ b/tests/wire/emailCampaigns.test.ts @@ -282,299 +282,7 @@ describe("EmailCampaignsClient", () => { server.mockEndpoint().get("/emailCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.emailCampaigns.getEmailCampaigns(); - expect(response).toEqual({ - campaigns: [ - { - attachmentFile: "http://mydomain.com/campaign/attachment/file.pdf", - abTesting: true, - id: 12, - name: "EN - Sales Summer 2017", - previewText: "Don't miss the sale!", - scheduledAt: "2017-06-01T12:30:00Z", - sendAtBestTime: true, - splitRule: 25, - status: "sent", - subject: "20% OFF for 2017 Summer Sales", - subjectA: "Discover the New Collection!", - subjectB: "Want to discover the New Collection?", - type: "classic", - winnerCriteria: "open", - winnerDelay: 50, - createdAt: "2017-05-01T12:30:00Z", - footer: "[DEFAULT_FOOTER]", - header: "[DEFAULT_HEADER]", - htmlContent: "This is my HTML Content", - inlineImageActivation: true, - mirrorActive: true, - modifiedAt: "2017-05-01T12:30:00Z", - recurring: false, - replyTo: "replyto@domain.com", - returnBounce: 5, - sender: { - email: "marketing@mycompany.com", - id: 26, - name: "Marketing", - }, - sentDate: "2018-12-01T16:30:00Z", - shareLink: "http://example.com/fhsgccc.html?t=9865448900", - tag: "Newsletter", - tags: ["tag1", "tag2"], - testSent: true, - toField: "{FNAME} {LNAME}", - utmCampaignValue: "myutm", - utmIDActive: true, - utmMedium: "EMAIL", - utmSource: "Brevo", - recipients: { - exclusionLists: [13], - lists: [5], - }, - statistics: { - campaignStats: [ - { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 5, - opensRate: 29.54, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - ], - globalStats: { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 2, - opensRate: 29.54, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - linksStats: {}, - mirrorClick: 120, - remaining: 1000, - statsByBrowser: { - key: { - clickers: 2665, - uniqueClicks: 2300, - uniqueViews: 7779, - viewed: 8999, - }, - }, - statsByDevice: {}, - statsByDomain: { - "hotmail.co.uk": { - appleMppOpens: 10, - clickers: 2720, - complaints: 5, - deferred: 30, - delivered: 117056, - estimatedViews: 560, - hardBounces: 0, - listId: 2, - opensRate: 29.54, - returnBounce: 5, - sent: 117055, - softBounces: 111, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 1970, - uniqueViews: 21111, - unsubscriptions: 105, - viewed: 35251, - }, - "yahoo.com": { - appleMppOpens: 10, - clickers: 533, - complaints: 0, - deferred: 30, - delivered: 25596, - estimatedViews: 560, - hardBounces: 0, - listId: 2, - opensRate: 29.54, - returnBounce: 5, - sent: 25601, - softBounces: 5, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 298, - uniqueViews: 3527, - unsubscriptions: 17, - viewed: 5255, - }, - }, - }, - }, - { - attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", - abTesting: true, - id: 22, - name: "Weekly - 1", - previewText: "your weekly newsletter!", - scheduledAt: "", - sendAtBestTime: true, - splitRule: 25, - status: "draft", - subject: "Week 1 - Newsletter", - subjectA: "Discover the New Collection!", - subjectB: "Want to discover the New Collection?", - type: "classic", - winnerCriteria: "open", - winnerDelay: 50, - createdAt: "2017-05-01T12:30:00Z", - footer: "[DEFAULT_FOOTER]", - header: "[DEFAULT_HEADER]", - htmlContent: "This is my HTML Content", - inlineImageActivation: true, - mirrorActive: true, - modifiedAt: "2017-05-01T12:30:00Z", - recurring: false, - replyTo: "replyto@domain.com", - returnBounce: 5, - sender: { - email: "newsletter@mycompany.com", - id: 26, - name: "Newsletter", - }, - sentDate: "2018-12-01T16:30:00Z", - shareLink: "http://example.com/fhsgccc.html?t=9865448900", - tag: "Newsletter", - tags: ["Newsletter", "Weekly"], - testSent: false, - toField: "{FNAME} {LNAME}", - utmCampaignValue: "myutm", - utmIDActive: true, - utmMedium: "EMAIL", - utmSource: "Brevo", - recipients: { - exclusionLists: [45], - lists: [10], - }, - statistics: { - campaignStats: [ - { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 10, - opensRate: 29.54, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - ], - globalStats: { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 2, - opensRate: 29.42, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - linksStats: {}, - mirrorClick: 120, - remaining: 1000, - statsByBrowser: { - key: { - clickers: 2665, - uniqueClicks: 2300, - uniqueViews: 7779, - viewed: 8999, - }, - }, - statsByDevice: {}, - statsByDomain: { - aol: { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 2, - opensRate: 29.54, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - gmail: { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 2, - opensRate: 29.54, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - }, - }, - }, - ], - count: 2, - }); + expect(response).toEqual(rawResponseBody); }); test("getEmailCampaigns (2)", async () => { @@ -609,9 +317,7 @@ describe("EmailCampaignsClient", () => { name: "Newsletter - May 2017", sender: {}, }); - expect(response).toEqual({ - id: 5, - }); + expect(response).toEqual(rawResponseBody); }); test("createEmailCampaign (2)", async () => { @@ -657,9 +363,7 @@ describe("EmailCampaignsClient", () => { const response = await client.emailCampaigns.uploadImageToGallery({ imageUrl: "https://somedomain.com/image1.jpg", }); - expect(response).toEqual({ - url: "https://img.mailinblue.com/100000/images/rnb/original/62casdase8wewq9df1c2f27c.jpeg", - }); + expect(response).toEqual(rawResponseBody); }); test("uploadImageToGallery (2)", async () => { @@ -822,181 +526,7 @@ describe("EmailCampaignsClient", () => { const response = await client.emailCampaigns.getEmailCampaign({ campaignId: 1000000, }); - expect(response).toEqual({ - attachmentFile: "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}", - abTesting: true, - id: 22, - name: "Weekly - 1", - previewText: "your weekly newsletter", - scheduledAt: "2017-09-22T12:30:00Z", - sendAtBestTime: true, - splitRule: 25, - status: "draft", - subject: "Week 1 - Newsletter", - subjectA: "Discover the New Collection!", - subjectB: "Want to discover the New Collection?", - type: "classic", - winnerCriteria: "open", - winnerDelay: 50, - createdAt: "2017-05-01T12:30:00Z", - footer: "[DEFAULT_FOOTER]", - header: "[DEFAULT_HEADER]", - htmlContent: "This is my HTML Content", - inlineImageActivation: true, - mirrorActive: true, - modifiedAt: "2017-05-01T12:30:00Z", - recurring: false, - replyTo: "replyto@domain.com", - returnBounce: 5, - sender: { - email: "newsletter@mycompany.com", - id: 26, - name: "Newsletter", - }, - sentDate: "2018-12-01T16:30:00Z", - shareLink: "http://dhh.brevo.com/fhsgccc.html?t=9865448900", - tag: "Newsletter", - tags: ["Newsletter", "Weekly"], - testSent: false, - toField: "{FNAME} {LNAME}", - utmCampaignValue: "myutm", - utmIDActive: true, - utmMedium: "EMAIL", - utmSource: "Brevo", - recipients: { - exclusionLists: [45], - lists: [22], - }, - statistics: { - campaignStats: [ - { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 22, - opensRate: 29.54, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - ], - globalStats: { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 2, - opensRate: 24.59, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - linksStats: {}, - mirrorClick: 120, - remaining: 1000, - statsByBrowser: { - internetExplorer: { - clickers: 0, - uniqueClicks: 0, - uniqueViews: 0, - viewed: 1, - }, - safari: { - clickers: 1, - uniqueClicks: 0, - uniqueViews: 0, - viewed: 1, - }, - thunderbird: { - clickers: 1, - uniqueClicks: 0, - uniqueViews: 0, - viewed: 1, - }, - }, - statsByDevice: { - desktop: { - mac: { - clickers: 1, - uniqueClicks: 0, - uniqueViews: 1, - viewed: 2, - }, - }, - mobile: { - androidMobile: { - clickers: 1, - uniqueClicks: 0, - uniqueViews: 0, - viewed: 1, - }, - iPhone: { - clickers: 1, - uniqueClicks: 0, - uniqueViews: 0, - viewed: 2, - }, - }, - tablet: { - key: { - clickers: 2665, - uniqueClicks: 2300, - uniqueViews: 7779, - viewed: 8999, - }, - }, - unknown: { - key: { - clickers: 2665, - uniqueClicks: 2300, - uniqueViews: 7779, - viewed: 8999, - }, - }, - }, - statsByDomain: { - gmail: { - appleMppOpens: 10, - clickers: 2665, - complaints: 1, - deferred: 30, - delivered: 19765, - estimatedViews: 560, - hardBounces: 87, - listId: 2, - opensRate: 29.54, - returnBounce: 5, - sent: 19887, - softBounces: 100, - trackableViews: 5661, - trackableViewsRate: 23.45, - uniqueClicks: 2300, - uniqueViews: 7779, - unsubscriptions: 2, - viewed: 8999, - }, - }, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getEmailCampaign (2)", async () => { @@ -1200,66 +730,7 @@ describe("EmailCampaignsClient", () => { const response = await client.emailCampaigns.getAbTestCampaignResult({ campaignId: 1000000, }); - expect(response).toEqual({ - clickRate: "50%", - clickedLinks: { - "Version A": [ - { - clickRate: "0%", - clicksCount: 0, - link: "https://google.com", - }, - { - clickRate: "0%", - clicksCount: 0, - link: "https://youtube.com", - }, - ], - "Version B": [ - { - clickRate: "40%", - clicksCount: 2, - link: "http://www.github.com", - }, - { - clickRate: "60%", - clicksCount: 3, - link: "http://www.stackoverflow.com", - }, - ], - }, - openRate: "100%", - statistics: { - clicks: { - "Version A": "0%", - "Version B": "50%", - }, - complaints: { - "Version A": "0%", - "Version B": "0%", - }, - hardBounces: { - "Version A": "0%", - "Version B": "0%", - }, - openers: { - "Version A": "20%", - "Version B": "100%", - }, - softBounces: { - "Version A": "0%", - "Version B": "0%", - }, - unsubscribed: { - "Version A": "20%", - "Version B": "0%", - }, - }, - winningCriteria: "Click", - winningSubjectLine: "Subject Line A", - winningVersion: "B", - winningVersionRate: "0%", - }); + expect(response).toEqual(rawResponseBody); }); test("getAbTestCampaignResult (2)", async () => { @@ -1323,9 +794,7 @@ describe("EmailCampaignsClient", () => { campaignId: 1000000, recipientsType: "all", }); - expect(response).toEqual({ - processId: 78, - }); + expect(response).toEqual(rawResponseBody); }); test("emailExportRecipients (2)", async () => { @@ -1620,9 +1089,7 @@ describe("EmailCampaignsClient", () => { const response = await client.emailCampaigns.getSharedTemplateUrl({ campaignId: 1000000, }); - expect(response).toEqual({ - sharedUrl: "https://my.brevo.com/pt2YU7R5W_guXlowgumy_VX4pFsKu._zd0Gjj96x1_GMmzc1Qps5ZIpj6nx-", - }); + expect(response).toEqual(rawResponseBody); }); test("getSharedTemplateUrl (2)", async () => { diff --git a/tests/wire/event.test.ts b/tests/wire/event.test.ts index 0cc7b84..7718d19 100644 --- a/tests/wire/event.test.ts +++ b/tests/wire/event.test.ts @@ -28,27 +28,7 @@ describe("EventClient", () => { server.mockEndpoint().get("/events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.event.getEvents(); - expect(response).toEqual({ - events: [ - { - contact_id: 211, - event_date: "2024-02-06T20:59:23Z", - event_name: "order_created", - event_filter_id: "abc123", - source: "api", - object_type: "subscription", - event_properties: { - duration: 142, - video_title: "Brevo \u2014 The most approachable CRM suite", - }, - contact_properties: { - AGE: 32, - GENDER: "FEMALE", - }, - }, - ], - count: 2, - }); + expect(response).toEqual(rawResponseBody); }); test("getEvents (2)", async () => { @@ -174,10 +154,7 @@ describe("EventClient", () => { identifiers: {}, }, ]); - expect(response).toEqual({ - message: "Batch accepted. Valid events have been added to the processing queue.", - count: 7, - }); + expect(response).toEqual(rawResponseBody); }); test("createBatchEvents (2)", async () => { diff --git a/tests/wire/externalFeeds.test.ts b/tests/wire/externalFeeds.test.ts index 810d814..b89e271 100644 --- a/tests/wire/externalFeeds.test.ts +++ b/tests/wire/externalFeeds.test.ts @@ -70,74 +70,7 @@ describe("ExternalFeedsClient", () => { startDate: "2024-01-01", endDate: "2024-01-31", }); - expect(response).toEqual({ - count: 18, - feeds: [ - { - id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", - name: "Product Catalog Feed", - alias: "product_catalog_feed", - url: "https://api.example.com/products", - authType: "noAuth", - username: "apiuser", - password: "apipass", - token: "abc123token456", - maxRetries: 3, - cache: true, - isInternal: false, - headers: [ - { - name: "Authorization", - value: "Bearer xyz789", - }, - ], - createdAt: "2025-09-18T13:29:27Z", - modifiedAt: "2025-09-18T13:29:27Z", - }, - { - id: "c2d3e4f5-a6b7-48c9-90d1-e2f3a4b5c6d7", - name: "Blog News Feed", - alias: "blog_news_feed", - url: "https://blog.example.com/api/posts", - authType: "noAuth", - username: "apiuser", - password: "apipass", - token: "abc123token456", - maxRetries: 3, - cache: true, - isInternal: true, - headers: [ - { - name: "Authorization", - value: "Bearer xyz789", - }, - ], - createdAt: "2025-09-17T16:03:25Z", - modifiedAt: "2025-09-17T16:03:25Z", - }, - { - id: "d3e4f5a6-b7c8-49d0-91e2-f3a4b5c6d7e8", - name: "Public Data Feed", - alias: "public_data_feed", - url: "https://jsonplaceholder.typicode.com/posts", - authType: "noAuth", - username: "apiuser", - password: "apipass", - token: "abc123token456", - maxRetries: 3, - cache: true, - isInternal: true, - headers: [ - { - name: "Authorization", - value: "Bearer xyz789", - }, - ], - createdAt: "2025-09-05T09:06:42Z", - modifiedAt: "2025-09-05T09:06:42Z", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getAllExternalFeeds (2)", async () => { @@ -194,9 +127,7 @@ describe("ExternalFeedsClient", () => { maxRetries: 3, cache: true, }); - expect(response).toEqual({ - id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", - }); + expect(response).toEqual(rawResponseBody); }); test("createExternalFeed (2)", async () => { @@ -227,9 +158,7 @@ describe("ExternalFeedsClient", () => { maxRetries: 3, cache: true, }); - expect(response).toEqual({ - id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", - }); + expect(response).toEqual(rawResponseBody); }); test("createExternalFeed (3)", async () => { @@ -260,9 +189,7 @@ describe("ExternalFeedsClient", () => { maxRetries: 3, cache: true, }); - expect(response).toEqual({ - id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", - }); + expect(response).toEqual(rawResponseBody); }); test("createExternalFeed (4)", async () => { @@ -317,19 +244,7 @@ describe("ExternalFeedsClient", () => { const response = await client.externalFeeds.getExternalFeedByUuid({ uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", }); - expect(response).toEqual({ - id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", - name: "Product Catalog Feed", - url: "https://api.example.com/products", - authType: "noAuth", - personalization: false, - defaultAttr: "", - defaultContact: "", - maxRetries: 0, - cache: false, - createdAt: "2025-09-18T13:29:27Z", - modifiedAt: "2025-09-18T13:29:27Z", - }); + expect(response).toEqual(rawResponseBody); }); test("getExternalFeedByUUID (2)", async () => { @@ -361,19 +276,7 @@ describe("ExternalFeedsClient", () => { const response = await client.externalFeeds.getExternalFeedByUuid({ uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", }); - expect(response).toEqual({ - id: "c2d3e4f5-a6b7-48c9-90d1-e2f3a4b5c6d7", - name: "Internal Blog Feed", - url: "https://blog.example.com/api/posts", - authType: "noAuth", - personalization: false, - defaultAttr: "", - defaultContact: "", - maxRetries: 0, - cache: false, - createdAt: "2025-09-17T16:03:25Z", - modifiedAt: "2025-09-17T16:03:25Z", - }); + expect(response).toEqual(rawResponseBody); }); test("getExternalFeedByUUID (3)", async () => { @@ -405,19 +308,7 @@ describe("ExternalFeedsClient", () => { const response = await client.externalFeeds.getExternalFeedByUuid({ uuid: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", }); - expect(response).toEqual({ - id: "d3e4f5a6-b7c8-49d0-91e2-f3a4b5c6d7e8", - name: "Public Data Feed", - url: "https://jsonplaceholder.typicode.com/posts", - authType: "noAuth", - personalization: false, - defaultAttr: "", - defaultContact: "", - maxRetries: 0, - cache: false, - createdAt: "2025-09-05T09:06:42Z", - modifiedAt: "2025-09-05T09:06:42Z", - }); + expect(response).toEqual(rawResponseBody); }); test("getExternalFeedByUUID (4)", async () => { diff --git a/tests/wire/files.test.ts b/tests/wire/files.test.ts index dff749e..36bdc74 100644 --- a/tests/wire/files.test.ts +++ b/tests/wire/files.test.ts @@ -24,17 +24,7 @@ describe("FilesClient", () => { server.mockEndpoint().get("/crm/files").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.files.getAllFiles(); - expect(response).toEqual([ - { - authorId: "61a5ce58y5d4795761045991", - companyId: "61a5ce58c5d4795761045991", - contactId: 1, - createdAt: "2017-05-01T17:05:03Z", - dealId: "61a5ce58c5d4795761045991", - name: "example.png", - size: 10, - }, - ]); + expect(response).toEqual(rawResponseBody); }); test("getAllFiles (2)", async () => { @@ -61,9 +51,7 @@ describe("FilesClient", () => { const response = await client.files.downloadAFile({ id: "id", }); - expect(response).toEqual({ - fileUrl: "https://storage.googleapis.com/brevo-app-crm.......-sample.pdf", - }); + expect(response).toEqual(rawResponseBody); }); test("downloadAFile (2)", async () => { @@ -157,15 +145,7 @@ describe("FilesClient", () => { const response = await client.files.getFileDetails({ id: "id", }); - expect(response).toEqual({ - authorId: "61a5ce58y5d4795761045991", - companyId: "61a5ce58c5d4795761045991", - contactId: 1, - createdAt: "2017-05-01T17:05:03Z", - dealId: "61a5ce58c5d4795761045991", - name: "example.png", - size: 10, - }); + expect(response).toEqual(rawResponseBody); }); test("getFileDetails (2)", async () => { diff --git a/tests/wire/inboundParsing.test.ts b/tests/wire/inboundParsing.test.ts index aeb985f..71a3e14 100644 --- a/tests/wire/inboundParsing.test.ts +++ b/tests/wire/inboundParsing.test.ts @@ -29,22 +29,7 @@ describe("InboundParsingClient", () => { server.mockEndpoint().get("/inbound/events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.inboundParsing.getInboundEmailEvents(); - expect(response).toEqual({ - events: [ - { - date: "2017-03-11T12:30:00Z", - recipient: "alexa@example.com", - sender: "john@example.com", - uuid: "1a825d56-029b-4a41-b8e4-1a825d56", - }, - { - date: "2017-03-12T12:30:00Z", - recipient: "bob@example.com", - sender: "alice@example.com", - uuid: "1a825d56-029b-4a41-b8e4-61670463431b", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getInboundEmailEvents (2)", async () => { @@ -90,35 +75,7 @@ describe("InboundParsingClient", () => { const response = await client.inboundParsing.getInboundEmailEventsByUuid({ uuid: "uuid", }); - expect(response).toEqual({ - attachments: [ - { - contentLength: 12345, - contentType: "application/pdf", - name: "invoice.pdf", - }, - ], - deliveredAt: "2017-03-12T12:31:00Z", - logs: [ - { - date: "2017-03-12T12:30:00Z", - type: "received", - }, - { - date: "2017-03-12T12:30:04Z", - type: "webhookFailed", - }, - { - date: "2017-03-12T12:31:04Z", - type: "webhookDelivered", - }, - ], - messageId: "", - receivedAt: "2017-03-12T12:30:00Z", - recipient: "bob@example.com", - sender: "alice@example.com", - subject: "Re: Question about your API", - }); + expect(response).toEqual(rawResponseBody); }); test("getInboundEmailEventsByUuid (2)", async () => { diff --git a/tests/wire/masterAccount.test.ts b/tests/wire/masterAccount.test.ts index 770a3c8..799cec6 100644 --- a/tests/wire/masterAccount.test.ts +++ b/tests/wire/masterAccount.test.ts @@ -23,9 +23,7 @@ describe("MasterAccountClient", () => { const response = await client.masterAccount.createANewGroupOfSubAccounts({ groupName: "My group", }); - expect(response).toEqual({ - id: "659xxxxxxxxxxxxxxxx6ef9c8", - }); + expect(response).toEqual(rawResponseBody); }); test("createANewGroupOfSubAccounts (2)", async () => { @@ -120,37 +118,7 @@ describe("MasterAccountClient", () => { const response = await client.masterAccount.getAGroupDetails({ id: "id", }); - expect(response).toEqual({ - group: { - createdAt: "2024-02-09T06:14:40+00:00", - groupName: "My group", - id: "5f926dba72a405440a4efc97", - }, - "sub-accounts": [ - { - companyName: "My sub organization", - createdAt: "2024-02-09T06:14:40+00:00", - id: 7866556, - }, - { - companyName: "Your sub organization", - createdAt: "2024-01-05T03:11:40+00:00", - id: 6563051, - }, - ], - users: [ - { - email: "my-user@my-org.com", - firstName: "John", - lastName: "Smith", - }, - { - email: "your-user@your-org.com", - firstName: "firstName", - lastName: "lastName", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("updateAGroupOfSubAccounts (1)", async () => { @@ -234,20 +202,7 @@ describe("MasterAccountClient", () => { server.mockEndpoint().get("/corporate/groups").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.masterAccount.getSubAccountGroups(); - expect(response).toEqual([ - { - groupName: "My group 1", - id: "d3b142c709d6ed67ef1cd903", - }, - { - groupName: "My group 2", - id: "a5b192a709d6ed67ef8fd922", - }, - { - groupName: "My group 3", - id: "bbb142c709d6ed67ef1cd910", - }, - ]); + expect(response).toEqual(rawResponseBody); }); test("getCorporateInvitedUsersList", async () => { @@ -300,48 +255,7 @@ describe("MasterAccountClient", () => { .build(); const response = await client.masterAccount.getCorporateInvitedUsersList(); - expect(response).toEqual({ - users: [ - { - email: "master-user2@company.com", - feature_access: { - analytics: ["download_data", "create_alerts", "my_looks", "explore_create"], - api_keys: ["all"], - apps_management: ["none"], - create_sub_organizations: ["all"], - manage_sub_organizations: ["all"], - my_plan: ["all", "all"], - sub_organization_groups: ["create", "edit_delete"], - user_management: ["none"], - }, - groups: { - id: "a5c4f22c08d9ed37ef1ca342", - name: "My group", - }, - is_owner: "is_owner", - status: "active", - }, - { - email: "master-user3@company.com", - feature_access: { - analytics: ["create_alerts", "my_looks"], - api_keys: ["none"], - apps_management: ["all"], - create_sub_organizations: ["all"], - manage_sub_organizations: ["all"], - my_plan: ["none", "none"], - sub_organization_groups: ["edit_delete"], - user_management: ["all"], - }, - groups: { - id: "a5c4f22c08d9ed37ef1ca342", - name: "My group", - }, - is_owner: "is_owner", - status: "active", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("listOfAllIPs", async () => { @@ -356,18 +270,7 @@ describe("MasterAccountClient", () => { server.mockEndpoint().get("/corporate/ip").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.masterAccount.listOfAllIPs(); - expect(response).toEqual([ - { - domain: "example.com", - ip: "192.168.1.1", - transactional: true, - }, - { - domain: "example.com", - ip: "192.168.1.2", - transactional: false, - }, - ]); + expect(response).toEqual(rawResponseBody); }); test("getTheDetailsOfRequestedMasterAccount (1)", async () => { @@ -417,72 +320,7 @@ describe("MasterAccountClient", () => { .build(); const response = await client.masterAccount.getTheDetailsOfRequestedMasterAccount(); - expect(response).toEqual({ - billingInfo: { - address: { - countryCode: "IN", - locality: "Pandav Nagar, New Delhi", - postalCode: "560048", - stateCode: "UP", - streetAddress: "C-92", - }, - companyName: "Corp Sample 1-1", - email: "sample@example.com", - name: { - familyName: "Pandit", - givenName: "Uday", - }, - }, - companyName: "Corp Sample 1-1", - currencyCode: "INR", - email: "sample@example.com", - id: 1003286, - planInfo: { - currencyCode: "INR", - features: [ - { - name: "MULTI_USER", - quantity: 10, - remaining: 0, - unitValue: "unitValue", - used: 15, - }, - { - name: "ADVANCED_REPORTING", - quantity: 12, - remaining: 11, - unitValue: "unitValue", - used: 1, - }, - { - name: "INBOX", - quantity: 10, - remaining: 0, - unitValue: "unitValue", - used: 10, - }, - { - name: "LANDING_PAGE", - quantity: 10, - remaining: 0, - unitValue: "unitValue", - used: 11, - }, - { - name: "RECURRING_CREDITS", - quantity: 500, - remaining: 499, - unitValue: "unitValue", - used: 1, - }, - ], - nextBillingAt: 1637739295, - planPeriod: "month", - price: 2100, - subAccounts: 15, - }, - timezone: "Europe/Paris", - }); + expect(response).toEqual(rawResponseBody); }); test("getTheDetailsOfRequestedMasterAccount (2)", async () => { @@ -522,9 +360,7 @@ describe("MasterAccountClient", () => { const response = await client.masterAccount.generateSsoTokenToAccessAdminAccount({ email: "vipin+ent-user@brevo.com", }); - expect(response).toEqual({ - token: "5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0", - }); + expect(response).toEqual(rawResponseBody); }); test("generateSsoTokenToAccessAdminAccount (2)", async () => { @@ -605,41 +441,7 @@ describe("MasterAccountClient", () => { offset: 1, limit: 1, }); - expect(response).toEqual({ - count: 3, - subAccounts: [ - { - active: true, - companyName: "Company1", - createdAt: 1631523176, - groups: [ - { - id: "5f8f8c3b5f56a02d4433b3a8", - name: "Group 1", - }, - { - id: "4fbf3c3b1f56a02ac465b1a0", - name: "Group 2", - }, - ], - id: 4043629, - }, - { - active: true, - companyName: "Company2", - createdAt: 1629439311, - groups: [{}], - id: 3984002, - }, - { - active: true, - companyName: "Company3", - createdAt: 1614713641, - groups: [{}], - id: 3524191, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getTheListOfAllTheSubAccountsOfTheMasterAccount (2)", async () => { @@ -692,9 +494,7 @@ describe("MasterAccountClient", () => { language: "fr", timezone: "Europe/Paris", }); - expect(response).toEqual({ - id: 4109344, - }); + expect(response).toEqual(rawResponseBody); }); test("createANewSubAccountUnderAMasterAccount (2)", async () => { @@ -739,9 +539,7 @@ describe("MasterAccountClient", () => { ids: [234322, 325553, 893432], ip: "103.11.32.88", }); - expect(response).toEqual({ - key: "value", - }); + expect(response).toEqual(rawResponseBody); }); test("associateAnIpToSubAccounts (2)", async () => { @@ -829,10 +627,7 @@ describe("MasterAccountClient", () => { id: 3232323, name: "My Api Key", }); - expect(response).toEqual({ - key: "xkeysib-21881axxxxxcc92e04-mIrexxxx7z", - status: "success", - }); + expect(response).toEqual(rawResponseBody); }); test("createAnApiKeyForASubAccount (2)", async () => { @@ -876,9 +671,7 @@ describe("MasterAccountClient", () => { const response = await client.masterAccount.generateSsoTokenToAccessSubAccount({ id: 3232323, }); - expect(response).toEqual({ - token: "5cadaxxxxxxxxxxxxxxxxxxxx5a179f85a0", - }); + expect(response).toEqual(rawResponseBody); }); test("generateSsoTokenToAccessSubAccount (2)", async () => { @@ -966,64 +759,7 @@ describe("MasterAccountClient", () => { const response = await client.masterAccount.getSubAccountDetails({ id: 1000000, }); - expect(response).toEqual({ - companyName: "API-Sub-26thOct21-4", - email: "uday+1@brevo.com", - groups: [ - { - id: "5f8f8c3b5f56a02d4433b3a7", - name: "Group 1", - }, - { - id: "5f8f8c3b5f56a02d4433b3a8", - name: "Group 2", - }, - ], - name: "Uday Pandit", - planInfo: { - credits: { - emails: { - quantity: 2000, - remaining: 1955, - }, - externalFeeds: { - quantity: 1, - remaining: 1, - }, - sms: { - quantity: 2000, - remaining: 1955, - }, - whatsapp: { - quantity: 100, - remaining: 50, - }, - wpSubscribers: { - quantity: 2000, - remaining: 1955, - }, - }, - features: { - inbox: { - quantity: 20, - remaining: 12, - }, - landingPage: { - quantity: 25, - remaining: 14, - }, - salesUsers: { - quantity: 30, - remaining: 14, - }, - users: { - quantity: 30, - remaining: 14, - }, - }, - planType: "paid", - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getSubAccountDetails (2)", async () => { @@ -1349,9 +1085,7 @@ describe("MasterAccountClient", () => { email: "inviteuser@example.com", privileges: [{}], }); - expect(response).toEqual({ - id: "659xxxxxxxxxxxxxxxx6ef9c8", - }); + expect(response).toEqual(rawResponseBody); }); test("inviteAdminUser (2)", async () => { @@ -1396,9 +1130,7 @@ describe("MasterAccountClient", () => { action: "resend", email: "email", }); - expect(response).toEqual({ - message: "Invitation resent successfully", - }); + expect(response).toEqual(rawResponseBody); }); test("resendCancelAdminUserInvitation (2)", async () => { @@ -1490,30 +1222,7 @@ describe("MasterAccountClient", () => { const response = await client.masterAccount.getCorporateUserPermission({ email: "email", }); - expect(response).toEqual({ - email: "invitedUser@company.com", - feature_access: { - analytics: ["download_data", "create_alerts", "my_looks", "explore_create"], - api_keys: ["all"], - apps_management: ["all"], - create_sub_organizations: ["all"], - manage_sub_organizations: ["all"], - my_plan: ["all", "all"], - sub_organization_groups: ["create", "edit_delete"], - user_management: ["none"], - }, - groups: [ - { - id: "6543ab3667ffbb00142e4486", - name: "Support", - }, - { - id: "174bab366732bbce142e4412", - name: "Technical", - }, - ], - status: "active", - }); + expect(response).toEqual(rawResponseBody); }); test("getCorporateUserPermission (2)", async () => { diff --git a/tests/wire/notes.test.ts b/tests/wire/notes.test.ts index 419d88f..a6c59fb 100644 --- a/tests/wire/notes.test.ts +++ b/tests/wire/notes.test.ts @@ -30,25 +30,7 @@ describe("NotesClient", () => { server.mockEndpoint().get("/crm/notes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.notes.getAllNotes(); - expect(response).toEqual([ - { - authorId: { - email: "johndoe@example.com", - id: "61a5ce58y5d4795761045991", - locale: "en_GB", - name: { - fullName: "John Doe", - }, - timezone: "Asia/Kolkata", - }, - contactIds: [247, 1, 2], - createdAt: "2017-05-01T17:05:03Z", - dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], - id: "61a5cd07ca1347c82306ad09", - text: "In communication with client_dev for resolution of queries.", - updatedAt: "2017-05-01T17:05:03Z", - }, - ]); + expect(response).toEqual(rawResponseBody); }); test("getAllNotes (2)", async () => { @@ -82,9 +64,7 @@ describe("NotesClient", () => { const response = await client.notes.createANote({ text: "In communication with client_dev for resolution of queries.", }); - expect(response).toEqual({ - id: "61a5cd07ca1347c82306ad09", - }); + expect(response).toEqual(rawResponseBody); }); test("createANote (2)", async () => { @@ -156,23 +136,7 @@ describe("NotesClient", () => { const response = await client.notes.getANote({ id: "id", }); - expect(response).toEqual({ - authorId: { - email: "johndoe@example.com", - id: "61a5ce58y5d4795761045991", - locale: "en_GB", - name: { - fullName: "John Doe", - }, - timezone: "Asia/Kolkata", - }, - contactIds: [247, 1, 2], - createdAt: "2017-05-01T17:05:03Z", - dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], - id: "61a5cd07ca1347c82306ad09", - text: "In communication with client_dev for resolution of queries.", - updatedAt: "2017-05-01T17:05:03Z", - }); + expect(response).toEqual(rawResponseBody); }); test("getANote (2)", async () => { diff --git a/tests/wire/payments.test.ts b/tests/wire/payments.test.ts index 8ca42e3..8b15a38 100644 --- a/tests/wire/payments.test.ts +++ b/tests/wire/payments.test.ts @@ -32,10 +32,7 @@ describe("PaymentsClient", () => { contactId: 43, reference: "Invoice #INV0001", }); - expect(response).toEqual({ - id: 122, - url: "https://pay.brevo.com/payment/6d4ec0b2b48ef803df4103ve", - }); + expect(response).toEqual(rawResponseBody); }); test("createPaymentRequest (2)", async () => { @@ -156,23 +153,7 @@ describe("PaymentsClient", () => { const response = await client.payments.getPaymentRequest({ id: "050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc", }); - expect(response).toEqual({ - cart: { - currency: "EUR", - specificAmount: 1200, - }, - configuration: { - customSuccessUrl: "https://my-company.com/payment-success", - }, - contactId: 43, - notification: { - channel: "email", - text: "Please pay for your yoga class.", - }, - numberOfRemindersSent: 5, - reference: "Invoice #INV0001\n", - status: "paid", - }); + expect(response).toEqual(rawResponseBody); }); test("getPaymentRequest (2)", async () => { diff --git a/tests/wire/process.test.ts b/tests/wire/process.test.ts index 141be90..24a7ae6 100644 --- a/tests/wire/process.test.ts +++ b/tests/wire/process.test.ts @@ -45,38 +45,7 @@ describe("ProcessClient", () => { server.mockEndpoint().get("/processes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.process.getProcesses(); - expect(response).toEqual({ - count: 198, - processes: [ - { - id: 217, - name: "IMPORTUSER", - status: "completed", - export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:35:00Z", - }, - { - id: 213, - name: "SEARCH_EXPORT_USERS", - status: "completed", - export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:35:00Z", - }, - { - id: 212, - name: "IMPORTUSER", - status: "queued", - export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:35:00Z", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getProcesses (2)", async () => { @@ -105,7 +74,7 @@ describe("ProcessClient", () => { invalid_emails: 2, duplicate_contact_id: 0, duplicate_ext_id: 1, - duplicate_email_id: 5, + duplicate_email_id: "duplicate_email_id", duplicate_phone_id: 1, duplicate_whatsapp_id: 1, duplicate_landline_number_id: 1, @@ -123,30 +92,7 @@ describe("ProcessClient", () => { const response = await client.process.getProcess({ processId: 1000000, }); - expect(response).toEqual({ - id: 217, - name: "IMPORTUSER", - status: "queued", - info: { - import: { - invalid_emails: 2, - duplicate_contact_id: 0, - duplicate_ext_id: 1, - duplicate_email_id: 5, - duplicate_phone_id: 1, - duplicate_whatsapp_id: 1, - duplicate_landline_number_id: 1, - }, - export: { - total_records: 1250, - file_size: 102400, - }, - }, - export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded after 30 minutes", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:32:15Z", - }); + expect(response).toEqual(rawResponseBody); }); test("getProcess (2)", async () => { @@ -169,21 +115,7 @@ describe("ProcessClient", () => { const response = await client.process.getProcess({ processId: 1000000, }); - expect(response).toEqual({ - id: 217, - name: "IMPORTUSER", - status: "completed", - info: { - export: { - total_records: 1250, - file_size: 102400, - }, - }, - export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded after 30 minutes", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:32:15Z", - }); + expect(response).toEqual(rawResponseBody); }); test("getProcess (3)", async () => { @@ -199,7 +131,7 @@ describe("ProcessClient", () => { invalid_emails: 2, duplicate_contact_id: 0, duplicate_ext_id: 1, - duplicate_email_id: 5, + duplicate_email_id: "duplicate_email_id", duplicate_phone_id: 1, duplicate_whatsapp_id: 1, duplicate_landline_number_id: 1, @@ -217,30 +149,7 @@ describe("ProcessClient", () => { const response = await client.process.getProcess({ processId: 1000000, }); - expect(response).toEqual({ - id: 213, - name: "SEARCH_EXPORT_USERS", - status: "completed", - info: { - import: { - invalid_emails: 2, - duplicate_contact_id: 0, - duplicate_ext_id: 1, - duplicate_email_id: 5, - duplicate_phone_id: 1, - duplicate_whatsapp_id: 1, - duplicate_landline_number_id: 1, - }, - export: { - total_records: 1250, - file_size: 102400, - }, - }, - export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded after 30 minutes", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:32:15Z", - }); + expect(response).toEqual(rawResponseBody); }); test("getProcess (4)", async () => { @@ -256,7 +165,7 @@ describe("ProcessClient", () => { invalid_emails: 2, duplicate_contact_id: 0, duplicate_ext_id: 1, - duplicate_email_id: 5, + duplicate_email_id: "duplicate_email_id", duplicate_phone_id: 1, duplicate_whatsapp_id: 1, duplicate_landline_number_id: 1, @@ -274,30 +183,7 @@ describe("ProcessClient", () => { const response = await client.process.getProcess({ processId: 1000000, }); - expect(response).toEqual({ - id: 189, - name: "TRANS-GLOBAL-CALC", - status: "failed", - info: { - import: { - invalid_emails: 2, - duplicate_contact_id: 0, - duplicate_ext_id: 1, - duplicate_email_id: 5, - duplicate_phone_id: 1, - duplicate_whatsapp_id: 1, - duplicate_landline_number_id: 1, - }, - export: { - total_records: 1250, - file_size: 102400, - }, - }, - export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded after 30 minutes", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:32:15Z", - }); + expect(response).toEqual(rawResponseBody); }); test("getProcess (5)", async () => { diff --git a/tests/wire/program.test.ts b/tests/wire/program.test.ts index fe78dfd..0f222d5 100644 --- a/tests/wire/program.test.ts +++ b/tests/wire/program.test.ts @@ -37,26 +37,7 @@ describe("ProgramClient", () => { .build(); const response = await client.program.getLpList(); - expect(response).toEqual({ - items: [ - { - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", - id: "id", - meta: { - key: "value", - }, - name: "name", - pattern: "pattern", - state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", - subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getLPList (2)", async () => { @@ -204,22 +185,7 @@ describe("ProgramClient", () => { const response = await client.program.createNewLp({ name: "name", }); - expect(response).toEqual({ - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", - id: "id", - meta: { - key: "value", - }, - name: "name", - pattern: "pattern", - state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", - subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("createNewLP (2)", async () => { @@ -362,22 +328,7 @@ describe("ProgramClient", () => { const response = await client.program.getLoyaltyProgramInfo({ pid: "pid", }); - expect(response).toEqual({ - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", - id: "id", - meta: { - key: "value", - }, - name: "name", - pattern: "pattern", - state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", - subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("getLoyaltyProgramInfo (2)", async () => { @@ -517,22 +468,7 @@ describe("ProgramClient", () => { pid: "pid", name: "name", }); - expect(response).toEqual({ - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", - id: "id", - meta: { - key: "value", - }, - name: "name", - pattern: "pattern", - state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", - subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("updateLoyaltyProgram (2)", async () => { @@ -821,22 +757,7 @@ describe("ProgramClient", () => { const response = await client.program.partiallyUpdateLoyaltyProgram({ pid: "pid", }); - expect(response).toEqual({ - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", - id: "id", - meta: { - key: "value", - }, - name: "name", - pattern: "pattern", - state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", - subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("partiallyUpdateLoyaltyProgram (2)", async () => { @@ -1015,48 +936,7 @@ describe("ProgramClient", () => { const response = await client.program.getParameterSubscriptionInfo({ pid: "pid", }); - expect(response).toEqual({ - balance: { - balances: [{}], - contactId: 1, - loyaltyProgramId: "loyaltyProgramId", - }, - members: [ - { - createdAt: "createdAt", - memberContactId: 1, - updatedAt: "updatedAt", - }, - ], - reward: [ - { - code: "code", - contactId: 1, - createdAt: "createdAt", - expirationDate: "expirationDate", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - rewardId: "rewardId", - updatedAt: "updatedAt", - }, - ], - tier: [ - { - contactId: 1, - createdAt: "createdAt", - groupId: "groupId", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - tierId: "tierId", - updatedAt: "updatedAt", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getParameterSubscriptionInfo (2)", async () => { @@ -1451,13 +1331,7 @@ describe("ProgramClient", () => { pid: "pid", memberContactIds: [1], }); - expect(response).toEqual({ - createdAt: "createdAt", - memberContactIds: [1], - organizationId: 1, - ownerContactId: 1, - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("subscribeMemberToASubscription (2)", async () => { @@ -1775,15 +1649,7 @@ describe("ProgramClient", () => { pid: "pid", contactId: 1, }); - expect(response).toEqual({ - contactId: 1, - createdAt: "createdAt", - loyaltyProgramId: "loyaltyProgramId", - loyaltySubscriptionId: "loyaltySubscriptionId", - organizationId: 1, - updatedAt: "updatedAt", - versionId: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("subscribeToLoyaltyProgram (2)", async () => { diff --git a/tests/wire/reward.test.ts b/tests/wire/reward.test.ts index 476fc18..053a4f1 100644 --- a/tests/wire/reward.test.ts +++ b/tests/wire/reward.test.ts @@ -23,9 +23,7 @@ describe("RewardClient", () => { pid: "pid", cpid: "cpid", }); - expect(response).toEqual({ - count: 1000000, - }); + expect(response).toEqual(rawResponseBody); }); test("getCodeCount (2)", async () => { @@ -170,22 +168,7 @@ describe("RewardClient", () => { const response = await client.reward.getRewardPageApi({ pid: "pid", }); - expect(response).toEqual({ - items: [ - { - createdAt: "2024-01-15T09:30:00Z", - endDate: "2024-01-15T09:30:00Z", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - publicImage: "publicImage", - startDate: "2024-01-15T09:30:00Z", - state: "state", - updatedAt: "2024-01-15T09:30:00Z", - }, - ], - totalCount: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("getRewardPageApi (2)", async () => { @@ -342,16 +325,7 @@ describe("RewardClient", () => { pid: "pid", name: "name", }); - expect(response).toEqual({ - createdAt: "2024-01-15T09:30:00Z", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - publicDescription: "publicDescription", - publicImage: "publicImage", - publicName: "publicName", - updatedAt: "updatedAt", - }); + expect(response).toEqual(rawResponseBody); }); test("createReward (2)", async () => { @@ -477,21 +451,7 @@ describe("RewardClient", () => { pid: "pid", rewardId: "rewardId", }); - expect(response).toEqual({ - code: "code", - consumedAt: "consumedAt", - contactId: 1000000, - createdAt: "2024-01-15T09:30:00Z", - expirationDate: "2024-01-15T09:30:00Z", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - rewardId: "rewardId", - updatedAt: "2024-01-15T09:30:00Z", - value: 1.1, - }); + expect(response).toEqual(rawResponseBody); }); test("createVoucher (2)", async () => { @@ -665,24 +625,7 @@ describe("RewardClient", () => { const response = await client.reward.redeemVoucher({ pid: "pid", }); - expect(response).toEqual({ - cancelledAt: "2024-01-15T09:30:00Z", - completedAt: "2024-01-15T09:30:00Z", - contactId: 1000000, - createdAt: "2024-01-15T09:30:00Z", - debitTransactionId: "debitTransactionId", - expiresAt: "2024-01-15T09:30:00Z", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - rejectReason: "rejectReason", - rejectedAt: "2024-01-15T09:30:00Z", - rewardAttributionId: "rewardAttributionId", - status: "status", - updatedAt: "2024-01-15T09:30:00Z", - }); + expect(response).toEqual(rawResponseBody); }); test("redeemVoucher (2)", async () => { @@ -894,24 +837,7 @@ describe("RewardClient", () => { pid: "pid", tid: "tid", }); - expect(response).toEqual({ - cancelledAt: "2024-01-15T09:30:00Z", - completedAt: "2024-01-15T09:30:00Z", - contactId: 1000000, - createdAt: "2024-01-15T09:30:00Z", - debitTransactionId: "debitTransactionId", - expiresAt: "2024-01-15T09:30:00Z", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - rejectReason: "rejectReason", - rejectedAt: "2024-01-15T09:30:00Z", - rewardAttributionId: "rewardAttributionId", - status: "status", - updatedAt: "2024-01-15T09:30:00Z", - }); + expect(response).toEqual(rawResponseBody); }); test("completeRedeemTransaction (2)", async () => { @@ -1167,9 +1093,7 @@ describe("RewardClient", () => { const response = await client.reward.validateReward({ pid: "pid", }); - expect(response).toEqual({ - authorize: true, - }); + expect(response).toEqual(rawResponseBody); }); test("validateReward (2)", async () => { @@ -1395,100 +1319,7 @@ describe("RewardClient", () => { pid: "pid", rid: "rid", }); - expect(response).toEqual({ - attributionPerConsumer: 1, - balanceDefinitionId: "balanceDefinitionId", - code: "code", - codeCount: 1000000, - codeGeneratorId: "codeGeneratorId", - codePoolId: "codePoolId", - config: "config", - createdAt: "2024-01-15T09:30:00Z", - disabledAt: "2024-01-15T09:30:00Z", - endDate: "2024-01-15T09:30:00Z", - expirationDate: "2024-01-15T09:30:00Z", - expirationModifier: "startOfPeriod", - expirationUnit: "expirationUnit", - expirationValue: 1, - generator: { - createdAt: "createdAt", - description: "description", - id: "id", - name: "name", - pattern: "pattern", - updatedAt: "2024-01-15T09:30:00Z", - }, - id: "id", - limits: [ - { - createdAt: "2024-01-15T09:30:00Z", - durationUnit: "durationUnit", - durationValue: 1, - limitValue: 1, - rewardLimitId: "rewardLimitId", - slidingSchedule: true, - type: "type", - updatedAt: "2024-01-15T09:30:00Z", - }, - ], - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - name: "name", - products: [ - { - createdAt: "createdAt", - imageRef: "imageRef", - productId: "productId", - value: "value", - }, - ], - publicDescription: "publicDescription", - publicImage: "publicImage", - publicName: "publicName", - redeemPerConsumer: 1, - redeemRules: ["redeemRules"], - rewardConfigs: { - attribution: "attribution", - code: "code", - value: "value", - }, - rule: { - condition: { - op: "op", - }, - createdAt: "createdAt", - description: "description", - event: { - name: "name", - source: "source", - }, - isInternal: true, - loyaltyProgramId: "loyaltyProgramId", - loyaltyVersionId: 1, - meta: { - key: "value", - }, - name: "name", - results: [{}], - ruleId: "ruleId", - ruleType: "ruleType", - updatedAt: "updatedAt", - }, - startDate: "2024-01-15T09:30:00Z", - subtractBalanceDefinitionId: "subtractBalanceDefinitionId", - subtractBalanceStrategy: "subtractBalanceStrategy", - subtractBalanceValue: 1, - subtractTotalBalance: true, - totalAttribution: 1, - totalRedeem: 1, - triggerId: "triggerId", - unit: "unit", - updatedAt: "updatedAt", - value: 1.1, - valueType: "valueType", - }); + expect(response).toEqual(rawResponseBody); }); test("getRewardInformation (2)", async () => { @@ -1660,28 +1491,7 @@ describe("RewardClient", () => { pid: "pid", contactId: 1, }); - expect(response).toEqual({ - contactId: 1000000, - contactRewards: [ - { - code: "code", - consumedAt: "consumedAt", - createdAt: "createdAt", - expirationDate: "expirationDate", - id: "id", - meta: { - key: "value", - }, - rewardId: "rewardId", - unit: "unit", - updatedAt: "updatedAt", - value: 1.1, - }, - ], - count: 1, - loyaltyProgramId: "loyaltyProgramId", - loyaltySubscriptionId: "loyaltySubscriptionId", - }); + expect(response).toEqual(rawResponseBody); }); test("getVoucherForAContact (2)", async () => { diff --git a/tests/wire/senders.test.ts b/tests/wire/senders.test.ts index f463646..cb39ccd 100644 --- a/tests/wire/senders.test.ts +++ b/tests/wire/senders.test.ts @@ -38,49 +38,7 @@ describe("SendersClient", () => { server.mockEndpoint().get("/senders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.senders.getSenders(); - expect(response).toEqual({ - senders: [ - { - active: true, - email: "support@example.com", - id: 1, - ips: [ - { - domain: "example.com", - ip: "203.0.113.100", - weight: 50, - }, - ], - name: "Support Team", - }, - { - active: false, - email: "hello@example.com", - id: 3, - ips: [ - { - domain: "example.com", - ip: "203.0.113.100", - weight: 50, - }, - ], - name: "Customer Service", - }, - { - active: false, - email: "marketing@testcompany.com", - id: 5, - ips: [ - { - domain: "example.com", - ip: "203.0.113.100", - weight: 50, - }, - ], - name: "Marketing Team", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getSenders (2)", async () => { @@ -112,41 +70,7 @@ describe("SendersClient", () => { server.mockEndpoint().get("/senders").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.senders.getSenders(); - expect(response).toEqual({ - senders: [ - { - active: true, - email: "marketing@example.com", - id: 10, - ips: [ - { - domain: "example.com", - ip: "203.0.113.100", - weight: 100, - }, - ], - name: "Marketing", - }, - { - active: false, - email: "newsletter@example.com", - id: 11, - ips: [ - { - domain: "example.com", - ip: "203.0.113.100", - weight: 50, - }, - { - domain: "news.example.com", - ip: "203.0.113.101", - weight: 50, - }, - ], - name: "Newsletter", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getSenders (3)", async () => { @@ -181,11 +105,7 @@ describe("SendersClient", () => { email: "support@example.com", name: "Support Team", }); - expect(response).toEqual({ - dkimError: false, - id: 15, - spfError: false, - }); + expect(response).toEqual(rawResponseBody); }); test("createSender (2)", async () => { @@ -218,11 +138,7 @@ describe("SendersClient", () => { ], name: "Marketing Team", }); - expect(response).toEqual({ - dkimError: false, - id: 15, - spfError: false, - }); + expect(response).toEqual(rawResponseBody); }); test("createSender (3)", async () => { @@ -263,11 +179,7 @@ describe("SendersClient", () => { ], name: "Newsletter", }); - expect(response).toEqual({ - dkimError: false, - id: 15, - spfError: false, - }); + expect(response).toEqual(rawResponseBody); }); test("createSender (4)", async () => { @@ -289,11 +201,7 @@ describe("SendersClient", () => { email: "support@example.com", name: "Support Team", }); - expect(response).toEqual({ - dkimError: false, - id: 15, - spfError: false, - }); + expect(response).toEqual(rawResponseBody); }); test("createSender (5)", async () => { @@ -315,11 +223,7 @@ describe("SendersClient", () => { email: "support@example.com", name: "Support Team", }); - expect(response).toEqual({ - dkimError: true, - id: 16, - spfError: false, - }); + expect(response).toEqual(rawResponseBody); }); test("createSender (6)", async () => { @@ -356,16 +260,7 @@ describe("SendersClient", () => { server.mockEndpoint().get("/senders/ips").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.senders.getIps(); - expect(response).toEqual({ - ips: [ - { - active: true, - domain: "mailing.enterprise.com", - id: 3, - ip: "192.168.1.100", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getIps (2)", async () => { @@ -383,28 +278,7 @@ describe("SendersClient", () => { server.mockEndpoint().get("/senders/ips").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.senders.getIps(); - expect(response).toEqual({ - ips: [ - { - active: true, - domain: "mailing.enterprise.com", - id: 3, - ip: "192.168.1.100", - }, - { - active: true, - domain: "newsletter.enterprise.com", - id: 5, - ip: "192.168.1.101", - }, - { - active: false, - domain: "notifications.enterprise.com", - id: 6, - ip: "192.168.1.102", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getIps (3)", async () => { @@ -638,16 +512,7 @@ describe("SendersClient", () => { const response = await client.senders.getIpsFromSender({ senderId: 1000000, }); - expect(response).toEqual({ - ips: [ - { - domain: "mailing.enterprise.com", - id: 3, - ip: "192.168.1.100", - weight: 75, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getIpsFromSender (2)", async () => { @@ -672,22 +537,7 @@ describe("SendersClient", () => { const response = await client.senders.getIpsFromSender({ senderId: 1000000, }); - expect(response).toEqual({ - ips: [ - { - domain: "mailing.enterprise.com", - id: 3, - ip: "192.168.1.100", - weight: 40, - }, - { - domain: "newsletter.enterprise.com", - id: 5, - ip: "192.168.1.101", - weight: 60, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getIpsFromSender (3)", async () => { diff --git a/tests/wire/smsCampaigns.test.ts b/tests/wire/smsCampaigns.test.ts index 6298783..6d6a40c 100644 --- a/tests/wire/smsCampaigns.test.ts +++ b/tests/wire/smsCampaigns.test.ts @@ -58,57 +58,7 @@ describe("SmsCampaignsClient", () => { server.mockEndpoint().get("/smsCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.smsCampaigns.getSmsCampaigns(); - expect(response).toEqual({ - campaigns: [ - { - content: "Visit our Store and get some discount !", - createdAt: "2017-06-01T12:30:00Z", - id: 2, - modifiedAt: "2017-05-01T12:30:00Z", - name: "PROMO CODE", - scheduledAt: "2017-06-01T12:30:00Z", - sender: "MyCompany", - status: "sent", - recipients: { - exclusionLists: [13], - lists: [21], - }, - statistics: { - answered: 2, - delivered: 2987, - hardBounces: 1, - processing: 0, - sent: 3000, - softBounces: 3, - unsubscriptions: 3, - }, - }, - { - content: "Summer Sale is starting tomorrow. Get extra 10% with this code:SUM17", - createdAt: "2017-06-01T12:30:00Z", - id: 10, - modifiedAt: "2017-05-01T12:30:00Z", - name: "SUMMER SALE", - scheduledAt: "2017-08-04T12:30:00Z", - sender: "MyCompany", - status: "draft", - recipients: { - exclusionLists: [13], - lists: [21], - }, - statistics: { - answered: 2, - delivered: 2987, - hardBounces: 1, - processing: 0, - sent: 3000, - softBounces: 3, - unsubscriptions: 3, - }, - }, - ], - count: 12, - }); + expect(response).toEqual(rawResponseBody); }); test("getSmsCampaigns (2)", async () => { @@ -148,9 +98,7 @@ describe("SmsCampaignsClient", () => { name: "Spring Promo Code", sender: "MyShop", }); - expect(response).toEqual({ - id: 5, - }); + expect(response).toEqual(rawResponseBody); }); test("createSmsCampaign (2)", async () => { @@ -213,29 +161,7 @@ describe("SmsCampaignsClient", () => { const response = await client.smsCampaigns.getSmsCampaign({ campaignId: 1000000, }); - expect(response).toEqual({ - content: "Visit our Store and get some discount !", - createdAt: "2017-06-01T12:30:00Z", - id: 2, - modifiedAt: "2017-05-01T12:30:00Z", - name: "PROMO CODE", - scheduledAt: "2017-06-01T12:30:00Z", - sender: "MyCompany", - status: "sent", - recipients: { - exclusionLists: [13], - lists: [21], - }, - statistics: { - answered: 2, - delivered: 2987, - hardBounces: 1, - processing: 0, - sent: 3000, - softBounces: 3, - unsubscriptions: 3, - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getSmsCampaign (2)", async () => { @@ -416,9 +342,7 @@ describe("SmsCampaignsClient", () => { campaignId: 1000000, recipientsType: "all", }); - expect(response).toEqual({ - processId: 78, - }); + expect(response).toEqual(rawResponseBody); }); test("requestSmsRecipientExport (2)", async () => { diff --git a/tests/wire/smsTemplates.test.ts b/tests/wire/smsTemplates.test.ts index 7338e8b..1b51c42 100644 --- a/tests/wire/smsTemplates.test.ts +++ b/tests/wire/smsTemplates.test.ts @@ -39,30 +39,7 @@ describe("SmsTemplatesClient", () => { .build(); const response = await client.smsTemplates.getSmsTemplates(); - expect(response).toEqual({ - count: 1, - templates: [ - { - id: 4, - name: "Order Confirmation - EN", - short_url_enabled: false, - message: "Thanks for your order !", - compliance: { - compliance_toggle: true, - organisation_prefix: "BREVO", - stop_keyword: "STOP", - }, - encryption: true, - unicode_sms: true, - media_file: "brv-logo.png", - media_file_size: "media_file_size", - media_url: - "https://img-st2.mailinblue.com/1232/images/content_library/original/69282fe28f55fd22de6e0cf9.png", - createdAt: "2025-05-01T12:30:00Z", - updatedAt: "2025-05-01T12:30:00Z", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getSMSTemplates (2)", async () => { diff --git a/tests/wire/tasks.test.ts b/tests/wire/tasks.test.ts index 1f74b0b..9c2f9e8 100644 --- a/tests/wire/tasks.test.ts +++ b/tests/wire/tasks.test.ts @@ -27,18 +27,7 @@ describe("TasksClient", () => { const response = await client.tasks.getAllTasks({ sortBy: "name", }); - expect(response).toEqual({ - items: [ - { - companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - contactsIds: [1, 2, 3], - dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - id: "61a5cd07ca1347c82306ad06", - name: "Task: Connect with client_dev", - taskTypeId: "61a5cd07ca1347c82306ad09", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getAllTasks (2)", async () => { @@ -78,9 +67,7 @@ describe("TasksClient", () => { name: "Task: Connect with client_dev", taskTypeId: "61a5cd07ca1347c82306ad09", }); - expect(response).toEqual({ - id: "61a5cd07ca1347c82306ad06", - }); + expect(response).toEqual(rawResponseBody); }); test("createATask (2)", async () => { @@ -125,14 +112,7 @@ describe("TasksClient", () => { const response = await client.tasks.getATask({ id: "id", }); - expect(response).toEqual({ - companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - contactsIds: [1, 2, 3], - dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - id: "61a5cd07ca1347c82306ad06", - name: "Task: Connect with client_dev", - taskTypeId: "61a5cd07ca1347c82306ad09", - }); + expect(response).toEqual(rawResponseBody); }); test("getATask (2)", async () => { @@ -273,9 +253,6 @@ describe("TasksClient", () => { server.mockEndpoint().get("/crm/tasktypes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.tasks.getAllTaskTypes(); - expect(response).toEqual({ - id: "61a88a2eb7a574180261234", - title: "Email", - }); + expect(response).toEqual(rawResponseBody); }); }); diff --git a/tests/wire/tier.test.ts b/tests/wire/tier.test.ts index e14d4ff..0bca4c0 100644 --- a/tests/wire/tier.test.ts +++ b/tests/wire/tier.test.ts @@ -32,17 +32,7 @@ describe("TierClient", () => { cid: "cid", tid: "tid", }); - expect(response).toEqual({ - contactId: 1, - createdAt: "2024-01-15T09:30:00Z", - groupId: "groupId", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - meta: { - key: "value", - }, - updatedAt: "2024-01-15T09:30:00Z", - }); + expect(response).toEqual(rawResponseBody); }); test("addSubscriptionToTier (2)", async () => { @@ -236,20 +226,7 @@ describe("TierClient", () => { const response = await client.tier.getListOfTierGroups({ pid: "pid", }); - expect(response).toEqual({ - items: [ - { - createdAt: "2024-01-15T09:30:00Z", - downgradeStrategy: "real_time", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - tierOrder: ["tierOrder"], - updatedAt: "2024-01-15T09:30:00Z", - upgradeStrategy: "real_time", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getListOfTierGroups (2)", async () => { @@ -385,16 +362,7 @@ describe("TierClient", () => { pid: "pid", name: "name", }); - expect(response).toEqual({ - createdAt: "2024-01-15T09:30:00Z", - downgradeStrategy: "real_time", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - tierOrder: ["tierOrder"], - updatedAt: "2024-01-15T09:30:00Z", - upgradeStrategy: "real_time", - }); + expect(response).toEqual(rawResponseBody); }); test("createTierGroup (2)", async () => { @@ -562,16 +530,7 @@ describe("TierClient", () => { pid: "pid", gid: "gid", }); - expect(response).toEqual({ - createdAt: "2024-01-15T09:30:00Z", - downgradeStrategy: "real_time", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - tierOrder: ["tierOrder"], - updatedAt: "2024-01-15T09:30:00Z", - upgradeStrategy: "real_time", - }); + expect(response).toEqual(rawResponseBody); }); test("getTierGroup (2)", async () => { @@ -721,16 +680,7 @@ describe("TierClient", () => { tierOrder: ["tierOrder"], upgradeStrategy: "real_time", }); - expect(response).toEqual({ - createdAt: "2024-01-15T09:30:00Z", - downgradeStrategy: "real_time", - id: "id", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - tierOrder: ["tierOrder"], - updatedAt: "2024-01-15T09:30:00Z", - upgradeStrategy: "real_time", - }); + expect(response).toEqual(rawResponseBody); }); test("updateTierGroup (2)", async () => { @@ -1083,30 +1033,7 @@ describe("TierClient", () => { accessConditions: [{}], name: "name", }); - expect(response).toEqual({ - accessConditions: [ - { - balanceDefinitionId: "balanceDefinitionId", - createdAt: "2024-01-15T09:30:00Z", - minimumValue: 1, - updatedAt: "2024-01-15T09:30:00Z", - }, - ], - createdAt: "2024-01-15T09:30:00Z", - groupId: "groupId", - imageRef: "imageRef", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - tierId: "tierId", - tierRewards: [ - { - createdAt: "2024-01-15T09:30:00Z", - rewardId: "rewardId", - updatedAt: "2024-01-15T09:30:00Z", - }, - ], - updatedAt: "2024-01-15T09:30:00Z", - }); + expect(response).toEqual(rawResponseBody); }); test("createTierForTierGroup (2)", async () => { @@ -1265,21 +1192,7 @@ describe("TierClient", () => { const response = await client.tier.getLoyaltyProgramTier({ pid: "pid", }); - expect(response).toEqual({ - items: [ - { - accessConditions: [{}], - createdAt: "2024-01-15T09:30:00Z", - groupId: "groupId", - imageRef: "imageRef", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - tierId: "tierId", - tierRewards: [{}], - updatedAt: "2024-01-15T09:30:00Z", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getLoyaltyProgramTier (2)", async () => { @@ -1428,30 +1341,7 @@ describe("TierClient", () => { name: "name", tierRewards: [{}], }); - expect(response).toEqual({ - accessConditions: [ - { - balanceDefinitionId: "balanceDefinitionId", - createdAt: "2024-01-15T09:30:00Z", - minimumValue: 1, - updatedAt: "2024-01-15T09:30:00Z", - }, - ], - createdAt: "2024-01-15T09:30:00Z", - groupId: "groupId", - imageRef: "imageRef", - loyaltyProgramId: "loyaltyProgramId", - name: "name", - tierId: "tierId", - tierRewards: [ - { - createdAt: "2024-01-15T09:30:00Z", - rewardId: "rewardId", - updatedAt: "2024-01-15T09:30:00Z", - }, - ], - updatedAt: "2024-01-15T09:30:00Z", - }); + expect(response).toEqual(rawResponseBody); }); test("updateTier (2)", async () => { diff --git a/tests/wire/transactionalEmails.test.ts b/tests/wire/transactionalEmails.test.ts index fa2f407..682b720 100644 --- a/tests/wire/transactionalEmails.test.ts +++ b/tests/wire/transactionalEmails.test.ts @@ -30,20 +30,7 @@ describe("TransactionalEmailsClient", () => { .build(); const response = await client.transactionalEmails.getTransacBlockedContacts(); - expect(response).toEqual({ - contacts: [ - { - blockedAt: "2017-05-01T12:30:00Z", - email: "abc@xyz.com", - reason: { - code: "adminBlocked", - message: "Admin blocked", - }, - senderEmail: "ez312@gmal.com", - }, - ], - count: 1, - }); + expect(response).toEqual(rawResponseBody); }); test("getTransacBlockedContacts (2)", async () => { @@ -134,9 +121,7 @@ describe("TransactionalEmailsClient", () => { .build(); const response = await client.transactionalEmails.getBlockedDomains(); - expect(response).toEqual({ - domains: ["example.com", "testdomain.com"], - }); + expect(response).toEqual(rawResponseBody); }); test("blockNewDomain (1)", async () => { @@ -307,10 +292,7 @@ describe("TransactionalEmailsClient", () => { }, ], }); - expect(response).toEqual({ - messageId: "<201798300811.5787683@relay.domain.com>", - messageIds: ["messageIds"], - }); + expect(response).toEqual(rawResponseBody); }); test("sendTransacEmail (2)", async () => { @@ -354,10 +336,7 @@ describe("TransactionalEmailsClient", () => { }, ], }); - expect(response).toEqual({ - messageId: "<201798300811.5787683@relay.domain.com>", - messageIds: ["messageIds"], - }); + expect(response).toEqual(rawResponseBody); }); test("sendTransacEmail (3)", async () => { @@ -465,26 +444,7 @@ describe("TransactionalEmailsClient", () => { startDate: "2022-02-02", endDate: "2022-03-02", }); - expect(response).toEqual({ - batches: [ - { - createdAt: "2022-02-26T11:36:43Z", - scheduledAt: "2022-02-28T11:36:43Z", - status: "queued", - }, - { - createdAt: "2022-02-24T11:36:43Z", - scheduledAt: "2022-02-25T11:36:43Z", - status: "processed", - }, - { - createdAt: "2022-02-25T11:36:43Z", - scheduledAt: "2022-02-26T11:36:43Z", - status: "inProgress", - }, - ], - count: 3, - }); + expect(response).toEqual(rawResponseBody); }); test("getScheduledEmailById (2)", async () => { @@ -510,11 +470,7 @@ describe("TransactionalEmailsClient", () => { startDate: "2022-02-02", endDate: "2022-03-02", }); - expect(response).toEqual({ - createdAt: "2022-02-26T11:36:43Z", - scheduledAt: "2022-02-28T11:36:43Z", - status: "queued", - }); + expect(response).toEqual(rawResponseBody); }); test("getScheduledEmailById (3)", async () => { @@ -592,31 +548,7 @@ describe("TransactionalEmailsClient", () => { server.mockEndpoint().get("/smtp/emails").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.transactionalEmails.getTransacEmailsList(); - expect(response).toEqual({ - count: 120, - transactionalEmails: [ - { - date: "2019-05-25T11:53:26Z", - email: "abc@xyz.com", - from: "diana.doe@example.com", - messageId: "<201798300811.5787683@relay.domain.com>", - subject: "summer camp", - tags: ["tag1"], - templateId: 15, - uuid: "5a78c-209ok98262910-std2341", - }, - { - date: "2019-05-25T07:28:11Z", - email: "test@test.com", - from: "diana.doe@example.com", - messageId: "<201798300811.5700093@relay.domain.com>", - subject: "details verification", - tags: ["tag1"], - templateId: 15, - uuid: "5a78c-209ok98262910-s99a341", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getTransacEmailsList (2)", async () => { @@ -655,28 +587,7 @@ describe("TransactionalEmailsClient", () => { const response = await client.transactionalEmails.getTransacEmailContent({ uuid: "uuid", }); - expect(response).toEqual({ - attachmentCount: 2, - body: "

Greetings from the team

This is the actual html content sent

", - date: "2016-02-25T11:53:26Z", - email: "abc@example.com", - events: [ - { - name: "sent", - time: "2016-02-25T11:53:26Z", - }, - { - name: "delivered", - time: "2016-02-25T11:55:26Z", - }, - { - name: "opened", - time: "2016-02-26T09:53:26Z", - }, - ], - subject: "Summer Camps", - templateId: 12, - }); + expect(response).toEqual(rawResponseBody); }); test("deleteAnSmtpTransactionalLog (1)", async () => { @@ -762,21 +673,7 @@ describe("TransactionalEmailsClient", () => { .build(); const response = await client.transactionalEmails.getAggregatedSmtpReport(); - expect(response).toEqual({ - blocked: 2, - clicks: 9987, - delivered: 18996, - hardBounces: 234, - invalid: 0, - opens: 17654, - range: "2016-09-08|2017-04-28", - requests: 19887, - softBounces: 1533, - spamReports: 1, - uniqueClicks: 8766, - uniqueOpens: 13688, - unsubscribed: 2, - }); + expect(response).toEqual(rawResponseBody); }); test("getAggregatedSmtpReport (2)", async () => { @@ -842,36 +739,7 @@ describe("TransactionalEmailsClient", () => { .build(); const response = await client.transactionalEmails.getEmailEventReport(); - expect(response).toEqual({ - events: [ - { - date: "2017-03-12T12:30:00Z", - email: "john.smith@example.com", - event: "deferred", - from: "john@example.com", - ip: "165.87.3.15", - link: "https://www.someexamplelink.com", - messageId: "<201798300811.5787683@example.domain.com>", - reason: "Error connection timeout", - subject: "Sib client_dev test", - tag: "OrderConfirmation", - templateId: 4, - }, - { - date: "2017-03-13T16:30:00Z", - email: "john.smith@example.com", - event: "delivered", - from: "john@example.com", - ip: "165.87.3.15", - link: "https://www.someexamplelink.com", - messageId: "<201798300811.5787683@example.domain.com>", - reason: "Error connection timeout", - subject: "Sib client_dev test", - tag: "OrderConfirmation", - templateId: 5, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getEmailEventReport (2)", async () => { @@ -941,40 +809,7 @@ describe("TransactionalEmailsClient", () => { .build(); const response = await client.transactionalEmails.getSmtpReport(); - expect(response).toEqual({ - reports: [ - { - blocked: 519, - clicks: 1026, - date: "2017-04-30", - delivered: 10103, - hardBounces: 21, - invalid: 1, - opens: 5091, - requests: 10756, - softBounces: 137, - spamReports: 0, - uniqueClicks: 720, - uniqueOpens: 2318, - unsubscribed: 0, - }, - { - blocked: 920, - clicks: 1514, - date: "2017-05-01", - delivered: 17499, - hardBounces: 34, - invalid: 2, - opens: 10089, - requests: 18812, - softBounces: 254, - spamReports: 0, - uniqueClicks: 1090, - uniqueOpens: 4393, - unsubscribed: 3, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getSmtpReport (2)", async () => { @@ -1021,14 +856,7 @@ describe("TransactionalEmailsClient", () => { const response = await client.transactionalEmails.postPreviewSmtpEmailTemplates({ key: "value", }); - expect(response).toEqual({ - fromEmail: "fromEmail", - fromName: "fromName", - html: "html", - previewText: "previewText", - subject: "subject", - usedFeedNames: ["usedFeedNames", "usedFeedNames"], - }); + expect(response).toEqual(rawResponseBody); }); test("postPreviewSmtpEmailTemplates (2)", async () => { @@ -1096,49 +924,7 @@ describe("TransactionalEmailsClient", () => { server.mockEndpoint().get("/smtp/templates").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.transactionalEmails.getSmtpTemplates(); - expect(response).toEqual({ - count: 2, - templates: [ - { - createdAt: "2016-02-24T14:44:24Z", - doiTemplate: false, - htmlContent: "HTML CONTENT 1", - id: 5, - isActive: false, - modifiedAt: "2016-02-24T15:37:11Z", - name: "ChristomasTimeTemplate", - replyTo: "replyto@domain.com", - sender: { - email: "john.smith@example.com", - id: "43", - name: "John", - }, - subject: "Merry Christmas", - tag: "Festival", - testSent: false, - toField: "", - }, - { - createdAt: "2016-02-25T11:53:26Z", - doiTemplate: false, - htmlContent: "HTML CONTENT 2", - id: 12, - isActive: true, - modifiedAt: "2016-02-25T11:53:26Z", - name: "SummerSales2017Template", - replyTo: "replyto@domain.com", - sender: { - email: "john.smith@example.com", - id: "43", - name: "John", - }, - subject: "Enjoy our summer Sales !", - tag: "Summer", - testSent: false, - toField: "", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getSmtpTemplates (2)", async () => { @@ -1178,9 +964,7 @@ describe("TransactionalEmailsClient", () => { subject: "Thanks for your purchase !", templateName: "Order Confirmation - EN", }); - expect(response).toEqual({ - id: 5, - }); + expect(response).toEqual(rawResponseBody); }); test("createSmtpTemplate (2)", async () => { @@ -1238,25 +1022,7 @@ describe("TransactionalEmailsClient", () => { const response = await client.transactionalEmails.getSmtpTemplate({ templateId: 1000000, }); - expect(response).toEqual({ - createdAt: "2016-02-25T11:53:26Z", - doiTemplate: false, - htmlContent: "HTML CONTENT 4", - id: 33, - isActive: true, - modifiedAt: "2016-02-25T11:53:26Z", - name: "OrderConfirmation", - replyTo: "replyto@domain.com", - sender: { - email: "john.smith@example.com", - id: "43", - name: "John", - }, - subject: "Order Confirmation : Thanks for your Purchase !", - tag: "", - testSent: false, - toField: "", - }); + expect(response).toEqual(rawResponseBody); }); test("getSmtpTemplate (2)", async () => { diff --git a/tests/wire/transactionalSms.test.ts b/tests/wire/transactionalSms.test.ts index d0c301b..5d6adfe 100644 --- a/tests/wire/transactionalSms.test.ts +++ b/tests/wire/transactionalSms.test.ts @@ -24,9 +24,7 @@ describe("TransactionalSmsClient", () => { recipient: "33689965433", sender: "MyShop", }); - expect(response).toEqual({ - messageId: 1511882900176220, - }); + expect(response).toEqual(rawResponseBody); }); test("sendAsyncTransactionalSms (2)", async () => { @@ -77,13 +75,7 @@ describe("TransactionalSmsClient", () => { recipient: "33689965433", sender: "MyShop", }); - expect(response).toEqual({ - messageId: 1511882900176220, - reference: "ab1cde2fgh3i4jklmno", - remainingCredits: 82.85, - smsCount: 2, - usedCredits: 0.7, - }); + expect(response).toEqual(rawResponseBody); }); test("sendTransacSms (2)", async () => { @@ -159,19 +151,7 @@ describe("TransactionalSmsClient", () => { .build(); const response = await client.transactionalSms.getTransacAggregatedSmsReport(); - expect(response).toEqual({ - accepted: 6, - blocked: 4, - delivered: 16, - hardBounces: 5, - range: "2015-05-22|2017-11-29", - rejected: 14, - replied: 8, - requests: 54, - skipped: 1, - softBounces: 26, - unsubscribed: 10, - }); + expect(response).toEqual(rawResponseBody); }); test("getTransacAggregatedSmsReport (2)", async () => { @@ -229,28 +209,7 @@ describe("TransactionalSmsClient", () => { .build(); const response = await client.transactionalSms.getSmsEvents(); - expect(response).toEqual({ - events: [ - { - date: "2015-05-20T12:30:00Z", - event: "sent", - messageId: "1473139351170140", - phoneNumber: "phoneNumber", - reason: "Recipient is currently unreachable", - reply: "reply", - tag: "cabWaiting", - }, - { - date: "2015-05-20T16:30:00Z", - event: "delivered", - messageId: "1473139351170140", - phoneNumber: "phoneNumber", - reason: "Recipient is currently unreachable", - reply: "reply", - tag: "cabRequest", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getSmsEvents (2)", async () => { @@ -329,49 +288,7 @@ describe("TransactionalSmsClient", () => { .build(); const response = await client.transactionalSms.getTransacSmsReport(); - expect(response).toEqual({ - reports: [ - { - accepted: 2318, - blocked: 1026, - date: "2017-04-30", - delivered: 10103, - hardBounces: 21, - rejected: 0, - replied: 5091, - requests: 10756, - skipped: 1, - softBounces: 137, - unsubscribed: 720, - }, - { - accepted: 4393, - blocked: 1514, - date: "2017-05-01", - delivered: 17499, - hardBounces: 34, - rejected: 0, - replied: 10089, - requests: 18812, - skipped: 0, - softBounces: 254, - unsubscribed: 1090, - }, - { - accepted: 4689, - blocked: 1646, - date: "2017-05-02", - delivered: 13427, - hardBounces: 16, - rejected: 0, - replied: 11563, - requests: 14321, - skipped: 1, - softBounces: 176, - unsubscribed: 1170, - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getTransacSmsReport (2)", async () => { diff --git a/tests/wire/transactionalWhatsApp.test.ts b/tests/wire/transactionalWhatsApp.test.ts index f286603..d1455ee 100644 --- a/tests/wire/transactionalWhatsApp.test.ts +++ b/tests/wire/transactionalWhatsApp.test.ts @@ -25,9 +25,7 @@ describe("TransactionalWhatsAppClient", () => { senderNumber: "senderNumber", templateId: 123, }); - expect(response).toEqual({ - messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", - }); + expect(response).toEqual(rawResponseBody); }); test("sendWhatsappMessage (2)", async () => { @@ -116,50 +114,7 @@ describe("TransactionalWhatsAppClient", () => { .build(); const response = await client.transactionalWhatsApp.getWhatsappEventReport(); - expect(response).toEqual({ - events: [ - { - body: "Hi! I am a reply", - contactNumber: "contactNumber", - date: "2017-03-12T12:30:00Z", - event: "sent", - mediaUrl: "https://example.com/media.png", - messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", - reason: "23befbae-1505-47a8-bd27-e30ef739f32c", - senderNumber: "senderNumber", - }, - { - body: "Hi! I am a reply", - contactNumber: "contactNumber", - date: "2017-03-12T12:30:00Z", - event: "error", - mediaUrl: "https://example.com/media.png", - messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", - reason: "error reason", - senderNumber: "senderNumber", - }, - { - body: "Hi! I am a reply", - contactNumber: "contactNumber", - date: "2017-03-12T12:30:00Z", - event: "soft-bounce", - mediaUrl: "https://example.com/media.png", - messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", - reason: "invalid whatsapp contact", - senderNumber: "senderNumber", - }, - { - body: "body only in case of text reply & url will be empty", - contactNumber: "contactNumber", - date: "2017-03-12T12:30:00Z", - event: "reply", - mediaUrl: "media url only in case media reply & body will be empty", - messageId: "23befbae-1505-47a8-bd27-e30ef739f32c", - reason: "23befbae-1505-47a8-bd27-e30ef739f32c", - senderNumber: "senderNumber", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getWhatsappEventReport (2)", async () => { diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index 32928ab..0da9032 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -41,40 +41,7 @@ describe("UserClient", () => { .build(); const response = await client.user.getInvitedUsersList(); - expect(response).toEqual({ - users: [ - { - email: "owner@company.com", - feature_access: { - conversations: "owner", - crm: "owner", - marketing: "owner", - }, - is_owner: "is_owner", - status: "active", - }, - { - email: "pendingInvitedUser@company.com", - feature_access: { - conversations: "none", - crm: "full", - marketing: "custom", - }, - is_owner: "is_owner", - status: "pending", - }, - { - email: "connectedInvitedUser@company.com", - feature_access: { - conversations: "full", - crm: "none", - marketing: "none", - }, - is_owner: "is_owner", - status: "active", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getInvitedUsersList (2)", async () => { @@ -113,10 +80,7 @@ describe("UserClient", () => { const response = await client.user.putRevokeUserPermission({ email: "email", }); - expect(response).toEqual({ - credit_notes: ["TEST-123"], - status: "OK", - }); + expect(response).toEqual(rawResponseBody); }); test("putRevokeUserPermission (2)", async () => { @@ -160,10 +124,7 @@ describe("UserClient", () => { email: "inviteuser@example.com", privileges: [{}], }); - expect(response).toEqual({ - invoice_id: "invoice_id", - status: "OK", - }); + expect(response).toEqual(rawResponseBody); }); test("inviteuser (2)", async () => { @@ -208,10 +169,7 @@ describe("UserClient", () => { action: "resend", email: "email", }); - expect(response).toEqual({ - credit_notes: ["TEST-123"], - status: "OK", - }); + expect(response).toEqual(rawResponseBody); }); test("putresendcancelinvitation (2)", async () => { @@ -256,11 +214,7 @@ describe("UserClient", () => { email: "inviteuser@example.com", privileges: [{}], }); - expect(response).toEqual({ - credit_notes: ["TEST-123"], - invoice_id: "invoice_id", - status: "OK", - }); + expect(response).toEqual(rawResponseBody); }); test("EditUserPermission (2)", async () => { @@ -341,77 +295,7 @@ describe("UserClient", () => { const response = await client.user.getUserPermission({ email: "email", }); - expect(response).toEqual({ - email: "invitedUser@company.com", - privileges: [ - { - feature: "Email campaign", - permissions: ["Create / edit / delete", "Send / schedule / suspend"], - }, - { - feature: "Templates", - permissions: ["Create / edit / delete", "Activate / deactivate"], - }, - { - feature: "SMS campaign", - permissions: ["Create / edit / delete", "Send / schedule / suspend"], - }, - { - feature: "Facebook Ads", - permissions: ["Schedule / pause"], - }, - { - feature: "Landing pages", - permissions: ["All"], - }, - { - feature: "Workflows", - permissions: ["Create / edit / delete", "Activate / deactivate / Pause"], - }, - { - feature: "Contacts", - permissions: ["View", "Contact forms"], - }, - { - feature: "SMTP & API", - permissions: ["SMTP", "API Keys", "Authorized IPs"], - }, - { - feature: "User management", - permissions: ["None"], - }, - { - feature: "Sales Platform", - permissions: [ - "Create / edit / delete owned deals and tasks", - "Manage deals and tasks from other users", - "Reports", - "Settings", - ], - }, - { - feature: "Conversations", - permissions: ["None"], - }, - { - feature: "Senders, Domains & Dedicated IPs", - permissions: ["Senders management", "Domains management", "Dedicated IPs management"], - }, - { - feature: "Push", - permissions: ["View", "Create / edit / delete", "Send", "Settings"], - }, - { - feature: "Companies", - permissions: [ - "Create / edit / delete owned companies", - "Manage companies from other users", - "Settings", - ], - }, - ], - status: "active", - }); + expect(response).toEqual(rawResponseBody); }); test("getUserPermission (2)", async () => { diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts index 207ac1a..9d3e4ec 100644 --- a/tests/wire/webhooks.test.ts +++ b/tests/wire/webhooks.test.ts @@ -43,52 +43,7 @@ describe("WebhooksClient", () => { server.mockEndpoint().get("/webhooks").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.webhooks.getWebhooks(); - expect(response).toEqual({ - webhooks: [ - { - auth: { - token: "test-auth-token1234", - type: "bearer", - }, - batched: true, - channel: "email", - createdAt: "2016-07-18T12:30:09Z", - description: "Webhook triggered on campaign openings", - events: ["opened"], - headers: [ - { - key: "cf-secret", - value: "test-header-value", - }, - ], - id: 9864, - modifiedAt: "2016-07-18T16:00:50Z", - type: "transactional", - url: "https://example.domain.com/webhook/events/kzfxxxxxxxx0uyo1", - }, - { - auth: { - token: "test-auth-token1234", - type: "bearer", - }, - batched: true, - channel: "sms", - createdAt: "2017-02-20T14:30:00Z", - description: "Webhook triggered on campaign hard bounces", - events: ["hardBounces"], - headers: [ - { - key: "cf-secret", - value: "test-header-value", - }, - ], - id: 22770, - modifiedAt: "2017-02-20T19:00:00Z", - type: "marketing", - url: "http://exmaple.domain.com/15kxxxxxn1", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getWebhooks (2)", async () => { @@ -123,9 +78,7 @@ describe("WebhooksClient", () => { events: ["sent"], url: "http://requestb.in/173lyyx1", }); - expect(response).toEqual({ - id: 5, - }); + expect(response).toEqual(rawResponseBody); }); test("createWebhook (2)", async () => { @@ -171,9 +124,7 @@ describe("WebhooksClient", () => { notifyURL: "https://brevo.com", type: "transactional", }); - expect(response).toEqual({ - processId: 78, - }); + expect(response).toEqual(rawResponseBody); }); test("exportWebhooksHistory (2)", async () => { @@ -223,27 +174,7 @@ describe("WebhooksClient", () => { const response = await client.webhooks.getWebhook({ webhookId: 1000000, }); - expect(response).toEqual({ - auth: { - token: "test-auth-token1234", - type: "bearer", - }, - batched: true, - channel: "sms", - createdAt: "2016-06-07T09:10:10Z", - description: "Webhook triggered on campaign openings and addition of lists", - events: ["listAdditions", "opened"], - headers: [ - { - key: "cf-secret", - value: "test-header-value", - }, - ], - id: 7287, - modifiedAt: "2016-06-08T11:30:00Z", - type: "marketing", - url: "http://example.domain.com/1brxxxxxx5p1", - }); + expect(response).toEqual(rawResponseBody); }); test("getWebhook (2)", async () => { diff --git a/tests/wire/whatsAppCampaigns.test.ts b/tests/wire/whatsAppCampaigns.test.ts index 0e9a43a..bf2f877 100644 --- a/tests/wire/whatsAppCampaigns.test.ts +++ b/tests/wire/whatsAppCampaigns.test.ts @@ -31,30 +31,7 @@ describe("WhatsAppCampaignsClient", () => { server.mockEndpoint().get("/whatsappCampaigns").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.whatsAppCampaigns.getWhatsAppCampaigns(); - expect(response).toEqual({ - campaigns: [ - { - campaignName: "campaign_22", - campaignStatus: "sent", - createdAt: "2017-05-01T12:30:00Z", - errorReason: "NONE", - id: 1672035851100690, - invalidatedContacts: 0, - modifiedAt: "2017-05-01T12:30:00Z", - readPercentage: 28.57, - scheduledAt: "2022-12-27T09:50:00Z", - stats: { - delivered: 3, - notSent: 4, - read: 2, - sent: 3, - unsubscribe: 0, - }, - templateId: "templateId", - }, - ], - count: 23, - }); + expect(response).toEqual(rawResponseBody); }); test("getWhatsAppCampaigns (2)", async () => { @@ -96,9 +73,7 @@ describe("WhatsAppCampaignsClient", () => { scheduledAt: "2017-06-01T12:30:00+02:00", templateId: 19, }); - expect(response).toEqual({ - id: 5, - }); + expect(response).toEqual(rawResponseBody); }); test("createWhatsAppCampaign (2)", async () => { @@ -148,14 +123,7 @@ describe("WhatsAppCampaignsClient", () => { .build(); const response = await client.whatsAppCampaigns.getWhatsAppConfig(); - expect(response).toEqual({ - businessStatus: "verified", - phoneNumberNameStatus: "APPROVED", - phoneNumberQuality: "GREEN", - sendingLimit: "TIER_1K", - whatsappBusinessAccountId: "whatsappBusinessAccountId", - whatsappBusinessAccountStatus: "APPROVED", - }); + expect(response).toEqual(rawResponseBody); }); test("getWhatsAppConfig (2)", async () => { @@ -203,9 +171,7 @@ describe("WhatsAppCampaignsClient", () => { language: "en", name: "Test template", }); - expect(response).toEqual({ - id: 5, - }); + expect(response).toEqual(rawResponseBody); }); test("createWhatsAppTemplate (2)", async () => { @@ -272,31 +238,7 @@ describe("WhatsAppCampaignsClient", () => { .build(); const response = await client.whatsAppCampaigns.getWhatsAppTemplates(); - expect(response).toEqual({ - count: 2, - templates: [ - { - category: "MARKETING", - createdAt: "2017-05-01T12:30:00Z", - errorReason: "NONE", - id: 235, - language: "en", - modifiedAt: "2017-05-01T12:30:00Z", - name: "campaign_22", - status: "approved", - }, - { - category: "MARKETING", - createdAt: "2017-0", - errorReason: "NONE", - id: 124, - language: "", - modifiedAt: "2017-05-01T12:30:00Z", - name: "test-template", - status: "draft", - }, - ], - }); + expect(response).toEqual(rawResponseBody); }); test("getWhatsAppTemplates (2)", async () => { @@ -398,56 +340,7 @@ describe("WhatsAppCampaignsClient", () => { const response = await client.whatsAppCampaigns.getWhatsAppCampaign({ campaignId: 1000000, }); - expect(response).toEqual({ - campaignName: "Test WhatsApp Campaign", - campaignStatus: "sent", - createdAt: "2022-12-26T06:50:00Z", - id: 1672035851100690, - modifiedAt: "2022-12-26T08:50:00Z", - scheduledAt: "2022-12-27T09:50:00Z", - senderNumber: "senderNumber", - stats: { - delivered: 3, - notSent: 4, - read: 2, - sent: 3, - unsubscribe: 0, - }, - template: { - body_variables: [ - { - datatype: "text", - default: "INVALID_HEADER", - name: "FIRSTNAME", - }, - ], - button_type: "CALL_TO_ACTION", - category: "MARKETING", - components: [ - { - text: "making it look like readable English.", - type: "BODY", - }, - { - text: "Life is a long lesson in humility", - type: "BUTTONS", - }, - ], - contains_button: true, - display_header: false, - header_type: "text", - header_variables: [ - { - datatype: "text", - default: "INVALID HEADER", - name: "FIRSTNAME", - }, - ], - hide_footer: true, - language: "en", - name: "official_campaign8", - }, - }); + expect(response).toEqual(rawResponseBody); }); test("getWhatsAppCampaign (2)", async () => { From 21fdcd66a8b388adf7cb8f14e5ec2eef2aa903b8 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 15:43:57 +0000 Subject: [PATCH 33/33] SDK regeneration --- .fern/metadata.json | 11 +- .fern/verify.sh | 5 + package.json | 4 +- pnpm-lock.yaml | 614 +++--- reference.md | 1921 ++++++++++++++++- src/BaseClient.ts | 29 +- src/api/resources/account/client/Client.ts | 34 +- .../account/types/GetAccountResponse.ts | 22 +- src/api/resources/balance/client/Client.ts | 116 +- .../requests/BeginTransactionRequest.ts | 33 +- .../requests/CreateBalanceOrderRequest.ts | 15 +- .../requests/GetContactBalancesRequest.ts | 15 +- ...yBalanceProgramsPidActiveBalanceRequest.ts | 14 +- ...nceProgramsPidTransactionHistoryRequest.ts | 12 +- .../balance/client/requests/index.ts | 4 +- .../types/GetContactBalancesRequestSort.ts | 8 + .../GetContactBalancesRequestSortField.ts | 8 + ...anceProgramsPidActiveBalanceRequestSort.ts | 8 + ...BalanceProgramsPidActiveBalanceResponse.ts | 34 + ...ceProgramsPidTransactionHistoryResponse.ts | 11 + .../types/GetSubscriptionBalancesResponse.ts | 9 +- ...ramsPidSubscriptionsCidBalancesResponse.ts | 28 +- src/api/resources/balance/types/index.ts | 4 + src/api/resources/companies/client/Client.ts | 78 +- .../client/requests/GetCompaniesRequest.ts | 8 +- .../requests/PatchCompaniesIdRequest.ts | 2 +- .../requests/PostCompaniesImportRequest.ts | 2 +- .../requests/PostCrmAttributesRequest.ts | 4 +- .../GetCrmAttributesCompaniesResponseItem.ts | 26 +- src/api/resources/contacts/client/Client.ts | 164 +- .../client/requests/CreateContactRequest.ts | 4 + .../client/requests/GetContactInfoRequest.ts | 4 +- .../client/requests/GetContactStatsRequest.ts | 4 +- .../client/requests/GetContactsRequest.ts | 4 +- .../client/requests/GetListRequest.ts | 2 +- .../client/requests/UpdateContactRequest.ts | 6 +- .../contacts/types/GetAttributesResponse.ts | 4 +- .../contacts/types/GetContactInfoResponse.ts | 6 +- .../contacts/types/GetSegmentsResponse.ts | 4 +- .../resources/conversations/client/Client.ts | 46 +- ...PostConversationsAgentOnlinePingRequest.ts | 16 +- .../PostConversationsMessagesRequest.ts | 22 +- .../PostConversationsPushedMessagesRequest.ts | 20 +- .../PutConversationsMessagesIdRequest.ts | 2 +- ...PutConversationsPushedMessagesIdRequest.ts | 4 +- src/api/resources/coupons/client/Client.ts | 24 +- .../resources/customObjects/client/Client.ts | 134 +- .../BatchDeleteObjectRecordsRequest.ts | 4 +- .../client/requests/GetrecordsRequest.ts | 2 +- .../client/requests/UpsertrecordsRequest.ts | 155 +- .../customObjects/client/requests/index.ts | 2 +- .../customObjects/types/GetrecordsResponse.ts | 19 +- src/api/resources/deals/client/Client.ts | 80 +- .../client/requests/GetCrmDealsRequest.ts | 8 +- .../client/requests/PatchCrmDealsIdRequest.ts | 2 +- .../requests/PostCrmDealsImportRequest.ts | 2 +- .../GetCrmAttributesDealsResponseItem.ts | 26 +- src/api/resources/domains/client/Client.ts | 10 +- src/api/resources/ecommerce/client/Client.ts | 99 +- .../requests/CreateBatchOrderRequest.ts | 4 +- .../CreateUpdateBatchProductsRequest.ts | 6 +- .../requests/CreateUpdateProductRequest.ts | 6 +- .../GetEcommerceAttributionMetricsRequest.ts | 3 +- .../client/requests/GetProductsRequest.ts | 20 +- .../types/CreateUpdateCategoryResponse.ts | 2 +- .../types/CreateUpdateProductResponse.ts | 4 +- .../types/GetProductsRequestSortByField.ts | 10 + src/api/resources/ecommerce/types/index.ts | 1 + .../resources/emailCampaigns/client/Client.ts | 71 +- .../requests/CreateEmailCampaignRequest.ts | 14 +- .../requests/GetEmailCampaignRequest.ts | 2 +- .../requests/GetEmailCampaignsRequest.ts | 10 +- .../types/GetEmailCampaignResponse.ts | 35 +- .../types/GetEmailCampaignsResponse.ts | 33 +- src/api/resources/event/client/Client.ts | 26 +- .../requests/CreateBatchEventsRequest.ts | 85 + .../client/requests/CreateEventRequest.ts | 6 +- .../resources/event/client/requests/index.ts | 1 + src/api/resources/event/index.ts | 1 - .../types/CreateBatchEventsRequestItem.ts | 66 - src/api/resources/event/types/index.ts | 1 - .../resources/externalFeeds/client/Client.ts | 14 +- .../types/GetAllExternalFeedsResponse.ts | 10 +- .../types/GetExternalFeedByUuidResponse.ts | 12 +- src/api/resources/files/client/Client.ts | 24 +- .../resources/inboundParsing/client/Client.ts | 15 +- .../requests/GetInboundEmailEventsRequest.ts | 4 +- .../GetInboundEmailEventsByUuidResponse.ts | 4 +- src/api/resources/index.ts | 1 - .../resources/masterAccount/client/Client.ts | 130 +- src/api/resources/notes/client/Client.ts | 28 +- .../client/requests/PatchCrmNotesIdRequest.ts | 2 +- .../notes/types/PostCrmNotesResponse.ts | 2 +- src/api/resources/payments/client/Client.ts | 12 +- src/api/resources/process/client/Client.ts | 39 +- .../process/types/GetProcessResponse.ts | 56 +- .../process/types/GetProcessesResponse.ts | 56 +- src/api/resources/program/client/Client.ts | 40 +- .../client/requests/GetLpListRequest.ts | 4 +- .../SubscribeToLoyaltyProgramRequest.ts | 8 +- .../program/types/GetLpListRequestSort.ts | 7 + .../GetParameterSubscriptionInfoResponse.ts | 2 + .../SubscribeMemberToASubscriptionResponse.ts | 8 +- .../SubscribeToLoyaltyProgramResponse.ts | 18 +- src/api/resources/program/types/index.ts | 1 + src/api/resources/reward/client/Client.ts | 36 +- .../client/requests/CreateVoucherRequest.ts | 2 + .../client/requests/RedeemVoucherRequest.ts | 2 + .../reward/types/CreateRewardResponse.ts | 14 +- .../reward/types/CreateVoucherResponse.ts | 2 + ...LoyaltyOfferProgramsPidVouchersResponse.ts | 2 + src/api/resources/senders/client/Client.ts | 18 +- .../resources/senders/types/GetIpsResponse.ts | 4 +- .../resources/smsCampaigns/client/Client.ts | 40 +- .../client/requests/GetSmsCampaignsRequest.ts | 6 +- .../types/GetSmsCampaignResponse.ts | 45 +- .../types/GetSmsCampaignsResponse.ts | 8 +- .../resources/smsTemplates/client/Client.ts | 6 +- src/api/resources/tasks/client/Client.ts | 53 +- .../client/requests/PostCrmTasksRequest.ts | 2 +- ...onse.ts => GetCrmTasktypesResponseItem.ts} | 5 +- src/api/resources/tasks/types/index.ts | 2 +- src/api/resources/tier/client/Client.ts | 32 +- .../client/requests/CreateTierGroupRequest.ts | 66 + .../transactionalEmails/client/Client.ts | 153 +- .../DeleteScheduledEmailByIdRequest.ts | 2 +- .../DeleteSmtpLogIdentifierRequest.ts | 6 +- .../GetAggregatedSmtpReportRequest.ts | 2 +- .../requests/GetEmailEventReportRequest.ts | 2 +- .../requests/GetScheduledEmailByIdRequest.ts | 4 +- .../client/requests/GetSmtpReportRequest.ts | 2 +- .../client/requests/GetSmtpTemplateRequest.ts | 6 +- .../requests/GetSmtpTemplatesRequest.ts | 2 + .../requests/UpdateSmtpTemplateRequest.ts | 6 +- .../types/GetSmtpTemplateRequestTemplateId.ts | 3 + .../types/GetTransacEmailContentResponse.ts | 4 +- .../PostPreviewSmtpEmailTemplatesRequest.ts | 3 + .../UpdateSmtpTemplateRequestTemplateId.ts | 3 + .../transactionalEmails/types/index.ts | 3 + .../transactionalSms/client/Client.ts | 36 +- .../transactionalWhatsApp/client/Client.ts | 8 +- src/api/resources/user/client/Client.ts | 20 +- src/api/resources/webhooks/client/Client.ts | 17 +- .../client/requests/CreateWebhookRequest.ts | 35 +- .../requests/ExportWebhooksHistoryRequest.ts | 2 +- .../whatsAppCampaigns/client/Client.ts | 32 +- .../types/GetWhatsAppCampaignResponse.ts | 16 + .../types/GetWhatsAppTemplatesResponse.ts | 2 + src/api/types/BalanceDefinition.ts | 117 +- src/api/types/BalanceLimit.ts | 52 +- src/api/types/Company.ts | 2 +- src/api/types/ConversationsMessage.ts | 80 +- src/api/types/Deal.ts | 8 +- src/api/types/FileData.ts | 14 +- src/api/types/GetCampaignRecipients.ts | 4 + src/api/types/GetCampaignStats.ts | 8 +- src/api/types/GetContactDetails.ts | 2 + src/api/types/GetEventsList.ts | 2 - src/api/types/GetExtendedCampaignOverview.ts | 35 +- src/api/types/GetExtendedCampaignStats.ts | 19 +- src/api/types/GetProductDetails.ts | 4 +- src/api/types/GetSmsCampaignOverview.ts | 8 +- src/api/types/GetSmtpTemplateOverview.ts | 4 +- src/api/types/GetWebhook.ts | 15 +- src/api/types/LoyaltyProgram.ts | 43 +- src/api/types/Note.ts | 18 +- src/api/types/NoteData.ts | 2 +- src/api/types/Order.ts | 2 +- src/api/types/Pipeline.ts | 6 +- src/api/types/SendTransacSms.ts | 23 +- src/api/types/Task.ts | 28 +- src/api/types/TierGroup.ts | 70 + src/api/types/Transaction.ts | 54 +- src/core/auth/AuthProvider.ts | 9 + src/core/auth/index.ts | 2 +- src/core/fetcher/Fetcher.ts | 25 +- src/core/fetcher/requestWithRetries.ts | 6 +- src/core/url/QueryStringBuilder.ts | 87 + src/core/url/index.ts | 1 + src/core/url/qs.ts | 37 +- src/version.ts | 2 +- tests/unit/fetcher/createRequestUrl.test.ts | 4 + .../fetcher/makePassthroughRequest.test.ts | 2 +- tests/unit/fetcher/redacting.test.ts | 106 + tests/unit/fetcher/requestWithRetries.test.ts | 66 +- tests/unit/url/QueryStringBuilder.test.ts | 236 ++ tests/unit/url/qs.test.ts | 102 +- tests/wire/account.test.ts | 16 +- tests/wire/balance.test.ts | 335 +-- tests/wire/companies.test.ts | 28 +- tests/wire/contacts.test.ts | 75 +- tests/wire/conversations.test.ts | 400 ++-- tests/wire/customObjects.test.ts | 154 +- tests/wire/deals.test.ts | 58 +- tests/wire/ecommerce.test.ts | 8 +- tests/wire/emailCampaigns.test.ts | 106 +- tests/wire/event.test.ts | 81 +- tests/wire/externalFeeds.test.ts | 44 +- tests/wire/files.test.ts | 18 +- tests/wire/inboundParsing.test.ts | 21 + tests/wire/masterAccount.test.ts | 74 +- tests/wire/notes.test.ts | 30 +- tests/wire/process.test.ts | 81 +- tests/wire/program.test.ts | 137 +- tests/wire/reward.test.ts | 6 +- tests/wire/senders.test.ts | 8 +- tests/wire/smsCampaigns.test.ts | 19 +- tests/wire/tasks.test.ts | 49 +- tests/wire/tier.test.ts | 42 + tests/wire/transactionalEmails.test.ts | 66 +- tests/wire/transactionalSms.test.ts | 23 + tests/wire/webhooks.test.ts | 16 +- tests/wire/whatsAppCampaigns.test.ts | 3 + 213 files changed, 6624 insertions(+), 2155 deletions(-) create mode 100755 .fern/verify.sh create mode 100644 src/api/resources/balance/types/GetContactBalancesRequestSort.ts create mode 100644 src/api/resources/balance/types/GetContactBalancesRequestSortField.ts create mode 100644 src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort.ts create mode 100644 src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidActiveBalanceResponse.ts create mode 100644 src/api/resources/ecommerce/types/GetProductsRequestSortByField.ts create mode 100644 src/api/resources/event/client/requests/CreateBatchEventsRequest.ts delete mode 100644 src/api/resources/event/types/CreateBatchEventsRequestItem.ts delete mode 100644 src/api/resources/event/types/index.ts create mode 100644 src/api/resources/program/types/GetLpListRequestSort.ts rename src/api/resources/tasks/types/{GetCrmTasktypesResponse.ts => GetCrmTasktypesResponseItem.ts} (71%) create mode 100644 src/api/resources/transactionalEmails/types/GetSmtpTemplateRequestTemplateId.ts create mode 100644 src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesRequest.ts create mode 100644 src/api/resources/transactionalEmails/types/UpdateSmtpTemplateRequestTemplateId.ts create mode 100644 src/core/url/QueryStringBuilder.ts create mode 100644 tests/unit/url/QueryStringBuilder.test.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index fc438ba..d51bc28 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "4.65.2", + "cliVersion": "5.23.3", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.63.3", + "generatorVersion": "3.70.6", "generatorConfig": { "generateWireTests": true, "namespaceExport": "Brevo", @@ -15,6 +15,9 @@ } } }, - "originGitCommit": "d2e18d0bd27160206c8251e11269b139a3b4ea10", - "sdkVersion": "5.0.4" + "originGitCommit": "626852ab9868892d33b75b16b34f5db02dcb70ca", + "originGitCommitIsDirty": true, + "invokedBy": "manual", + "requestedVersion": "6.0.0", + "sdkVersion": "6.0.0" } diff --git a/.fern/verify.sh b/.fern/verify.sh new file mode 100755 index 0000000..a224ac8 --- /dev/null +++ b/.fern/verify.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -euo pipefail +pnpm install +pnpm build +pnpm test diff --git a/package.json b/package.json index a3986f1..03b45f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getbrevo/brevo", - "version": "5.0.4", + "version": "6.0.0", "private": false, "repository": { "type": "git", @@ -402,7 +402,7 @@ "ts-loader": "^9.5.4", "vitest": "^4.1.1", "msw": "2.11.2", - "@types/node": "^18.19.70", + "@types/node": "^20.0.0", "typescript": "~5.9.3", "@biomejs/biome": "2.4.10" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 255bd14..de64b6a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,23 +12,23 @@ importers: specifier: 2.4.10 version: 2.4.10 '@types/node': - specifier: ^18.19.70 - version: 18.19.130 + specifier: ^20.0.0 + version: 20.19.41 msw: specifier: 2.11.2 - version: 2.11.2(@types/node@18.19.130)(typescript@5.9.3) + version: 2.11.2(@types/node@20.19.41)(typescript@5.9.3) ts-loader: specifier: ^9.5.4 - version: 9.5.7(typescript@5.9.3)(webpack@5.106.0) + version: 9.5.7(typescript@5.9.3)(webpack@5.106.2) typescript: specifier: ~5.9.3 version: 5.9.3 vitest: specifier: ^4.1.1 - version: 4.1.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3))(vite@8.0.8(@types/node@18.19.130)(terser@5.46.1)) + version: 4.1.6(@types/node@20.19.41)(msw@2.11.2(@types/node@20.19.41)(typescript@5.9.3))(vite@8.0.12(@types/node@20.19.41)(terser@5.47.1)) webpack: specifier: ^5.105.4 - version: 5.106.0 + version: 5.106.2 packages: @@ -95,11 +95,11 @@ packages: '@bundled-es-modules/statuses@1.0.1': resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} - '@emnapi/core@1.9.2': - resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==} + '@emnapi/core@1.10.0': + resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} - '@emnapi/runtime@1.9.2': - resolution: {integrity: sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==} + '@emnapi/runtime@1.10.0': + resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} '@emnapi/wasi-threads@1.2.1': resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} @@ -159,8 +159,8 @@ packages: resolution: {integrity: sha512-2+BzZbjRO7Ct61k8fMNHEtoKjeWI9pIlHFTqBwZ5icHpqszIgEZbjb1MW5Z0+bITTCTl3gk4PDBxs9tA/csXvA==} engines: {node: '>=18'} - '@napi-rs/wasm-runtime@1.1.3': - resolution: {integrity: sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==} + '@napi-rs/wasm-runtime@1.1.4': + resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==} peerDependencies: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 @@ -174,112 +174,112 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@oxc-project/types@0.124.0': - resolution: {integrity: sha512-VBFWMTBvHxS11Z5Lvlr3IWgrwhMTXV+Md+EQF0Xf60+wAdsGFTBx7X7K/hP4pi8N7dcm1RvcHwDxZ16Qx8keUg==} + '@oxc-project/types@0.129.0': + resolution: {integrity: sha512-3oz8m3FGdr2nDXVqmFUw7jolKliC4MoyXYIG2c7gpjBnzUWQpUGIYcXYKxTdTi+N2jusvt610ckTMkxdwHkYEg==} - '@rolldown/binding-android-arm64@1.0.0-rc.15': - resolution: {integrity: sha512-YYe6aWruPZDtHNpwu7+qAHEMbQ/yRl6atqb/AhznLTnD3UY99Q1jE7ihLSahNWkF4EqRPVC4SiR4O0UkLK02tA==} + '@rolldown/binding-android-arm64@1.0.0': + resolution: {integrity: sha512-TWMZnRLMe63C2Lhyicviu7ZHaU4kxa6PS3rofvc9GmcvptzNN11BcfQ4Sl7MwTOsisQoa2keB/EBdNCAnUo8vA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.0.0-rc.15': - resolution: {integrity: sha512-oArR/ig8wNTPYsXL+Mzhs0oxhxfuHRfG7Ikw7jXsw8mYOtk71W0OkF2VEVh699pdmzjPQsTjlD1JIOoHkLP1Fg==} + '@rolldown/binding-darwin-arm64@1.0.0': + resolution: {integrity: sha512-6XcD+8k0gPVItNagEw78/qqcBDwKcwDYS8V2hRmVsfUSIrd8cWe/CBvRDI5toqFyPfj+FJr6t8U6Xj2P2prEew==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-rc.15': - resolution: {integrity: sha512-YzeVqOqjPYvUbJSWJ4EDL8ahbmsIXQpgL3JVipmN+MX0XnXMeWomLN3Fb+nwCmP/jfyqte5I3XRSm7OfQrbyxw==} + '@rolldown/binding-darwin-x64@1.0.0': + resolution: {integrity: sha512-iN/tWVXRQDWvmZlKdceP1Dwug9GDpEymhb9p4xnEe6zvCg5lFmzVljl+1qR1NVx3yfGpr2Na+CuLmv5IU8uzfQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.0.0-rc.15': - resolution: {integrity: sha512-9Erhx956jeQ0nNTyif1+QWAXDRD38ZNjr//bSHrt6wDwB+QkAfl2q6Mn1k6OBPerznjRmbM10lgRb1Pli4xZPw==} + '@rolldown/binding-freebsd-x64@1.0.0': + resolution: {integrity: sha512-jjQMDvvwSOuhOwMszD/klSOjyWMM3zI64hWTj9KT5x4MxRbZAf+7vLQ6qouRhtsLVFHr3f0ILaJAfgENPiQdAQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.15': - resolution: {integrity: sha512-cVwk0w8QbZJGTnP/AHQBs5yNwmpgGYStL88t4UIaqcvYJWBfS0s3oqVLZPwsPU6M0zlW4GqjP0Zq5MnAGwFeGA==} + '@rolldown/binding-linux-arm-gnueabihf@1.0.0': + resolution: {integrity: sha512-d//Dtg2x6/m3mbV64yUGNnDGNZaDGRpDLLNGerHQUVObuNaIQaaDp25yUiqGXtHEXX+NP2d0wAlmKgpYgIAJ2A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.15': - resolution: {integrity: sha512-eBZ/u8iAK9SoHGanqe/jrPnY0JvBN6iXbVOsbO38mbz+ZJsaobExAm1Iu+rxa4S1l2FjG0qEZn4Rc6X8n+9M+w==} + '@rolldown/binding-linux-arm64-gnu@1.0.0': + resolution: {integrity: sha512-n7Ofp0mx+aB2cC+Sdy5YtMnXtY9lchnHbY+3Yt0uq9JsWQExf4f5Whu0tK0R8Jdc9S6RchTHjIFY7uc92puOVQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': - resolution: {integrity: sha512-ZvRYMGrAklV9PEkgt4LQM6MjQX2P58HPAuecwYObY2DhS2t35R0I810bKi0wmaYORt6m/2Sm+Z+nFgb0WhXNcQ==} + '@rolldown/binding-linux-arm64-musl@1.0.0': + resolution: {integrity: sha512-EIVjy2cgd7uuMMo94FVkBp7F6DhcZAUwNURkSG3RwUmvAXR6s0ISxM81U+IydcZByPG0pZIHsf1b6kTxoFDgJA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': - resolution: {integrity: sha512-VDpgGBzgfg5hLg+uBpCLoFG5kVvEyafmfxGUV0UHLcL5irxAK7PKNeC2MwClgk6ZAiNhmo9FLhRYgvMmedLtnQ==} + '@rolldown/binding-linux-ppc64-gnu@1.0.0': + resolution: {integrity: sha512-JEwwOPcwTLAcpDQlqSmjEmfs63xJnSiUNIGvLcDLUHCWK4XowpS/7c7tUsUH6uT/ct6bMUTdXKfI8967FYj6mg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': - resolution: {integrity: sha512-y1uXY3qQWCzcPgRJATPSOUP4tCemh4uBdY7e3EZbVwCJTY3gLJWnQABgeUetvED+bt1FQ01OeZwvhLS2bpNrAQ==} + '@rolldown/binding-linux-s390x-gnu@1.0.0': + resolution: {integrity: sha512-0wjCFhLrihtAubnT9iA0N++0pSV0z5Hg7tNGdNJ4RFaINceHadoF+kiFGyY1qSSNVIAZtLotG8Ju1bgDPkjnFA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': - resolution: {integrity: sha512-023bTPBod7J3Y/4fzAN6QtpkSABR0rigtrwaP+qSEabUh5zf6ELr9Nc7GujaROuPY3uwdSIXWrvhn1KxOvurWA==} + '@rolldown/binding-linux-x64-gnu@1.0.0': + resolution: {integrity: sha512-Dfn7iak9BcMMePxcoJfpSbWqnEyrp/dRF63/8qW/eHBdOZov6x5aShLLEYGYdIeSJ6vMLK/XCVB+lGIxm41bQA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': - resolution: {integrity: sha512-witB2O0/hU4CgfOOKUoeFgQ4GktPi1eEbAhaLAIpgD6+ZnhcPkUtPsoKKHRzmOoWPZue46IThdSgdo4XneOLYw==} + '@rolldown/binding-linux-x64-musl@1.0.0': + resolution: {integrity: sha512-5/utzzDmD/pD/bmuaUcbTf/sZYy0aztwIVlfpoW1fTjCZ0BaPOMVWGZL1zvgxyi7ZIVYWlxKONHmSbHuiOh8Jw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': - resolution: {integrity: sha512-UCL68NJ0Ud5zRipXZE9dF5PmirzJE4E4BCIOOssEnM7wLDsxjc6Qb0sGDxTNRTP53I6MZpygyCpY8Aa8sPfKPg==} + '@rolldown/binding-openharmony-arm64@1.0.0': + resolution: {integrity: sha512-ouJs8VcUomfLfpbUECqFMRqdV4x6aeAK3MA4m6vTrJJjKyWTV5KnxZx7Jd9G+GlDaQQxubcba00x16OyJ1meig==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-wasm32-wasi@1.0.0-rc.15': - resolution: {integrity: sha512-ApLruZq/ig+nhaE7OJm4lDjayUnOHVUa77zGeqnqZ9pn0ovdVbbNPerVibLXDmWeUZXjIYIT8V3xkT58Rm9u5Q==} - engines: {node: '>=14.0.0'} + '@rolldown/binding-wasm32-wasi@1.0.0': + resolution: {integrity: sha512-E+oHKGiDA+lsKMmFtffDDw91EryDT7uJocrIuCHqhm6bCTM6xFK+3gaCkYOHfPwQr0cCNarSM2xaELoQDz9jJg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [wasm32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': - resolution: {integrity: sha512-KmoUoU7HnN+Si5YWJigfTws1jz1bKBYDQKdbLspz0UaqjjFkddHsqorgiW1mxcAj88lYUE6NC/zJNwT+SloqtA==} + '@rolldown/binding-win32-arm64-msvc@1.0.0': + resolution: {integrity: sha512-yYK02n8Rngo+gbm1y6G0+7jk1sJ/2Wt7K0me0Y7k/ErBpyf+LJ2gFpqWVTcRV1rUepBlQRmpgWkTQCiiwrK0Ow==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.15': - resolution: {integrity: sha512-3P2A8L+x75qavWLe/Dll3EYBJLQmtkJN8rfh+U/eR3MqMgL/h98PhYI+JFfXuDPgPeCB7iZAKiqii5vqOvnA0g==} + '@rolldown/binding-win32-x64-msvc@1.0.0': + resolution: {integrity: sha512-14bpChMahXRRXiTwahSl+zzHPW6qQTXtkMuJBFlbo+pqSAews2d4BdCSHfrJ/MBsCZtpmTafsY+1QhBzitcmdg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] - '@rolldown/pluginutils@1.0.0-rc.15': - resolution: {integrity: sha512-UromN0peaE53IaBRe9W7CjrZgXl90fqGpK+mIZbA3qSTeYqg3pqpROBdIPvOG3F5ereDHNwoHBI2e50n1BDr1g==} + '@rolldown/pluginutils@1.0.0': + resolution: {integrity: sha512-aKs/3GSWyV0mrhNmt/96/Z3yczC3yvrzYATCiCXQebBsGyYzjNdUphRVLeJQ67ySKVXRfMxt2lm12pmXvbPFQQ==} '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} - '@tybys/wasm-util@0.10.1': - resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@tybys/wasm-util@0.10.2': + resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} @@ -296,23 +296,23 @@ packages: '@types/eslint@9.6.1': resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} - '@types/estree@1.0.8': - resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/node@18.19.130': - resolution: {integrity: sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==} + '@types/node@20.19.41': + resolution: {integrity: sha512-ECymXOukMnOoVkC2bb1Vc/w/836DXncOg5m8Xj1RH7xSHZJWNYY6Zh7EH477vcnD5egKNNfy2RpNOmuChhFPgQ==} '@types/statuses@2.0.6': resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==} - '@vitest/expect@4.1.4': - resolution: {integrity: sha512-iPBpra+VDuXmBFI3FMKHSFXp3Gx5HfmSCE8X67Dn+bwephCnQCaB7qWK2ldHa+8ncN8hJU8VTMcxjPpyMkUjww==} + '@vitest/expect@4.1.6': + resolution: {integrity: sha512-7EHDquPthALSV0jhhjgEW8FXaviMx7rSqu8W6oqCoAuOhKov814P99QDV1pxMA3QPv21YudvJngIhjrNI4opLg==} - '@vitest/mocker@4.1.4': - resolution: {integrity: sha512-R9HTZBhW6yCSGbGQnDnH3QHfJxokKN4KB+Yvk9Q1le7eQNYwiCyKxmLmurSpFy6BzJanSLuEUDrD+j97Q+ZLPg==} + '@vitest/mocker@4.1.6': + resolution: {integrity: sha512-MCFc63czMjEInOlcY2cpQCvCN+KgbAn+60xu9cMgP4sKaLC5JNAKw7JH8QdAnoAC88hW1IiSNZ+GgVXlN1UcMQ==} peerDependencies: msw: ^2.4.9 vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -322,20 +322,20 @@ packages: vite: optional: true - '@vitest/pretty-format@4.1.4': - resolution: {integrity: sha512-ddmDHU0gjEUyEVLxtZa7xamrpIefdEETu3nZjWtHeZX4QxqJ7tRxSteHVXJOcr8jhiLoGAhkK4WJ3WqBpjx42A==} + '@vitest/pretty-format@4.1.6': + resolution: {integrity: sha512-h5SxD/IzNhZYnrSZRsUZQIC+vD0GY8cUvq0iwsmkFKixRCKLLWqCXa/FIQ4S1R+sI+PGoojkHsdNrbZiM9Qpgw==} - '@vitest/runner@4.1.4': - resolution: {integrity: sha512-xTp7VZ5aXP5ZJrn15UtJUWlx6qXLnGtF6jNxHepdPHpMfz/aVPx+htHtgcAL2mDXJgKhpoo2e9/hVJsIeFbytQ==} + '@vitest/runner@4.1.6': + resolution: {integrity: sha512-nOPCmn2+yD0ZNmKdsXGv/UxMMWbMuKeD6GyYncNwdkYDxpQvrPSKYj2rWuDjC2Y4b6w6hjip5dBKFzEUuZe3vA==} - '@vitest/snapshot@4.1.4': - resolution: {integrity: sha512-MCjCFgaS8aZz+m5nTcEcgk/xhWv0rEH4Yl53PPlMXOZ1/Ka2VcZU6CJ+MgYCZbcJvzGhQRjVrGQNZqkGPttIKw==} + '@vitest/snapshot@4.1.6': + resolution: {integrity: sha512-YhsdE6xAVfTDmzjxL2ZDUvjj+ZsgyOKe+TdQzqkD72wIOmHka8NuGQ6NpTNZv9D2Z63fbwWKJPeVpEw4EQgYxw==} - '@vitest/spy@4.1.4': - resolution: {integrity: sha512-XxNdAsKW7C+FLydqFJLb5KhJtl3PGCMmYwFRfhvIgxJvLSXhhVI1zM8f1qD3Zg7RCjTSzDVyct6sghs9UEgBEQ==} + '@vitest/spy@4.1.6': + resolution: {integrity: sha512-JFKxMx6udhwKh/Ldo270e17QX710vgunMkuPAvXjHSvC6oqLWAHhVhjg/I71q0u0CBSErIODV1Kjv0FQNSWjdg==} - '@vitest/utils@4.1.4': - resolution: {integrity: sha512-13QMT+eysM5uVGa1rG4kegGYNp6cnQcsTc67ELFbhNLQO+vgsygtYJx2khvdt4gVQqSSpC/KT5FZZxUpP3Oatw==} + '@vitest/utils@4.1.6': + resolution: {integrity: sha512-FxIY+U81R3LGKCxaHHFRQ5+g6/iRgGLmeHWdp2Amj4ljQRrEIWHmZyDfDYBRZlpyqA7qKxtS9DD1dhk8RnRIVQ==} '@webassemblyjs/ast@1.14.1': resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} @@ -412,8 +412,8 @@ packages: peerDependencies: ajv: ^8.8.2 - ajv@8.18.0: - resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -427,8 +427,8 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - baseline-browser-mapping@2.10.17: - resolution: {integrity: sha512-HdrkN8eVG2CXxeifv/VdJ4A4RSra1DTW8dc/hdxzhGHN8QePs6gKaWM9pHPcpCoxYZJuOZ8drHmbdpLHjCYjLA==} + baseline-browser-mapping@2.10.29: + resolution: {integrity: sha512-Asa2krT+XTPZINCS+2QcyS8WTkObE77RwkydwF7h6DmnKqbvlalz93m/dnphUyCa6SWSP51VgtEUf2FN+gelFQ==} engines: {node: '>=6.0.0'} hasBin: true @@ -444,8 +444,8 @@ packages: buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - caniuse-lite@1.0.30001787: - resolution: {integrity: sha512-mNcrMN9KeI68u7muanUpEejSLghOKlVhRqS/Za2IeyGllJ9I9otGpR9g3nsw7n4W378TE/LyIteA0+/FOZm4Kg==} + caniuse-lite@1.0.30001792: + resolution: {integrity: sha512-hVLMUZFgR4JJ6ACt1uEESvQN1/dBVqPAKY0hgrV70eN3391K6juAfTjKZLKvOMsx8PxA7gsY1/tLMMTcfFLLpw==} chai@6.2.2: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} @@ -488,18 +488,18 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} - electron-to-chromium@1.5.334: - resolution: {integrity: sha512-mgjZAz7Jyx1SRCwEpy9wefDS7GvNPazLthHg8eQMJ76wBdGQQDW33TCrUTvQ4wzpmOrv2zrFoD3oNufMdyMpog==} + electron-to-chromium@1.5.353: + resolution: {integrity: sha512-kOrWphBi8TOZyiJZqsgqIle0lw+tzmnQK83pV9dZUd01Nm2POECSyFQMAuarzZdYqQW7FH9RaYOuaRo3h+bQ3w==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enhanced-resolve@5.20.1: - resolution: {integrity: sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==} + enhanced-resolve@5.21.3: + resolution: {integrity: sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q==} engines: {node: '>=10.13.0'} - es-module-lexer@2.0.0: - resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} + es-module-lexer@2.1.0: + resolution: {integrity: sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==} escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} @@ -535,8 +535,8 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-uri@3.1.0: - resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + fast-uri@3.1.2: + resolution: {integrity: sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==} fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} @@ -566,8 +566,8 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphql@16.13.2: - resolution: {integrity: sha512-5bJ+nf/UCpAjHM8i06fl7eLyVC9iuNAjm9qzkiu2ZGhM0VscSvS6WDPfAwkdkBuoXGM9FJSbKl6wylMwP9Ktig==} + graphql@16.14.0: + resolution: {integrity: sha512-BBvQ/406p+4CZbTpCbVPSxfzrZrbnuWSP1ELYgyS6B+hNeKzgrdB4JczCa5VZUBQrDa9hUngm0KnexY6pJRN5Q==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} has-flag@4.0.0: @@ -592,9 +592,6 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} - json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} @@ -672,8 +669,8 @@ packages: resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} engines: {node: '>= 12.0.0'} - loader-runner@4.3.1: - resolution: {integrity: sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==} + loader-runner@4.3.2: + resolution: {integrity: sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==} engines: {node: '>=6.11.5'} magic-string@0.30.21: @@ -686,12 +683,8 @@ packages: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} engines: {node: '>= 0.6'} msw@2.11.2: @@ -708,16 +701,16 @@ packages: resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} engines: {node: ^18.17.0 || >=20.5.0} - nanoid@3.3.11: - resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + nanoid@3.3.12: + resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - node-releases@2.0.37: - resolution: {integrity: sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==} + node-releases@2.0.44: + resolution: {integrity: sha512-5WUyunoPMsvvEhS8AxHtRzP+oA8UCkJ7YRxatWKjngndhDGLiqEVAQKWjFAiAiuL8zMRGzGSJxFnLetoa43qGQ==} obug@2.1.1: resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} @@ -742,8 +735,8 @@ packages: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} - postcss@8.5.9: - resolution: {integrity: sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==} + postcss@8.5.14: + resolution: {integrity: sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==} engines: {node: ^10 || ^12 || >=14} require-directory@2.1.1: @@ -757,8 +750,8 @@ packages: rettime@0.7.0: resolution: {integrity: sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==} - rolldown@1.0.0-rc.15: - resolution: {integrity: sha512-Ff31guA5zT6WjnGp0SXw76X6hzGRk/OQq2hE+1lcDe+lJdHSgnSX6nK3erbONHyCbpSj9a9E+uX/OvytZoWp2g==} + rolldown@1.0.0: + resolution: {integrity: sha512-yD986aXDESFGS95spT1LAv0jssywP4npMEjmMHyN2/5+eE8qQJUype2AaKkRiLgBgyD0LFlubwAht7VmY8rGoA==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -766,8 +759,8 @@ packages: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} - semver@7.7.4: - resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} + semver@7.8.0: + resolution: {integrity: sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==} engines: {node: '>=10'} hasBin: true @@ -800,8 +793,8 @@ packages: resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} engines: {node: '>= 0.8'} - std-env@4.0.0: - resolution: {integrity: sha512-zUMPtQ/HBY3/50VbpkupYHbRroTRZJPRLvreamgErJVys0ceuzMkD44J/QjqhHjOzK42GQ3QZIeFG1OYfOtKqQ==} + std-env@4.1.0: + resolution: {integrity: sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==} strict-event-emitter@0.5.1: resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} @@ -822,36 +815,63 @@ packages: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} - tapable@2.3.2: - resolution: {integrity: sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA==} + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} - terser-webpack-plugin@5.4.0: - resolution: {integrity: sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g==} + terser-webpack-plugin@5.6.0: + resolution: {integrity: sha512-Eum+5ajkaOhf5KbM26osvv21kLD7BaGqQ1UA4Ami4arYwylmGUQTgHFpHDdmJod1q4QXa66p0to/FBKID+J1vA==} engines: {node: '>= 10.13.0'} peerDependencies: + '@minify-html/node': '*' '@swc/core': '*' + '@swc/css': '*' + '@swc/html': '*' + clean-css: '*' + cssnano: '*' + csso: '*' esbuild: '*' + html-minifier-terser: '*' + lightningcss: '*' + postcss: '*' uglify-js: '*' webpack: ^5.1.0 peerDependenciesMeta: + '@minify-html/node': + optional: true '@swc/core': optional: true + '@swc/css': + optional: true + '@swc/html': + optional: true + clean-css: + optional: true + cssnano: + optional: true + csso: + optional: true esbuild: optional: true + html-minifier-terser: + optional: true + lightningcss: + optional: true + postcss: + optional: true uglify-js: optional: true - terser@5.46.1: - resolution: {integrity: sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ==} + terser@5.47.1: + resolution: {integrity: sha512-tPbLXTI6ohPASb/1YViL428oEHu6/qv1OxqYnfaonVCFHqx4+wCd95pHrQWsL5X4pl90CTyW9piSAsS2L0VoMw==} engines: {node: '>=10'} hasBin: true tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@1.1.1: - resolution: {integrity: sha512-VKS/ZaQhhkKFMANmAOhhXVoIfBXblQxGX1myCQ2faQrfmobMftXeJPcZGp0gS07ocvGJWDLZGyOZDadDBqYIJg==} + tinyexec@1.1.2: + resolution: {integrity: sha512-dAqSqE/RabpBKI8+h26GfLq6Vb3JVXs30XYQjdMjaj/c2tS8IYYMbIzP599KtRj7c57/wYApb3QjgRgXmrCukA==} engines: {node: '>=18'} tinyglobby@0.2.16: @@ -862,11 +882,11 @@ packages: resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} engines: {node: '>=14.0.0'} - tldts-core@7.0.28: - resolution: {integrity: sha512-7W5Efjhsc3chVdFhqtaU0KtK32J37Zcr9RKtID54nG+tIpcY79CQK/veYPODxtD/LJ4Lue66jvrQzIX2Z2/pUQ==} + tldts-core@7.0.30: + resolution: {integrity: sha512-uiHN8PIB1VmWyS98eZYja4xzlYqeFZVjb4OuYlJQnZAuJhMw4PbKQOKgHKhBdJR3FE/t5mUQ1Kd80++B+qhD1Q==} - tldts@7.0.28: - resolution: {integrity: sha512-+Zg3vWhRUv8B1maGSTFdev9mjoo8Etn2Ayfs4cnjlD3CsGkxXX4QyW3j2WJ0wdjYcYmy7Lx2RDsZMhgCWafKIw==} + tldts@7.0.30: + resolution: {integrity: sha512-ELrFxuqsDdHUwoh0XxDbxuLD3Wnz49Z57IFvTtvWy1hJdcMZjXLIuonjilCiWHlT2GbE4Wlv1wKVTzDFnXH1aw==} hasBin: true to-regex-range@5.0.1: @@ -896,8 +916,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} update-browserslist-db@1.2.3: resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} @@ -905,13 +925,13 @@ packages: peerDependencies: browserslist: '>= 4.21.0' - vite@8.0.8: - resolution: {integrity: sha512-dbU7/iLVa8KZALJyLOBOQ88nOXtNG8vxKuOT4I2mD+Ya70KPceF4IAmDsmU0h1Qsn5bPrvsY9HJstCRh3hG6Uw==} + vite@8.0.12: + resolution: {integrity: sha512-w2dDofOWv2QB09ZITZBsvKTVAlYvPR4IAmrY/v0ir9KvLs0xybR7i48wxhM1/oyBWO34wPns+bPGw5ZrZqDpZg==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: '@types/node': ^20.19.0 || >=22.12.0 - '@vitejs/devtools': ^0.1.0 + '@vitejs/devtools': ^0.1.18 esbuild: ^0.27.0 || ^0.28.0 jiti: '>=1.21.0' less: ^4.0.0 @@ -948,20 +968,20 @@ packages: yaml: optional: true - vitest@4.1.4: - resolution: {integrity: sha512-tFuJqTxKb8AvfyqMfnavXdzfy3h3sWZRWwfluGbkeR7n0HUev+FmNgZ8SDrRBTVrVCjgH5cA21qGbCffMNtWvg==} + vitest@4.1.6: + resolution: {integrity: sha512-6lvjbS3p9b4CrdCmguzbh2/4uoXhGE2q71R4OX5sqF9R1bo9Xd6fGrMAfvp5wnCzlBnFVdCOp6onuTQVbo8iUQ==} engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@opentelemetry/api': ^1.9.0 '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 - '@vitest/browser-playwright': 4.1.4 - '@vitest/browser-preview': 4.1.4 - '@vitest/browser-webdriverio': 4.1.4 - '@vitest/coverage-istanbul': 4.1.4 - '@vitest/coverage-v8': 4.1.4 - '@vitest/ui': 4.1.4 + '@vitest/browser-playwright': 4.1.6 + '@vitest/browser-preview': 4.1.6 + '@vitest/browser-webdriverio': 4.1.6 + '@vitest/coverage-istanbul': 4.1.6 + '@vitest/coverage-v8': 4.1.6 + '@vitest/ui': 4.1.6 happy-dom: '*' jsdom: '*' vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -993,12 +1013,12 @@ packages: resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} engines: {node: '>=10.13.0'} - webpack-sources@3.3.4: - resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} + webpack-sources@3.4.1: + resolution: {integrity: sha512-eACpxRN02yaawnt+uUNIF7Qje6A9zArxBbcAJjK1PK3S9Ycg5jIuJ8pW4q8EMnwNZCEGltcjkRx1QzOxOkKD8A==} engines: {node: '>=10.13.0'} - webpack@5.106.0: - resolution: {integrity: sha512-Pkx5joZ9RrdgO5LBkyX1L2ZAJeK/Taz3vqZ9CbcP0wS5LEMx5QkKsEwLl29QJfihZ+DKRBFldzy1O30pJ1MDpA==} + webpack@5.106.2: + resolution: {integrity: sha512-wGN3qcrBQIFmQ/c0AiOAQBvrZ5lmY8vbbMv4Mxfgzqd/B6+9pXtLo73WuS1dSGXM5QYY3hZnIbvx+K1xxe6FyA==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -1081,13 +1101,13 @@ snapshots: dependencies: statuses: 2.0.2 - '@emnapi/core@1.9.2': + '@emnapi/core@1.10.0': dependencies: '@emnapi/wasi-threads': 1.2.1 tslib: 2.8.1 optional: true - '@emnapi/runtime@1.9.2': + '@emnapi/runtime@1.10.0': dependencies: tslib: 2.8.1 optional: true @@ -1099,31 +1119,31 @@ snapshots: '@inquirer/ansi@1.0.2': {} - '@inquirer/confirm@5.1.21(@types/node@18.19.130)': + '@inquirer/confirm@5.1.21(@types/node@20.19.41)': dependencies: - '@inquirer/core': 10.3.2(@types/node@18.19.130) - '@inquirer/type': 3.0.10(@types/node@18.19.130) + '@inquirer/core': 10.3.2(@types/node@20.19.41) + '@inquirer/type': 3.0.10(@types/node@20.19.41) optionalDependencies: - '@types/node': 18.19.130 + '@types/node': 20.19.41 - '@inquirer/core@10.3.2(@types/node@18.19.130)': + '@inquirer/core@10.3.2(@types/node@20.19.41)': dependencies: '@inquirer/ansi': 1.0.2 '@inquirer/figures': 1.0.15 - '@inquirer/type': 3.0.10(@types/node@18.19.130) + '@inquirer/type': 3.0.10(@types/node@20.19.41) cli-width: 4.1.0 mute-stream: 2.0.0 signal-exit: 4.1.0 wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 18.19.130 + '@types/node': 20.19.41 '@inquirer/figures@1.0.15': {} - '@inquirer/type@3.0.10(@types/node@18.19.130)': + '@inquirer/type@3.0.10(@types/node@20.19.41)': optionalDependencies: - '@types/node': 18.19.130 + '@types/node': 20.19.41 '@jridgewell/gen-mapping@0.3.13': dependencies: @@ -1153,11 +1173,11 @@ snapshots: outvariant: 1.4.3 strict-event-emitter: 0.5.1 - '@napi-rs/wasm-runtime@1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)': + '@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': dependencies: - '@emnapi/core': 1.9.2 - '@emnapi/runtime': 1.9.2 - '@tybys/wasm-util': 0.10.1 + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@tybys/wasm-util': 0.10.2 optional: true '@open-draft/deferred-promise@2.2.0': {} @@ -1169,62 +1189,62 @@ snapshots: '@open-draft/until@2.1.0': {} - '@oxc-project/types@0.124.0': {} + '@oxc-project/types@0.129.0': {} - '@rolldown/binding-android-arm64@1.0.0-rc.15': + '@rolldown/binding-android-arm64@1.0.0': optional: true - '@rolldown/binding-darwin-arm64@1.0.0-rc.15': + '@rolldown/binding-darwin-arm64@1.0.0': optional: true - '@rolldown/binding-darwin-x64@1.0.0-rc.15': + '@rolldown/binding-darwin-x64@1.0.0': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-rc.15': + '@rolldown/binding-freebsd-x64@1.0.0': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.15': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.15': + '@rolldown/binding-linux-arm64-gnu@1.0.0': optional: true - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': + '@rolldown/binding-linux-arm64-musl@1.0.0': optional: true - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': + '@rolldown/binding-linux-ppc64-gnu@1.0.0': optional: true - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': + '@rolldown/binding-linux-s390x-gnu@1.0.0': optional: true - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': + '@rolldown/binding-linux-x64-gnu@1.0.0': optional: true - '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': + '@rolldown/binding-linux-x64-musl@1.0.0': optional: true - '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': + '@rolldown/binding-openharmony-arm64@1.0.0': optional: true - '@rolldown/binding-wasm32-wasi@1.0.0-rc.15': + '@rolldown/binding-wasm32-wasi@1.0.0': dependencies: - '@emnapi/core': 1.9.2 - '@emnapi/runtime': 1.9.2 - '@napi-rs/wasm-runtime': 1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2) + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': + '@rolldown/binding-win32-arm64-msvc@1.0.0': optional: true - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.15': + '@rolldown/binding-win32-x64-msvc@1.0.0': optional: true - '@rolldown/pluginutils@1.0.0-rc.15': {} + '@rolldown/pluginutils@1.0.0': {} '@standard-schema/spec@1.1.0': {} - '@tybys/wasm-util@0.10.1': + '@tybys/wasm-util@0.10.2': dependencies: tslib: 2.8.1 optional: true @@ -1241,62 +1261,62 @@ snapshots: '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 9.6.1 - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 '@types/eslint@9.6.1': dependencies: - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 '@types/json-schema': 7.0.15 - '@types/estree@1.0.8': {} + '@types/estree@1.0.9': {} '@types/json-schema@7.0.15': {} - '@types/node@18.19.130': + '@types/node@20.19.41': dependencies: - undici-types: 5.26.5 + undici-types: 6.21.0 '@types/statuses@2.0.6': {} - '@vitest/expect@4.1.4': + '@vitest/expect@4.1.6': dependencies: '@standard-schema/spec': 1.1.0 '@types/chai': 5.2.3 - '@vitest/spy': 4.1.4 - '@vitest/utils': 4.1.4 + '@vitest/spy': 4.1.6 + '@vitest/utils': 4.1.6 chai: 6.2.2 tinyrainbow: 3.1.0 - '@vitest/mocker@4.1.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3))(vite@8.0.8(@types/node@18.19.130)(terser@5.46.1))': + '@vitest/mocker@4.1.6(msw@2.11.2(@types/node@20.19.41)(typescript@5.9.3))(vite@8.0.12(@types/node@20.19.41)(terser@5.47.1))': dependencies: - '@vitest/spy': 4.1.4 + '@vitest/spy': 4.1.6 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - msw: 2.11.2(@types/node@18.19.130)(typescript@5.9.3) - vite: 8.0.8(@types/node@18.19.130)(terser@5.46.1) + msw: 2.11.2(@types/node@20.19.41)(typescript@5.9.3) + vite: 8.0.12(@types/node@20.19.41)(terser@5.47.1) - '@vitest/pretty-format@4.1.4': + '@vitest/pretty-format@4.1.6': dependencies: tinyrainbow: 3.1.0 - '@vitest/runner@4.1.4': + '@vitest/runner@4.1.6': dependencies: - '@vitest/utils': 4.1.4 + '@vitest/utils': 4.1.6 pathe: 2.0.3 - '@vitest/snapshot@4.1.4': + '@vitest/snapshot@4.1.6': dependencies: - '@vitest/pretty-format': 4.1.4 - '@vitest/utils': 4.1.4 + '@vitest/pretty-format': 4.1.6 + '@vitest/utils': 4.1.6 magic-string: 0.30.21 pathe: 2.0.3 - '@vitest/spy@4.1.4': {} + '@vitest/spy@4.1.6': {} - '@vitest/utils@4.1.4': + '@vitest/utils@4.1.6': dependencies: - '@vitest/pretty-format': 4.1.4 + '@vitest/pretty-format': 4.1.6 convert-source-map: 2.0.0 tinyrainbow: 3.1.0 @@ -1386,19 +1406,19 @@ snapshots: acorn@8.16.0: {} - ajv-formats@2.1.1(ajv@8.18.0): + ajv-formats@2.1.1(ajv@8.20.0): optionalDependencies: - ajv: 8.18.0 + ajv: 8.20.0 - ajv-keywords@5.1.0(ajv@8.18.0): + ajv-keywords@5.1.0(ajv@8.20.0): dependencies: - ajv: 8.18.0 + ajv: 8.20.0 fast-deep-equal: 3.1.3 - ajv@8.18.0: + ajv@8.20.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.0 + fast-uri: 3.1.2 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -1410,7 +1430,7 @@ snapshots: assertion-error@2.0.1: {} - baseline-browser-mapping@2.10.17: {} + baseline-browser-mapping@2.10.29: {} braces@3.0.3: dependencies: @@ -1418,15 +1438,15 @@ snapshots: browserslist@4.28.2: dependencies: - baseline-browser-mapping: 2.10.17 - caniuse-lite: 1.0.30001787 - electron-to-chromium: 1.5.334 - node-releases: 2.0.37 + baseline-browser-mapping: 2.10.29 + caniuse-lite: 1.0.30001792 + electron-to-chromium: 1.5.353 + node-releases: 2.0.44 update-browserslist-db: 1.2.3(browserslist@4.28.2) buffer-from@1.1.2: {} - caniuse-lite@1.0.30001787: {} + caniuse-lite@1.0.30001792: {} chai@6.2.2: {} @@ -1459,16 +1479,16 @@ snapshots: detect-libc@2.1.2: {} - electron-to-chromium@1.5.334: {} + electron-to-chromium@1.5.353: {} emoji-regex@8.0.0: {} - enhanced-resolve@5.20.1: + enhanced-resolve@5.21.3: dependencies: graceful-fs: 4.2.11 - tapable: 2.3.2 + tapable: 2.3.3 - es-module-lexer@2.0.0: {} + es-module-lexer@2.1.0: {} escalade@3.2.0: {} @@ -1487,7 +1507,7 @@ snapshots: estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 events@3.3.0: {} @@ -1495,7 +1515,7 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-uri@3.1.0: {} + fast-uri@3.1.2: {} fdir@6.5.0(picomatch@4.0.4): optionalDependencies: @@ -1514,7 +1534,7 @@ snapshots: graceful-fs@4.2.11: {} - graphql@16.13.2: {} + graphql@16.14.0: {} has-flag@4.0.0: {} @@ -1528,12 +1548,10 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 18.19.130 + '@types/node': 20.19.41 merge-stream: 2.0.0 supports-color: 8.1.1 - json-parse-even-better-errors@2.3.1: {} - json-schema-traverse@1.0.0: {} lightningcss-android-arm64@1.32.0: @@ -1585,7 +1603,7 @@ snapshots: lightningcss-win32-arm64-msvc: 1.32.0 lightningcss-win32-x64-msvc: 1.32.0 - loader-runner@4.3.1: {} + loader-runner@4.3.2: {} magic-string@0.30.21: dependencies: @@ -1598,23 +1616,19 @@ snapshots: braces: 3.0.3 picomatch: 2.3.2 - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 + mime-db@1.54.0: {} - msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3): + msw@2.11.2(@types/node@20.19.41)(typescript@5.9.3): dependencies: '@bundled-es-modules/cookie': 2.0.1 '@bundled-es-modules/statuses': 1.0.1 - '@inquirer/confirm': 5.1.21(@types/node@18.19.130) + '@inquirer/confirm': 5.1.21(@types/node@20.19.41) '@mswjs/interceptors': 0.39.8 '@open-draft/deferred-promise': 2.2.0 '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 '@types/statuses': 2.0.6 - graphql: 16.13.2 + graphql: 16.14.0 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 @@ -1632,11 +1646,11 @@ snapshots: mute-stream@2.0.0: {} - nanoid@3.3.11: {} + nanoid@3.3.12: {} neo-async@2.6.2: {} - node-releases@2.0.37: {} + node-releases@2.0.44: {} obug@2.1.1: {} @@ -1652,9 +1666,9 @@ snapshots: picomatch@4.0.4: {} - postcss@8.5.9: + postcss@8.5.14: dependencies: - nanoid: 3.3.11 + nanoid: 3.3.12 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -1664,35 +1678,35 @@ snapshots: rettime@0.7.0: {} - rolldown@1.0.0-rc.15: + rolldown@1.0.0: dependencies: - '@oxc-project/types': 0.124.0 - '@rolldown/pluginutils': 1.0.0-rc.15 + '@oxc-project/types': 0.129.0 + '@rolldown/pluginutils': 1.0.0 optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-rc.15 - '@rolldown/binding-darwin-arm64': 1.0.0-rc.15 - '@rolldown/binding-darwin-x64': 1.0.0-rc.15 - '@rolldown/binding-freebsd-x64': 1.0.0-rc.15 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.15 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.15 - '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.15 - '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.15 - '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.15 - '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.15 - '@rolldown/binding-linux-x64-musl': 1.0.0-rc.15 - '@rolldown/binding-openharmony-arm64': 1.0.0-rc.15 - '@rolldown/binding-wasm32-wasi': 1.0.0-rc.15 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.15 - '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.15 + '@rolldown/binding-android-arm64': 1.0.0 + '@rolldown/binding-darwin-arm64': 1.0.0 + '@rolldown/binding-darwin-x64': 1.0.0 + '@rolldown/binding-freebsd-x64': 1.0.0 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0 + '@rolldown/binding-linux-arm64-gnu': 1.0.0 + '@rolldown/binding-linux-arm64-musl': 1.0.0 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0 + '@rolldown/binding-linux-s390x-gnu': 1.0.0 + '@rolldown/binding-linux-x64-gnu': 1.0.0 + '@rolldown/binding-linux-x64-musl': 1.0.0 + '@rolldown/binding-openharmony-arm64': 1.0.0 + '@rolldown/binding-wasm32-wasi': 1.0.0 + '@rolldown/binding-win32-arm64-msvc': 1.0.0 + '@rolldown/binding-win32-x64-msvc': 1.0.0 schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.18.0 - ajv-formats: 2.1.1(ajv@8.18.0) - ajv-keywords: 5.1.0(ajv@8.18.0) + ajv: 8.20.0 + ajv-formats: 2.1.1(ajv@8.20.0) + ajv-keywords: 5.1.0(ajv@8.20.0) - semver@7.7.4: {} + semver@7.8.0: {} siginfo@2.0.0: {} @@ -1713,7 +1727,7 @@ snapshots: statuses@2.0.2: {} - std-env@4.0.0: {} + std-env@4.1.0: {} strict-event-emitter@0.5.1: {} @@ -1735,17 +1749,17 @@ snapshots: dependencies: has-flag: 4.0.0 - tapable@2.3.2: {} + tapable@2.3.3: {} - terser-webpack-plugin@5.4.0(webpack@5.106.0): + terser-webpack-plugin@5.6.0(webpack@5.106.2): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 - terser: 5.46.1 - webpack: 5.106.0 + terser: 5.47.1 + webpack: 5.106.2 - terser@5.46.1: + terser@5.47.1: dependencies: '@jridgewell/source-map': 0.3.11 acorn: 8.16.0 @@ -1754,7 +1768,7 @@ snapshots: tinybench@2.9.0: {} - tinyexec@1.1.1: {} + tinyexec@1.1.2: {} tinyglobby@0.2.16: dependencies: @@ -1763,11 +1777,11 @@ snapshots: tinyrainbow@3.1.0: {} - tldts-core@7.0.28: {} + tldts-core@7.0.30: {} - tldts@7.0.28: + tldts@7.0.30: dependencies: - tldts-core: 7.0.28 + tldts-core: 7.0.30 to-regex-range@5.0.1: dependencies: @@ -1775,17 +1789,17 @@ snapshots: tough-cookie@6.0.1: dependencies: - tldts: 7.0.28 + tldts: 7.0.30 - ts-loader@9.5.7(typescript@5.9.3)(webpack@5.106.0): + ts-loader@9.5.7(typescript@5.9.3)(webpack@5.106.2): dependencies: chalk: 4.1.2 - enhanced-resolve: 5.20.1 + enhanced-resolve: 5.21.3 micromatch: 4.0.8 - semver: 7.7.4 + semver: 7.8.0 source-map: 0.7.6 typescript: 5.9.3 - webpack: 5.106.0 + webpack: 5.106.2 tslib@2.8.1: optional: true @@ -1794,7 +1808,7 @@ snapshots: typescript@5.9.3: {} - undici-types@5.26.5: {} + undici-types@6.21.0: {} update-browserslist-db@1.2.3(browserslist@4.28.2): dependencies: @@ -1802,42 +1816,42 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 - vite@8.0.8(@types/node@18.19.130)(terser@5.46.1): + vite@8.0.12(@types/node@20.19.41)(terser@5.47.1): dependencies: lightningcss: 1.32.0 picomatch: 4.0.4 - postcss: 8.5.9 - rolldown: 1.0.0-rc.15 + postcss: 8.5.14 + rolldown: 1.0.0 tinyglobby: 0.2.16 optionalDependencies: - '@types/node': 18.19.130 + '@types/node': 20.19.41 fsevents: 2.3.3 - terser: 5.46.1 - - vitest@4.1.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3))(vite@8.0.8(@types/node@18.19.130)(terser@5.46.1)): - dependencies: - '@vitest/expect': 4.1.4 - '@vitest/mocker': 4.1.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.9.3))(vite@8.0.8(@types/node@18.19.130)(terser@5.46.1)) - '@vitest/pretty-format': 4.1.4 - '@vitest/runner': 4.1.4 - '@vitest/snapshot': 4.1.4 - '@vitest/spy': 4.1.4 - '@vitest/utils': 4.1.4 - es-module-lexer: 2.0.0 + terser: 5.47.1 + + vitest@4.1.6(@types/node@20.19.41)(msw@2.11.2(@types/node@20.19.41)(typescript@5.9.3))(vite@8.0.12(@types/node@20.19.41)(terser@5.47.1)): + dependencies: + '@vitest/expect': 4.1.6 + '@vitest/mocker': 4.1.6(msw@2.11.2(@types/node@20.19.41)(typescript@5.9.3))(vite@8.0.12(@types/node@20.19.41)(terser@5.47.1)) + '@vitest/pretty-format': 4.1.6 + '@vitest/runner': 4.1.6 + '@vitest/snapshot': 4.1.6 + '@vitest/spy': 4.1.6 + '@vitest/utils': 4.1.6 + es-module-lexer: 2.1.0 expect-type: 1.3.0 magic-string: 0.30.21 obug: 2.1.1 pathe: 2.0.3 picomatch: 4.0.4 - std-env: 4.0.0 + std-env: 4.1.0 tinybench: 2.9.0 - tinyexec: 1.1.1 + tinyexec: 1.1.2 tinyglobby: 0.2.16 tinyrainbow: 3.1.0 - vite: 8.0.8(@types/node@18.19.130)(terser@5.46.1) + vite: 8.0.12(@types/node@20.19.41)(terser@5.47.1) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 18.19.130 + '@types/node': 20.19.41 transitivePeerDependencies: - msw @@ -1846,12 +1860,12 @@ snapshots: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - webpack-sources@3.3.4: {} + webpack-sources@3.4.1: {} - webpack@5.106.0: + webpack@5.106.2: dependencies: '@types/eslint-scope': 3.7.7 - '@types/estree': 1.0.8 + '@types/estree': 1.0.9 '@types/json-schema': 7.0.15 '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 @@ -1860,24 +1874,32 @@ snapshots: acorn-import-phases: 1.0.4(acorn@8.16.0) browserslist: 4.28.2 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.20.1 - es-module-lexer: 2.0.0 + enhanced-resolve: 5.21.3 + es-module-lexer: 2.1.0 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - json-parse-even-better-errors: 2.3.1 - loader-runner: 4.3.1 - mime-types: 2.1.35 + loader-runner: 4.3.2 + mime-db: 1.54.0 neo-async: 2.6.2 schema-utils: 4.3.3 - tapable: 2.3.2 - terser-webpack-plugin: 5.4.0(webpack@5.106.0) + tapable: 2.3.3 + terser-webpack-plugin: 5.6.0(webpack@5.106.2) watchpack: 2.5.1 - webpack-sources: 3.3.4 + webpack-sources: 3.4.1 transitivePeerDependencies: + - '@minify-html/node' - '@swc/core' + - '@swc/css' + - '@swc/html' + - clean-css + - cssnano + - csso - esbuild + - html-minifier-terser + - lightningcss + - postcss - uglify-js why-is-node-running@2.3.0: diff --git a/reference.md b/reference.md index 0932e24..e0541dd 100644 --- a/reference.md +++ b/reference.md @@ -19,25 +19,22 @@ Retrieves details of your Brevo account. - Check plan details (type, credits, expiration) - Get relay information (for transactional emails) - Check Marketing Automation status -- View date/time preferences and account settings - Access organization and user identifiers **Key information returned:** - Complete account details (organization ID, user ID, company information) - Address and contact information - Plan configurations and credit allocations across different verticals -- Marketing Automation settings and tracker key +- Marketing Automation settings and tracker key (when enabled) - SMTP relay configuration for transactional emails -- Date/time preferences and account settings - Enterprise features availability status **Important considerations:** - Provides comprehensive account overview for billing and configuration management - Essential for understanding current plan limitations and feature availability -- Marketing Automation key required for advanced automation features -- Plan verticals show detailed breakdown across Marketing, Chat, and CRM categories +- Marketing Automation key is only returned when Marketing Automation is enabled on the account +- Plan verticals show detailed breakdown across Marketing, Chat, and CRM categories (only returned when plan verticals are available) - Relay configuration crucial for transactional email setup and deliverability -- Date/time preferences affect campaign scheduling and reporting displays - Enterprise status determines access to advanced features and sub-account management
@@ -1261,6 +1258,20 @@ await client.masterAccount.getSubAccountDetails({
+#### 📝 Description + +
+
+ +
+
+ +Permanently deletes a sub-account from the corporate master account. Once deleted, all data associated with the sub-account organization is removed and cannot be recovered, so ensure the sub-account is no longer needed before proceeding. +
+
+
+
+ #### 🔌 Usage
@@ -1931,6 +1942,20 @@ await client.masterAccount.changeAdminUserPermissions({
+#### 📝 Description + +
+
+ +
+
+ +Retrieves the list of all users associated with your organization, including both active and pending invited users. Each user entry includes their email address, owner status, current invitation status, and feature access levels for marketing, CRM, and conversations. +
+
+
+
+ #### 🔌 Usage
@@ -1972,6 +1997,20 @@ await client.user.getInvitedUsersList();
+#### 📝 Description + +
+
+ +
+
+ +Revokes all permissions for an invited user in the organization, effectively removing their access to the platform. If the user''s plan change generated credit notes, they are returned in the response for billing reconciliation. +
+
+
+
+ #### 🔌 Usage
@@ -2157,6 +2196,20 @@ await client.user.inviteuser({
+#### 📝 Description + +
+
+ +
+
+ +Resends or cancels a pending invitation for a user in the organization, depending on the action path parameter. Use `resend` to send a new invitation email to the user, or `cancel` to revoke the pending invitation entirely and remove the user''s pending access. +
+
+
+
+ #### 🔌 Usage
@@ -2342,6 +2395,20 @@ await client.user.editUserPermission({
+#### 📝 Description + +
+
+ +
+
+ +Retrieves the granular feature-level permissions assigned to a specific user in the organization, identified by their email address. The response includes the user''s current status (active or pending) and a detailed list of privileges specifying which features and permission levels are granted. +
+
+
+
+ #### 🔌 Usage
@@ -2412,20 +2479,19 @@ Retrieves a list of background processes from your Brevo account with filtering - Identify failed or stuck processes for troubleshooting **Key information returned:** -- Process details (ID, name, type, status) -- Process creation and completion timestamps -- Process progress and completion status -- Error information for failed processes -- Process result data and download links +- Process details (ID, name, status) +- Export download URLs for completed export processes +- Import details with CSV report URLs for completed import processes +- Total count of processes for pagination **Important considerations:** - Background processes handle long-running operations like imports and exports -- Process status indicates current state (queued, processing, completed, failed, cancelled) +- Process status indicates current state (queued, processing, completed) - Export processes provide download URLs when completed -- Failed processes include error messages for troubleshooting +- Import processes provide CSV report URLs with details about problematic records - Use pagination for accounts with many historical processes - Sort options available for creation order (ascending or descending) -- Different process types handle specific operations (imports, exports, calculations) +- Default limit is 10 results per page, maximum is 50
@@ -2498,18 +2564,14 @@ Retrieves detailed information about a specific background process. - Track process execution times **Key information returned:** -- Complete process details and status -- Import/export statistics and results -- Error information for troubleshooting -- Download URLs for export processes -- Process timing and performance data +- Complete process details (ID, name, status) +- Download URLs for completed export processes +- Import details with CSV report URLs for completed import processes **Important considerations:** -- Process ID must exist in your account -- Completed processes provide detailed statistics and results -- Export processes include download URLs when successful -- Failed processes contain error messages for debugging -- Timing information helps with performance analysis +- Process ID must exist in your account and not be deleted +- Completed export processes include download URLs +- Completed import processes include CSV report URLs with details about problematic records - Different process types return different result structures
@@ -3588,7 +3650,6 @@ Key information returned: ```typescript await client.webhooks.createWebhook({ - events: ["sent"], url: "http://requestb.in/173lyyx1" }); @@ -4377,24 +4438,51 @@ await client.externalFeeds.deleteExternalFeed({ Custom objects are only available to Enterprise plans. This feature is in beta. These are subject to change. -This API allows bulk upsert of object records in a single request. Each object record may include - - Attributes - - Identifiers - - Associations -**Response:** - The API processes the request asynchronously and returns a processId that you can use to track the background process status. -**API and Schema Limitation:** - - Size: - - Max 1000 objects records per request - - Max request body size: 1 MB - - Max 500 attributes defined per object record upsert request - - This is coherent with schema limitation: an object cannot have more than 500 attributes. - - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - - Max 10 associations defined per associated object type, in each record of the request - - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests. +Performs bulk create or update (upsert) operations for object records in a single asynchronous request. This endpoint is optimized for high-volume data imports and synchronization scenarios. + +**How Upsert Works:** +- **Create**: Omit `identifiers`, or provide only `ext_id` (if it doesn't already exist). A new record is created with a Brevo-generated `id`. +- **Update**: Provide `id` (Brevo internal ID) or an `ext_id` that already exists. The matching record is updated with the new attribute values. +- **Important:** `id` is for **updates only**. Providing an `id` that does not belong to an existing record will fail during async processing (the HTTP response will still be 202, but the record will be rejected in the background). To create a new record with a stable external reference, use `ext_id` instead. + +**Request Structure:** +Each object record in the `records` array can include: +- `identifiers`: Either `id` (internal Brevo ID) or `ext_id` (your external system ID) — required for updates. **Note:** use `id` (singular), not `ids`. +- `attributes`: Key-value pairs where each key is the attribute **key** (e.g., `company_name`), not the attribute label (e.g., "Company Name"). +- `associations`: Controls linking and unlinking of associated records (optional). Each entry specifies: + - `object_type`: The type of the associated object + - `action`: `link` (default) to create the association, or `unlink` to remove it + - `records`: The associated records to link or unlink (each identified by `ext_id` or `id`) + - **Unlink is idempotent** — unlinking a non-existing association is a no-op (no error returned) + - `link` and `unlink` actions can be submitted for the same `object_type` in a single record entry + - Both associated records must already exist before a link can be created + +> **Common mistake:** Passing the attribute **label** (the display name you see in the UI) instead of the attribute **key** will cause the attribute to be silently ignored and the record may not be created as expected. + +**Asynchronous Processing:** +- Returns immediately with a `processId` (HTTP 202 Accepted) +- Use the processId to track status via the Get process API + +**API and Schema Limitations:** +- Max 1000 object records per request +- Max request body size: 1 MB +- Max 500 attributes per object record (matches the schema limit of 500 attributes per object) +- Unknown attribute keys are silently ignored (no error, no attribute creation) +- Max 10 association records per associated object-type in each record of the request. If you need more, send multiple requests. + +**Important Behaviors:** +- The object schema must be created before upserting records +- Unknown attribute keys are silently ignored (no error, no creation) +- Both associated object records must already exist before creating a link association +- Unlink operations are idempotent: attempting to unlink a non-existing association returns success +- `link` and `unlink` actions can be submitted for the same `object_type` in a single record entry +- Contact objects cannot be created via this endpoint +- For `category` and `multiple_category` attributes, pass the option **key** as the value (not the option label or option ID). +- The `id` identifier (internal Brevo ID) can only be used for **updating** existing records. To create new records, either omit identifiers (Brevo auto-generates an ID) or provide an `ext_id`. + **Errors:** - - Make sure both object records exist before associating them, else the API will return an error. - - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". +- Make sure both object records exist before associating them, else the API will return an error. +- This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type".
@@ -4411,7 +4499,34 @@ This API allows bulk upsert of object records in a single request. Each object r ```typescript await client.customObjects.upsertrecords({ object_type: "vehicle", - records: [{}] + records: [{ + associations: [{ + object_type: "garage", + action: "link", + records: [{ + identifiers: { + id: 435435 + } + }] + }, { + object_type: "garage", + action: "unlink", + records: [{ + identifiers: { + ext_id: "old-garage-001" + } + }] + }], + attributes: { + "make": "Toyota", + "model": "Camry", + "year": 2020, + "engine_type": "hybrid" + }, + identifiers: { + ext_id: "VIN123" + } + }] }); ``` @@ -4530,8 +4645,8 @@ await client.customObjects.getrecords({
Use this endpoint to delete multiple object records of the same object-type in one request. -The request is accepted and processed asynchronously. You can track the status of the deletion process using the returned **processId**. -**API and Schema Limitations:** - Each request can contain up to **1000** object record identifiers - If more records must be deleted → send multiple batch requests +The request is accepted and processed asynchronously. You can track the status of the deletion process using the returned **processId**. +**Limitations:** - Each request can contain up to **1000** object record identifiers - Either `ids` or `ext_ids` must be provided, but **not both** in the same request - Deletion of Brevo standard object records is not supported via this endpoint - If more records must be deleted, send multiple batch requests
@@ -4592,6 +4707,20 @@ await client.customObjects.batchDeleteObjectRecords({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve all contacts from your Brevo account with support for pagination, filtering, and sorting. Results default to 50 contacts per page (maximum 1000) sorted in descending order of creation, and can be filtered by modification date, creation date, contact IDs (up to 20), list IDs, segment ID, or contact attributes using the equals operator. Note that either listIds or segmentId can be passed but not both simultaneously. +
+
+
+
+ #### 🔌 Usage
@@ -4706,6 +4835,20 @@ await client.contacts.createContact();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve all contact attributes defined in your Brevo account, grouped by category (normal, transactional, category, calculated, global). Each attribute includes its name, type, and category, along with enumeration values for category-type attributes and options for multiple-choice-type attributes. +
+
+
+
+ #### 🔌 Usage
@@ -4747,6 +4890,20 @@ await client.contacts.getAttributes();
+#### 📝 Description + +
+
+ +
+
+ +Create a new contact attribute under the specified category and name. The required body properties depend on the category: use "type" for normal, transactional, or category attributes; use "value" for calculated or global attributes; use "enumeration" for category attributes; and use "multiCategoryOptions" for normal multiple-choice attributes. None of the category or multicategory option values can exceed 200 characters. +
+
+
+
+ #### 🔌 Usage
@@ -4799,6 +4956,20 @@ await client.contacts.createAttribute({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing contact attribute identified by its category and name. For category-type attributes, you can update the enumeration values; for calculated or global attributes, update the computed value formula; and for normal multiple-choice attributes, update the multicategory options. None of the category or multicategory option values can exceed 200 characters. +
+
+
+
+ #### 🔌 Usage
@@ -4851,6 +5022,20 @@ await client.contacts.updateAttribute({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete an existing contact attribute by its category and name. The attribute must exist in the specified category (normal, transactional, category, calculated, or global), otherwise a 404 error is returned. +
+
+
+
+ #### 🔌 Usage
@@ -4903,6 +5088,20 @@ await client.contacts.deleteAttribute({
+#### 📝 Description + +
+
+ +
+
+ +Delete a specific option from an existing multiple-choice contact attribute. The attribute type must be "multiple-choice", and both the attribute name and the option to delete must already exist in your account. +
+
+
+
+ #### 🔌 Usage
@@ -4956,6 +5155,20 @@ await client.contacts.deleteMultiAttributeOptions({
+#### 📝 Description + +
+
+ +
+
+ +Update multiple contacts in a single API call by passing an array of contact objects. Each contact in the array must be identified by one of: email, id, or sms (only one identifier per contact). You can update attributes, blacklist status, list memberships, ext_id, and transactional email forbidden senders for each contact in the batch. +
+
+
+
+ #### 🔌 Usage
@@ -5205,6 +5418,20 @@ await client.contacts.getFolders();
+#### 📝 Description + +
+
+ +
+
+ +Create a new folder to organize your contact lists. Folders serve as containers for grouping related lists together. The folder name is required and must be provided in the request body. +
+
+
+
+ #### 🔌 Usage
@@ -5321,6 +5548,20 @@ await client.contacts.getFolder({
+#### 📝 Description + +
+
+ +
+
+ +Update the name of an existing folder identified by its ID. The new folder name must be provided in the request body. Returns a 404 error if the folder ID does not exist. +
+
+
+
+ #### 🔌 Usage
@@ -5373,6 +5614,20 @@ await client.contacts.updateFolder({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete a folder identified by its ID. Deleting a folder will also delete all the contact lists contained within it. This action cannot be undone. +
+
+
+
+ #### 🔌 Usage
@@ -5619,6 +5874,20 @@ await client.contacts.getLists();
+#### 📝 Description + +
+
+ +
+
+ +Create a new contact list inside a specified folder. Both the list name and the parent folder ID are required. The newly created list will be empty and ready to receive contacts via the add contacts endpoint. +
+
+
+
+ #### 🔌 Usage
@@ -5671,6 +5940,20 @@ await client.contacts.createList({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the details of a specific contact list by its ID, including its name, folder ID, creation date, subscriber counts, and campaign statistics. You can optionally filter campaign statistics by providing startDate and endDate parameters (both must be used together in YYYY-MM-DD format). +
+
+
+
+ #### 🔌 Usage
@@ -5722,6 +6005,20 @@ await client.contacts.getList({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing contact list identified by its ID. You can update the list name, move it to a different folder by providing a new folderId, or both. Only one of the two parameters (name, folderId) needs to be provided per request. +
+
+
+
+ #### 🔌 Usage
@@ -5773,6 +6070,20 @@ await client.contacts.updateList({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete a contact list identified by its ID. The contacts in the list are not deleted; they are only removed from this list. Returns a 404 error if the list ID does not exist. +
+
+
+
+ #### 🔌 Usage
@@ -5824,7 +6135,7 @@ await client.contacts.deleteList({
-#### 🔌 Usage +#### 📝 Description
@@ -5832,10 +6143,24 @@ await client.contacts.deleteList({
-```typescript -await client.contacts.getContactsFromList({ - listId: 1000000 -}); +Retrieve all contacts belonging to a specific list, identified by its list ID. Results are paginated with a default of 50 contacts per page (maximum 500) and sorted in descending order of creation. You can optionally filter contacts by their modification date using the modifiedSince parameter. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.contacts.getContactsFromList({ + listId: 1000000 +}); ```
@@ -5983,6 +6308,20 @@ await client.contacts.removeContactFromList({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve all contact segments defined in your Brevo account with support for pagination and sorting. Results default to 10 segments per page (maximum 50) sorted in descending order of creation. Each segment includes its ID, name, category name, and last update timestamp. +
+
+
+
+ #### 🔌 Usage
@@ -6231,6 +6570,20 @@ await client.contacts.deleteContact({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve email campaign statistics for a specific contact identified by email address or numeric ID. Statistics include messages sent, opens, clicks, hard/soft bounces, deliveries, unsubscriptions, complaints, and transactional attributes. By default, data covers the last 90 days; use startDate and endDate parameters (YYYY-MM-DD) to specify a custom range with a maximum span of 90 days. +
+
+
+
+ #### 🔌 Usage
@@ -6291,7 +6644,7 @@ await client.contacts.getContactStats({
-We recommend pinging this endpoint every minute for as long as the agent has to be considered online. +Sets the agent's status to online for 2-3 minutes. We recommend pinging this endpoint every minute for as long as the agent has to be considered online. You must provide either `agentId` alone, or all three of `agentEmail` + `agentName` + `receivedFrom`.
@@ -6348,6 +6701,20 @@ await client.conversations.setsAgentsStatusToOnlineFor23Minutes({
+#### 📝 Description + +
+
+ +
+
+ +Send a message as an agent to an existing visitor's conversation. You must provide either `agentId` alone, or all three of `agentEmail` + `agentName` + `receivedFrom` to identify the agent. +
+
+
+
+ #### 🔌 Usage
@@ -6401,6 +6768,20 @@ await client.conversations.sendAMessageAsAnAgent({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a single message by its ID. +
+
+
+
+ #### 🔌 Usage
@@ -6460,7 +6841,7 @@ await client.conversations.getAMessage({
-Only agents’ messages can be edited. +Update the text of a message sent by an agent. Only messages of type `agent` can be edited. The `text` and `html` fields of the message will be updated.
@@ -6526,7 +6907,7 @@ await client.conversations.updateAMessageSentByAnAgent({
-Only agents’ messages can be deleted. +Delete a message sent by an agent. Only messages of type `agent` can be deleted.
@@ -6591,7 +6972,7 @@ await client.conversations.deleteAMessageSentByAnAgent({
-Example of automated messages: order status, announce new features in your web app, etc. +Send an automated (pushed) message to a visitor on behalf of an agent. Example use cases: order status updates, announcing new features in your web app, etc.
@@ -6608,7 +6989,7 @@ Example of automated messages: order status, announce new features in your web a ```typescript await client.conversations.sendAnAutomatedMessageToAVisitor({ groupId: "PjRBMhWGen6aRHjif", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" }); @@ -6650,6 +7031,20 @@ await client.conversations.sendAnAutomatedMessageToAVisitor({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a single automated (pushed) message by its ID. +
+
+
+
+ #### 🔌 Usage
@@ -6701,6 +7096,20 @@ await client.conversations.getAnAutomatedMessage({
+#### 📝 Description + +
+
+ +
+
+ +Update the text of an automated (pushed) message. The `text` and `html` fields of the message will be updated. +
+
+
+
+ #### 🔌 Usage
@@ -6712,7 +7121,7 @@ await client.conversations.getAnAutomatedMessage({ ```typescript await client.conversations.updateAnAutomatedMessage({ id: "id", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54" + text: "Your order has shipped! Here's your tracking number: 9114 5847 4668 7775 9233 54" }); ``` @@ -6753,6 +7162,20 @@ await client.conversations.updateAnAutomatedMessage({
+#### 📝 Description + +
+
+ +
+
+ +Delete an automated (pushed) message by its ID. +
+
+
+
+ #### 🔌 Usage
@@ -6870,6 +7293,20 @@ await client.conversations.setVisitorGroupAssignment({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of all ecommerce categories stored in your Brevo account. Results are sorted by creation date in descending order by default, and can be filtered by category IDs, name, modification date, creation date, or deletion status. The response includes a `count` field with the total number of matching categories, and pagination defaults to 50 categories per page (maximum 100). +
+
+
+
+ #### 🔌 Usage
@@ -6919,6 +7356,20 @@ await client.ecommerce.getCategories();
+#### 📝 Description + +
+
+ +
+
+ +Create a new ecommerce category or update an existing one, identified by the mandatory `id` field. When `updateEnabled` is set to `false` (the default), the endpoint performs an insert and returns `201`; if the category ID already exists, a `400` error is returned. When `updateEnabled` is `true`, the endpoint performs an upsert, returning `201` for a new category or `204` when an existing category is updated. The `name` field is mandatory for creation but optional for updates. +
+
+
+
+ #### 🔌 Usage
@@ -6970,6 +7421,20 @@ await client.ecommerce.createUpdateCategory({
+#### 📝 Description + +
+
+ +
+
+ +Create or update multiple ecommerce categories in a single request. The `categories` array accepts up to 100 category objects, each requiring a unique `id`. When `updateEnabled` is `false` (the default), all categories are inserted as new; if any ID already exists, a `400` error is returned. When `updateEnabled` is `true`, existing categories are updated and new ones are created via upsert. Duplicate IDs within the same request payload are rejected. The response returns the count of created and updated categories. +
+
+
+
+ #### 🔌 Usage
@@ -7023,6 +7488,20 @@ await client.ecommerce.createUpdateBatchCategory({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the full details of a single ecommerce category by its unique ID. The response includes the category name, URL, creation and modification timestamps, and deletion status. Returns a `404` error if no category matches the provided ID. +
+
+
+
+ #### 🔌 Usage
@@ -7129,6 +7608,20 @@ await client.ecommerce.activateTheECommerceApp();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve aggregated ecommerce attribution metrics for one or more Brevo email campaigns, SMS campaigns, or automation workflows. You can optionally filter by a date range using `periodFrom` and `periodTo` in RFC3339 format. The response includes per-source metrics (orders count, revenue, and average basket) as well as aggregated totals across all requested sources. +
+
+
+
+ #### 🔌 Usage
@@ -7140,7 +7633,8 @@ await client.ecommerce.activateTheECommerceApp(); ```typescript await client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows({ periodFrom: "2022-01-02T00:00:00Z", - periodTo: "2022-01-03T00:00:00Z" + periodTo: "2022-01-03T00:00:00Z", + "emailCampaignId[]": ["sale"] }); ``` @@ -7181,6 +7675,20 @@ await client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflow
+#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed attribution metrics for a single Brevo campaign or automation workflow, identified by its conversion source type and ID. The response includes orders count, revenue, average basket value, and the number of new customers attributed to that specific campaign or workflow. +
+
+
+
+ #### 🔌 Usage
@@ -7233,6 +7741,20 @@ await client.ecommerce.getDetailedAttributionMetricsForASingleBrevoCampaignOrWor
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the list of products whose sales have been attributed to a specific Brevo campaign or automation workflow. Each product entry includes its ID, name, SKU, image URL, product URL, price, revenue, and orders count. The conversion source type must be one of `email_campaign`, `sms_campaign`, `automation_workflow_email`, or `automation_workflow_sms`. +
+
+
+
+ #### 🔌 Usage
@@ -7285,6 +7807,20 @@ await client.ecommerce.getAttributedProductSalesForASingleBrevoCampaignOrWorkflo
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the ISO 4217 display currency code currently configured for your Brevo ecommerce account. This currency is used to display monetary values across the ecommerce dashboard and reports. Returns a `403` error if ecommerce is not activated on the account. +
+
+
+
+ #### 🔌 Usage
@@ -7326,6 +7862,20 @@ await client.ecommerce.getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAcco
+#### 📝 Description + +
+
+ +
+
+ +Set or update the ISO 4217 display currency code for your Brevo ecommerce account. This currency determines how monetary values are displayed in the ecommerce dashboard and reports. The provided currency code must be a valid ISO 4217 code; invalid codes result in a `422` error. Returns a `403` error if ecommerce is not activated on the account. +
+
+
+
+ #### 🔌 Usage
@@ -7588,6 +8138,20 @@ await client.ecommerce.createBatchOrder({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of all ecommerce products stored in your Brevo account. Results are sorted by creation date in descending order by default, and can be filtered by product IDs, name (minimum 3 characters), price range, category IDs, modification date, creation date, or deletion status. Use the `search` parameter to query across SKU, name, and ID simultaneously — results are prioritized as exact SKU match > SKU prefix match > name match > ID match. Pagination defaults to 50 products per page (maximum 1000), and the response includes a `count` field with the total number of matching products. +
+
+
+
+ #### 🔌 Usage
@@ -7637,6 +8201,20 @@ await client.ecommerce.getProducts();
+#### 📝 Description + +
+
+ +
+
+ +Create a new ecommerce product or update an existing one, identified by the mandatory `id` field. When `updateEnabled` is `false` (the default), the endpoint inserts a new product and returns `201`; if the product ID already exists, a `400` error is returned. When `updateEnabled` is `true`, the endpoint performs an upsert, returning `201` for a new product or `204` for an update. The `name` field is mandatory for creation but optional for updates. Product images are downloaded, validated (max 5 MB, formats: jpeg, jpg, png, bmp, gif, webp), and re-hosted on S3. The `metaInfo` object supports up to 20 keys with a cumulative size limit of approximately 1000 KB. +
+
+
+
+ #### 🔌 Usage
@@ -7689,7 +8267,7 @@ await client.ecommerce.createUpdateProduct({
-#### 🔌 Usage +#### 📝 Description
@@ -7697,9 +8275,23 @@ await client.ecommerce.createUpdateProduct({
-```typescript -await client.ecommerce.createUpdateBatchProducts({ - products: [{ +Create or update multiple ecommerce products in a single request. The `products` array accepts up to 100 product objects for creation (or up to 1000 when `updateEnabled` is `true` and the account has an increased limit). Each product requires a unique `id` and `name` (name is mandatory for creation only). When `updateEnabled` is `false`, all products are inserted as new; if any ID already exists, a `400` error is returned. When `updateEnabled` is `true`, existing products are updated and new ones are created via upsert. Duplicate IDs within the same request payload are rejected. The response returns the count of created and updated products. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.ecommerce.createUpdateBatchProducts({ + products: [{ id: "P11", name: "Iphone 11" }] @@ -7743,6 +8335,20 @@ await client.ecommerce.createUpdateBatchProducts({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the full details of a single ecommerce product by its unique ID. The response includes the product name, price, SKU, URL, image URLs (original and thumbnails), categories, stock level, meta information, creation and modification timestamps, and deletion status. Returns a `404` error if no product matches the provided ID. +
+
+
+
+ #### 🔌 Usage
@@ -7794,6 +8400,20 @@ await client.ecommerce.getProductInfo({
+#### 📝 Description + +
+
+ +
+
+ +Register a contact to receive an alert for a specific product event, such as `back_in_stock`. At least one contact identifier (`ext_id`, `email`, or `sms`) must be provided; when multiple are given, priority is `ext_id` > `email` > `sms`. Returns a `404` error if the product ID does not exist, and a `403` error if product alerts are not enabled for the account. +
+
+
+
+ #### 🔌 Usage
@@ -7847,6 +8467,20 @@ await client.ecommerce.createProductAlert({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of all coupon collections in your Brevo account. Results can be sorted by creation date, remaining coupons count, or expiration date, in ascending or descending order. Pagination defaults to 50 collections per page (maximum 100). +
+
+
+
+ #### 🔌 Usage
@@ -7896,6 +8530,20 @@ await client.coupons.getCouponCollections();
+#### 📝 Description + +
+
+ +
+
+ +Create a new coupon collection with a name and a default coupon value. You can optionally set an expiration date in RFC3339 format and configure alert thresholds to receive email notifications when remaining coupons or remaining days before expiration fall below a specified number. The collection ID is auto-generated as a UUID and returned in the response. +
+
+
+
+ #### 🔌 Usage
@@ -7948,6 +8596,20 @@ await client.coupons.createCouponCollection({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the details of a single coupon collection by its UUID. The response includes the collection name, default coupon value, total and remaining coupon counts, and creation timestamp. Returns a `404` error if no collection matches the provided ID. +
+
+
+
+ #### 🔌 Usage
@@ -7999,6 +8661,20 @@ await client.coupons.getCouponCollection({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing coupon collection by its UUID. You can modify the default coupon value, set or remove the expiration date (pass `null` to remove), and configure or disable alert thresholds for remaining coupons or remaining days. Only the fields included in the request body are updated; omitted fields remain unchanged. +
+
+
+
+ #### 🔌 Usage
@@ -8050,6 +8726,20 @@ await client.coupons.updateCouponCollection({
+#### 📝 Description + +
+
+ +
+
+ +Add coupons to an existing coupon collection. The `coupons` array must contain between 1 and 10,000 unique coupon code strings, all associated with the specified `collectionId`. Coupon creation is processed asynchronously and a `204` status is returned immediately upon acceptance. Returns a `404` error if the specified coupon collection does not exist. +
+
+
+
+ #### 🔌 Usage
@@ -8103,6 +8793,20 @@ await client.coupons.createCoupons({
+#### 📝 Description + +
+
+ +
+
+ +Create a new payment request for a Brevo contact. The request requires a reference (displayed on the payment page), a contact ID, and a cart with currency and amount in cents. You can optionally configure a custom success redirect URL and enable email notifications with reminders. Returns the payment request ID and its public payment URL. A `403` error is returned if Brevo Payments is not activated or the account is not validated. +
+
+
+
+ #### 🔌 Usage
@@ -8159,6 +8863,20 @@ await client.payments.createPaymentRequest({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the details of a specific payment request by its ID. The response includes the reference, status (created, sent, reminderSent, or paid), cart details, notification configuration, contact ID, and the number of reminders sent. Returns a `404` error if no payment request matches the provided ID. +
+
+
+
+ #### 🔌 Usage
@@ -8210,6 +8928,20 @@ await client.payments.getPaymentRequest({
+#### 📝 Description + +
+
+ +
+
+ +Delete a payment request by its UUID. Once deleted, the payment request can no longer be accessed or paid. Returns a `404` error if no payment request matches the provided ID, and a `403` error if Brevo Payments is not activated or the account is not validated. +
+
+
+
+ #### 🔌 Usage
@@ -8418,10 +9150,12 @@ Create multiple events to track contacts' interactions in a single request.
```typescript -await client.event.createBatchEvents([{ - event_name: "order_created", - identifiers: {} - }]); +await client.event.createBatchEvents({ + events: [{ + event_name: "order_created", + identifiers: {} + }] +}); ```
@@ -8437,7 +9171,7 @@ await client.event.createBatchEvents([{
-**request:** `Brevo.CreateBatchEventsRequestItem[]` +**request:** `Brevo.CreateBatchEventsRequest`
@@ -8470,7 +9204,7 @@ await client.event.createBatchEvents([{
-This endpoint will show the list of all the events for the received emails. +This endpoint will show the list of all the events for the received emails. When no date range is provided, the last 30 days of events are returned by default.
@@ -8652,7 +9386,7 @@ await client.inboundParsing.getInboundEmailAttachment({
## Balance -
client.balance.getActiveBalancesApi({ ...params }) -> Brevo.BalanceLimit +
client.balance.getActiveBalancesApi({ ...params }) -> Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceResponse
@@ -8681,8 +9415,8 @@ Returns Active Balances ```typescript await client.balance.getActiveBalancesApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id" + contactId: 1000000, + balanceDefinitionId: "balanceDefinitionId" }); ``` @@ -9340,7 +10074,7 @@ await client.balance.deleteBalanceLimit({
-Returns balance list +Returns contact balances for a given balance definition across all subscriptions.
@@ -9356,7 +10090,8 @@ Returns balance list ```typescript await client.balance.getContactBalances({ - pid: "pid" + pid: "pid", + balanceDefinitionId: "balanceDefinitionId" }); ``` @@ -9426,7 +10161,7 @@ await client.balance.createBalanceOrder({ balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source" + source: "engine" }); ``` @@ -9625,7 +10360,7 @@ Returns transaction history ```typescript await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, + contactId: 1000000, balanceDefinitionId: "balanceDefinitionId" }); @@ -10609,7 +11344,7 @@ Subscribes to a loyalty program ```typescript await client.program.subscribeToLoyaltyProgram({ pid: "pid", - contactId: 1 + contactId: 1000000 }); ``` @@ -11986,7 +12721,7 @@ await client.tier.deleteTier({
The response payload for this endpoint has changed -You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). +You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/2023/2/7).
@@ -12041,6 +12776,20 @@ await client.emailCampaigns.getEmailCampaigns();
+#### 📝 Description + +
+
+ +
+
+ +Create a new email campaign. The campaign requires at minimum a name and sender details, and is created in draft status by default. You must provide email content via one of three mutually exclusive options: htmlContent (inline HTML), htmlUrl (remote URL), or templateId (existing template); additionally, A/B testing can be enabled by setting abTesting to true with subjectA and subjectB, but this is incompatible with sendAtBestTime. +
+
+
+
+ #### 🔌 Usage
@@ -12093,6 +12842,20 @@ await client.emailCampaigns.createEmailCampaign({
+#### 📝 Description + +
+
+ +
+
+ +Upload an image to your account''s image gallery by providing an absolute URL to the image. The maximum allowed image size is 2MB and supported formats are jpeg, jpg, png, bmp, and gif; local file uploads are not supported. +
+
+
+
+ #### 🔌 Usage
@@ -12144,6 +12907,20 @@ await client.emailCampaigns.uploadImageToGallery({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed information about a specific email campaign by its ID, including recipients, statistics, and HTML content. Use the statistics query parameter to select which statistics to include (globalStats, linksStats, statsByDomain, statsByDevice, or statsByBrowser); statsByDevice and statsByBrowser are only available on this single-campaign endpoint. You can exclude HTML content from the response by setting excludeHtmlContent to true. +
+
+
+
+ #### 🔌 Usage
@@ -12195,6 +12972,20 @@ await client.emailCampaigns.getEmailCampaign({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing email campaign''s properties such as name, subject, content, sender, recipients, schedule, and A/B testing configuration. The campaign must exist and the request body must contain at least one valid field to update. Only draft or scheduled campaigns can be modified; if sendAtBestTime is enabled, IP warmup will be automatically disabled. +
+
+
+
+ #### 🔌 Usage
@@ -12246,6 +13037,20 @@ await client.emailCampaigns.updateEmailCampaign({
+#### 📝 Description + +
+
+ +
+
+ +Delete an email campaign by its campaign ID. Only campaigns that have not been scheduled can be deleted; attempting to delete a campaign that has already been scheduled will return a 403 permission denied error. Related data in templates, newsletter builder, and schedule collections is also cleaned up. +
+
+
+
+ #### 🔌 Usage
@@ -12362,6 +13167,20 @@ await client.emailCampaigns.getAbTestCampaignResult({
+#### 📝 Description + +
+
+ +
+
+ +Export the recipients of a sent email campaign as an asynchronous process, filtered by recipient type (e.g. openers, clickers, hardBounces). The recipientsType field is required and determines which subset of recipients to export. An optional notifyURL webhook will be called once the export is complete, and the response returns a processId to track the export status. +
+
+
+
+ #### 🔌 Usage
@@ -12414,6 +13233,20 @@ await client.emailCampaigns.emailExportRecipients({
+#### 📝 Description + +
+
+ +
+
+ +Send an existing email campaign immediately by scheduling it for the current time. The campaign must have valid recipients and content configured before sending. The system verifies your account''s send limit and credit balance before dispatching; if credits are insufficient, a 402 error is returned. +
+
+
+
+ #### 🔌 Usage
@@ -12536,7 +13369,7 @@ await client.emailCampaigns.sendReport({
-#### 🔌 Usage +#### 📝 Description
@@ -12544,19 +13377,33 @@ await client.emailCampaigns.sendReport({
-```typescript -await client.emailCampaigns.sendTestEmail({ - campaignId: 1000000, - body: {} -}); - -``` +Send a test version of an email campaign to specified email addresses or your entire test list. If the emailTo array is left empty, the test mail will be sent to all addresses in your test list. You can send a maximum of 50 test emails per day.
-#### ⚙️ Parameters +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.emailCampaigns.sendTestEmail({ + campaignId: 1000000, + body: {} +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters
@@ -12653,6 +13500,20 @@ await client.emailCampaigns.getSharedTemplateUrl({
+#### 📝 Description + +
+
+ +
+
+ +Update the status of an email campaign, such as suspending, archiving, or replicating it. Available status values include suspended, archive, darchive, sent, queued, replicate, replicateTemplate, cancel, and draft. Note that the replicateTemplate status is only available for template type campaigns. +
+
+
+
+ #### 🔌 Usage
@@ -12706,6 +13567,20 @@ await client.emailCampaigns.updateCampaignStatus({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of all your SMS campaigns with their statistics and recipient information. Results can be filtered by status and date range, with a default limit of 500 and maximum of 1000 per page. The sort order defaults to descending by creation date; date filters are only available when status is not passed or is set to sent. +
+
+
+
+ #### 🔌 Usage
@@ -12755,6 +13630,20 @@ await client.smsCampaigns.getSmsCampaigns();
+#### 📝 Description + +
+
+ +
+
+ +Create a new SMS campaign with the required name, sender, and content fields. The sender name is limited to 11 alphanumeric characters or 15 numeric characters, and the content should stay within 160 characters per SMS segment. If a scheduledAt date is provided, listIds in recipients become mandatory; accounts under validation are limited to 4 total campaigns and campaigns with more than 10 recipients will be saved as draft. +
+
+
+
+ #### 🔌 Usage
@@ -12808,6 +13697,20 @@ await client.smsCampaigns.createSmsCampaign({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve detailed information about a specific SMS campaign by its ID, including campaign content, sender, recipients with list names, statistics (delivered, sent, bounces, unsubscriptions, answered), and tags. Unlike the list endpoint, recipients are returned as objects with id and name fields rather than plain IDs. +
+
+
+
+ #### 🔌 Usage
@@ -12859,6 +13762,20 @@ await client.smsCampaigns.getSmsCampaign({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing SMS campaign''s properties such as name, sender, content, recipients, scheduled date, organisation prefix, and unsubscribe instructions. The request body must contain at least one valid field to update. The campaign must exist and must be of type SMS; if a scheduledAt is provided, valid recipients must be present either in the request or already configured on the campaign. +
+
+
+
+ #### 🔌 Usage
@@ -12910,6 +13827,20 @@ await client.smsCampaigns.updateSmsCampaign({
+#### 📝 Description + +
+
+ +
+
+ +Delete an SMS campaign by its campaign ID. Only campaigns that have not been scheduled or sent can be deleted; attempting to delete a campaign that is queued, in process, or has been sent with recipients will return a 403 permission denied error. +
+
+
+
+ #### 🔌 Usage
@@ -13027,6 +13958,20 @@ await client.smsCampaigns.requestSmsRecipientExport({
+#### 📝 Description + +
+
+ +
+
+ +Send an existing SMS campaign immediately by scheduling it for the current time. The system verifies your account''s SMS credit balance before dispatching; if credits are insufficient or the remaining credit is less than the number of recipients, a 402 error is returned. The campaign must have valid recipients and content already configured. +
+
+
+
+ #### 🔌 Usage
@@ -13149,6 +14094,20 @@ await client.smsCampaigns.sendSmsReport({
+#### 📝 Description + +
+
+ +
+
+ +Send a test SMS to a specified phone number to preview the campaign before sending it to all recipients. The phone number must belong to one of your existing contacts in your Brevo account and must not be blacklisted. The number should include the country code (e.g. 33689965433). +
+
+
+
+ #### 🔌 Usage
@@ -13200,6 +14159,20 @@ await client.smsCampaigns.sendTestSms({
+#### 📝 Description + +
+
+ +
+
+ +Update the status of an SMS campaign, such as suspending, archiving, or replicating it. Available status values include suspended, archive, darchive, sent, queued, replicate, replicateTemplate, cancel, and draft. Note that the replicateTemplate status is only available for template type campaigns. +
+
+
+
+ #### 🔌 Usage
@@ -13253,6 +14226,20 @@ await client.smsCampaigns.updateSmsCampaignStatus({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of all your WhatsApp campaigns with their statistics and metadata. Results can be filtered by creation date range using startDate and endDate, with a default limit of 50 and maximum of 100 per page. The sort order defaults to descending by modification date. +
+
+
+
+ #### 🔌 Usage
@@ -13499,6 +14486,20 @@ await client.whatsAppCampaigns.createWhatsAppTemplate({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of all your WhatsApp templates with their status, category, language, and metadata. Results can be filtered by creation date range and optionally by source (Automation or Conversations), with a default limit of 50 and maximum of 100 per page. The sort order defaults to descending by modification date. +
+
+
+
+ #### 🔌 Usage
@@ -13752,6 +14753,20 @@ await client.whatsAppCampaigns.updateWhatsAppCampaign({
+#### 📝 Description + +
+
+ +
+
+ +Delete a WhatsApp campaign by its campaign ID. The campaign must exist; if the campaign ID is not found, a 404 error is returned. This action is permanent and cannot be undone. +
+
+
+
+ #### 🔌 Usage
@@ -13804,6 +14819,20 @@ await client.whatsAppCampaigns.deleteWhatsAppCampaign({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of companies with optional filtering, sorting, and search capabilities. Results are sorted by creation date in descending order by default, and can be filtered by attributes, linked contacts, linked deals, or modification/creation timestamps. +
+
+
+
+ #### 🔌 Usage
@@ -13853,6 +14882,20 @@ await client.companies.getAllCompanies();
+#### 📝 Description + +
+
+ +
+
+ +Create a new CRM company with the specified name, attributes, and optional associations to contacts and deals. The company name is required, and you can optionally provide a country code when a phone number attribute is included. +
+
+
+
+ #### 🔌 Usage
@@ -13967,6 +15010,20 @@ await client.companies.importCompaniesCreationAndUpdation({});
+#### 📝 Description + +
+
+ +
+
+ +Link or unlink contacts and deals with a specific company in a single request. You can simultaneously link new contacts/deals and unlink existing ones by providing the respective ID arrays in the request body. +
+
+
+
+ #### 🔌 Usage
@@ -14018,6 +15075,20 @@ await client.companies.linkAndUnlinkCompanyWithContactAndDeal({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the full details of a single company by its identifier, including its attributes, linked contacts, and linked deals. Returns a 404 error if the company does not exist, or a 403 error if the user lacks permission to view the company. +
+
+
+
+ #### 🔌 Usage
@@ -14069,6 +15140,20 @@ await client.companies.getACompany({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete a company by its identifier. The requesting user must be the company owner or have manage permission on companies; otherwise, a 403 Forbidden error is returned. +
+
+
+
+ #### 🔌 Usage
@@ -14120,6 +15205,20 @@ await client.companies.deleteACompany({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing company''s attributes, name, linked contacts, or linked deals. Note that passing `linkedContactsIds` or `linkedDealsIds` replaces the entire list of associations, so omitted IDs will be removed. The company name cannot be set to an empty string. +
+
+
+
+ #### 🔌 Usage
@@ -14171,7 +15270,21 @@ await client.companies.updateACompany({
-#### 🔌 Usage +#### 📝 Description + +
+
+ +
+
+ +Create a new custom attribute for companies or deals. The attribute label must be unique within the object type, cannot exceed 50 characters, and cannot use reserved names. For `single-select` or `multi-choice` attribute types, you must also provide the `optionsLabels` array. +
+
+
+
+ +#### 🔌 Usage
@@ -14224,6 +15337,20 @@ await client.companies.createACompanyDealAttribute({
+#### 📝 Description + +
+
+ +
+
+ +Delete an existing custom attribute by its identifier. This permanently removes the attribute definition and cleans up all references to it across companies or deals. System-default and non-editable attributes cannot be deleted. +
+
+
+
+ #### 🔌 Usage
@@ -14275,6 +15402,20 @@ await client.companies.deleteAnAttribute({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing custom attribute''s label or options. You can rename the attribute label or modify the available options for `single-select` and `multi-choice` attribute types. System-default attributes cannot be modified except for specific editable fields. +
+
+
+
+ #### 🔌 Usage
@@ -14326,6 +15467,20 @@ await client.companies.updateAnAttribute({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the list of all attributes defined for companies, including both system-default and custom attributes. Each attribute includes its label, internal name, type, required status, and available options for select-type attributes. +
+
+
+
+ #### 🔌 Usage
@@ -14368,6 +15523,20 @@ await client.companies.getCompanyAttributes();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the list of all attributes defined for deals, including both system-default and custom attributes. Each attribute includes its label, internal name, type, required status, and available options for select-type attributes. +
+
+
+
+ #### 🔌 Usage
@@ -14409,6 +15578,20 @@ await client.deals.getDealAttributes();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of deals with optional filtering, sorting, and search capabilities. Results can be filtered by attributes such as deal name or owner, linked companies, linked contacts, or modification/creation timestamps. Default sort order is descending by creation date. +
+
+
+
+ #### 🔌 Usage
@@ -14458,6 +15641,20 @@ await client.deals.getAllDeals();
+#### 📝 Description + +
+
+ +
+
+ +Create a new deal in the CRM with the specified name, attributes, and optional associations to contacts and companies. You can assign the deal to a specific pipeline and stage by providing `pipeline` and `deal_stage` attribute IDs, which can be retrieved from the pipeline details endpoint. +
+
+
+
+ #### 🔌 Usage
@@ -14572,6 +15769,20 @@ await client.deals.importDealsCreationAndUpdation({});
+#### 📝 Description + +
+
+ +
+
+ +Link or unlink contacts and companies with a specific deal in a single request. You can simultaneously link new contacts/companies and unlink existing ones by providing the respective ID arrays in the request body. +
+
+
+
+ #### 🔌 Usage
@@ -14623,6 +15834,20 @@ await client.deals.linkAndUnlinkADealWithContactsAndCompanies({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the full details of a single deal by its identifier, including its attributes, pipeline stage, linked contacts, and linked companies. Returns a 404 error if the deal does not exist. +
+
+
+
+ #### 🔌 Usage
@@ -14674,6 +15899,20 @@ await client.deals.getADeal({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete a deal by its identifier. The requesting user must be the deal owner or have manage permission on deals; otherwise, a 403 Forbidden error is returned. +
+
+
+
+ #### 🔌 Usage
@@ -14725,6 +15964,20 @@ await client.deals.deleteADeal({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing deal''s attributes, name, linked contacts, or linked companies. Note that passing `linkedContactsIds` or `linkedCompaniesIds` replaces the entire list of associations, so omitted IDs will be removed. To move a deal to a different pipeline or stage, provide both the `pipeline` and `deal_stage` attribute IDs. +
+
+
+
+ #### 🔌 Usage
@@ -14831,6 +16084,20 @@ await client.deals.getPipelineStages();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the list of all deal pipelines configured for your account, including each pipeline''s stages and settings. If no pipelines have been configured yet, a default pipeline is automatically created and returned. +
+
+
+
+ #### 🔌 Usage
@@ -14872,6 +16139,20 @@ await client.deals.getAllPipelines();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the details of a specific deal pipeline by its identifier, including its stages, stage ordering, and configuration. Use this endpoint to obtain the pipeline and stage IDs needed when creating or updating deals. +
+
+
+
+ #### 🔌 Usage
@@ -14924,6 +16205,20 @@ await client.deals.getAPipeline({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of CRM files with optional filtering by entity type, entity IDs, and date range. Results are sorted by creation date in descending order by default, with a default limit of 50 files per page. +
+
+
+
+ #### 🔌 Usage
@@ -14973,6 +16268,20 @@ await client.files.getAllFiles();
+#### 📝 Description + +
+
+ +
+
+ +Upload a file and associate it with a contact, company, or deal. The file must be sent as multipart form data with a maximum size of 10 MB. You can optionally link the file to a specific entity by providing the corresponding entity ID. +
+
+
+
+ #### 🔌 Usage
@@ -15024,6 +16333,20 @@ await client.files.uploadAFile({
+#### 📝 Description + +
+
+ +
+
+ +Get a temporary download URL for a CRM file by its identifier. The returned URL is valid for 5 minutes only and provides direct access to the file content. +
+
+
+
+ #### 🔌 Usage
@@ -15075,6 +16398,20 @@ await client.files.downloadAFile({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete a CRM file by its identifier. This removes the file from storage and unlinks it from any associated contacts, companies, or deals. +
+
+
+
+ #### 🔌 Usage
@@ -15126,6 +16463,20 @@ await client.files.deleteAFile({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the metadata and details of a specific CRM file by its identifier. This returns information such as the file name, size, type, creation date, and associated entities, but does not include the file content itself. +
+
+
+
+ #### 🔌 Usage
@@ -15178,6 +16529,20 @@ await client.files.getFileDetails({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of CRM notes with optional filtering by entity type, entity IDs, and date range. Results are sorted by creation date in descending order by default, with a default limit of 50 notes per page. +
+
+
+
+ #### 🔌 Usage
@@ -15227,6 +16592,20 @@ await client.notes.getAllNotes();
+#### 📝 Description + +
+
+ +
+
+ +Create a new CRM note and optionally associate it with contacts, companies, or deals. The note text content is required, and you can link the note to multiple entities simultaneously during creation. +
+
+
+
+ #### 🔌 Usage
@@ -15237,7 +16616,7 @@ await client.notes.getAllNotes(); ```typescript await client.notes.createANote({ - text: "In communication with client_dev for resolution of queries." + text: "

Meeting notes: Action item - visit Brevo for details.

" }); ``` @@ -15278,6 +16657,20 @@ await client.notes.createANote({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the full details of a single CRM note by its identifier. The response includes the note''s text content, creation date, author, and any associated contacts, companies, or deals. +
+
+
+
+ #### 🔌 Usage
@@ -15329,6 +16722,20 @@ await client.notes.getANote({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete a CRM note by its identifier. This removes the note and unlinks it from any associated contacts, companies, or deals. +
+
+
+
+ #### 🔌 Usage
@@ -15380,6 +16787,20 @@ await client.notes.deleteANote({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing CRM note''s text content and its associations with contacts, companies, or deals. You can modify the note text, change the pinned status, or update the linked entities. +
+
+
+
+ #### 🔌 Usage
@@ -15392,7 +16813,7 @@ await client.notes.deleteANote({ await client.notes.updateANote({ id: "id", body: { - text: "In communication with client_dev for resolution of queries." + text: "

Meeting notes: Action item - visit Brevo for details.

" } }); @@ -15435,6 +16856,20 @@ await client.notes.updateANote({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of CRM tasks with optional filtering by task type, status, date range, assignee, and linked entities (contacts, deals, companies). Results are sorted by creation date in descending order by default, with a default limit of 50 tasks per page. +
+
+
+
+ #### 🔌 Usage
@@ -15486,6 +16921,20 @@ await client.tasks.getAllTasks({
+#### 📝 Description + +
+
+ +
+
+ +Create a new CRM task with the specified name, type, due date, and optional associations to contacts, companies, or deals. A task requires a name, task type ID, and due date at minimum. You can also set a duration, notes, a reminder, and assign the task to a specific user. +
+
+
+
+ #### 🔌 Usage
@@ -15497,7 +16946,7 @@ await client.tasks.getAllTasks({ ```typescript await client.tasks.createATask({ date: "2021-11-01T17:44:54Z", - name: "Task: Connect with client_dev", + name: "Task: Connect with client", taskTypeId: "61a5cd07ca1347c82306ad09" }); @@ -15533,11 +16982,25 @@ await client.tasks.createATask({
-
- -
client.tasks.getATask({ ...params }) -> Brevo.Task -
-
+
+ +
client.tasks.getATask({ ...params }) -> Brevo.Task +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieve the full details of a single CRM task by its identifier. The response includes the task''s name, type, status, due date, duration, notes, assignee, reminder settings, and linked contacts, companies, or deals. +
+
+
+
#### 🔌 Usage @@ -15590,6 +17053,20 @@ await client.tasks.getATask({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete a CRM task by its identifier. This removes the task and cancels any associated reminders. The requesting user must be the task assignee or have manage permission on tasks. +
+
+
+
+ #### 🔌 Usage
@@ -15641,6 +17118,20 @@ await client.tasks.deleteATask({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing CRM task''s properties such as name, type, due date, status, duration, notes, assignee, reminder, or linked entities. Only the fields provided in the request body will be updated; omitted fields remain unchanged. +
+
+
+
+ #### 🔌 Usage
@@ -15688,10 +17179,24 @@ await client.tasks.updateATask({
-
client.tasks.getAllTaskTypes() -> Brevo.GetCrmTasktypesResponse +
client.tasks.getAllTaskTypes() -> Brevo.GetCrmTasktypesResponseItem[] +
+
+ +#### 📝 Description +
+
+
+ +Retrieve the list of all available task types, such as Email, Call, Meeting, Todo, Lunch, Deadline, and LinkedIn. If no task types exist yet, the default set is automatically created and returned. Use the task type ID when creating or updating tasks. +
+
+
+
+ #### 🔌 Usage
@@ -15867,6 +17372,20 @@ await client.transactionalWhatsApp.getWhatsappEventReport();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of transactional contacts that have been blocked or unsubscribed, along with the reason for blocking (e.g. hard bounce, admin blocked, spam complaint, or unsubscription via email/API/Marketing Automation). Both `startDate` and `endDate` must be provided together when filtering by date range, and neither date can be in the future. Results default to 50 per page (max 100) and are sorted in descending order of record creation unless overridden with the `sort` parameter. +
+
+
+
+ #### 🔌 Usage
@@ -15916,6 +17435,20 @@ await client.transactionalEmails.getTransacBlockedContacts();
+#### 📝 Description + +
+
+ +
+
+ +Unblock or resubscribe a transactional contact by removing their email address from the blacklist. The email address must be URL-encoded in the path parameter and must be a valid email format. If the contact is not found in the blocklist, a 404 error is returned. +
+
+
+
+ #### 🔌 Usage
@@ -16215,6 +17748,20 @@ await client.transactionalEmails.deleteHardbounces();
+#### 📝 Description + +
+
+ +
+
+ +Send a transactional email to one or more recipients, either using inline HTML content or a pre-built template via `templateId`. You can schedule emails for future delivery using `scheduledAt` (UTC, up to 5-minute delay), send multiple personalized versions with `messageVersions` (max 2000 total recipients, 99 per version), and attach files via URL or base64-encoded content. A `sender` and `subject` are required when no `templateId` is provided; when a `templateId` is used, the template''s sender and subject are applied unless overridden. +
+
+
+
+ #### 🔌 Usage
@@ -16537,6 +18084,20 @@ await client.transactionalEmails.getTransacEmailContent({
+#### 📝 Description + +
+
+ +
+
+ +Delete SMTP transactional log entries identified by a message ID (enclosed in angle brackets with an @ sign) or a valid email address. Optionally narrow the deletion to a specific date range using `from_date` and `to_date` query parameters (YYYY-MM-DD format). The operation also removes any associated stored email preview content. +
+
+
+
+ #### 🔌 Usage
@@ -16714,6 +18275,20 @@ await client.transactionalEmails.getEmailEventReport();
+#### 📝 Description + +
+
+ +
+
+ +This endpoint will show the aggregated stats per day for the past 10 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 30 days. +
+
+
+
+ #### 🔌 Usage
@@ -16763,6 +18338,20 @@ await client.transactionalEmails.getSmtpReport();
+#### 📝 Description + +
+
+ +
+
+ +Generate a fully rendered preview of a transactional email template by resolving dynamic variables. Provide either an `email` address (to populate variables from the contact''s attributes) or a `params` object with key-value pairs for manual substitution; at least one of these is required alongside the mandatory `templateId`. The response includes the rendered HTML, subject, sender details, preview text, and any feed names used in the template. +
+
+
+
+ #### 🔌 Usage
@@ -16790,7 +18379,7 @@ await client.transactionalEmails.postPreviewSmtpEmailTemplates({
-**request:** `unknown` +**request:** `Brevo.PostPreviewSmtpEmailTemplatesRequest`
@@ -16814,6 +18403,20 @@ await client.transactionalEmails.postPreviewSmtpEmailTemplates({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of all transactional email templates (including automation templates) with their details such as name, subject, sender, status, HTML content, and timestamps. Results default to 50 per page (max 1000) and are sorted in descending creation order unless overridden. You can filter by active/inactive status using `templateStatus` and by editor type using `editorType` (currently only `richTextEditor` is supported). +
+
+
+
+ #### 🔌 Usage
@@ -16863,6 +18466,20 @@ await client.transactionalEmails.getSmtpTemplates();
+#### 📝 Description + +
+
+ +
+
+ +Create a new transactional email template with the specified sender, subject, and content. The `sender`, `subject`, and `templateName` fields are required. Template content can be provided via `htmlContent` (minimum 10 characters) or `htmlUrl`; at least one must be supplied. Templates are created as inactive by default unless `isActive` is explicitly set to `true`. +
+
+
+
+ #### 🔌 Usage
@@ -16916,6 +18533,20 @@ await client.transactionalEmails.createSmtpTemplate({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve the full details of a specific transactional email template by its numeric ID or custom template identifier string. The response includes the template name, subject, sender information, HTML content, active status, creation and modification timestamps, reply-to address, tag, and a `doiTemplate` flag indicating whether the template is a double opt-in template (detected by the presence of optin-related tags or variables in the content). +
+
+
+
+ #### 🔌 Usage
@@ -16967,6 +18598,20 @@ await client.transactionalEmails.getSmtpTemplate({
+#### 📝 Description + +
+
+ +
+
+ +Update an existing transactional email template by its numeric ID or custom template identifier string. All fields in the request body are optional; only the provided fields will be updated. You can update the template name, subject, sender, reply-to address, HTML content (via `htmlContent` or `htmlUrl`), active status, tag, attachment URL, and the personalized `toField`. Only one of sender email or sender ID should be provided per request. +
+
+
+
+ #### 🔌 Usage
@@ -17018,6 +18663,20 @@ await client.transactionalEmails.updateSmtpTemplate({
+#### 📝 Description + +
+
+ +
+
+ +Permanently delete a transactional email template by its numeric ID. Only inactive templates can be deleted; attempting to delete an active template returns a 405 error. To deactivate a template before deletion, use `PUT /smtp/templates/{templateId}` with `isActive` set to `false`. Deletion also removes associated newsletter template data and triggers asynchronous cleanup of shared assets. +
+
+
+
+ #### 🔌 Usage
@@ -17069,6 +18728,20 @@ await client.transactionalEmails.deleteSmtpTemplate({
+#### 📝 Description + +
+
+ +
+
+ +Send a test email of the specified transactional template to one or more recipients. Provide an array of email addresses in the `emailTo` field; if left empty, the test mail is sent to your entire test list. You can send a maximum of 50 test emails per day, and all provided email addresses must be valid. +
+
+
+
+ #### 🔌 Usage
@@ -17190,6 +18863,20 @@ await client.transactionalSms.sendAsyncTransactionalSms({
+#### 📝 Description + +
+
+ +
+
+ +Send a transactional SMS message to a single mobile number. The `sender`, `recipient`, and either `content` or `templateId` fields are required. The sender name is limited to 11 alphanumeric characters or 15 numeric characters, and the recipient must be a valid international phone number (6-15 digits, optional leading +). Tags can be a string or an array of up to 10 strings. The SMS type defaults to `transactional` but can be set to `marketing`; if the content includes a stop code, it is automatically treated as marketing. Returns the message ID, SMS count, credits used, and remaining credits. +
+
+
+
+ #### 🔌 Usage
@@ -17242,6 +18929,20 @@ await client.transactionalSms.sendTransacSms({
+#### 📝 Description + +
+
+ +
+
+ +Retrieve an aggregated report of your transactional SMS activity over a specified time period, including counts for requests, delivered, hard bounces, soft bounces, blocked, unsubscribed, replied, accepted, rejected, and skipped messages. Filter by date range using `startDate` and `endDate` (both required together, YYYY-MM-DD format) or by a number of past `days` (not compatible with date range). You can further narrow results by `tag`. If no date filter is provided, the report covers all available data and returns the auto-detected date range. +
+
+
+
+ #### 🔌 Usage
@@ -17291,6 +18992,20 @@ await client.transactionalSms.getTransacAggregatedSmsReport();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a paginated list of individual SMS event records (unaggregated), including event type, phone number, message ID, timestamp, tag, and reason or reply content where applicable. Results default to 50 per page (max 100) and are sorted in descending order unless overridden. Filter by date range (`startDate`/`endDate`), past `days` (not compatible with date range), specific `event` type (e.g. delivered, bounces, replies), `phoneNumber`, or `tags`. Bounce events include the failure reason, and reply events include the reply content. +
+
+
+
+ #### 🔌 Usage
@@ -17340,6 +19055,20 @@ await client.transactionalSms.getSmsEvents();
+#### 📝 Description + +
+
+ +
+
+ +Retrieve a day-by-day breakdown of your transactional SMS activity, with each entry containing the date and counts for requests, delivered, hard bounces, soft bounces, blocked, unsubscribed, replied, accepted, rejected, and skipped messages. Filter by date range using `startDate` and `endDate` (both required together, YYYY-MM-DD format), by a number of past `days` (not compatible with date range), or by `tag`. Results are sorted in descending order by default unless overridden with the `sort` parameter. +
+
+
+
+ #### 🔌 Usage
diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 00b1d03..1fcac98 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -5,6 +5,12 @@ import { mergeHeaders } from "./core/headers.js"; import * as core from "./core/index.js"; import type * as environments from "./environments.js"; +export type AuthOption = + | false + | core.AuthProvider["getAuthRequest"] + | core.AuthProvider + | HeaderAuthProvider.AuthOptions; + export type BaseClientOptions = { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ @@ -19,6 +25,8 @@ export type BaseClientOptions = { fetch?: typeof fetch; /** Configure logging for the client. */ logging?: core.logging.LogConfig | core.logging.Logger; + /** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */ + auth?: AuthOption; } & HeaderAuthProvider.AuthOptions; export interface BaseRequestOptions { @@ -51,8 +59,8 @@ export function normalizeClientOptions { const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth; + + if (options.auth === false) { + normalized.authProvider = new core.NoOpAuthProvider(); + return normalized; + } + if (options.auth != null) { + if (typeof options.auth === "function") { + normalized.authProvider = { getAuthRequest: options.auth }; + return normalized; + } + if (core.isAuthProvider(options.auth)) { + normalized.authProvider = options.auth; + return normalized; + } + Object.assign(normalized, options.auth); + } + const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized); normalized.authProvider ??= new HeaderAuthProvider(normalizedWithNoOpAuthProvider); return normalized; diff --git a/src/api/resources/account/client/Client.ts b/src/api/resources/account/client/Client.ts index 883de54..fce474b 100644 --- a/src/api/resources/account/client/Client.ts +++ b/src/api/resources/account/client/Client.ts @@ -30,29 +30,28 @@ export class AccountClient { * - Check plan details (type, credits, expiration) * - Get relay information (for transactional emails) * - Check Marketing Automation status - * - View date/time preferences and account settings * - Access organization and user identifiers * * **Key information returned:** * - Complete account details (organization ID, user ID, company information) * - Address and contact information * - Plan configurations and credit allocations across different verticals - * - Marketing Automation settings and tracker key + * - Marketing Automation settings and tracker key (when enabled) * - SMTP relay configuration for transactional emails - * - Date/time preferences and account settings * - Enterprise features availability status * * **Important considerations:** * - Provides comprehensive account overview for billing and configuration management * - Essential for understanding current plan limitations and feature availability - * - Marketing Automation key required for advanced automation features - * - Plan verticals show detailed breakdown across Marketing, Chat, and CRM categories + * - Marketing Automation key is only returned when Marketing Automation is enabled on the account + * - Plan verticals show detailed breakdown across Marketing, Chat, and CRM categories (only returned when plan verticals are available) * - Relay configuration crucial for transactional email setup and deliverability - * - Date/time preferences affect campaign scheduling and reporting displays * - Enterprise status determines access to advanced features and sub-account management * * @param {AccountClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.account.getAccount() */ @@ -80,7 +79,7 @@ export class AccountClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -92,11 +91,16 @@ export class AccountClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/account"); @@ -163,7 +167,11 @@ export class AccountClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/account/types/GetAccountResponse.ts b/src/api/resources/account/types/GetAccountResponse.ts index 4816f3d..44890b7 100644 --- a/src/api/resources/account/types/GetAccountResponse.ts +++ b/src/api/resources/account/types/GetAccountResponse.ts @@ -16,9 +16,7 @@ export interface GetAccountResponse { /** Last Name */ lastName: string; /** Address informations */ - address: GetAccountResponse.Address; - /** User's date and time preferences */ - dateTimePreferences: GetAccountResponse.DateTimePreferences; + address?: GetAccountResponse.Address | undefined; marketingAutomation?: GetAccountResponse.MarketingAutomation | undefined; /** Information about your plans and credits */ plan: GetAccountResponse.Plan.Item[]; @@ -43,18 +41,6 @@ export namespace GetAccountResponse { zipCode: string; } - /** - * User's date and time preferences - */ - export interface DateTimePreferences { - /** User's timezone setting */ - timezone: string; - /** Preferred time format (12 or 24 hour) */ - timeFormat: string; - /** Preferred date format */ - dateFormat: string; - } - export interface MarketingAutomation { /** * Status of Marketing Automation Plateform activation @@ -117,11 +103,11 @@ export namespace GetAccountResponse { /** Current status of the plan */ status: Item.Status; /** Plan start date (Unix timestamp) */ - startDate: string; + startDate?: string | undefined; /** Plan end date (Unix timestamp) */ - endDate: string; + endDate?: string | undefined; /** User seat information for the plan */ - users: Item.Users | null; + users?: (Item.Users | null) | undefined; /** Credits allocated for this plan category (optional, may not be present for all plan categories) */ credits?: string | undefined; } diff --git a/src/api/resources/balance/client/Client.ts b/src/api/resources/balance/client/Client.ts index cdca428..21adfbe 100644 --- a/src/api/resources/balance/client/Client.ts +++ b/src/api/resources/balance/client/Client.ts @@ -37,38 +37,29 @@ export class BalanceClient { * @example * await client.balance.getActiveBalancesApi({ * pid: "pid", - * contact_id: 1, - * balance_definition_id: "balance_definition_id" + * contactId: 1000000, + * balanceDefinitionId: "balanceDefinitionId" * }) */ public getActiveBalancesApi( request: Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceRequest, requestOptions?: BalanceClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getActiveBalancesApi(request, requestOptions)); } private async __getActiveBalancesApi( request: Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceRequest, requestOptions?: BalanceClient.RequestOptions, - ): Promise> { - const { - pid, - limit, - offset, - sort_field: sortField, - sort, - contact_id: contactId, - balance_definition_id: balanceDefinitionId, - includeInternal, - } = request; + ): Promise> { + const { pid, limit, offset, sortField, sort, contactId, balanceDefinitionId, includeInternal } = request; const _queryParams: Record = { limit, offset, - sort_field: sortField, - sort, - contact_id: contactId, - balance_definition_id: balanceDefinitionId, + sortField: sortField != null ? sortField : undefined, + sort: sort != null ? sort : undefined, + contactId, + balanceDefinitionId, includeInternal, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -86,7 +77,11 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -94,7 +89,10 @@ export class BalanceClient { logging: this._options.logging, }); if (_response.ok) { - return { data: _response.body as Brevo.BalanceLimit, rawResponse: _response.rawResponse }; + return { + data: _response.body as Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceResponse, + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { @@ -179,7 +177,11 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -270,7 +272,7 @@ export class BalanceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -363,7 +365,11 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -455,7 +461,7 @@ export class BalanceClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -547,7 +553,7 @@ export class BalanceClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -641,7 +647,7 @@ export class BalanceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -735,7 +741,11 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -830,7 +840,7 @@ export class BalanceClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -921,7 +931,7 @@ export class BalanceClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -965,7 +975,7 @@ export class BalanceClient { } /** - * Returns balance list + * Returns contact balances for a given balance definition across all subscriptions. * * @param {Brevo.GetContactBalancesRequest} request * @param {BalanceClient.RequestOptions} requestOptions - Request-specific configuration. @@ -978,7 +988,8 @@ export class BalanceClient { * * @example * await client.balance.getContactBalances({ - * pid: "pid" + * pid: "pid", + * balanceDefinitionId: "balanceDefinitionId" * }) */ public getContactBalances( @@ -992,9 +1003,14 @@ export class BalanceClient { request: Brevo.GetContactBalancesRequest, requestOptions?: BalanceClient.RequestOptions, ): Promise> { - const { pid, includeInternal } = request; + const { pid, includeInternal, limit, offset, sort, sortField, balanceDefinitionId } = request; const _queryParams: Record = { includeInternal, + limit, + offset, + sort: sort != null ? sort : undefined, + sortField: sortField != null ? sortField : undefined, + balanceDefinitionId, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -1011,7 +1027,11 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1072,7 +1092,7 @@ export class BalanceClient { * balanceDefinitionId: "balanceDefinitionId", * contactId: 1, * dueAt: "dueAt", - * source: "source" + * source: "engine" * }) */ public createBalanceOrder( @@ -1103,7 +1123,7 @@ export class BalanceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1194,7 +1214,11 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1287,7 +1311,7 @@ export class BalanceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1350,7 +1374,7 @@ export class BalanceClient { * @example * await client.balance.getTransactionHistoryApi({ * pid: "pid", - * contactId: 1, + * contactId: 1000000, * balanceDefinitionId: "balanceDefinitionId" * }) */ @@ -1373,9 +1397,9 @@ export class BalanceClient { sort, contactId, balanceDefinitionId, - filters, status, transactionType, + loyaltySubscriptionId, } = request; const _queryParams: Record = { limit, @@ -1384,9 +1408,9 @@ export class BalanceClient { sort: sort != null ? sort : undefined, contactId, balanceDefinitionId, - filters, status: status != null ? status : undefined, transactionType: transactionType != null ? transactionType : undefined, + loyaltySubscriptionId, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -1403,7 +1427,11 @@ export class BalanceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1496,7 +1524,7 @@ export class BalanceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1586,7 +1614,7 @@ export class BalanceClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1674,7 +1702,7 @@ export class BalanceClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/balance/client/requests/BeginTransactionRequest.ts b/src/api/resources/balance/client/requests/BeginTransactionRequest.ts index 7ecd06e..88defe7 100644 --- a/src/api/resources/balance/client/requests/BeginTransactionRequest.ts +++ b/src/api/resources/balance/client/requests/BeginTransactionRequest.ts @@ -11,22 +11,33 @@ export interface BeginTransactionRequest { /** Loyalty Program Id */ pid: string; - /** Unique identifier for the loyalty subscription (required unless `contactId` is provided). */ - LoyaltySubscriptionId?: string; - /** Transaction amount (must be provided). */ + /** Transaction amount. A positive value creates a credit transaction and a negative value creates a debit transaction (unless transactionType is explicitly provided). */ amount: number; - /** Whether the transaction should be automatically completed. */ - autoComplete?: boolean; + /** Explicit transaction type. If not provided, the type is inferred from the sign of the amount (positive = credit, negative = debit). */ + transactionType?: BeginTransactionRequest.TransactionType; /** Unique identifier (UUID) of the associated balance definition. */ balanceDefinitionId: string; - /** Optional expiry time for the balance in minutes (must be greater than 0 if provided). */ - balanceExpiryInMinutes?: number; - /** Unique identifier of the contact involved in the transaction (required unless `LoyaltySubscriptionId` is provided). */ + /** Unique identifier of the contact involved in the transaction. Required unless `LoyaltySubscriptionId` is provided. */ contactId?: number; - /** Optional timestamp specifying when the transaction occurred. */ - eventTime?: string; + /** Unique identifier for the loyalty subscription. Required unless `contactId` is provided. */ + LoyaltySubscriptionId?: string; /** Optional metadata associated with the transaction. */ meta?: Record; - /** Optional time-to-live for the transaction (must be greater than 0 if provided). */ + /** Time-to-live for the transaction in seconds. Must be at least 10 seconds if provided. */ ttl?: number; + /** Timestamp specifying when the transaction event occurred (ISO 8601 / RFC 3339 format). */ + eventTime?: string; + /** Whether the transaction should be automatically completed. */ + autoComplete?: boolean; + /** Expiry time for the balance in minutes. Must be greater than 0 if provided. Only applicable when autoComplete is true. */ + balanceExpiryInMinutes?: number; +} + +export namespace BeginTransactionRequest { + /** Explicit transaction type. If not provided, the type is inferred from the sign of the amount (positive = credit, negative = debit). */ + export const TransactionType = { + Credit: "credit", + Debit: "debit", + } as const; + export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; } diff --git a/src/api/resources/balance/client/requests/CreateBalanceOrderRequest.ts b/src/api/resources/balance/client/requests/CreateBalanceOrderRequest.ts index 126012a..a895748 100644 --- a/src/api/resources/balance/client/requests/CreateBalanceOrderRequest.ts +++ b/src/api/resources/balance/client/requests/CreateBalanceOrderRequest.ts @@ -8,7 +8,7 @@ * balanceDefinitionId: "balanceDefinitionId", * contactId: 1, * dueAt: "dueAt", - * source: "source" + * source: "engine" * } */ export interface CreateBalanceOrderRequest { @@ -26,6 +26,15 @@ export interface CreateBalanceOrderRequest { expiresAt?: string; /** Optional metadata associated with the order. */ meta?: Record; - /** Specifies the origin of the order (`engine` or `user`). */ - source: string; + /** Specifies the origin of the order. */ + source: CreateBalanceOrderRequest.Source; +} + +export namespace CreateBalanceOrderRequest { + /** Specifies the origin of the order. */ + export const Source = { + Engine: "engine", + User: "user", + } as const; + export type Source = (typeof Source)[keyof typeof Source]; } diff --git a/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts b/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts index 676e240..4f1b5ab 100644 --- a/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts +++ b/src/api/resources/balance/client/requests/GetContactBalancesRequest.ts @@ -1,9 +1,12 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Brevo from "../../../../index.js"; + /** * @example * { - * pid: "pid" + * pid: "pid", + * balanceDefinitionId: "balanceDefinitionId" * } */ export interface GetContactBalancesRequest { @@ -11,4 +14,14 @@ export interface GetContactBalancesRequest { pid: string; /** Include balances tied to internal definitions. */ includeInternal?: boolean; + /** Limit the number of records returned */ + limit?: number; + /** Skip a number of records */ + offset?: number; + /** Sort order */ + sort?: Brevo.GetContactBalancesRequestSort; + /** Field to sort by */ + sortField?: Brevo.GetContactBalancesRequestSortField; + /** Balance Definition ID (required) */ + balanceDefinitionId: string; } diff --git a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts index cdced4d..5f11f9f 100644 --- a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts +++ b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.ts @@ -1,11 +1,13 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Brevo from "../../../../index.js"; + /** * @example * { * pid: "pid", - * contact_id: 1, - * balance_definition_id: "balance_definition_id" + * contactId: 1000000, + * balanceDefinitionId: "balanceDefinitionId" * } */ export interface GetLoyaltyBalanceProgramsPidActiveBalanceRequest { @@ -16,13 +18,13 @@ export interface GetLoyaltyBalanceProgramsPidActiveBalanceRequest { /** Offset */ offset?: number; /** Sort Field */ - sort_field?: string; + sortField?: "createdAt"; /** Sort Order */ - sort?: string; + sort?: Brevo.GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort; /** Contact ID */ - contact_id: number; + contactId: number; /** Balance Definition ID */ - balance_definition_id: string; + balanceDefinitionId: string; /** Include balances tied to internal definitions. */ includeInternal?: boolean; } diff --git a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts index 915f95e..aa39b6a 100644 --- a/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts +++ b/src/api/resources/balance/client/requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.ts @@ -6,7 +6,7 @@ import type * as Brevo from "../../../../index.js"; * @example * { * pid: "pid", - * contactId: 1, + * contactId: 1000000, * balanceDefinitionId: "balanceDefinitionId" * } */ @@ -19,16 +19,16 @@ export interface GetLoyaltyBalanceProgramsPidTransactionHistoryRequest { offset?: number; /** Field to sort by */ sortField?: "createdAt"; - /** Sort order, either asc or desc */ + /** Sort order */ sort?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort; /** Contact ID */ contactId: number; /** Balance Definition ID */ balanceDefinitionId: string; - /** Filters to apply */ - filters?: string | string[]; - /** Transaction status filter. Allowed values: draft, completed, rejected, cancelled, expired */ + /** Transaction status filter */ status?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus; - /** Transaction type filter. Allowed values: credit, debit */ + /** Transaction type filter */ transactionType?: Brevo.GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType; + /** Loyalty Subscription ID filter */ + loyaltySubscriptionId?: string; } diff --git a/src/api/resources/balance/client/requests/index.ts b/src/api/resources/balance/client/requests/index.ts index a782eb4..600d81b 100644 --- a/src/api/resources/balance/client/requests/index.ts +++ b/src/api/resources/balance/client/requests/index.ts @@ -1,8 +1,8 @@ -export type { BeginTransactionRequest } from "./BeginTransactionRequest.js"; +export { BeginTransactionRequest } from "./BeginTransactionRequest.js"; export type { CancelTransactionRequest } from "./CancelTransactionRequest.js"; export type { CompleteTransactionRequest } from "./CompleteTransactionRequest.js"; export { CreateBalanceLimitRequest } from "./CreateBalanceLimitRequest.js"; -export type { CreateBalanceOrderRequest } from "./CreateBalanceOrderRequest.js"; +export { CreateBalanceOrderRequest } from "./CreateBalanceOrderRequest.js"; export type { DeleteBalanceDefinitionRequest } from "./DeleteBalanceDefinitionRequest.js"; export type { DeleteBalanceLimitRequest } from "./DeleteBalanceLimitRequest.js"; export type { GetBalanceDefinitionListRequest } from "./GetBalanceDefinitionListRequest.js"; diff --git a/src/api/resources/balance/types/GetContactBalancesRequestSort.ts b/src/api/resources/balance/types/GetContactBalancesRequestSort.ts new file mode 100644 index 0000000..5111e7d --- /dev/null +++ b/src/api/resources/balance/types/GetContactBalancesRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetContactBalancesRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetContactBalancesRequestSort = + (typeof GetContactBalancesRequestSort)[keyof typeof GetContactBalancesRequestSort]; diff --git a/src/api/resources/balance/types/GetContactBalancesRequestSortField.ts b/src/api/resources/balance/types/GetContactBalancesRequestSortField.ts new file mode 100644 index 0000000..d3b7135 --- /dev/null +++ b/src/api/resources/balance/types/GetContactBalancesRequestSortField.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetContactBalancesRequestSortField = { + UpdatedAt: "updatedAt", + Value: "value", +} as const; +export type GetContactBalancesRequestSortField = + (typeof GetContactBalancesRequestSortField)[keyof typeof GetContactBalancesRequestSortField]; diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort.ts new file mode 100644 index 0000000..bb0ebad --- /dev/null +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort = + (typeof GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort)[keyof typeof GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort]; diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidActiveBalanceResponse.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidActiveBalanceResponse.ts new file mode 100644 index 0000000..8b83e48 --- /dev/null +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidActiveBalanceResponse.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Active balance response for a specific contact and balance definition. + */ +export interface GetLoyaltyBalanceProgramsPidActiveBalanceResponse { + /** Total number of active balances. */ + count?: number | undefined; + /** Unique identifier of the loyalty program. */ + loyaltyProgramId?: string | undefined; + /** Unique identifier of the contact. */ + contactId?: number | undefined; + /** Unique identifier of the balance definition. */ + balanceDefinitionId?: string | undefined; + /** List of active balances. */ + activeBalances?: GetLoyaltyBalanceProgramsPidActiveBalanceResponse.ActiveBalances.Item[] | undefined; +} + +export namespace GetLoyaltyBalanceProgramsPidActiveBalanceResponse { + export type ActiveBalances = ActiveBalances.Item[]; + + export namespace ActiveBalances { + export interface Item { + /** Unique identifier of the balance entry. */ + id?: string | undefined; + /** Current balance amount. */ + amount?: number | undefined; + /** Timestamp when the balance was created. */ + createdAt?: string | undefined; + /** Timestamp when the balance expires (if applicable). */ + expiresAt?: string | undefined; + } + } +} diff --git a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts index 741d358..b0e1102 100644 --- a/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts +++ b/src/api/resources/balance/types/GetLoyaltyBalanceProgramsPidTransactionHistoryResponse.ts @@ -26,6 +26,8 @@ export namespace GetLoyaltyBalanceProgramsPidTransactionHistoryResponse { export interface Item { /** The transaction amount. */ amount?: number | undefined; + /** The type of the transaction. */ + transactionType?: Item.TransactionType | undefined; /** Expiration date of the balance associated with this transaction. */ balanceExpirationDate?: string | undefined; /** Timestamp when the transaction was canceled, if applicable. */ @@ -45,5 +47,14 @@ export namespace GetLoyaltyBalanceProgramsPidTransactionHistoryResponse { /** Current status of the transaction (e.g., pending, completed, rejected). */ status?: string | undefined; } + + export namespace Item { + /** The type of the transaction. */ + export const TransactionType = { + Credit: "credit", + Debit: "debit", + } as const; + export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; + } } } diff --git a/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts b/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts index 01c0686..467238f 100644 --- a/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts +++ b/src/api/resources/balance/types/GetSubscriptionBalancesResponse.ts @@ -1,6 +1,11 @@ // This file was auto-generated by Fern from our API Definition. export interface GetSubscriptionBalancesResponse { + /** Unique identifier of the loyalty program. */ + loyaltyProgramId?: string | undefined; + /** Unique identifier of the contact. */ + contactId?: number | undefined; + /** Aggregate balance per balance definition. */ balance?: GetSubscriptionBalancesResponse.Balance.Item[] | undefined; } @@ -9,9 +14,9 @@ export namespace GetSubscriptionBalancesResponse { export namespace Balance { export interface Item { - /** balance definition ID */ + /** Balance definition ID. */ balanceDefinitionId?: string | undefined; - /** Unique identifier for the balance definition associated with this aggregate balance */ + /** Aggregate balance value for this definition. */ value?: number | undefined; } } diff --git a/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts b/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts index 97d48f7..7971a16 100644 --- a/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts +++ b/src/api/resources/balance/types/PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse.ts @@ -1,22 +1,22 @@ // This file was auto-generated by Fern from our API Definition. export interface PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse { - /** The current amount available in the balance */ + /** Unique identifier for the balance. */ + id?: string | undefined; + /** The current amount available in the balance. */ amount?: number | undefined; - /** balance definition ID */ - balanceDefinitionId?: string | undefined; - /** Timestamp of when the balance was last consumed */ - consumedAt?: string | undefined; - /** contact ID */ + /** Loyalty program ID. */ + loyaltyProgramId?: string | undefined; + /** Organization ID. */ + organizationId?: number | undefined; + /** Contact ID. */ contactId?: number | undefined; - /** Timestamp of when the balance was created */ + /** Balance definition ID. */ + balanceDefinitionId?: string | undefined; + /** Timestamp of when the balance was created. */ createdAt?: string | undefined; - /** Expiration timestamp of the balance */ + /** Expiration timestamp of the balance. */ expiresAt?: string | undefined; - /** Unique identifier for the balance */ - id?: string | undefined; - /** loyalty program ID */ - loyaltyProgramId?: string | undefined; - /** organization ID */ - organizationId?: number | undefined; + /** Timestamp of when the balance was last consumed. */ + consumedAt?: string | undefined; } diff --git a/src/api/resources/balance/types/index.ts b/src/api/resources/balance/types/index.ts index 5714e84..54867f8 100644 --- a/src/api/resources/balance/types/index.ts +++ b/src/api/resources/balance/types/index.ts @@ -5,7 +5,11 @@ export * from "./GetBalanceDefinitionListRequestVersion.js"; export * from "./GetBalanceDefinitionListResponse.js"; export * from "./GetBalanceDefinitionRequestVersion.js"; export * from "./GetBalanceLimitRequestVersion.js"; +export * from "./GetContactBalancesRequestSort.js"; +export * from "./GetContactBalancesRequestSortField.js"; export * from "./GetContactBalancesResponse.js"; +export * from "./GetLoyaltyBalanceProgramsPidActiveBalanceRequestSort.js"; +export * from "./GetLoyaltyBalanceProgramsPidActiveBalanceResponse.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.js"; export * from "./GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.js"; diff --git a/src/api/resources/companies/client/Client.ts b/src/api/resources/companies/client/Client.ts index 025cc1c..e2866b6 100644 --- a/src/api/resources/companies/client/Client.ts +++ b/src/api/resources/companies/client/Client.ts @@ -24,6 +24,8 @@ export class CompaniesClient { } /** + * Retrieve a paginated list of companies with optional filtering, sorting, and search capabilities. Results are sorted by creation date in descending order by default, and can be filtered by attributes, linked contacts, linked deals, or modification/creation timestamps. + * * @param {Brevo.GetCompaniesRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -43,10 +45,19 @@ export class CompaniesClient { request: Brevo.GetCompaniesRequest = {}, requestOptions?: CompaniesClient.RequestOptions, ): Promise> { - const { filters, linkedContactsIds, linkedDealsIds, modifiedSince, createdSince, page, limit, sort, sortBy } = - request; + const { + "filters[attributes.name]": filtersAttributesName, + linkedContactsIds, + linkedDealsIds, + modifiedSince, + createdSince, + page, + limit, + sort, + sortBy, + } = request; const _queryParams: Record = { - filters, + "filters[attributes.name]": filtersAttributesName, linkedContactsIds, linkedDealsIds, modifiedSince, @@ -71,7 +82,11 @@ export class CompaniesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -99,6 +114,8 @@ export class CompaniesClient { } /** + * Create a new CRM company with the specified name, attributes, and optional associations to contacts and deals. The company name is required, and you can optionally provide a country code when a phone number attribute is included. + * * @param {Brevo.PostCompaniesRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -136,7 +153,7 @@ export class CompaniesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -214,7 +231,7 @@ export class CompaniesClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, @@ -245,6 +262,8 @@ export class CompaniesClient { } /** + * Link or unlink contacts and deals with a specific company in a single request. You can simultaneously link new contacts/deals and unlink existing ones by providing the respective ID arrays in the request body. + * * @param {Brevo.PatchCompaniesLinkUnlinkIdRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -285,7 +304,7 @@ export class CompaniesClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -315,6 +334,8 @@ export class CompaniesClient { } /** + * Retrieve the full details of a single company by its identifier, including its attributes, linked contacts, and linked deals. Returns a 404 error if the company does not exist, or a 403 error if the user lacks permission to view the company. + * * @param {Brevo.GetCompaniesIdRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -353,7 +374,7 @@ export class CompaniesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -383,6 +404,8 @@ export class CompaniesClient { } /** + * Permanently delete a company by its identifier. The requesting user must be the company owner or have manage permission on companies; otherwise, a 403 Forbidden error is returned. + * * @param {Brevo.DeleteCompaniesIdRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -421,7 +444,7 @@ export class CompaniesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -451,6 +474,8 @@ export class CompaniesClient { } /** + * Update an existing company''s attributes, name, linked contacts, or linked deals. Note that passing `linkedContactsIds` or `linkedDealsIds` replaces the entire list of associations, so omitted IDs will be removed. The company name cannot be set to an empty string. + * * @param {Brevo.PatchCompaniesIdRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -490,7 +515,7 @@ export class CompaniesClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -522,6 +547,8 @@ export class CompaniesClient { } /** + * Create a new custom attribute for companies or deals. The attribute label must be unique within the object type, cannot exceed 50 characters, and cannot use reserved names. For `single-select` or `multi-choice` attribute types, you must also provide the `optionsLabels` array. + * * @param {Brevo.PostCrmAttributesRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -561,7 +588,7 @@ export class CompaniesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -591,6 +618,8 @@ export class CompaniesClient { } /** + * Delete an existing custom attribute by its identifier. This permanently removes the attribute definition and cleans up all references to it across companies or deals. System-default and non-editable attributes cannot be deleted. + * * @param {Brevo.DeleteCrmAttributesIdRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -629,7 +658,7 @@ export class CompaniesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -659,6 +688,8 @@ export class CompaniesClient { } /** + * Update an existing custom attribute''s label or options. You can rename the attribute label or modify the available options for `single-select` and `multi-choice` attribute types. System-default attributes cannot be modified except for specific editable fields. + * * @param {Brevo.PatchCrmAttributesIdRequest} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -698,7 +729,7 @@ export class CompaniesClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -730,8 +761,12 @@ export class CompaniesClient { } /** + * Retrieve the list of all attributes defined for companies, including both system-default and custom attributes. Each attribute includes its label, internal name, type, required status, and available options for select-type attributes. + * * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.companies.getCompanyAttributes() */ @@ -759,7 +794,7 @@ export class CompaniesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -774,11 +809,16 @@ export class CompaniesClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/attributes/companies"); diff --git a/src/api/resources/companies/client/requests/GetCompaniesRequest.ts b/src/api/resources/companies/client/requests/GetCompaniesRequest.ts index 3e9bb7a..0c8bcc0 100644 --- a/src/api/resources/companies/client/requests/GetCompaniesRequest.ts +++ b/src/api/resources/companies/client/requests/GetCompaniesRequest.ts @@ -7,15 +7,15 @@ import type * as Brevo from "../../../../index.js"; * {} */ export interface GetCompaniesRequest { - /** Filter by attrbutes. If you have filter for owner on your side please send it as {"attributes.owner":"6299dcf3874a14eacbc65c46"} */ - filters?: string; + /** Filter by attributes. If you have a filter for the owner on your side please send it as filters[attributes.owner] and utilize the account email for the filtering. */ + "filters[attributes.name]"?: string; /** Filter by linked contacts ids */ linkedContactsIds?: number; /** Filter by linked Deals ids */ linkedDealsIds?: string; - /** Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ + /** Filter (urlencoded) the companies modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ modifiedSince?: string; - /** Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ + /** Filter (urlencoded) the companies created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ createdSince?: string; /** Index of the first document of the page */ page?: number; diff --git a/src/api/resources/companies/client/requests/PatchCompaniesIdRequest.ts b/src/api/resources/companies/client/requests/PatchCompaniesIdRequest.ts index c4cc485..b5212a1 100644 --- a/src/api/resources/companies/client/requests/PatchCompaniesIdRequest.ts +++ b/src/api/resources/companies/client/requests/PatchCompaniesIdRequest.ts @@ -14,7 +14,7 @@ export interface PatchCompaniesIdRequest { countryCode?: number; /** Warning - Using PATCH on linkedContactIds replaces the list of linked contacts. Omitted IDs will be removed. */ linkedContactsIds?: number[]; - /** Warning - Using PATCH on linkedDealsIds replaces the list of linked contacts. Omitted IDs will be removed. */ + /** Warning - Using PATCH on linkedDealsIds replaces the list of linked deals. Omitted IDs will be removed. */ linkedDealsIds?: string[]; /** Name of company */ name?: string; diff --git a/src/api/resources/companies/client/requests/PostCompaniesImportRequest.ts b/src/api/resources/companies/client/requests/PostCompaniesImportRequest.ts index 212b9d3..4470149 100644 --- a/src/api/resources/companies/client/requests/PostCompaniesImportRequest.ts +++ b/src/api/resources/companies/client/requests/PostCompaniesImportRequest.ts @@ -7,7 +7,7 @@ import type * as core from "../../../../../core/index.js"; * {} */ export interface PostCompaniesImportRequest { - /** The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name */ + /** The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update companies] (b) associated_contact (c) associated_deal (f) any other attribute with internal name */ file?: core.file.Uploadable | undefined; /** * The mapping options in JSON format. Here is an example of the JSON structure: ```json { diff --git a/src/api/resources/companies/client/requests/PostCrmAttributesRequest.ts b/src/api/resources/companies/client/requests/PostCrmAttributesRequest.ts index 8a617eb..4de1e5a 100644 --- a/src/api/resources/companies/client/requests/PostCrmAttributesRequest.ts +++ b/src/api/resources/companies/client/requests/PostCrmAttributesRequest.ts @@ -15,7 +15,7 @@ export interface PostCrmAttributesRequest { description?: string; /** The label for the attribute (max 50 characters, cannot be empty) */ label: string; - /** The type of object the attribute belongs to (prefilled with `companies`, mandatory) */ + /** The type of object the attribute belongs to. Must be either `companies` or `deals`. */ objectType: PostCrmAttributesRequest.ObjectType; /** Options for multi-choice or single-select attributes */ optionsLabels?: string[]; @@ -33,7 +33,7 @@ export namespace PostCrmAttributesRequest { MultiChoice: "multi-choice", } as const; export type AttributeType = (typeof AttributeType)[keyof typeof AttributeType]; - /** The type of object the attribute belongs to (prefilled with `companies`, mandatory) */ + /** The type of object the attribute belongs to. Must be either `companies` or `deals`. */ export const ObjectType = { Companies: "companies", Deals: "deals", diff --git a/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts b/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts index 7ddbd7d..5947558 100644 --- a/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts +++ b/src/api/resources/companies/types/GetCrmAttributesCompaniesResponseItem.ts @@ -1,12 +1,30 @@ // This file was auto-generated by Fern from our API Definition. /** - * List of attributes + * Company attribute details */ export interface GetCrmAttributesCompaniesResponseItem { - attributeOptions?: Record[] | undefined; - attributeTypeName?: string | undefined; + /** Internal name of the attribute */ internalName?: string | undefined; - isRequired?: boolean | undefined; + /** Type of the attribute */ + attributeTypeName?: string | undefined; + /** Display label of the attribute */ label?: string | undefined; + /** Options for single-select or multi-choice attributes */ + attributeOptions?: GetCrmAttributesCompaniesResponseItem.AttributeOptions.Item[] | undefined; + /** Whether this attribute is required */ + isRequired?: boolean | undefined; + /** Whether this attribute value is read-only */ + isValueReadonly?: boolean | undefined; +} + +export namespace GetCrmAttributesCompaniesResponseItem { + export type AttributeOptions = AttributeOptions.Item[]; + + export namespace AttributeOptions { + export interface Item { + key?: string | undefined; + value?: string | undefined; + } + } } diff --git a/src/api/resources/contacts/client/Client.ts b/src/api/resources/contacts/client/Client.ts index df3e57e..9d3ddb8 100644 --- a/src/api/resources/contacts/client/Client.ts +++ b/src/api/resources/contacts/client/Client.ts @@ -23,6 +23,8 @@ export class ContactsClient { } /** + * Retrieve all contacts from your Brevo account with support for pagination, filtering, and sorting. Results default to 50 contacts per page (maximum 1000) sorted in descending order of creation, and can be filtered by modification date, creation date, contact IDs (up to 20), list IDs, segment ID, or contact attributes using the equals operator. Note that either listIds or segmentId can be passed but not both simultaneously. + * * @param {Brevo.GetContactsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -43,13 +45,14 @@ export class ContactsClient { request: Brevo.GetContactsRequest = {}, requestOptions?: ContactsClient.RequestOptions, ): Promise> { - const { limit, offset, modifiedSince, createdSince, sort, segmentId, listIds, filter } = request; + const { limit, offset, modifiedSince, createdSince, sort, ids, segmentId, listIds, filter } = request; const _queryParams: Record = { limit, offset, modifiedSince, createdSince, sort: sort != null ? sort : undefined, + ids, segmentId, listIds, filter, @@ -69,7 +72,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -142,7 +149,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -180,8 +187,12 @@ export class ContactsClient { } /** + * Retrieve all contact attributes defined in your Brevo account, grouped by category (normal, transactional, category, calculated, global). Each attribute includes its name, type, and category, along with enumeration values for category-type attributes and options for multiple-choice-type attributes. + * * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.contacts.getAttributes() */ @@ -209,7 +220,7 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -221,17 +232,24 @@ export class ContactsClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/contacts/attributes"); } /** + * Create a new contact attribute under the specified category and name. The required body properties depend on the category: use "type" for normal, transactional, or category attributes; use "value" for calculated or global attributes; use "enumeration" for category attributes; and use "multiCategoryOptions" for normal multiple-choice attributes. None of the category or multicategory option values can exceed 200 characters. + * * @param {Brevo.CreateAttributeRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -271,7 +289,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -306,6 +324,8 @@ export class ContactsClient { } /** + * Update an existing contact attribute identified by its category and name. For category-type attributes, you can update the enumeration values; for calculated or global attributes, update the computed value formula; and for normal multiple-choice attributes, update the multicategory options. None of the category or multicategory option values can exceed 200 characters. + * * @param {Brevo.UpdateAttributeRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -346,7 +366,7 @@ export class ContactsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -383,6 +403,8 @@ export class ContactsClient { } /** + * Permanently delete an existing contact attribute by its category and name. The attribute must exist in the specified category (normal, transactional, category, calculated, or global), otherwise a 404 error is returned. + * * @param {Brevo.DeleteAttributeRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -422,7 +444,7 @@ export class ContactsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -457,6 +479,8 @@ export class ContactsClient { } /** + * Delete a specific option from an existing multiple-choice contact attribute. The attribute type must be "multiple-choice", and both the attribute name and the option to delete must already exist in your account. + * * @param {Brevo.DeleteMultiAttributeOptionsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -497,7 +521,7 @@ export class ContactsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -532,6 +556,8 @@ export class ContactsClient { } /** + * Update multiple contacts in a single API call by passing an array of contact objects. Each contact in the array must be identified by one of: email, id, or sms (only one identifier per contact). You can update attributes, blacklist status, list memberships, ext_id, and transactional email forbidden senders for each contact in the batch. + * * @param {Brevo.UpdateBatchContactsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -567,7 +593,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -639,7 +665,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -714,7 +740,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -795,7 +821,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -823,6 +853,8 @@ export class ContactsClient { } /** + * Create a new folder to organize your contact lists. Folders serve as containers for grouping related lists together. The folder name is required and must be provided in the request body. + * * @param {Brevo.CreateUpdateFolder} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -858,7 +890,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -930,7 +962,7 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -960,6 +992,8 @@ export class ContactsClient { } /** + * Update the name of an existing folder identified by its ID. The new folder name must be provided in the request body. Returns a 404 error if the folder ID does not exist. + * * @param {Brevo.UpdateFolderRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1000,7 +1034,7 @@ export class ContactsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1032,6 +1066,8 @@ export class ContactsClient { } /** + * Permanently delete a folder identified by its ID. Deleting a folder will also delete all the contact lists contained within it. This action cannot be undone. + * * @param {Brevo.DeleteFolderRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1070,7 +1106,7 @@ export class ContactsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1152,7 +1188,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1224,7 +1264,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1298,7 +1338,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1326,6 +1370,8 @@ export class ContactsClient { } /** + * Create a new contact list inside a specified folder. Both the list name and the parent folder ID are required. The newly created list will be empty and ready to receive contacts via the add contacts endpoint. + * * @param {Brevo.CreateListRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1364,7 +1410,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1394,6 +1440,8 @@ export class ContactsClient { } /** + * Retrieve the details of a specific contact list by its ID, including its name, folder ID, creation date, subscriber counts, and campaign statistics. You can optionally filter campaign statistics by providing startDate and endDate parameters (both must be used together in YYYY-MM-DD format). + * * @param {Brevo.GetListRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1436,7 +1484,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1466,6 +1518,8 @@ export class ContactsClient { } /** + * Update an existing contact list identified by its ID. You can update the list name, move it to a different folder by providing a new folderId, or both. Only one of the two parameters (name, folderId) needs to be provided per request. + * * @param {Brevo.UpdateListRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1505,7 +1559,7 @@ export class ContactsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1537,6 +1591,8 @@ export class ContactsClient { } /** + * Permanently delete a contact list identified by its ID. The contacts in the list are not deleted; they are only removed from this list. Returns a 404 error if the list ID does not exist. + * * @param {Brevo.DeleteListRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1575,7 +1631,7 @@ export class ContactsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1605,11 +1661,14 @@ export class ContactsClient { } /** + * Retrieve all contacts belonging to a specific list, identified by its list ID. Results are paginated with a default of 50 contacts per page (maximum 500) and sorted in descending order of creation. You can optionally filter contacts by their modification date using the modifiedSince parameter. + * * @param {Brevo.GetContactsFromListRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.TooManyRequestsError} * * @example * await client.contacts.getContactsFromList({ @@ -1649,7 +1708,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1666,6 +1729,11 @@ export class ContactsClient { throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); case 404: throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Brevo.TooManyRequestsError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); default: throw new errors.BrevoError({ statusCode: _response.error.statusCode, @@ -1742,7 +1810,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1845,7 +1913,7 @@ export class ContactsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1882,6 +1950,8 @@ export class ContactsClient { } /** + * Retrieve all contact segments defined in your Brevo account with support for pagination and sorting. Results default to 10 segments per page (maximum 50) sorted in descending order of creation. Each segment includes its ID, name, category name, and last update timestamp. + * * @param {Brevo.GetSegmentsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1922,7 +1992,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1997,7 +2071,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2074,7 +2152,11 @@ export class ContactsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -2155,7 +2237,11 @@ export class ContactsClient { ), method: "DELETE", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2190,6 +2276,8 @@ export class ContactsClient { } /** + * Retrieve email campaign statistics for a specific contact identified by email address or numeric ID. Statistics include messages sent, opens, clicks, hard/soft bounces, deliveries, unsubscriptions, complaints, and transactional attributes. By default, data covers the last 90 days; use startDate and endDate parameters (YYYY-MM-DD) to specify a custom range with a maximum span of 90 days. + * * @param {Brevo.GetContactStatsRequest} request * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -2232,7 +2320,11 @@ export class ContactsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/contacts/client/requests/CreateContactRequest.ts b/src/api/resources/contacts/client/requests/CreateContactRequest.ts index 85077ff..70a63f5 100644 --- a/src/api/resources/contacts/client/requests/CreateContactRequest.ts +++ b/src/api/resources/contacts/client/requests/CreateContactRequest.ts @@ -21,6 +21,10 @@ export interface CreateContactRequest { smtpBlacklistSender?: string[]; /** Facilitate to update the existing contact in the same request (updateEnabled = true) */ updateEnabled?: boolean; + /** When true, if the contact being created shares an identifier (email, SMS, ext_id, whatsapp, landline) with an existing contact, the two contacts are force-merged. The contact with the most recent `last_modified` timestamp is retained; the other is deleted. When false (default), a 4xx error is returned on identifier conflict. */ + forceMerge?: boolean; + /** When true, the response returns the `id` of the surviving contact after merge. */ + getId?: boolean; } export namespace CreateContactRequest { diff --git a/src/api/resources/contacts/client/requests/GetContactInfoRequest.ts b/src/api/resources/contacts/client/requests/GetContactInfoRequest.ts index 0df5b8e..5f2ee5a 100644 --- a/src/api/resources/contacts/client/requests/GetContactInfoRequest.ts +++ b/src/api/resources/contacts/client/requests/GetContactInfoRequest.ts @@ -13,8 +13,8 @@ export interface GetContactInfoRequest { identifier: Brevo.GetContactInfoRequestIdentifier; /** email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute */ identifierType?: Brevo.GetContactInfoRequestIdentifierType; - /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate */ + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate. Must not be greater than the current date. */ startDate?: string; - /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. */ + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Must not be greater than the current date. */ endDate?: string; } diff --git a/src/api/resources/contacts/client/requests/GetContactStatsRequest.ts b/src/api/resources/contacts/client/requests/GetContactStatsRequest.ts index 0324ab0..ee47c0a 100644 --- a/src/api/resources/contacts/client/requests/GetContactStatsRequest.ts +++ b/src/api/resources/contacts/client/requests/GetContactStatsRequest.ts @@ -11,8 +11,8 @@ import type * as Brevo from "../../../../index.js"; export interface GetContactStatsRequest { /** Email (urlencoded) OR ID of the contact */ identifier: Brevo.GetContactStatsRequestIdentifier; - /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate */ + /** **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate. Must not be greater than the current date. */ startDate?: string; - /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days */ + /** **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Must not be greater than the current date. Maximum difference between startDate and endDate should not be greater than 90 days. */ endDate?: string; } diff --git a/src/api/resources/contacts/client/requests/GetContactsRequest.ts b/src/api/resources/contacts/client/requests/GetContactsRequest.ts index fad0d39..44a5801 100644 --- a/src/api/resources/contacts/client/requests/GetContactsRequest.ts +++ b/src/api/resources/contacts/client/requests/GetContactsRequest.ts @@ -17,7 +17,9 @@ export interface GetContactsRequest { createdSince?: string; /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ sort?: Brevo.GetContactsRequestSort; - /** Id of the segment. **Either listIds or segmentId can be passed.** */ + /** Filter by a list of contact IDs. You can pass a **maximum of 20 IDs**. All elements must be integers. */ + ids?: number | number[]; + /** Id of the segment. **Either listIds or segmentId can be passed.** Must be a positive integer (minimum value of 1). */ segmentId?: number; /** Ids of the list. **Either listIds or segmentId can be passed.** */ listIds?: number | number[]; diff --git a/src/api/resources/contacts/client/requests/GetListRequest.ts b/src/api/resources/contacts/client/requests/GetListRequest.ts index 8a5f023..5ce31af 100644 --- a/src/api/resources/contacts/client/requests/GetListRequest.ts +++ b/src/api/resources/contacts/client/requests/GetListRequest.ts @@ -9,7 +9,7 @@ export interface GetListRequest { /** Id of the list */ listId: number; - /** **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** */ + /** **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** */ startDate?: string; /** **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result** */ endDate?: string; diff --git a/src/api/resources/contacts/client/requests/UpdateContactRequest.ts b/src/api/resources/contacts/client/requests/UpdateContactRequest.ts index c67887b..1503193 100644 --- a/src/api/resources/contacts/client/requests/UpdateContactRequest.ts +++ b/src/api/resources/contacts/client/requests/UpdateContactRequest.ts @@ -9,9 +9,9 @@ import type * as Brevo from "../../../../index.js"; * } */ export interface UpdateContactRequest { - /** Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value */ + /** Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE_NUMBER attribute value */ identifier: Brevo.UpdateContactRequestIdentifier; - /** email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute */ + /** email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute */ identifierType?: Brevo.UpdateContactRequestIdentifierType; /** Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, **{ "EMAIL":"newemail@domain.com", "FNAME":"Ellie", "LNAME":"Roger", "COUNTRIES":["India","China"]}**. The attribute's parameter should be passed in capital letter while updating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored .Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}** */ attributes?: Record; @@ -27,6 +27,8 @@ export interface UpdateContactRequest { smtpBlacklistSender?: string[]; /** Ids of the lists to remove the contact from */ unlinkListIds?: number[]; + /** When true, if the contact being updated shares an identifier (email, SMS, ext_id, whatsapp, landline) with an existing contact, the two contacts are force-merged. The contact with the most recent `last_modified` timestamp is retained; the other is deleted. When false (default), a 4xx error is returned on identifier conflict. */ + forceMerge?: boolean; } export namespace UpdateContactRequest { diff --git a/src/api/resources/contacts/types/GetAttributesResponse.ts b/src/api/resources/contacts/types/GetAttributesResponse.ts index 3480d56..7d3de20 100644 --- a/src/api/resources/contacts/types/GetAttributesResponse.ts +++ b/src/api/resources/contacts/types/GetAttributesResponse.ts @@ -40,8 +40,10 @@ export namespace GetAttributesResponse { export interface Item { /** Label of the "category" type attribute */ label: string; - /** ID of Value of the "category" type attribute */ + /** Numeric ID of the "category" type attribute value. Set to 0 when the raw value cannot be converted to an integer (for example non-numeric values such as "en" or "fr"). Refer to `valueStr` for the original string representation. */ value: number; + /** String representation of the "category" type attribute value. Always contains the original value as stored. Use this field when the attribute value is non-numeric (e.g. "en", "fr") or when you need the exact string form alongside the numeric `value`. */ + valueStr: string; } } diff --git a/src/api/resources/contacts/types/GetContactInfoResponse.ts b/src/api/resources/contacts/types/GetContactInfoResponse.ts index 3123d63..9c0da83 100644 --- a/src/api/resources/contacts/types/GetContactInfoResponse.ts +++ b/src/api/resources/contacts/types/GetContactInfoResponse.ts @@ -17,6 +17,8 @@ export interface GetContactInfoResponse { modifiedAt: string; /** Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) */ smsBlacklisted: boolean; + /** Blacklist status for WhatsApp campaigns (true=blacklisted, false=not blacklisted) */ + whatsappBlacklisted: boolean; /** Campaign statistics of the contact */ statistics: GetContactInfoResponse.Statistics; } @@ -37,13 +39,13 @@ export namespace GetContactInfoResponse { complaints?: Statistics.Complaints.Item[] | undefined; /** Listing of the delivered campaign for the contact */ delivered?: Statistics.Delivered.Item[] | undefined; - /** Listing of the hardbounes generated by the contact */ + /** Listing of the hard bounces generated by the contact */ hardBounces?: Statistics.HardBounces.Item[] | undefined; /** Listing of the sent campaign for the contact */ messagesSent?: Statistics.MessagesSent.Item[] | undefined; /** Listing of the openings generated by the contact */ opened?: Statistics.Opened.Item[] | undefined; - /** Listing of the softbounes generated by the contact */ + /** Listing of the soft bounces generated by the contact */ softBounces?: Statistics.SoftBounces.Item[] | undefined; /** Listing of the transactional attributes for the contact */ transacAttributes?: Statistics.TransacAttributes.Item[] | undefined; diff --git a/src/api/resources/contacts/types/GetSegmentsResponse.ts b/src/api/resources/contacts/types/GetSegmentsResponse.ts index 0171aea..2ef1902 100644 --- a/src/api/resources/contacts/types/GetSegmentsResponse.ts +++ b/src/api/resources/contacts/types/GetSegmentsResponse.ts @@ -14,11 +14,11 @@ export namespace GetSegmentsResponse { export interface Item { /** Name of the Segment Category */ categoryName: string; - /** ID of the list */ + /** ID of the segment */ id: number; /** Name of the Segment */ segmentName: string; - /** Updation UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ) */ + /** Last update UTC date-time of the segment (YYYY-MM-DDTHH:mm:ss.SSSZ) */ updatedAt?: string | undefined; } } diff --git a/src/api/resources/conversations/client/Client.ts b/src/api/resources/conversations/client/Client.ts index 72a8a7c..8934d33 100644 --- a/src/api/resources/conversations/client/Client.ts +++ b/src/api/resources/conversations/client/Client.ts @@ -23,7 +23,7 @@ export class ConversationsClient { } /** - * We recommend pinging this endpoint every minute for as long as the agent has to be considered online. + * Sets the agent's status to online for 2-3 minutes. We recommend pinging this endpoint every minute for as long as the agent has to be considered online. You must provide either `agentId` alone, or all three of `agentEmail` + `agentName` + `receivedFrom`. * * @param {Brevo.PostConversationsAgentOnlinePingRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -71,7 +71,7 @@ export class ConversationsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -106,6 +106,8 @@ export class ConversationsClient { } /** + * Send a message as an agent to an existing visitor's conversation. You must provide either `agentId` alone, or all three of `agentEmail` + `agentName` + `receivedFrom` to identify the agent. + * * @param {Brevo.PostConversationsMessagesRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -162,7 +164,7 @@ export class ConversationsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -192,6 +194,8 @@ export class ConversationsClient { } /** + * Retrieve a single message by its ID. + * * @param {Brevo.GetConversationsMessagesIdRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -230,7 +234,7 @@ export class ConversationsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -260,7 +264,7 @@ export class ConversationsClient { } /** - * Only agents’ messages can be edited. + * Update the text of a message sent by an agent. Only messages of type `agent` can be edited. The `text` and `html` fields of the message will be updated. * * @param {Brevo.PutConversationsMessagesIdRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -302,7 +306,7 @@ export class ConversationsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -334,7 +338,7 @@ export class ConversationsClient { } /** - * Only agents’ messages can be deleted. + * Delete a message sent by an agent. Only messages of type `agent` can be deleted. * * @param {Brevo.DeleteConversationsMessagesIdRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -374,7 +378,7 @@ export class ConversationsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -409,7 +413,7 @@ export class ConversationsClient { } /** - * Example of automated messages: order status, announce new features in your web app, etc. + * Send an automated (pushed) message to a visitor on behalf of an agent. Example use cases: order status updates, announcing new features in your web app, etc. * * @param {Brevo.PostConversationsPushedMessagesRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -419,20 +423,20 @@ export class ConversationsClient { * @example * await client.conversations.sendAnAutomatedMessageToAVisitor({ * groupId: "PjRBMhWGen6aRHjif", - * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" * }) * * @example * await client.conversations.sendAnAutomatedMessageToAVisitor({ - * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" * }) * * @example * await client.conversations.sendAnAutomatedMessageToAVisitor({ * agentId: "d9nKoegKSjmCtyK78", - * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" * }) */ @@ -463,7 +467,7 @@ export class ConversationsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -498,6 +502,8 @@ export class ConversationsClient { } /** + * Retrieve a single automated (pushed) message by its ID. + * * @param {Brevo.GetConversationsPushedMessagesIdRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -536,7 +542,7 @@ export class ConversationsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -571,6 +577,8 @@ export class ConversationsClient { } /** + * Update the text of an automated (pushed) message. The `text` and `html` fields of the message will be updated. + * * @param {Brevo.PutConversationsPushedMessagesIdRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -580,7 +588,7 @@ export class ConversationsClient { * @example * await client.conversations.updateAnAutomatedMessage({ * id: "id", - * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54" + * text: "Your order has shipped! Here's your tracking number: 9114 5847 4668 7775 9233 54" * }) */ public updateAnAutomatedMessage( @@ -611,7 +619,7 @@ export class ConversationsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -648,6 +656,8 @@ export class ConversationsClient { } /** + * Delete an automated (pushed) message by its ID. + * * @param {Brevo.DeleteConversationsPushedMessagesIdRequest} request * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -686,7 +696,7 @@ export class ConversationsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -761,7 +771,7 @@ export class ConversationsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/conversations/client/requests/PostConversationsAgentOnlinePingRequest.ts b/src/api/resources/conversations/client/requests/PostConversationsAgentOnlinePingRequest.ts index 83ed09b..7dcabda 100644 --- a/src/api/resources/conversations/client/requests/PostConversationsAgentOnlinePingRequest.ts +++ b/src/api/resources/conversations/client/requests/PostConversationsAgentOnlinePingRequest.ts @@ -14,12 +14,12 @@ * } */ export interface PostConversationsAgentOnlinePingRequest { - /** agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. */ - agentEmail?: unknown; - /** agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). */ - agentId?: unknown; - /** agent name */ - agentName?: unknown; - /** mark your messages to distinguish messages created by you from the others. */ - receivedFrom?: unknown; + /** Agent's email address. When sending online pings from a standalone system, it's hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there's no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically. */ + agentEmail?: string; + /** Agent ID. It can be found on the agent's page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). */ + agentId?: string; + /** Agent's name. */ + agentName?: string; + /** Mark your messages to distinguish messages created by you from the others. */ + receivedFrom?: string; } diff --git a/src/api/resources/conversations/client/requests/PostConversationsMessagesRequest.ts b/src/api/resources/conversations/client/requests/PostConversationsMessagesRequest.ts index a42ca62..be0eae1 100644 --- a/src/api/resources/conversations/client/requests/PostConversationsMessagesRequest.ts +++ b/src/api/resources/conversations/client/requests/PostConversationsMessagesRequest.ts @@ -26,14 +26,16 @@ * } */ export interface PostConversationsMessagesRequest { - /** agent email. When sending messages from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. */ - agentEmail?: unknown; - /** agent ID. It can be found on agent’s page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). */ - agentId?: unknown; - /** agent name */ - agentName?: unknown; - /** mark your messages to distinguish messages created by you from the others. */ - receivedFrom?: unknown; - text?: unknown; - visitorId?: unknown; + /** Agent's email address. When sending messages from a standalone system, it's hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. */ + agentEmail?: string; + /** Agent ID. It can be found on the agent's page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required). */ + agentId?: string; + /** Agent's name. */ + agentName?: string; + /** Mark your messages to distinguish messages created by you from the others. */ + receivedFrom?: string; + /** Message text. */ + text: string; + /** Visitor's ID received from a webhook or generated by you to bind an existing user account to Conversations. */ + visitorId: string; } diff --git a/src/api/resources/conversations/client/requests/PostConversationsPushedMessagesRequest.ts b/src/api/resources/conversations/client/requests/PostConversationsPushedMessagesRequest.ts index fb466bf..ede5f2b 100644 --- a/src/api/resources/conversations/client/requests/PostConversationsPushedMessagesRequest.ts +++ b/src/api/resources/conversations/client/requests/PostConversationsPushedMessagesRequest.ts @@ -4,28 +4,30 @@ * @example * { * groupId: "PjRBMhWGen6aRHjif", - * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" * } * * @example * { - * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" * } * * @example * { * agentId: "d9nKoegKSjmCtyK78", - * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + * text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", * visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg" * } */ export interface PostConversationsPushedMessagesRequest { - /** agent ID. It can be found on agent’s page or received from a webhook. */ - agentId?: unknown; - /** group ID. It can be found on group’s page. */ - groupId?: unknown; - text?: unknown; - visitorId?: unknown; + /** Agent ID. It can be found on the agent's page or received from a webhook. */ + agentId?: string; + /** Group ID. It can be found on the group's page. */ + groupId?: string; + /** Message text. */ + text: string; + /** Visitor's ID received from a webhook or generated by you to bind an existing user account to Conversations. */ + visitorId: string; } diff --git a/src/api/resources/conversations/client/requests/PutConversationsMessagesIdRequest.ts b/src/api/resources/conversations/client/requests/PutConversationsMessagesIdRequest.ts index 881c908..fb2747d 100644 --- a/src/api/resources/conversations/client/requests/PutConversationsMessagesIdRequest.ts +++ b/src/api/resources/conversations/client/requests/PutConversationsMessagesIdRequest.ts @@ -10,6 +10,6 @@ export interface PutConversationsMessagesIdRequest { /** ID of the message */ id: string; - /** edited message text */ + /** The new message text. */ text: string; } diff --git a/src/api/resources/conversations/client/requests/PutConversationsPushedMessagesIdRequest.ts b/src/api/resources/conversations/client/requests/PutConversationsPushedMessagesIdRequest.ts index a66209a..9e476f4 100644 --- a/src/api/resources/conversations/client/requests/PutConversationsPushedMessagesIdRequest.ts +++ b/src/api/resources/conversations/client/requests/PutConversationsPushedMessagesIdRequest.ts @@ -4,12 +4,12 @@ * @example * { * id: "id", - * text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54" + * text: "Your order has shipped! Here's your tracking number: 9114 5847 4668 7775 9233 54" * } */ export interface PutConversationsPushedMessagesIdRequest { /** ID of the message */ id: string; - /** edited message text */ + /** The new message text. */ text: string; } diff --git a/src/api/resources/coupons/client/Client.ts b/src/api/resources/coupons/client/Client.ts index 64331ff..93e6e79 100644 --- a/src/api/resources/coupons/client/Client.ts +++ b/src/api/resources/coupons/client/Client.ts @@ -23,6 +23,8 @@ export class CouponsClient { } /** + * Retrieve a paginated list of all coupon collections in your Brevo account. Results can be sorted by creation date, remaining coupons count, or expiration date, in ascending or descending order. Pagination defaults to 50 collections per page (maximum 100). + * * @param {Brevo.GetCouponCollectionsRequest} request * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -65,7 +67,11 @@ export class CouponsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -95,6 +101,8 @@ export class CouponsClient { } /** + * Create a new coupon collection with a name and a default coupon value. You can optionally set an expiration date in RFC3339 format and configure alert thresholds to receive email notifications when remaining coupons or remaining days before expiration fall below a specified number. The collection ID is auto-generated as a UUID and returned in the response. + * * @param {Brevo.CreateCouponCollectionRequest} request * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -134,7 +142,7 @@ export class CouponsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -166,6 +174,8 @@ export class CouponsClient { } /** + * Retrieve the details of a single coupon collection by its UUID. The response includes the collection name, default coupon value, total and remaining coupon counts, and creation timestamp. Returns a `404` error if no collection matches the provided ID. + * * @param {Brevo.GetCouponCollectionRequest} request * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -205,7 +215,7 @@ export class CouponsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -237,6 +247,8 @@ export class CouponsClient { } /** + * Update an existing coupon collection by its UUID. You can modify the default coupon value, set or remove the expiration date (pass `null` to remove), and configure or disable alert thresholds for remaining coupons or remaining days. Only the fields included in the request body are updated; omitted fields remain unchanged. + * * @param {Brevo.UpdateCouponCollectionRequest} request * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -276,7 +288,7 @@ export class CouponsClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -308,6 +320,8 @@ export class CouponsClient { } /** + * Add coupons to an existing coupon collection. The `coupons` array must contain between 1 and 10,000 unique coupon code strings, all associated with the specified `collectionId`. Coupon creation is processed asynchronously and a `204` status is returned immediately upon acceptance. Returns a `404` error if the specified coupon collection does not exist. + * * @param {Brevo.CreateCouponsRequest} request * @param {CouponsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -348,7 +362,7 @@ export class CouponsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/customObjects/client/Client.ts b/src/api/resources/customObjects/client/Client.ts index 012c9ad..7d44f9b 100644 --- a/src/api/resources/customObjects/client/Client.ts +++ b/src/api/resources/customObjects/client/Client.ts @@ -25,24 +25,51 @@ export class CustomObjectsClient { /** * Custom objects are only available to Enterprise plans. * This feature is in beta. These are subject to change. - * This API allows bulk upsert of object records in a single request. Each object record may include - * - Attributes - * - Identifiers - * - Associations - * **Response:** - * The API processes the request asynchronously and returns a processId that you can use to track the background process status. - * **API and Schema Limitation:** - * - Size: - * - Max 1000 objects records per request - * - Max request body size: 1 MB - * - Max 500 attributes defined per object record upsert request - * - This is coherent with schema limitation: an object cannot have more than 500 attributes. - * - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - * - Max 10 associations defined per associated object type, in each record of the request - * - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests. + * Performs bulk create or update (upsert) operations for object records in a single asynchronous request. This endpoint is optimized for high-volume data imports and synchronization scenarios. + * + * **How Upsert Works:** + * - **Create**: Omit `identifiers`, or provide only `ext_id` (if it doesn't already exist). A new record is created with a Brevo-generated `id`. + * - **Update**: Provide `id` (Brevo internal ID) or an `ext_id` that already exists. The matching record is updated with the new attribute values. + * - **Important:** `id` is for **updates only**. Providing an `id` that does not belong to an existing record will fail during async processing (the HTTP response will still be 202, but the record will be rejected in the background). To create a new record with a stable external reference, use `ext_id` instead. + * + * **Request Structure:** + * Each object record in the `records` array can include: + * - `identifiers`: Either `id` (internal Brevo ID) or `ext_id` (your external system ID) — required for updates. **Note:** use `id` (singular), not `ids`. + * - `attributes`: Key-value pairs where each key is the attribute **key** (e.g., `company_name`), not the attribute label (e.g., "Company Name"). + * - `associations`: Controls linking and unlinking of associated records (optional). Each entry specifies: + * - `object_type`: The type of the associated object + * - `action`: `link` (default) to create the association, or `unlink` to remove it + * - `records`: The associated records to link or unlink (each identified by `ext_id` or `id`) + * - **Unlink is idempotent** — unlinking a non-existing association is a no-op (no error returned) + * - `link` and `unlink` actions can be submitted for the same `object_type` in a single record entry + * - Both associated records must already exist before a link can be created + * + * > **Common mistake:** Passing the attribute **label** (the display name you see in the UI) instead of the attribute **key** will cause the attribute to be silently ignored and the record may not be created as expected. + * + * **Asynchronous Processing:** + * - Returns immediately with a `processId` (HTTP 202 Accepted) + * - Use the processId to track status via the Get process API + * + * **API and Schema Limitations:** + * - Max 1000 object records per request + * - Max request body size: 1 MB + * - Max 500 attributes per object record (matches the schema limit of 500 attributes per object) + * - Unknown attribute keys are silently ignored (no error, no attribute creation) + * - Max 10 association records per associated object-type in each record of the request. If you need more, send multiple requests. + * + * **Important Behaviors:** + * - The object schema must be created before upserting records + * - Unknown attribute keys are silently ignored (no error, no creation) + * - Both associated object records must already exist before creating a link association + * - Unlink operations are idempotent: attempting to unlink a non-existing association returns success + * - `link` and `unlink` actions can be submitted for the same `object_type` in a single record entry + * - Contact objects cannot be created via this endpoint + * - For `category` and `multiple_category` attributes, pass the option **key** as the value (not the option label or option ID). + * - The `id` identifier (internal Brevo ID) can only be used for **updating** existing records. To create new records, either omit identifiers (Brevo auto-generates an ID) or provide an `ext_id`. + * * **Errors:** - * - Make sure both object records exist before associating them, else the API will return an error. - * - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". + * - Make sure both object records exist before associating them, else the API will return an error. + * - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type". * * @param {Brevo.UpsertrecordsRequest} request * @param {CustomObjectsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -55,7 +82,61 @@ export class CustomObjectsClient { * @example * await client.customObjects.upsertrecords({ * object_type: "vehicle", - * records: [{}] + * records: [{ + * associations: [{ + * object_type: "garage", + * action: "link", + * records: [{ + * identifiers: { + * id: 435435 + * } + * }] + * }, { + * object_type: "garage", + * action: "unlink", + * records: [{ + * identifiers: { + * ext_id: "old-garage-001" + * } + * }] + * }], + * attributes: { + * "make": "Toyota", + * "model": "Camry", + * "year": 2020, + * "engine_type": "hybrid" + * }, + * identifiers: { + * ext_id: "VIN123" + * } + * }] + * }) + * + * @example + * await client.customObjects.upsertrecords({ + * object_type: "vehicle", + * records: [{ + * attributes: { + * "make": "Honda", + * "model": "Civic", + * "year": 2023, + * "engine_type": "petrol" + * } + * }] + * }) + * + * @example + * await client.customObjects.upsertrecords({ + * object_type: "vehicle", + * records: [{ + * attributes: { + * "color": "red", + * "engine_type": "diesel" + * }, + * identifiers: { + * id: 42 + * } + * }] * }) */ public upsertrecords( @@ -86,7 +167,7 @@ export class CustomObjectsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -179,7 +260,11 @@ export class CustomObjectsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -219,15 +304,14 @@ export class CustomObjectsClient { /** * Use this endpoint to delete multiple object records of the same object-type in one request. - * The request is accepted and processed asynchronously. You can track the status of the deletion process using the returned **processId**. - * **API and Schema Limitations:** - Each request can contain up to **1000** object record identifiers - If more records must be deleted → send multiple batch requests + * The request is accepted and processed asynchronously. You can track the status of the deletion process using the returned **processId**. + * **Limitations:** - Each request can contain up to **1000** object record identifiers - Either `ids` or `ext_ids` must be provided, but **not both** in the same request - Deletion of Brevo standard object records is not supported via this endpoint - If more records must be deleted, send multiple batch requests * * @param {Brevo.BatchDeleteObjectRecordsRequest} request * @param {CustomObjectsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} * @throws {@link Brevo.ForbiddenError} - * @throws {@link Brevo.NotFoundError} * @throws {@link Brevo.InternalServerError} * * @example @@ -266,7 +350,7 @@ export class CustomObjectsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -288,8 +372,6 @@ export class CustomObjectsClient { throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); case 403: throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); - case 404: - throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); case 500: throw new Brevo.InternalServerError(_response.error.body as unknown, _response.rawResponse); default: diff --git a/src/api/resources/customObjects/client/requests/BatchDeleteObjectRecordsRequest.ts b/src/api/resources/customObjects/client/requests/BatchDeleteObjectRecordsRequest.ts index cb95008..98ddbb3 100644 --- a/src/api/resources/customObjects/client/requests/BatchDeleteObjectRecordsRequest.ts +++ b/src/api/resources/customObjects/client/requests/BatchDeleteObjectRecordsRequest.ts @@ -12,13 +12,13 @@ export interface BatchDeleteObjectRecordsRequest { /** Object type for the records to delete */ object_type: string; - /** One of the below must be provided */ + /** Either `ids` or `ext_ids` must be provided, but not both in the same request. */ identifiers?: BatchDeleteObjectRecordsRequest.Identifiers; } export namespace BatchDeleteObjectRecordsRequest { /** - * One of the below must be provided + * Either `ids` or `ext_ids` must be provided, but not both in the same request. */ export type Identifiers = | { diff --git a/src/api/resources/customObjects/client/requests/GetrecordsRequest.ts b/src/api/resources/customObjects/client/requests/GetrecordsRequest.ts index 029f0c8..a1bf354 100644 --- a/src/api/resources/customObjects/client/requests/GetrecordsRequest.ts +++ b/src/api/resources/customObjects/client/requests/GetrecordsRequest.ts @@ -11,7 +11,7 @@ import type * as Brevo from "../../../../index.js"; * } */ export interface GetrecordsRequest { - /** object type for the attribute */ + /** Object type for the records to retrieve. Must be a previously created custom object type. Contact as object type is not supported in this endpoint. */ object_type: string; /** Number of records returned per page */ limit: number; diff --git a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts index 36e0ce2..cfb90c7 100644 --- a/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts +++ b/src/api/resources/customObjects/client/requests/UpsertrecordsRequest.ts @@ -4,11 +4,65 @@ * @example * { * object_type: "vehicle", - * records: [{}] + * records: [{ + * associations: [{ + * object_type: "garage", + * action: "link", + * records: [{ + * identifiers: { + * id: 435435 + * } + * }] + * }, { + * object_type: "garage", + * action: "unlink", + * records: [{ + * identifiers: { + * ext_id: "old-garage-001" + * } + * }] + * }], + * attributes: { + * "make": "Toyota", + * "model": "Camry", + * "year": 2020, + * "engine_type": "hybrid" + * }, + * identifiers: { + * ext_id: "VIN123" + * } + * }] + * } + * + * @example + * { + * object_type: "vehicle", + * records: [{ + * attributes: { + * "make": "Honda", + * "model": "Civic", + * "year": 2023, + * "engine_type": "petrol" + * } + * }] + * } + * + * @example + * { + * object_type: "vehicle", + * records: [{ + * attributes: { + * "color": "red", + * "engine_type": "diesel" + * }, + * identifiers: { + * id: 42 + * } + * }] * } */ export interface UpsertrecordsRequest { - /** object type for the attribute */ + /** Object type for the records to upsert. Must be a previously created custom object type. Only lowercase alphanumeric characters and underscores are allowed (max 32 characters). */ object_type: string; /** List of object records to be upsert. Each record can have attributes, identifiers, and associations. */ records: UpsertrecordsRequest.Records.Item[]; @@ -19,10 +73,26 @@ export namespace UpsertrecordsRequest { export namespace Records { export interface Item { + /** List of associations for the object record. Maximum 20 total entries allowed, with a maximum of 10 link actions and 10 unlink actions. Each entry specifies an object_type and an action (link or unlink). Unlink is idempotent — removing a non-existing association does not return an error. Both associated records must already exist before creating a link. */ associations?: Item.Associations.Item[] | undefined; - /** Attributes attached with the object record. Only the already created attributes will be used with records. Pass the value with the attributes key you want to set or update for the object record. Minimum 1 attribute is required. */ + /** + * Key-value pairs of attribute data for the object record. Each key must be the attribute **key** (e.g., `company_name`, `engine_type`), not the attribute label (e.g., "Company Name", "Engine Type"). Only attributes that already exist in the object schema will be accepted — unknown keys are silently ignored. Minimum 1 attribute is required. + * + * For `category` or `multiple_category` attributes, set the value to the option **key** (not the option label or option ID). You can find available option keys in the `options` array returned by the GET attributes endpoint, or in the frontend under each attribute's settings. + * + * For example, use the option key "hybrid" not the label "Hybrid" — using the label will be silently ignored. + * + * For `multiple_choice` type, pass an **array of option keys** (not display labels). For example, if options have keys `"sunroof"` and `"leather_seats"`, pass `["sunroof", "leather_seats"]`. + */ attributes?: Record | undefined; - /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request. */ + /** + * Identifiers for the object record. Supports `id` (singular, not `ids`) or `ext_id`. + * - `ext_id`: Your external system's identifier for this record. + * - `id`: Internal Brevo record ID — can only be used for **updating** existing records, not for creation. + * NOTE: + * - This is an optional field. If no identifier is provided, Brevo auto-generates an internal ID that you can use for future operations. + * - If both `ext_id` and `id` are provided, `id` takes precedence and the operation is treated as an update. It is recommended to provide only one identifier per record. + */ identifiers?: Item.Identifiers | undefined; } @@ -30,45 +100,54 @@ export namespace UpsertrecordsRequest { export type Associations = Associations.Item[]; export namespace Associations { - export type Item = - | { - object_type?: string | undefined; - records?: - | { - identifiers?: - | { - ext_id?: string | undefined; - id?: number | undefined; - } - | undefined; - }[] - | undefined; - } - | { - object_type?: string | undefined; - records?: - | ( - | { - identifiers?: - | { - ext_id?: string | undefined; - id?: number | undefined; - } - | undefined; - } - | { - identifiers?: Record | undefined; - } - )[] - | undefined; - }; + export interface Item { + /** Type of the associated object */ + object_type: string; + /** Action to perform on the association. - `link`: Create association between records (default if not provided) - `unlink`: Remove association between records. Idempotent — unlinking a non-existing association is a no-op success. */ + action?: Item.Action | undefined; + records: Item.Records.Item[]; + } + + export namespace Item { + /** Action to perform on the association. - `link`: Create association between records (default if not provided) - `unlink`: Remove association between records. Idempotent — unlinking a non-existing association is a no-op success. */ + export const Action = { + Link: "link", + Unlink: "unlink", + } as const; + export type Action = (typeof Action)[keyof typeof Action]; + export type Records = Records.Item[]; + + export namespace Records { + export interface Item { + /** Identifiers for the associated object record. Provide either `ext_id` or `id`. */ + identifiers?: Item.Identifiers | undefined; + } + + export namespace Item { + /** + * Identifiers for the associated object record. Provide either `ext_id` or `id`. + */ + export interface Identifiers { + /** External ID of the associated record in your system. */ + ext_id?: string | undefined; + /** Internal ID of the associated object record generated by Brevo. */ + id?: number | undefined; + } + } + } + } } /** - * Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request. + * Identifiers for the object record. Supports `id` (singular, not `ids`) or `ext_id`. + * - `ext_id`: Your external system's identifier for this record. + * - `id`: Internal Brevo record ID — can only be used for **updating** existing records, not for creation. + * NOTE: + * - This is an optional field. If no identifier is provided, Brevo auto-generates an internal ID that you can use for future operations. + * - If both `ext_id` and `id` are provided, `id` takes precedence and the operation is treated as an update. It is recommended to provide only one identifier per record. */ export interface Identifiers { - /** ext_id is ID of record in the external system that client_dev want to store in the object system. */ + /** ext_id is ID of record in the external system that client wants to store in the object system. */ ext_id?: string | undefined; /** Internal ID of the object record generated by Brevo */ id?: number | undefined; diff --git a/src/api/resources/customObjects/client/requests/index.ts b/src/api/resources/customObjects/client/requests/index.ts index ba83d4f..1d1be1c 100644 --- a/src/api/resources/customObjects/client/requests/index.ts +++ b/src/api/resources/customObjects/client/requests/index.ts @@ -1,3 +1,3 @@ export type { BatchDeleteObjectRecordsRequest } from "./BatchDeleteObjectRecordsRequest.js"; export type { GetrecordsRequest } from "./GetrecordsRequest.js"; -export type { UpsertrecordsRequest } from "./UpsertrecordsRequest.js"; +export { UpsertrecordsRequest } from "./UpsertrecordsRequest.js"; diff --git a/src/api/resources/customObjects/types/GetrecordsResponse.ts b/src/api/resources/customObjects/types/GetrecordsResponse.ts index 0b688dc..eb81c18 100644 --- a/src/api/resources/customObjects/types/GetrecordsResponse.ts +++ b/src/api/resources/customObjects/types/GetrecordsResponse.ts @@ -13,11 +13,18 @@ export namespace GetrecordsResponse { export interface Item { /** List of associations for the object record. If association query param is true it will return 5 associated records per association. */ associations?: Item.Associations.Item[] | undefined; - /** Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required. */ + /** + * Key-value pairs of attribute data for the object record. Each key is the attribute **key** (e.g., `company_name`, `engine_type`), not the attribute label (e.g., "Company Name", "Engine Type"). Only attributes that already exist in the object schema will be present. + * For `category` or `multiple_category` attributes, the value is the option **key** (not the option label or option ID). + */ attributes?: Record | undefined; /** Timestamp when the object record was created */ createdAt?: string | undefined; - /** Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. */ + /** + * Identifiers for the object record. Supports `id` (singular, not `ids`) or `ext_id`. + * - `ext_id`: Your external system's identifier for this record. + * - `id`: Internal Brevo record ID. + */ identifiers?: Item.Identifiers | undefined; /** Timestamp when the object record was last updated */ updatedAt?: string | undefined; @@ -73,12 +80,14 @@ export namespace GetrecordsResponse { } /** - * Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. + * Identifiers for the object record. Supports `id` (singular, not `ids`) or `ext_id`. + * - `ext_id`: Your external system's identifier for this record. + * - `id`: Internal Brevo record ID. */ export interface Identifiers { - /** ext_id is ID of record in the external system that client_dev want to store in the object system. */ + /** External ID of the record in your system. */ ext_id?: string | undefined; - /** Internal ID of the object record generated by Brevo */ + /** Internal ID of the object record generated by Brevo. */ id?: number | undefined; } } diff --git a/src/api/resources/deals/client/Client.ts b/src/api/resources/deals/client/Client.ts index d0e428b..439e15c 100644 --- a/src/api/resources/deals/client/Client.ts +++ b/src/api/resources/deals/client/Client.ts @@ -24,8 +24,12 @@ export class DealsClient { } /** + * Retrieve the list of all attributes defined for deals, including both system-default and custom attributes. Each attribute includes its label, internal name, type, required status, and available options for select-type attributes. + * * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.deals.getDealAttributes() */ @@ -53,7 +57,7 @@ export class DealsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -68,17 +72,24 @@ export class DealsClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/attributes/deals"); } /** + * Retrieve a paginated list of deals with optional filtering, sorting, and search capabilities. Results can be filtered by attributes such as deal name or owner, linked companies, linked contacts, or modification/creation timestamps. Default sort order is descending by creation date. + * * @param {Brevo.GetCrmDealsRequest} request * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -107,6 +118,7 @@ export class DealsClient { offset, limit, sort, + sortBy, } = request; const _queryParams: Record = { "filters[attributes.deal_name]": filtersAttributesDealName, @@ -117,6 +129,7 @@ export class DealsClient { offset, limit, sort: sort != null ? sort : undefined, + sortBy, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -133,7 +146,11 @@ export class DealsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -161,6 +178,8 @@ export class DealsClient { } /** + * Create a new deal in the CRM with the specified name, attributes, and optional associations to contacts and companies. You can assign the deal to a specific pipeline and stage by providing `pipeline` and `deal_stage` attribute IDs, which can be retrieved from the pipeline details endpoint. + * * @param {Brevo.PostCrmDealsRequest} request * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -198,7 +217,7 @@ export class DealsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -276,7 +295,7 @@ export class DealsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, @@ -307,6 +326,8 @@ export class DealsClient { } /** + * Link or unlink contacts and companies with a specific deal in a single request. You can simultaneously link new contacts/companies and unlink existing ones by providing the respective ID arrays in the request body. + * * @param {Brevo.PatchCrmDealsLinkUnlinkIdRequest} request * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -347,7 +368,7 @@ export class DealsClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -377,6 +398,8 @@ export class DealsClient { } /** + * Retrieve the full details of a single deal by its identifier, including its attributes, pipeline stage, linked contacts, and linked companies. Returns a 404 error if the deal does not exist. + * * @param {Brevo.GetCrmDealsIdRequest} request * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -415,7 +438,7 @@ export class DealsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -445,6 +468,8 @@ export class DealsClient { } /** + * Permanently delete a deal by its identifier. The requesting user must be the deal owner or have manage permission on deals; otherwise, a 403 Forbidden error is returned. + * * @param {Brevo.DeleteCrmDealsIdRequest} request * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -483,7 +508,7 @@ export class DealsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -513,6 +538,8 @@ export class DealsClient { } /** + * Update an existing deal''s attributes, name, linked contacts, or linked companies. Note that passing `linkedContactsIds` or `linkedCompaniesIds` replaces the entire list of associations, so omitted IDs will be removed. To move a deal to a different pipeline or stage, provide both the `pipeline` and `deal_stage` attribute IDs. + * * @param {Brevo.PatchCrmDealsIdRequest} request * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -552,7 +579,7 @@ export class DealsClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -590,6 +617,8 @@ export class DealsClient { * * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.deals.getPipelineStages() */ @@ -615,7 +644,7 @@ export class DealsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -627,17 +656,24 @@ export class DealsClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/pipeline/details"); } /** + * Retrieve the list of all deal pipelines configured for your account, including each pipeline''s stages and settings. If no pipelines have been configured yet, a default pipeline is automatically created and returned. + * * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} @@ -667,7 +703,7 @@ export class DealsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -695,6 +731,8 @@ export class DealsClient { } /** + * Retrieve the details of a specific deal pipeline by its identifier, including its stages, stage ordering, and configuration. Use this endpoint to obtain the pipeline and stage IDs needed when creating or updating deals. + * * @param {Brevo.GetCrmPipelineDetailsPipelineIdRequest} request * @param {DealsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -732,7 +770,7 @@ export class DealsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/deals/client/requests/GetCrmDealsRequest.ts b/src/api/resources/deals/client/requests/GetCrmDealsRequest.ts index cfda0b9..3c68e3e 100644 --- a/src/api/resources/deals/client/requests/GetCrmDealsRequest.ts +++ b/src/api/resources/deals/client/requests/GetCrmDealsRequest.ts @@ -11,11 +11,11 @@ export interface GetCrmDealsRequest { "filters[attributes.deal_name]"?: string; /** Filter by linked companies ids */ "filters[linkedCompaniesIds]"?: string; - /** Filter by linked companies ids */ + /** Filter by linked contacts ids */ "filters[linkedContactsIds]"?: string; - /** Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ + /** Filter (urlencoded) the deals modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ modifiedSince?: string; - /** Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ + /** Filter (urlencoded) the deals created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. */ createdSince?: string; /** Index of the first document of the page */ offset?: number; @@ -23,4 +23,6 @@ export interface GetCrmDealsRequest { limit?: number; /** Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed */ sort?: Brevo.GetCrmDealsRequestSort; + /** The field used to sort field names. */ + sortBy?: string; } diff --git a/src/api/resources/deals/client/requests/PatchCrmDealsIdRequest.ts b/src/api/resources/deals/client/requests/PatchCrmDealsIdRequest.ts index b71c9cb..dafac2e 100644 --- a/src/api/resources/deals/client/requests/PatchCrmDealsIdRequest.ts +++ b/src/api/resources/deals/client/requests/PatchCrmDealsIdRequest.ts @@ -10,7 +10,7 @@ export interface PatchCrmDealsIdRequest { id: string; /** Attributes for deal update To assign owner of a Deal you can send attributes.deal_owner and utilize the account email or ID. If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage` Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}` */ attributes?: Record; - /** Warning - Using PATCH on linkedCompaniesIds replaces the list of linked contacts. Omitted IDs will be removed. */ + /** Warning - Using PATCH on linkedCompaniesIds replaces the list of linked companies. Omitted IDs will be removed. */ linkedCompaniesIds?: string[]; /** Warning - Using PATCH on linkedContactIds replaces the list of linked contacts. Omitted IDs will be removed. */ linkedContactsIds?: number[]; diff --git a/src/api/resources/deals/client/requests/PostCrmDealsImportRequest.ts b/src/api/resources/deals/client/requests/PostCrmDealsImportRequest.ts index 5910b03..5641c1b 100644 --- a/src/api/resources/deals/client/requests/PostCrmDealsImportRequest.ts +++ b/src/api/resources/deals/client/requests/PostCrmDealsImportRequest.ts @@ -13,7 +13,7 @@ export interface PostCrmDealsImportRequest { * The mapping options in JSON format. Here is an example of the JSON structure: ```json { * "link_entities": true, // Determines whether to link related entities during the import process * "unlink_entities": false, // Determines whether to unlink related entities during the import process - * "update_existing_records": true, // Determines whether to update based on company ID or treat every row as create + * "update_existing_records": true, // Determines whether to update based on deal ID or treat every row as create * "unset_empty_attributes": false // Determines whether to unset a specific attribute during update if the values input is blank * } ``` */ diff --git a/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts b/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts index 3fadd07..08404c1 100644 --- a/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts +++ b/src/api/resources/deals/types/GetCrmAttributesDealsResponseItem.ts @@ -1,12 +1,30 @@ // This file was auto-generated by Fern from our API Definition. /** - * List of attributes + * Deal attribute details */ export interface GetCrmAttributesDealsResponseItem { - attributeOptions?: Record[] | undefined; - attributeTypeName?: string | undefined; + /** Internal name of the attribute */ internalName?: string | undefined; - isRequired?: boolean | undefined; + /** Type of the attribute */ + attributeTypeName?: string | undefined; + /** Display label of the attribute */ label?: string | undefined; + /** Options for single-select or multi-choice attributes */ + attributeOptions?: GetCrmAttributesDealsResponseItem.AttributeOptions.Item[] | undefined; + /** Whether this attribute is required */ + isRequired?: boolean | undefined; + /** Whether this attribute value is read-only */ + isValueReadonly?: boolean | undefined; +} + +export namespace GetCrmAttributesDealsResponseItem { + export type AttributeOptions = AttributeOptions.Item[]; + + export namespace AttributeOptions { + export interface Item { + key?: string | undefined; + value?: string | undefined; + } + } } diff --git a/src/api/resources/domains/client/Client.ts b/src/api/resources/domains/client/Client.ts index de247ae..36cabf7 100644 --- a/src/api/resources/domains/client/Client.ts +++ b/src/api/resources/domains/client/Client.ts @@ -70,7 +70,7 @@ export class DomainsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -159,7 +159,7 @@ export class DomainsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -240,7 +240,7 @@ export class DomainsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -318,7 +318,7 @@ export class DomainsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -403,7 +403,7 @@ export class DomainsClient { ), method: "PUT", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index 1a92a4c..80f904d 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -23,6 +23,8 @@ export class EcommerceClient { } /** + * Retrieve a paginated list of all ecommerce categories stored in your Brevo account. Results are sorted by creation date in descending order by default, and can be filtered by category IDs, name, modification date, creation date, or deletion status. The response includes a `count` field with the total number of matching categories, and pagination defaults to 50 categories per page (maximum 100). + * * @param {Brevo.GetCategoriesRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -68,7 +70,11 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -96,6 +102,8 @@ export class EcommerceClient { } /** + * Create a new ecommerce category or update an existing one, identified by the mandatory `id` field. When `updateEnabled` is set to `false` (the default), the endpoint performs an insert and returns `201`; if the category ID already exists, a `400` error is returned. When `updateEnabled` is `true`, the endpoint performs an upsert, returning `201` for a new category or `204` when an existing category is updated. The `name` field is mandatory for creation but optional for updates. + * * @param {Brevo.CreateUpdateCategoryRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -133,7 +141,7 @@ export class EcommerceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -166,6 +174,8 @@ export class EcommerceClient { } /** + * Create or update multiple ecommerce categories in a single request. The `categories` array accepts up to 100 category objects, each requiring a unique `id`. When `updateEnabled` is `false` (the default), all categories are inserted as new; if any ID already exists, a `400` error is returned. When `updateEnabled` is `true`, existing categories are updated and new ones are created via upsert. Duplicate IDs within the same request payload are rejected. The response returns the count of created and updated categories. + * * @param {Brevo.CreateUpdateBatchCategoryRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -205,7 +215,7 @@ export class EcommerceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -238,6 +248,8 @@ export class EcommerceClient { } /** + * Retrieve the full details of a single ecommerce category by its unique ID. The response includes the category name, URL, creation and modification timestamps, and deletion status. Returns a `404` error if no category matches the provided ID. + * * @param {Brevo.GetCategoryInfoRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -276,7 +288,7 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -338,7 +350,7 @@ export class EcommerceClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -368,6 +380,8 @@ export class EcommerceClient { } /** + * Retrieve aggregated ecommerce attribution metrics for one or more Brevo email campaigns, SMS campaigns, or automation workflows. You can optionally filter by a date range using `periodFrom` and `periodTo` in RFC3339 format. The response includes per-source metrics (orders count, revenue, and average basket) as well as aggregated totals across all requested sources. + * * @param {Brevo.GetEcommerceAttributionMetricsRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -376,7 +390,8 @@ export class EcommerceClient { * @example * await client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows({ * periodFrom: "2022-01-02T00:00:00Z", - * periodTo: "2022-01-03T00:00:00Z" + * periodTo: "2022-01-03T00:00:00Z", + * "emailCampaignId[]": ["sale"] * }) */ public getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows( @@ -423,7 +438,11 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -459,6 +478,8 @@ export class EcommerceClient { } /** + * Retrieve detailed attribution metrics for a single Brevo campaign or automation workflow, identified by its conversion source type and ID. The response includes orders count, revenue, average basket value, and the number of new customers attributed to that specific campaign or workflow. + * * @param {Brevo.GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -499,7 +520,7 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -535,6 +556,8 @@ export class EcommerceClient { } /** + * Retrieve the list of products whose sales have been attributed to a specific Brevo campaign or automation workflow. Each product entry includes its ID, name, SKU, image URL, product URL, price, revenue, and orders count. The conversion source type must be one of `email_campaign`, `sms_campaign`, `automation_workflow_email`, or `automation_workflow_sms`. + * * @param {Brevo.GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -575,7 +598,7 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -611,6 +634,8 @@ export class EcommerceClient { } /** + * Retrieve the ISO 4217 display currency code currently configured for your Brevo ecommerce account. This currency is used to display monetary values across the ecommerce dashboard and reports. Returns a `403` error if ecommerce is not activated on the account. + * * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} @@ -646,7 +671,7 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -686,6 +711,8 @@ export class EcommerceClient { } /** + * Set or update the ISO 4217 display currency code for your Brevo ecommerce account. This currency determines how monetary values are displayed in the ecommerce dashboard and reports. The provided currency code must be a valid ISO 4217 code; invalid codes result in a `422` error. Returns a `403` error if ecommerce is not activated on the account. + * * @param {Brevo.SetConfigDisplayCurrencyRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -726,7 +753,7 @@ export class EcommerceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -817,7 +844,11 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -892,7 +923,7 @@ export class EcommerceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -971,7 +1002,7 @@ export class EcommerceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1001,6 +1032,8 @@ export class EcommerceClient { } /** + * Retrieve a paginated list of all ecommerce products stored in your Brevo account. Results are sorted by creation date in descending order by default, and can be filtered by product IDs, name (minimum 3 characters), price range, category IDs, modification date, creation date, or deletion status. Use the `search` parameter to query across SKU, name, and ID simultaneously — results are prioritized as exact SKU match > SKU prefix match > name match > ID match. Pagination defaults to 50 products per page (maximum 1000), and the response includes a `count` field with the total number of matching products. + * * @param {Brevo.GetProductsRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1025,6 +1058,7 @@ export class EcommerceClient { offset, sort, ids, + search, name, "price[lte]": priceLte, "price[gte]": priceGte, @@ -1032,9 +1066,16 @@ export class EcommerceClient { "price[gt]": priceGt, "price[eq]": priceEq, "price[ne]": priceNe, + "alternativePrice[lte]": alternativePriceLte, + "alternativePrice[gte]": alternativePriceGte, + "alternativePrice[lt]": alternativePriceLt, + "alternativePrice[gt]": alternativePriceGt, + "alternativePrice[eq]": alternativePriceEq, + "alternativePrice[ne]": alternativePriceNe, categories, modifiedSince, createdSince, + sortByField, isDeleted, } = request; const _queryParams: Record = { @@ -1042,6 +1083,7 @@ export class EcommerceClient { offset, sort: sort != null ? sort : undefined, ids, + search, name, "price[lte]": priceLte, "price[gte]": priceGte, @@ -1049,9 +1091,16 @@ export class EcommerceClient { "price[gt]": priceGt, "price[eq]": priceEq, "price[ne]": priceNe, + "alternativePrice[lte]": alternativePriceLte, + "alternativePrice[gte]": alternativePriceGte, + "alternativePrice[lt]": alternativePriceLt, + "alternativePrice[gt]": alternativePriceGt, + "alternativePrice[eq]": alternativePriceEq, + "alternativePrice[ne]": alternativePriceNe, categories, modifiedSince, createdSince, + sortByField: sortByField != null ? sortByField : undefined, isDeleted, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -1069,7 +1118,11 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1097,6 +1150,8 @@ export class EcommerceClient { } /** + * Create a new ecommerce product or update an existing one, identified by the mandatory `id` field. When `updateEnabled` is `false` (the default), the endpoint inserts a new product and returns `201`; if the product ID already exists, a `400` error is returned. When `updateEnabled` is `true`, the endpoint performs an upsert, returning `201` for a new product or `204` for an update. The `name` field is mandatory for creation but optional for updates. Product images are downloaded, validated (max 5 MB, formats: jpeg, jpg, png, bmp, gif, webp), and re-hosted on S3. The `metaInfo` object supports up to 20 keys with a cumulative size limit of approximately 1000 KB. + * * @param {Brevo.CreateUpdateProductRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1135,7 +1190,7 @@ export class EcommerceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1168,6 +1223,8 @@ export class EcommerceClient { } /** + * Create or update multiple ecommerce products in a single request. The `products` array accepts up to 100 product objects for creation (or up to 1000 when `updateEnabled` is `true` and the account has an increased limit). Each product requires a unique `id` and `name` (name is mandatory for creation only). When `updateEnabled` is `false`, all products are inserted as new; if any ID already exists, a `400` error is returned. When `updateEnabled` is `true`, existing products are updated and new ones are created via upsert. Duplicate IDs within the same request payload are rejected. The response returns the count of created and updated products. + * * @param {Brevo.CreateUpdateBatchProductsRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1208,7 +1265,7 @@ export class EcommerceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1241,6 +1298,8 @@ export class EcommerceClient { } /** + * Retrieve the full details of a single ecommerce product by its unique ID. The response includes the product name, price, SKU, URL, image URLs (original and thumbnails), categories, stock level, meta information, creation and modification timestamps, and deletion status. Returns a `404` error if no product matches the provided ID. + * * @param {Brevo.GetProductInfoRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1279,7 +1338,7 @@ export class EcommerceClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1309,6 +1368,8 @@ export class EcommerceClient { } /** + * Register a contact to receive an alert for a specific product event, such as `back_in_stock`. At least one contact identifier (`ext_id`, `email`, or `sms`) must be provided; when multiple are given, priority is `ext_id` > `email` > `sms`. Returns a `404` error if the product ID does not exist, and a `403` error if product alerts are not enabled for the account. + * * @param {Brevo.CreateProductAlertRequest} request * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1351,7 +1412,7 @@ export class EcommerceClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts index 62a9c47..504a9c8 100644 --- a/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateBatchOrderRequest.ts @@ -19,9 +19,9 @@ import type * as Brevo from "../../../../index.js"; * } */ export interface CreateBatchOrderRequest { - /** Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual. */ + /** Defines whether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual. */ historical?: boolean; - /** Notify Url provided by client_dev to get the status of batch request */ + /** Webhook URL to receive the status of the batch request */ notifyUrl?: string; /** array of order objects */ orders: Brevo.Order[]; diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts index b34e33b..daa9a29 100644 --- a/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateBatchProductsRequest.ts @@ -12,7 +12,7 @@ export interface CreateUpdateBatchProductsRequest { /** array of products objects */ products: CreateUpdateBatchProductsRequest.Products.Item[]; - /** Facilitate to update the existing categories in the same request (updateEnabled = true) */ + /** Facilitate to update the existing products in the same request (updateEnabled = true) */ updateEnabled?: boolean; } @@ -37,12 +37,14 @@ export namespace CreateUpdateBatchProductsRequest { isDeleted?: boolean | undefined; /** Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**. */ metaInfo?: Record | undefined; - /** Mandatory in case of creation**. Name of the product for which you requested the details */ + /** **Mandatory in case of creation**. Name of the product, as displayed in the shop */ name: string; /** Parent product id of the product */ parentId?: string | undefined; /** Price of the product */ price?: number | undefined; + /** Alternative price of the product */ + alternativePrice?: number | undefined; /** Product identifier from the shop */ sku?: string | undefined; /** Current stock value of the product from the shop's database */ diff --git a/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts b/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts index 68fe8d9..0d45390 100644 --- a/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts +++ b/src/api/resources/ecommerce/client/requests/CreateUpdateProductRequest.ts @@ -24,17 +24,19 @@ export interface CreateUpdateProductRequest { isDeleted?: boolean; /** Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**. */ metaInfo?: Record; - /** Mandatory in case of creation**. Name of the product for which you requested the details */ + /** **Mandatory in case of creation**. Name of the product, as displayed in the shop */ name: string; /** Parent product id of the product */ parentId?: string; /** Price of the product */ price?: number; + /** Alternative price of the product */ + alternativePrice?: number; /** Product identifier from the shop */ sku?: string; /** Current stock value of the product from the shop's database */ stock?: number; - /** Facilitate to update the existing category in the same request (updateEnabled = true) */ + /** Facilitate to update the existing product in the same request (updateEnabled = true) */ updateEnabled?: boolean; /** URL to the product */ url?: string; diff --git a/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsRequest.ts b/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsRequest.ts index a715215..2c1d8f9 100644 --- a/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsRequest.ts +++ b/src/api/resources/ecommerce/client/requests/GetEcommerceAttributionMetricsRequest.ts @@ -4,7 +4,8 @@ * @example * { * periodFrom: "2022-01-02T00:00:00Z", - * periodTo: "2022-01-03T00:00:00Z" + * periodTo: "2022-01-03T00:00:00Z", + * "emailCampaignId[]": ["sale"] * } */ export interface GetEcommerceAttributionMetricsRequest { diff --git a/src/api/resources/ecommerce/client/requests/GetProductsRequest.ts b/src/api/resources/ecommerce/client/requests/GetProductsRequest.ts index c2b6aa0..9bacbf9 100644 --- a/src/api/resources/ecommerce/client/requests/GetProductsRequest.ts +++ b/src/api/resources/ecommerce/client/requests/GetProductsRequest.ts @@ -15,6 +15,8 @@ export interface GetProductsRequest { sort?: Brevo.GetProductsRequestSort; /** Filter by product ids */ ids?: string | string[]; + /** Search products simultaneously across SKU, name, and ID fields. Results are returned in the following priority order: **exact SKU match** > **SKU prefix match** > **name match** > **ID match**. For example, `?search=123` on products with `{sku: "123"}` and `{sku: "123456"}` returns the exact SKU match first. */ + search?: string; /** Filter by product name, minimum 3 characters should be present for search. */ name?: string; /** Price filter for products less than and equals to particular amount */ @@ -29,12 +31,26 @@ export interface GetProductsRequest { "price[eq]"?: number; /** Price filter for products not equals to particular amount */ "price[ne]"?: number; + /** Alternative price filter for products less than and equals to particular amount */ + "alternativePrice[lte]"?: number; + /** Alternative price filter for products greater than and equals to particular amount */ + "alternativePrice[gte]"?: number; + /** Alternative price filter for products less than particular amount */ + "alternativePrice[lt]"?: number; + /** Alternative price filter for products greater than particular amount */ + "alternativePrice[gt]"?: number; + /** Alternative price filter for products equals to particular amount */ + "alternativePrice[eq]"?: number; + /** Alternative price filter for products not equals to particular amount */ + "alternativePrice[ne]"?: number; /** Filter by categories ids */ categories?: string | string[]; - /** Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + /** Filter (urlencoded) the products modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ modifiedSince?: string; - /** Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ + /** Filter (urlencoded) the products created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** */ createdSince?: string; + /** Sort the results by a specific field. Default sort field is `created_at` when not passed. */ + sortByField?: Brevo.GetProductsRequestSortByField; /** Filter products by their deletion status. If `false` is passed, only products that are not deleted will be returned. */ isDeleted?: string; } diff --git a/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts index 2901a3c..849f753 100644 --- a/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts +++ b/src/api/resources/ecommerce/types/CreateUpdateCategoryResponse.ts @@ -2,5 +2,5 @@ export interface CreateUpdateCategoryResponse { /** ID of the category when a new category is created */ - id?: number | undefined; + id?: string | undefined; } diff --git a/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts b/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts index edeab69..63572b5 100644 --- a/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts +++ b/src/api/resources/ecommerce/types/CreateUpdateProductResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. export interface CreateUpdateProductResponse { - /** ID of the Product when a new product is created */ - id?: number | undefined; + /** ID of the product when a new product is created */ + id?: string | undefined; } diff --git a/src/api/resources/ecommerce/types/GetProductsRequestSortByField.ts b/src/api/resources/ecommerce/types/GetProductsRequestSortByField.ts new file mode 100644 index 0000000..2b4cfcd --- /dev/null +++ b/src/api/resources/ecommerce/types/GetProductsRequestSortByField.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetProductsRequestSortByField = { + CreatedAt: "created_at", + Name: "name", + Price: "price", + Id: "id", +} as const; +export type GetProductsRequestSortByField = + (typeof GetProductsRequestSortByField)[keyof typeof GetProductsRequestSortByField]; diff --git a/src/api/resources/ecommerce/types/index.ts b/src/api/resources/ecommerce/types/index.ts index 45ea6ad..f4da27e 100644 --- a/src/api/resources/ecommerce/types/index.ts +++ b/src/api/resources/ecommerce/types/index.ts @@ -13,5 +13,6 @@ export * from "./GetEcommerceAttributionProductsConversionSourceConversionSource export * from "./GetEcommerceConfigDisplayCurrencyResponse.js"; export * from "./GetOrdersRequestSort.js"; export * from "./GetProductsRequestSort.js"; +export * from "./GetProductsRequestSortByField.js"; export * from "./GetProductsResponse.js"; export * from "./SetConfigDisplayCurrencyResponse.js"; diff --git a/src/api/resources/emailCampaigns/client/Client.ts b/src/api/resources/emailCampaigns/client/Client.ts index d9758c5..ff6cad8 100644 --- a/src/api/resources/emailCampaigns/client/Client.ts +++ b/src/api/resources/emailCampaigns/client/Client.ts @@ -24,7 +24,7 @@ export class EmailCampaignsClient { /** * The response payload for this endpoint has changed - * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns). + * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/2023/2/7). * * @param {Brevo.GetEmailCampaignsRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -55,6 +55,7 @@ export class EmailCampaignsClient { offset, sort, excludeHtmlContent, + excludePdfAttachment, } = request; const _queryParams: Record = { type: type_ != null ? type_ : undefined, @@ -66,6 +67,7 @@ export class EmailCampaignsClient { offset, sort: sort != null ? sort : undefined, excludeHtmlContent, + excludePdfAttachment, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -82,7 +84,11 @@ export class EmailCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -110,10 +116,13 @@ export class EmailCampaignsClient { } /** + * Create a new email campaign. The campaign requires at minimum a name and sender details, and is created in draft status by default. You must provide email content via one of three mutually exclusive options: htmlContent (inline HTML), htmlUrl (remote URL), or templateId (existing template); additionally, A/B testing can be enabled by setting abTesting to true with subjectA and subjectB, but this is incompatible with sendAtBestTime. + * * @param {Brevo.CreateEmailCampaignRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.MethodNotAllowedError} * * @example * await client.emailCampaigns.createEmailCampaign({ @@ -148,7 +157,7 @@ export class EmailCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -165,6 +174,11 @@ export class EmailCampaignsClient { switch (_response.error.statusCode) { case 400: throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 405: + throw new Brevo.MethodNotAllowedError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); default: throw new errors.BrevoError({ statusCode: _response.error.statusCode, @@ -178,6 +192,8 @@ export class EmailCampaignsClient { } /** + * Upload an image to your account''s image gallery by providing an absolute URL to the image. The maximum allowed image size is 2MB and supported formats are jpeg, jpg, png, bmp, and gif; local file uploads are not supported. + * * @param {Brevo.UploadImageToGalleryRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -215,7 +231,7 @@ export class EmailCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -245,6 +261,8 @@ export class EmailCampaignsClient { } /** + * Retrieve detailed information about a specific email campaign by its ID, including recipients, statistics, and HTML content. Use the statistics query parameter to select which statistics to include (globalStats, linksStats, statsByDomain, statsByDevice, or statsByBrowser); statsByDevice and statsByBrowser are only available on this single-campaign endpoint. You can exclude HTML content from the response by setting excludeHtmlContent to true. + * * @param {Brevo.GetEmailCampaignRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -287,7 +305,11 @@ export class EmailCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -317,11 +339,14 @@ export class EmailCampaignsClient { } /** + * Update an existing email campaign''s properties such as name, subject, content, sender, recipients, schedule, and A/B testing configuration. The campaign must exist and the request body must contain at least one valid field to update. Only draft or scheduled campaigns can be modified; if sendAtBestTime is enabled, IP warmup will be automatically disabled. + * * @param {Brevo.UpdateEmailCampaignRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} * @throws {@link Brevo.NotFoundError} + * @throws {@link Brevo.MethodNotAllowedError} * * @example * await client.emailCampaigns.updateEmailCampaign({ @@ -356,7 +381,7 @@ export class EmailCampaignsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -375,6 +400,11 @@ export class EmailCampaignsClient { throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); case 404: throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + case 405: + throw new Brevo.MethodNotAllowedError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); default: throw new errors.BrevoError({ statusCode: _response.error.statusCode, @@ -388,10 +418,13 @@ export class EmailCampaignsClient { } /** + * Delete an email campaign by its campaign ID. Only campaigns that have not been scheduled can be deleted; attempting to delete a campaign that has already been scheduled will return a 403 permission denied error. Related data in templates, newsletter builder, and schedule collections is also cleaned up. + * * @param {Brevo.DeleteEmailCampaignRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.ForbiddenError} * @throws {@link Brevo.NotFoundError} * * @example @@ -426,7 +459,7 @@ export class EmailCampaignsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -441,6 +474,8 @@ export class EmailCampaignsClient { switch (_response.error.statusCode) { case 400: throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Brevo.ForbiddenError(_response.error.body as unknown, _response.rawResponse); case 404: throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); default: @@ -501,7 +536,7 @@ export class EmailCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -539,6 +574,8 @@ export class EmailCampaignsClient { } /** + * Export the recipients of a sent email campaign as an asynchronous process, filtered by recipient type (e.g. openers, clickers, hardBounces). The recipientsType field is required and determines which subset of recipients to export. An optional notifyURL webhook will be called once the export is complete, and the response returns a processId to track the export status. + * * @param {Brevo.EmailExportRecipientsRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -579,7 +616,7 @@ export class EmailCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -616,6 +653,8 @@ export class EmailCampaignsClient { } /** + * Send an existing email campaign immediately by scheduling it for the current time. The campaign must have valid recipients and content configured before sending. The system verifies your account''s send limit and credit balance before dispatching; if credits are insufficient, a 402 error is returned. + * * @param {Brevo.SendEmailCampaignNowRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -655,7 +694,7 @@ export class EmailCampaignsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -742,7 +781,7 @@ export class EmailCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -779,6 +818,8 @@ export class EmailCampaignsClient { } /** + * Send a test version of an email campaign to specified email addresses or your entire test list. If the emailTo array is left empty, the test mail will be sent to all addresses in your test list. You can send a maximum of 50 test emails per day. + * * @param {Brevo.SendTestEmailRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -819,7 +860,7 @@ export class EmailCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -897,7 +938,7 @@ export class EmailCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -937,6 +978,8 @@ export class EmailCampaignsClient { } /** + * Update the status of an email campaign, such as suspending, archiving, or replicating it. Available status values include suspended, archive, darchive, sent, queued, replicate, replicateTemplate, cancel, and draft. Note that the replicateTemplate status is only available for template type campaigns. + * * @param {Brevo.UpdateCampaignStatusRequest} request * @param {EmailCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -977,7 +1020,7 @@ export class EmailCampaignsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts index 883f201..aaf2dce 100644 --- a/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts +++ b/src/api/resources/emailCampaigns/client/requests/CreateEmailCampaignRequest.ts @@ -18,9 +18,9 @@ export interface CreateEmailCampaignRequest { footer?: string; /** Header of the email campaign */ header?: string; - /** Mandatory if htmlUrl and templateId are empty. Body of the message (HTML). */ + /** **Mandatory if htmlUrl and templateId are empty.** Body of the message (HTML). Must have more than 10 characters and be less than 1MB in size. Cannot be used together with `htmlUrl` or `templateId`. */ htmlContent?: string; - /** **Mandatory if htmlContent and templateId are empty**. Url to the message (HTML). For example: **https://html.domain.com** */ + /** **Mandatory if htmlContent and templateId are empty.** URL to the message (HTML). Cannot be used together with `htmlContent` or `templateId`. For example: **https://html.domain.com** */ htmlUrl?: string; /** **Mandatory if ipWarmupEnable is set to true**. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. */ increaseRate?: number; @@ -46,7 +46,7 @@ export interface CreateEmailCampaignRequest { scheduledAt?: string; /** Set this to true if you want to send your campaign at best time. */ sendAtBestTime?: boolean; - /** Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** */ + /** Sender details including id or email and name (optional). Only one of either Sender’s email or Sender’s ID shall be passed in one request at a time. Passing both `email` and `id` will result in an error. For example: **{"name":"xyz", "email":"example@abc.com"}** or **{"name":"xyz", "id":123}** */ sender: CreateEmailCampaignRequest.Sender; /** Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else */ splitRule?: number; @@ -58,7 +58,7 @@ export interface CreateEmailCampaignRequest { subjectB?: string; /** Tag of the campaign */ tag?: string; - /** **Mandatory if htmlContent and htmlUrl are empty**. Id of the transactional email template with status _active_. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. */ + /** **Mandatory if htmlContent and htmlUrl are empty.** Id of the transactional email template with status _active_. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. Cannot be used together with `htmlContent` or `htmlUrl`. */ templateId?: number; /** To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization */ toField?: string; @@ -110,12 +110,12 @@ export namespace CreateEmailCampaignRequest { } /** - * Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}** + * Sender details including id or email and name (optional). Only one of either Sender’s email or Sender’s ID shall be passed in one request at a time. Passing both `email` and `id` will result in an error. For example: **{"name":"xyz", "email":"example@abc.com"}** or **{"name":"xyz", "id":123}** */ export interface Sender { - /** Sender email */ + /** Sender email. Must be a valid email address. Cannot be used together with `id` in the same request. */ email?: string | undefined; - /** Select the sender for the campaign on the basis of sender id. _In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)_. */ + /** Select the sender for the campaign on the basis of sender id. Cannot be used together with `email` in the same request. _In order to select a sender with a specific pool of IPs, dedicated IP users shall pass id (instead of email)._ */ id?: number | undefined; /** Sender Name */ name?: string | undefined; diff --git a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts index d176a52..209aeae 100644 --- a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts +++ b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignRequest.ts @@ -11,7 +11,7 @@ import type * as Brevo from "../../../../index.js"; export interface GetEmailCampaignRequest { /** Id of the campaign */ campaignId: number; - /** Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response. */ + /** Filter on the type of statistics required. Example: **globalStats** value will only fetch globalStats info of the campaign in the returned response. `statsByDevice` and `statsByBrowser` are only available when retrieving a single campaign (not in the list endpoint). */ statistics?: Brevo.GetEmailCampaignRequestStatistics; /** Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body */ excludeHtmlContent?: boolean; diff --git a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignsRequest.ts b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignsRequest.ts index 9eb4bda..a4260e5 100644 --- a/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignsRequest.ts +++ b/src/api/resources/emailCampaigns/client/requests/GetEmailCampaignsRequest.ts @@ -11,11 +11,11 @@ export interface GetEmailCampaignsRequest { type?: Brevo.GetEmailCampaignsRequestType; /** Filter on the status of the campaign */ status?: Brevo.GetEmailCampaignsRequestStatus; - /** Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint. */ + /** Filter on the type of statistics required. Example: **globalStats** value will only fetch globalStats info of the campaign in the returned response. This option only returns data for events that occurred in the last 6 months. For older campaigns, it is advisable to use the **Get Campaign Report** endpoint. */ statistics?: Brevo.GetEmailCampaignsRequestStatistics; - /** **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) */ + /** **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result.** Only available if `status` is not passed or is set to `sent`. The date range between `startDate` and `endDate` must not exceed 2 years. `startDate` must not be in the future. */ startDate?: string; - /** **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) */ + /** **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result.** Only available if `status` is not passed or is set to `sent`. The date range between `startDate` and `endDate` must not exceed 2 years. `endDate` must not be in the future. */ endDate?: string; /** Number of documents per page */ limit?: number; @@ -23,6 +23,8 @@ export interface GetEmailCampaignsRequest { offset?: number; /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ sort?: Brevo.GetEmailCampaignsRequestSort; - /** Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body */ + /** Use this flag to exclude htmlContent from the response body. If set to **true**, the htmlContent field will be returned as an empty string in the response body. */ excludeHtmlContent?: boolean; + /** Use this flag to filter out campaigns that have a PDF attachment. If set to **true**, only campaigns without a PDF attachment (or with no attachment at all) will be returned. */ + excludePdfAttachment?: boolean; } diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts index a6642f8..75310df 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignResponse.ts @@ -33,8 +33,12 @@ export interface GetEmailCampaignResponse { winnerCriteria?: string | undefined; /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ winnerDelay?: number | undefined; + /** URL of the attachment file associated with the campaign. Empty string if no attachment is present. */ + attachmentUrl?: string | undefined; /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; + /** Expiration date configuration for the email campaign, if set. Contains the duration and unit of the email expiry. */ + emailExpirationDate?: GetEmailCampaignResponse.EmailExpirationDate | undefined; /** Footer of the campaign */ footer: string; /** Header of the campaign */ @@ -56,7 +60,7 @@ export interface GetEmailCampaignResponse { sender: GetEmailCampaignResponse.Sender; /** Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' */ sentDate?: string | undefined; - /** Link to share the campaign on social medias */ + /** Link to share the campaign on social media. For trigger campaigns, this returns a descriptive message instead of a URL. For classic campaigns that have not been sent, this also returns a descriptive message. */ shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; @@ -66,12 +70,13 @@ export interface GetEmailCampaignResponse { testSent: boolean; /** Customisation of the "to" field of the campaign */ toField?: string | undefined; - /** utm parameter associated with campaign */ + /** The utm_campaign value associated with the campaign. Only present if a UTM campaign value was set. */ utmCampaignValue?: string | undefined; - /** utm id active */ - utmIDActive?: boolean | undefined; + /** The campaign ID used as utm_id parameter. Only present if UTM campaign tracking with ID is enabled. */ + utmID?: number | undefined; + /** The utm_medium value. Set to "EMAIL" when UTM campaign tracking is enabled. */ utmMedium?: string | undefined; - /** source of utm */ + /** The utm_source value. Set to "Brevo" when UTM campaign tracking is enabled. */ utmSource?: string | undefined; recipients: Brevo.GetCampaignRecipients; statistics: Brevo.GetExtendedCampaignStats; @@ -98,6 +103,26 @@ export namespace GetEmailCampaignResponse { } as const; export type Type = (typeof Type)[keyof typeof Type]; + /** + * Expiration date configuration for the email campaign, if set. Contains the duration and unit of the email expiry. + */ + export interface EmailExpirationDate { + /** Duration of the email expiry */ + duration?: number | undefined; + /** Unit of the duration */ + unit?: EmailExpirationDate.Unit | undefined; + } + + export namespace EmailExpirationDate { + /** Unit of the duration */ + export const Unit = { + Days: "days", + Weeks: "weeks", + Months: "months", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; + } + export interface Sender { /** Sender email of the campaign */ email?: string | undefined; diff --git a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts index 71d563b..49f8ad9 100644 --- a/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts +++ b/src/api/resources/emailCampaigns/types/GetEmailCampaignsResponse.ts @@ -43,8 +43,12 @@ export namespace GetEmailCampaignsResponse { winnerCriteria?: string | undefined; /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ winnerDelay?: number | undefined; + /** URL of the attachment file associated with the campaign. Empty string if no attachment is present. */ + attachmentUrl?: string | undefined; /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; + /** Expiration date configuration for the email campaign, if set. Contains the duration and unit of the email expiry. */ + emailExpirationDate?: Item.EmailExpirationDate | undefined; /** Footer of the campaign */ footer: string; /** Header of the campaign */ @@ -76,12 +80,13 @@ export namespace GetEmailCampaignsResponse { testSent: boolean; /** Customisation of the "to" field of the campaign */ toField?: string | undefined; - /** utm parameter associated with campaign */ + /** The utm_campaign value associated with the campaign. Only present if a UTM campaign value was set. */ utmCampaignValue?: string | undefined; - /** utm id active */ - utmIDActive?: boolean | undefined; + /** The campaign ID used as utm_id parameter. Only present if UTM campaign tracking with ID is enabled. */ + utmID?: number | undefined; + /** The utm_medium value. Set to "EMAIL" when UTM campaign tracking is enabled. */ utmMedium?: string | undefined; - /** source of utm */ + /** The utm_source value. Set to "Brevo" when UTM campaign tracking is enabled. */ utmSource?: string | undefined; recipients: Brevo.GetCampaignRecipients; statistics: Brevo.GetExtendedCampaignStats; @@ -108,6 +113,26 @@ export namespace GetEmailCampaignsResponse { } as const; export type Type = (typeof Type)[keyof typeof Type]; + /** + * Expiration date configuration for the email campaign, if set. Contains the duration and unit of the email expiry. + */ + export interface EmailExpirationDate { + /** Duration of the email expiry */ + duration?: number | undefined; + /** Unit of the duration */ + unit?: EmailExpirationDate.Unit | undefined; + } + + export namespace EmailExpirationDate { + /** Unit of the duration */ + export const Unit = { + Days: "days", + Weeks: "weeks", + Months: "months", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; + } + export interface Sender { /** Sender email of the campaign */ email?: string | undefined; diff --git a/src/api/resources/event/client/Client.ts b/src/api/resources/event/client/Client.ts index 0025fc4..7bc7d40 100644 --- a/src/api/resources/event/client/Client.ts +++ b/src/api/resources/event/client/Client.ts @@ -83,7 +83,11 @@ export class EventClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -156,7 +160,7 @@ export class EventClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -190,27 +194,29 @@ export class EventClient { /** * Create multiple events to track contacts' interactions in a single request. * - * @param {Brevo.CreateBatchEventsRequestItem[]} request + * @param {Brevo.CreateBatchEventsRequest} request * @param {EventClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} * @throws {@link Brevo.UnauthorizedError} * * @example - * await client.event.createBatchEvents([{ - * event_name: "order_created", - * identifiers: {} - * }]) + * await client.event.createBatchEvents({ + * events: [{ + * event_name: "order_created", + * identifiers: {} + * }] + * }) */ public createBatchEvents( - request: Brevo.CreateBatchEventsRequestItem[], + request: Brevo.CreateBatchEventsRequest, requestOptions?: EventClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createBatchEvents(request, requestOptions)); } private async __createBatchEvents( - request: Brevo.CreateBatchEventsRequestItem[], + request: Brevo.CreateBatchEventsRequest, requestOptions?: EventClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -229,7 +235,7 @@ export class EventClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/event/client/requests/CreateBatchEventsRequest.ts b/src/api/resources/event/client/requests/CreateBatchEventsRequest.ts new file mode 100644 index 0000000..93b8458 --- /dev/null +++ b/src/api/resources/event/client/requests/CreateBatchEventsRequest.ts @@ -0,0 +1,85 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * events: [{ + * event_name: "order_created", + * identifiers: {} + * }] + * } + */ +export interface CreateBatchEventsRequest { + events: CreateBatchEventsRequest.Events.Item[]; +} + +export namespace CreateBatchEventsRequest { + export type Events = Events.Item[]; + + export namespace Events { + export interface Item { + /** Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **"FIRSTNAME": "Jane" , "AGE": 37** */ + contact_properties?: Record | undefined; + /** Timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used. */ + event_date?: string | undefined; + /** The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. */ + event_name: string; + /** Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. */ + event_properties?: Record | undefined; + /** Identifies the contact associated with the event. At least one identifier is required. */ + identifiers: Item.Identifiers; + /** Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. */ + object?: Item.Object_ | undefined; + } + + export namespace Item { + export namespace ContactProperties { + export type Value = string | number; + } + + export namespace EventProperties { + export type Value = string | number | Record | unknown[]; + } + + /** + * Identifies the contact associated with the event. At least one identifier is required. + */ + export interface Identifiers { + /** Internal unique contact ID. When present, this takes priority over all other identifiers for event attribution and contact resolution. */ + contact_id?: number | undefined; + /** Email Id associated with the event */ + email_id?: string | undefined; + /** ext_id associated with the event */ + ext_id?: string | undefined; + /** landline_number associated with the event */ + landline_number_id?: string | undefined; + /** SMS associated with the event */ + phone_id?: string | undefined; + /** whatsapp associated with the event */ + whatsapp_id?: string | undefined; + } + + /** + * Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. + */ + export interface Object_ { + /** Identifiers for the object. */ + identifiers?: Object_.Identifiers | undefined; + /** Type of object (e.g., subscription, vehicle, etc.) */ + type?: string | undefined; + } + + export namespace Object_ { + /** + * Identifiers for the object. + */ + export interface Identifiers { + /** External object ID */ + ext_id?: string | undefined; + /** Internal object ID */ + id?: string | undefined; + } + } + } + } +} diff --git a/src/api/resources/event/client/requests/CreateEventRequest.ts b/src/api/resources/event/client/requests/CreateEventRequest.ts index 5729e3e..52ffeac 100644 --- a/src/api/resources/event/client/requests/CreateEventRequest.ts +++ b/src/api/resources/event/client/requests/CreateEventRequest.ts @@ -10,11 +10,11 @@ export interface CreateEventRequest { /** Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **"FIRSTNAME": "Jane" , "AGE": 37** */ contact_properties?: Record; - /** Timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used. */ + /** ISO 8601 timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used. */ event_date?: string; - /** The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. */ + /** The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters; only alphanumeric characters, hyphens (-), and underscores (_) are allowed. */ event_name: string; - /** Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. */ + /** Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field types are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50KB. */ event_properties?: Record; /** Identifies the contact associated with the event. At least one identifier is required. */ identifiers: CreateEventRequest.Identifiers; diff --git a/src/api/resources/event/client/requests/index.ts b/src/api/resources/event/client/requests/index.ts index 471011e..04cb32a 100644 --- a/src/api/resources/event/client/requests/index.ts +++ b/src/api/resources/event/client/requests/index.ts @@ -1,2 +1,3 @@ +export type { CreateBatchEventsRequest } from "./CreateBatchEventsRequest.js"; export type { CreateEventRequest } from "./CreateEventRequest.js"; export type { GetEventsRequest } from "./GetEventsRequest.js"; diff --git a/src/api/resources/event/index.ts b/src/api/resources/event/index.ts index d9adb1a..914b8c3 100644 --- a/src/api/resources/event/index.ts +++ b/src/api/resources/event/index.ts @@ -1,2 +1 @@ export * from "./client/index.js"; -export * from "./types/index.js"; diff --git a/src/api/resources/event/types/CreateBatchEventsRequestItem.ts b/src/api/resources/event/types/CreateBatchEventsRequestItem.ts deleted file mode 100644 index 88da2d1..0000000 --- a/src/api/resources/event/types/CreateBatchEventsRequestItem.ts +++ /dev/null @@ -1,66 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface CreateBatchEventsRequestItem { - /** Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **"FIRSTNAME": "Jane" , "AGE": 37** */ - contact_properties?: Record | undefined; - /** Timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used. */ - event_date?: string | undefined; - /** The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only. */ - event_name: string; - /** Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb. */ - event_properties?: Record | undefined; - /** Identifies the contact associated with the event. At least one identifier is required. */ - identifiers: CreateBatchEventsRequestItem.Identifiers; - /** Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. */ - object?: CreateBatchEventsRequestItem.Object_ | undefined; -} - -export namespace CreateBatchEventsRequestItem { - export namespace ContactProperties { - export type Value = string | number | boolean; - } - - export namespace EventProperties { - export type Value = string | number | boolean | Record | unknown[]; - } - - /** - * Identifies the contact associated with the event. At least one identifier is required. - */ - export interface Identifiers { - /** Internal unique contact ID. When present, this takes priority over all other identifiers for event attribution and contact resolution. */ - contact_id?: number | undefined; - /** Email Id associated with the event */ - email_id?: string | undefined; - /** ext_id associated with the event */ - ext_id?: string | undefined; - /** landline_number associated with the event */ - landline_number_id?: string | undefined; - /** SMS associated with the event */ - phone_id?: string | undefined; - /** whatsapp associated with the event */ - whatsapp_id?: string | undefined; - } - - /** - * Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account. - */ - export interface Object_ { - /** Identifiers for the object. */ - identifiers?: Object_.Identifiers | undefined; - /** Type of object (e.g., subscription, vehicle, etc.) */ - type?: string | undefined; - } - - export namespace Object_ { - /** - * Identifiers for the object. - */ - export interface Identifiers { - /** External object ID */ - ext_id?: string | undefined; - /** Internal object ID */ - id?: string | undefined; - } - } -} diff --git a/src/api/resources/event/types/index.ts b/src/api/resources/event/types/index.ts deleted file mode 100644 index b2fea88..0000000 --- a/src/api/resources/event/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./CreateBatchEventsRequestItem.js"; diff --git a/src/api/resources/externalFeeds/client/Client.ts b/src/api/resources/externalFeeds/client/Client.ts index ad42ffd..04bee5f 100644 --- a/src/api/resources/externalFeeds/client/Client.ts +++ b/src/api/resources/externalFeeds/client/Client.ts @@ -98,7 +98,11 @@ export class ExternalFeedsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -209,7 +213,7 @@ export class ExternalFeedsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -300,7 +304,7 @@ export class ExternalFeedsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -434,7 +438,7 @@ export class ExternalFeedsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -522,7 +526,7 @@ export class ExternalFeedsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts b/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts index 84a4a05..0751667 100644 --- a/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts +++ b/src/api/resources/externalFeeds/types/GetAllExternalFeedsResponse.ts @@ -16,24 +16,20 @@ export namespace GetAllExternalFeedsResponse { id: string; /** Name of the feed */ name: string; - /** URL-friendly alias for the feed */ - alias: string; /** URL of the external data source */ url: string; /** Authentication type for accessing the feed */ authType: Item.AuthType; - /** Username for basic authentication */ + /** Username for basic authentication. Only returned when authType is 'basic'. Excluded when authType is 'token'. */ username?: string | undefined; - /** Password for basic authentication */ + /** Password for basic authentication. Only returned when authType is 'basic'. Excluded when authType is 'token'. */ password?: string | undefined; - /** Token for token-based authentication */ + /** Token for token-based authentication. Only returned when authType is 'token'. Excluded when authType is 'basic' or 'noAuth'. */ token?: string | undefined; /** Maximum number of retry attempts for failed requests */ maxRetries: number; /** Whether to cache the feed response */ cache: boolean; - /** Whether this is an internal Brevo system feed */ - isInternal: boolean; /** Custom HTTP headers for the feed request */ headers?: (Item.Headers.Item[] | null) | undefined; /** Feed creation timestamp */ diff --git a/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts b/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts index f685018..b2a5256 100644 --- a/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts +++ b/src/api/resources/externalFeeds/types/GetExternalFeedByUuidResponse.ts @@ -9,18 +9,12 @@ export interface GetExternalFeedByUuidResponse { url: string; /** Authentication type for accessing the feed */ authType: GetExternalFeedByUuidResponse.AuthType; - /** Username for basic authentication (null if not using basic auth) */ + /** Username for basic authentication. Only returned when authType is 'basic'. Excluded from response when authType is 'token'. */ username?: (string | null) | undefined; - /** Password for basic authentication (null if not using basic auth) */ + /** Password for basic authentication. Only returned when authType is 'basic'. Excluded from response when authType is 'token'. */ password?: (string | null) | undefined; - /** Token for token-based authentication (null if not using token auth) */ + /** Token for token-based authentication. Only returned when authType is 'token'. Excluded from response when authType is 'basic' or 'noAuth'. */ token?: (string | null) | undefined; - /** Whether personalization is enabled for this feed */ - personalization: boolean; - /** Default attribute name for personalization fallback (empty string if not set) */ - defaultAttr: string; - /** Default contact email for personalization fallback (empty string if not set) */ - defaultContact: string; /** Custom HTTP headers for the feed request */ headers?: (GetExternalFeedByUuidResponse.Headers.Item[] | null) | undefined; /** Maximum number of retry attempts for failed requests */ diff --git a/src/api/resources/files/client/Client.ts b/src/api/resources/files/client/Client.ts index 2eed388..c710e9d 100644 --- a/src/api/resources/files/client/Client.ts +++ b/src/api/resources/files/client/Client.ts @@ -23,6 +23,8 @@ export class FilesClient { } /** + * Retrieve a paginated list of CRM files with optional filtering by entity type, entity IDs, and date range. Results are sorted by creation date in descending order by default, with a default limit of 50 files per page. + * * @param {Brevo.GetCrmFilesRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -67,7 +69,11 @@ export class FilesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -95,6 +101,8 @@ export class FilesClient { } /** + * Upload a file and associate it with a contact, company, or deal. The file must be sent as multipart form data with a maximum size of 10 MB. You can optionally link the file to a specific entity by providing the corresponding entity ID. + * * @param {Brevo.PostCrmFilesRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -148,7 +156,7 @@ export class FilesClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, @@ -179,6 +187,8 @@ export class FilesClient { } /** + * Get a temporary download URL for a CRM file by its identifier. The returned URL is valid for 5 minutes only and provides direct access to the file content. + * * @param {Brevo.GetCrmFilesIdRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -217,7 +227,7 @@ export class FilesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -247,6 +257,8 @@ export class FilesClient { } /** + * Permanently delete a CRM file by its identifier. This removes the file from storage and unlinks it from any associated contacts, companies, or deals. + * * @param {Brevo.DeleteCrmFilesIdRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -285,7 +297,7 @@ export class FilesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -315,6 +327,8 @@ export class FilesClient { } /** + * Retrieve the metadata and details of a specific CRM file by its identifier. This returns information such as the file name, size, type, creation date, and associated entities, but does not include the file content itself. + * * @param {Brevo.GetCrmFilesIdDataRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -353,7 +367,7 @@ export class FilesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/inboundParsing/client/Client.ts b/src/api/resources/inboundParsing/client/Client.ts index 1691671..ba8846c 100644 --- a/src/api/resources/inboundParsing/client/Client.ts +++ b/src/api/resources/inboundParsing/client/Client.ts @@ -23,7 +23,7 @@ export class InboundParsingClient { } /** - * This endpoint will show the list of all the events for the received emails. + * This endpoint will show the list of all the events for the received emails. When no date range is provided, the last 30 days of events are returned by default. * * @param {Brevo.GetInboundEmailEventsRequest} request * @param {InboundParsingClient.RequestOptions} requestOptions - Request-specific configuration. @@ -68,7 +68,11 @@ export class InboundParsingClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -102,6 +106,7 @@ export class InboundParsingClient { * @param {InboundParsingClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} * * @example * await client.inboundParsing.getInboundEmailEventsByUuid({ @@ -135,7 +140,7 @@ export class InboundParsingClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -153,6 +158,8 @@ export class InboundParsingClient { switch (_response.error.statusCode) { case 400: throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); default: throw new errors.BrevoError({ statusCode: _response.error.statusCode, @@ -198,7 +205,7 @@ export class InboundParsingClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), responseType: "binary-response", timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, diff --git a/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsRequest.ts b/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsRequest.ts index 39f2441..bf07b77 100644 --- a/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsRequest.ts +++ b/src/api/resources/inboundParsing/client/requests/GetInboundEmailEventsRequest.ts @@ -9,9 +9,9 @@ import type * as Brevo from "../../../../index.js"; export interface GetInboundEmailEventsRequest { /** Email address of the sender. */ sender?: string; - /** Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is one month. */ + /** Mandatory if endDate is used. Starting date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) from which you want to fetch the list. Maximum time period that can be selected is 30 days. Must not be in the future. */ startDate?: string; - /** Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is one month. */ + /** Mandatory if startDate is used. Ending date (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.SSSZ) till which you want to fetch the list. Maximum time period that can be selected is 30 days. Must not be in the future. */ endDate?: string; /** Number of documents returned per page */ limit?: number; diff --git a/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts b/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts index 29c4ef8..0368a97 100644 --- a/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts +++ b/src/api/resources/inboundParsing/types/GetInboundEmailEventsByUuidResponse.ts @@ -3,9 +3,9 @@ export interface GetInboundEmailEventsByUuidResponse { /** List of attachments of the email. This will be present only after the processing is done. */ attachments?: GetInboundEmailEventsByUuidResponse.Attachments.Item[] | undefined; - /** Date when email was delivered successfully to client_dev’s webhook */ + /** Date when email was delivered successfully to the client’s webhook */ deliveredAt?: (string | null) | undefined; - /** List of events/logs that describe the lifecycle of the email on SIB platform */ + /** List of events/logs that describe the lifecycle of the email on the Brevo platform */ logs?: GetInboundEmailEventsByUuidResponse.Logs.Item[] | undefined; /** Value of the Message-ID header. This will be present only after the processing is done. */ messageId?: string | undefined; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 7252a47..b4c41cb 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -33,7 +33,6 @@ export * as emailCampaigns from "./emailCampaigns/index.js"; export * from "./emailCampaigns/types/index.js"; export * from "./event/client/requests/index.js"; export * as event from "./event/index.js"; -export * from "./event/types/index.js"; export * from "./externalFeeds/client/requests/index.js"; export * as externalFeeds from "./externalFeeds/index.js"; export * from "./externalFeeds/types/index.js"; diff --git a/src/api/resources/masterAccount/client/Client.ts b/src/api/resources/masterAccount/client/Client.ts index 790e33c..3b81f6d 100644 --- a/src/api/resources/masterAccount/client/Client.ts +++ b/src/api/resources/masterAccount/client/Client.ts @@ -62,7 +62,7 @@ export class MasterAccountClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -133,7 +133,7 @@ export class MasterAccountClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -174,6 +174,8 @@ export class MasterAccountClient { * @param {Brevo.GetCorporateGroupIdRequest} request * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.masterAccount.getAGroupDetails({ * id: "id" @@ -206,7 +208,7 @@ export class MasterAccountClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -218,11 +220,16 @@ export class MasterAccountClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/group/{id}"); @@ -269,7 +276,7 @@ export class MasterAccountClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -341,7 +348,7 @@ export class MasterAccountClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -373,6 +380,8 @@ export class MasterAccountClient { * * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.masterAccount.getSubAccountGroups() */ @@ -400,7 +409,7 @@ export class MasterAccountClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -415,11 +424,16 @@ export class MasterAccountClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/groups"); @@ -433,6 +447,8 @@ export class MasterAccountClient { * @param {Brevo.GetCorporateInvitedUsersListRequest} request * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.masterAccount.getCorporateInvitedUsersList() */ @@ -468,7 +484,11 @@ export class MasterAccountClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -483,11 +503,16 @@ export class MasterAccountClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/invited/users"); @@ -499,6 +524,8 @@ export class MasterAccountClient { * * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.masterAccount.listOfAllIPs() */ @@ -526,7 +553,7 @@ export class MasterAccountClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -538,11 +565,16 @@ export class MasterAccountClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/corporate/ip"); @@ -582,7 +614,7 @@ export class MasterAccountClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -658,7 +690,7 @@ export class MasterAccountClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -737,7 +769,11 @@ export class MasterAccountClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -810,7 +846,7 @@ export class MasterAccountClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -883,7 +919,7 @@ export class MasterAccountClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -958,7 +994,7 @@ export class MasterAccountClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1033,7 +1069,7 @@ export class MasterAccountClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1109,7 +1145,7 @@ export class MasterAccountClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1185,7 +1221,7 @@ export class MasterAccountClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1216,6 +1252,8 @@ export class MasterAccountClient { } /** + * Permanently deletes a sub-account from the corporate master account. Once deleted, all data associated with the sub-account organization is removed and cannot be recovered, so ensure the sub-account is no longer needed before proceeding. + * * @param {Brevo.DeleteCorporateSubAccountIdRequest} request * @param {MasterAccountClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1254,7 +1292,7 @@ export class MasterAccountClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1333,7 +1371,7 @@ export class MasterAccountClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1427,7 +1465,7 @@ export class MasterAccountClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1519,7 +1557,7 @@ export class MasterAccountClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1617,7 +1655,7 @@ export class MasterAccountClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1694,7 +1732,7 @@ export class MasterAccountClient { ), method: "PUT", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1770,7 +1808,7 @@ export class MasterAccountClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1842,7 +1880,7 @@ export class MasterAccountClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1948,7 +1986,7 @@ export class MasterAccountClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/notes/client/Client.ts b/src/api/resources/notes/client/Client.ts index 739efba..6ddf808 100644 --- a/src/api/resources/notes/client/Client.ts +++ b/src/api/resources/notes/client/Client.ts @@ -23,6 +23,8 @@ export class NotesClient { } /** + * Retrieve a paginated list of CRM notes with optional filtering by entity type, entity IDs, and date range. Results are sorted by creation date in descending order by default, with a default limit of 50 notes per page. + * * @param {Brevo.GetCrmNotesRequest} request * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -67,7 +69,11 @@ export class NotesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -95,6 +101,8 @@ export class NotesClient { } /** + * Create a new CRM note and optionally associate it with contacts, companies, or deals. The note text content is required, and you can link the note to multiple entities simultaneously during creation. + * * @param {Brevo.NoteData} request * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -103,7 +111,7 @@ export class NotesClient { * * @example * await client.notes.createANote({ - * text: "In communication with client_dev for resolution of queries." + * text: "

Meeting notes: Action item - visit Brevo for details.

" * }) */ public createANote( @@ -133,7 +141,7 @@ export class NotesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -168,6 +176,8 @@ export class NotesClient { } /** + * Retrieve the full details of a single CRM note by its identifier. The response includes the note''s text content, creation date, author, and any associated contacts, companies, or deals. + * * @param {Brevo.GetCrmNotesIdRequest} request * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -206,7 +216,7 @@ export class NotesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -236,6 +246,8 @@ export class NotesClient { } /** + * Permanently delete a CRM note by its identifier. This removes the note and unlinks it from any associated contacts, companies, or deals. + * * @param {Brevo.DeleteCrmNotesIdRequest} request * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -274,7 +286,7 @@ export class NotesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -304,6 +316,8 @@ export class NotesClient { } /** + * Update an existing CRM note''s text content and its associations with contacts, companies, or deals. You can modify the note text, change the pinned status, or update the linked entities. + * * @param {Brevo.PatchCrmNotesIdRequest} request * @param {NotesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -315,7 +329,7 @@ export class NotesClient { * await client.notes.updateANote({ * id: "id", * body: { - * text: "In communication with client_dev for resolution of queries." + * text: "

Meeting notes: Action item - visit Brevo for details.

" * } * }) */ @@ -347,7 +361,7 @@ export class NotesClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/notes/client/requests/PatchCrmNotesIdRequest.ts b/src/api/resources/notes/client/requests/PatchCrmNotesIdRequest.ts index e5ee5c9..2ba14cf 100644 --- a/src/api/resources/notes/client/requests/PatchCrmNotesIdRequest.ts +++ b/src/api/resources/notes/client/requests/PatchCrmNotesIdRequest.ts @@ -7,7 +7,7 @@ import type * as Brevo from "../../../../index.js"; * { * id: "id", * body: { - * text: "In communication with client_dev for resolution of queries." + * text: "

Meeting notes: Action item - visit Brevo for details.

" * } * } */ diff --git a/src/api/resources/notes/types/PostCrmNotesResponse.ts b/src/api/resources/notes/types/PostCrmNotesResponse.ts index 2d0e24a..b1aff47 100644 --- a/src/api/resources/notes/types/PostCrmNotesResponse.ts +++ b/src/api/resources/notes/types/PostCrmNotesResponse.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. /** - * Updated Note ID + * Created Note ID */ export interface PostCrmNotesResponse { /** Unique note Id */ diff --git a/src/api/resources/payments/client/Client.ts b/src/api/resources/payments/client/Client.ts index 90f2f7a..9ebadeb 100644 --- a/src/api/resources/payments/client/Client.ts +++ b/src/api/resources/payments/client/Client.ts @@ -23,6 +23,8 @@ export class PaymentsClient { } /** + * Create a new payment request for a Brevo contact. The request requires a reference (displayed on the payment page), a contact ID, and a cart with currency and amount in cents. You can optionally configure a custom success redirect URL and enable email notifications with reminders. Returns the payment request ID and its public payment URL. A `403` error is returned if Brevo Payments is not activated or the account is not validated. + * * @param {Brevo.CreatePaymentRequestRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -67,7 +69,7 @@ export class PaymentsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -101,6 +103,8 @@ export class PaymentsClient { } /** + * Retrieve the details of a specific payment request by its ID. The response includes the reference, status (created, sent, reminderSent, or paid), cart details, notification configuration, contact ID, and the number of reminders sent. Returns a `404` error if no payment request matches the provided ID. + * * @param {Brevo.GetPaymentRequestRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -141,7 +145,7 @@ export class PaymentsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -175,6 +179,8 @@ export class PaymentsClient { } /** + * Delete a payment request by its UUID. Once deleted, the payment request can no longer be accessed or paid. Returns a `404` error if no payment request matches the provided ID, and a `403` error if Brevo Payments is not activated or the account is not validated. + * * @param {Brevo.DeletePaymentRequestRequest} request * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -214,7 +220,7 @@ export class PaymentsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/process/client/Client.ts b/src/api/resources/process/client/Client.ts index 2e24f26..6968285 100644 --- a/src/api/resources/process/client/Client.ts +++ b/src/api/resources/process/client/Client.ts @@ -33,20 +33,19 @@ export class ProcessClient { * - Identify failed or stuck processes for troubleshooting * * **Key information returned:** - * - Process details (ID, name, type, status) - * - Process creation and completion timestamps - * - Process progress and completion status - * - Error information for failed processes - * - Process result data and download links + * - Process details (ID, name, status) + * - Export download URLs for completed export processes + * - Import details with CSV report URLs for completed import processes + * - Total count of processes for pagination * * **Important considerations:** * - Background processes handle long-running operations like imports and exports - * - Process status indicates current state (queued, processing, completed, failed, cancelled) + * - Process status indicates current state (queued, processing, completed) * - Export processes provide download URLs when completed - * - Failed processes include error messages for troubleshooting + * - Import processes provide CSV report URLs with details about problematic records * - Use pagination for accounts with many historical processes * - Sort options available for creation order (ascending or descending) - * - Different process types handle specific operations (imports, exports, calculations) + * - Default limit is 10 results per page, maximum is 50 * * @param {Brevo.GetProcessesRequest} request * @param {ProcessClient.RequestOptions} requestOptions - Request-specific configuration. @@ -88,7 +87,11 @@ export class ProcessClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -126,18 +129,14 @@ export class ProcessClient { * - Track process execution times * * **Key information returned:** - * - Complete process details and status - * - Import/export statistics and results - * - Error information for troubleshooting - * - Download URLs for export processes - * - Process timing and performance data + * - Complete process details (ID, name, status) + * - Download URLs for completed export processes + * - Import details with CSV report URLs for completed import processes * * **Important considerations:** - * - Process ID must exist in your account - * - Completed processes provide detailed statistics and results - * - Export processes include download URLs when successful - * - Failed processes contain error messages for debugging - * - Timing information helps with performance analysis + * - Process ID must exist in your account and not be deleted + * - Completed export processes include download URLs + * - Completed import processes include CSV report URLs with details about problematic records * - Different process types return different result structures * * @param {Brevo.GetProcessRequest} request @@ -178,7 +177,7 @@ export class ProcessClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/process/types/GetProcessResponse.ts b/src/api/resources/process/types/GetProcessResponse.ts index 8ce6ad6..55898a8 100644 --- a/src/api/resources/process/types/GetProcessResponse.ts +++ b/src/api/resources/process/types/GetProcessResponse.ts @@ -7,16 +7,10 @@ export interface GetProcessResponse { name: GetProcessResponse.Name; /** Current status of the process */ status: GetProcessResponse.Status; - /** Additional process information (for completed processes) */ - info?: (GetProcessResponse.Info | null) | undefined; - /** Download URL for completed export processes */ - export_url?: (string | null) | undefined; - /** Error message for failed processes */ - error?: (string | null) | undefined; - /** Process creation timestamp */ - created_at?: (string | null) | undefined; - /** Process completion timestamp */ - completed_at?: (string | null) | undefined; + /** Additional process information, only returned for completed IMPORTUSER processes. Contains URLs to CSV files with details about problematic records. */ + info?: GetProcessResponse.Info | undefined; + /** Download URL for completed export processes (returned for SEARCH_EXPORT_USERS, SEARCH_EXPORT_USERS_API, CAMPAIGN_USER_DETAILS, and EXPORT_WEBHOOK process types) */ + export_url?: string | undefined; } export namespace GetProcessResponse { @@ -43,44 +37,32 @@ export namespace GetProcessResponse { export type Status = (typeof Status)[keyof typeof Status]; /** - * Additional process information (for completed processes) + * Additional process information, only returned for completed IMPORTUSER processes. Contains URLs to CSV files with details about problematic records. */ export interface Info { - /** Import process details */ + /** Import process details with URLs to CSV reports */ import?: Info.Import | undefined; - /** Export process details */ - export?: Info.Export | undefined; } export namespace Info { /** - * Import process details + * Import process details with URLs to CSV reports */ export interface Import { - /** Number of invalid email addresses */ - invalid_emails?: (number | null) | undefined; - /** Number of duplicate contact IDs */ - duplicate_contact_id?: (number | null) | undefined; - /** Number of duplicate external IDs */ - duplicate_ext_id?: (number | null) | undefined; + /** URL to CSV file containing invalid email addresses, or null if none */ + invalid_emails?: (string | null) | undefined; + /** URL to CSV file containing duplicate contact IDs, or null if none */ + duplicate_contact_id?: (string | null) | undefined; + /** URL to CSV file containing duplicate external IDs, or null if none */ + duplicate_ext_id?: (string | null) | undefined; /** URL to CSV file containing duplicate email IDs, or null if none */ duplicate_email_id?: (string | null) | undefined; - /** Number of duplicate phone numbers */ - duplicate_phone_id?: (number | null) | undefined; - /** Number of duplicate WhatsApp numbers */ - duplicate_whatsapp_id?: (number | null) | undefined; - /** Number of duplicate landline numbers */ - duplicate_landline_number_id?: (number | null) | undefined; - } - - /** - * Export process details - */ - export interface Export { - /** Total number of exported records */ - total_records?: number | undefined; - /** Size of exported file in bytes */ - file_size?: number | undefined; + /** URL to CSV file containing duplicate phone numbers, or null if none */ + duplicate_phone_id?: (string | null) | undefined; + /** URL to CSV file containing duplicate WhatsApp numbers, or null if none */ + duplicate_whatsapp_id?: (string | null) | undefined; + /** URL to CSV file containing duplicate landline numbers, or null if none */ + duplicate_landline_number_id?: (string | null) | undefined; } } } diff --git a/src/api/resources/process/types/GetProcessesResponse.ts b/src/api/resources/process/types/GetProcessesResponse.ts index 7187111..a0018e1 100644 --- a/src/api/resources/process/types/GetProcessesResponse.ts +++ b/src/api/resources/process/types/GetProcessesResponse.ts @@ -18,16 +18,10 @@ export namespace GetProcessesResponse { name: Item.Name; /** Current status of the process */ status: Item.Status; - /** Additional process information (for completed processes) */ - info?: (Item.Info | null) | undefined; - /** Download URL for completed export processes */ - export_url?: (string | null) | undefined; - /** Error message for failed processes */ - error?: (string | null) | undefined; - /** Process creation timestamp */ - created_at?: (string | null) | undefined; - /** Process completion timestamp */ - completed_at?: (string | null) | undefined; + /** Additional process information, only returned for completed IMPORTUSER processes. Contains URLs to CSV files with details about problematic records. */ + info?: Item.Info | undefined; + /** Download URL for completed export processes (returned for SEARCH_EXPORT_USERS, SEARCH_EXPORT_USERS_API, CAMPAIGN_USER_DETAILS, and EXPORT_WEBHOOK process types) */ + export_url?: string | undefined; } export namespace Item { @@ -54,44 +48,32 @@ export namespace GetProcessesResponse { export type Status = (typeof Status)[keyof typeof Status]; /** - * Additional process information (for completed processes) + * Additional process information, only returned for completed IMPORTUSER processes. Contains URLs to CSV files with details about problematic records. */ export interface Info { - /** Import process details */ + /** Import process details with URLs to CSV reports */ import?: Info.Import | undefined; - /** Export process details */ - export?: Info.Export | undefined; } export namespace Info { /** - * Import process details + * Import process details with URLs to CSV reports */ export interface Import { - /** Number of invalid email addresses */ - invalid_emails?: (number | null) | undefined; - /** Number of duplicate contact IDs */ - duplicate_contact_id?: (number | null) | undefined; - /** Number of duplicate external IDs */ - duplicate_ext_id?: (number | null) | undefined; + /** URL to CSV file containing invalid email addresses, or null if none */ + invalid_emails?: (string | null) | undefined; + /** URL to CSV file containing duplicate contact IDs, or null if none */ + duplicate_contact_id?: (string | null) | undefined; + /** URL to CSV file containing duplicate external IDs, or null if none */ + duplicate_ext_id?: (string | null) | undefined; /** URL to CSV file containing duplicate email IDs, or null if none */ duplicate_email_id?: (string | null) | undefined; - /** Number of duplicate phone numbers */ - duplicate_phone_id?: (number | null) | undefined; - /** Number of duplicate WhatsApp numbers */ - duplicate_whatsapp_id?: (number | null) | undefined; - /** Number of duplicate landline numbers */ - duplicate_landline_number_id?: (number | null) | undefined; - } - - /** - * Export process details - */ - export interface Export { - /** Total number of exported records */ - total_records?: number | undefined; - /** Size of exported file in bytes */ - file_size?: number | undefined; + /** URL to CSV file containing duplicate phone numbers, or null if none */ + duplicate_phone_id?: (string | null) | undefined; + /** URL to CSV file containing duplicate WhatsApp numbers, or null if none */ + duplicate_whatsapp_id?: (string | null) | undefined; + /** URL to CSV file containing duplicate landline numbers, or null if none */ + duplicate_landline_number_id?: (string | null) | undefined; } } } diff --git a/src/api/resources/program/client/Client.ts b/src/api/resources/program/client/Client.ts index 43facb8..c418aa4 100644 --- a/src/api/resources/program/client/Client.ts +++ b/src/api/resources/program/client/Client.ts @@ -54,7 +54,7 @@ export class ProgramClient { limit, offset, sort_field: sortField != null ? sortField : undefined, - sort, + sort: sort != null ? sort : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -71,7 +71,11 @@ export class ProgramClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -155,7 +159,7 @@ export class ProgramClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -239,7 +243,7 @@ export class ProgramClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -329,7 +333,7 @@ export class ProgramClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -420,7 +424,7 @@ export class ProgramClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -509,7 +513,7 @@ export class ProgramClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -606,7 +610,11 @@ export class ProgramClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -698,7 +706,7 @@ export class ProgramClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -787,7 +795,7 @@ export class ProgramClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -877,7 +885,7 @@ export class ProgramClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -976,7 +984,11 @@ export class ProgramClient { ), method: "DELETE", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1037,7 +1049,7 @@ export class ProgramClient { * @example * await client.program.subscribeToLoyaltyProgram({ * pid: "pid", - * contactId: 1 + * contactId: 1000000 * }) */ public subscribeToLoyaltyProgram( @@ -1068,7 +1080,7 @@ export class ProgramClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/program/client/requests/GetLpListRequest.ts b/src/api/resources/program/client/requests/GetLpListRequest.ts index c8f85ed..d43a5bf 100644 --- a/src/api/resources/program/client/requests/GetLpListRequest.ts +++ b/src/api/resources/program/client/requests/GetLpListRequest.ts @@ -13,6 +13,6 @@ export interface GetLpListRequest { offset?: number; /** Sort documents by field */ sort_field?: Brevo.GetLpListRequestSortField; - /** Sort documents by field */ - sort?: string; + /** Sort order */ + sort?: Brevo.GetLpListRequestSort; } diff --git a/src/api/resources/program/client/requests/SubscribeToLoyaltyProgramRequest.ts b/src/api/resources/program/client/requests/SubscribeToLoyaltyProgramRequest.ts index c359ebf..772e9f9 100644 --- a/src/api/resources/program/client/requests/SubscribeToLoyaltyProgramRequest.ts +++ b/src/api/resources/program/client/requests/SubscribeToLoyaltyProgramRequest.ts @@ -4,7 +4,7 @@ * @example * { * pid: "pid", - * contactId: 1 + * contactId: 1000000 * } */ export interface SubscribeToLoyaltyProgramRequest { @@ -12,8 +12,10 @@ export interface SubscribeToLoyaltyProgramRequest { pid: string; /** Required contact ID; must be greater than 0. */ contactId: number; - /** Optional custom date-time format. */ - creationDate?: string; /** Optional subscription ID (max length 64). */ loyaltySubscriptionId?: string; + /** Optional creation date in ISO 8601 format (YYYY-MM-DDThh:mm:ss.ffffff+HH:MM). Must be in the past. */ + creationDate?: string; + /** Optional metadata associated with the subscription. */ + meta?: Record; } diff --git a/src/api/resources/program/types/GetLpListRequestSort.ts b/src/api/resources/program/types/GetLpListRequestSort.ts new file mode 100644 index 0000000..90e2837 --- /dev/null +++ b/src/api/resources/program/types/GetLpListRequestSort.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetLpListRequestSort = { + Asc: "asc", + Desc: "desc", +} as const; +export type GetLpListRequestSort = (typeof GetLpListRequestSort)[keyof typeof GetLpListRequestSort]; diff --git a/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts b/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts index e9942bc..840473c 100644 --- a/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts +++ b/src/api/resources/program/types/GetParameterSubscriptionInfoResponse.ts @@ -69,6 +69,8 @@ export namespace GetParameterSubscriptionInfoResponse { rewardId?: string | undefined; /** Timestamp when the reward was last updated. */ updatedAt?: string | undefined; + /** Date from which the voucher becomes valid. */ + validFrom?: string | undefined; } } diff --git a/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts b/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts index 775a80a..05ddc8d 100644 --- a/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts +++ b/src/api/resources/program/types/SubscribeMemberToASubscriptionResponse.ts @@ -1,14 +1,14 @@ // This file was auto-generated by Fern from our API Definition. export interface SubscribeMemberToASubscriptionResponse { - /** Timestamp when the subscription member was created. */ - createdAt?: string | undefined; - /** List of unique member contact IDs. */ - memberContactIds?: number[] | undefined; /** Unique identifier of the organization. */ organizationId?: number | undefined; /** Unique identifier of the subscription owner. */ ownerContactId?: number | undefined; + /** List of unique member contact IDs. */ + memberContactIds?: number[] | undefined; + /** Timestamp when the subscription member was created. */ + createdAt?: string | undefined; /** Timestamp when the subscription member was last updated. */ updatedAt?: string | undefined; } diff --git a/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts b/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts index 9030768..8444ad6 100644 --- a/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts +++ b/src/api/resources/program/types/SubscribeToLoyaltyProgramResponse.ts @@ -1,18 +1,20 @@ // This file was auto-generated by Fern from our API Definition. export interface SubscribeToLoyaltyProgramResponse { - /** Unique identifier of the contact. */ - contactId?: number | undefined; - /** Timestamp when the subscription was created. */ - createdAt?: string | undefined; + /** Unique identifier of the organization. */ + organizationId?: number | undefined; /** Unique identifier of the loyalty program. */ loyaltyProgramId?: string | undefined; + /** Version number of the subscription. */ + versionId?: number | undefined; + /** Unique identifier of the contact. */ + contactId?: number | undefined; /** Unique identifier of the subscription. */ loyaltySubscriptionId?: string | undefined; - /** Unique identifier of the organization. */ - organizationId?: number | undefined; + /** Metadata associated with the subscription. */ + meta?: Record | undefined; + /** Timestamp when the subscription was created. */ + createdAt?: string | undefined; /** Timestamp when the subscription was last updated. */ updatedAt?: string | undefined; - /** Version number of the subscription. */ - versionId?: number | undefined; } diff --git a/src/api/resources/program/types/index.ts b/src/api/resources/program/types/index.ts index 0cec94a..33841d5 100644 --- a/src/api/resources/program/types/index.ts +++ b/src/api/resources/program/types/index.ts @@ -1,3 +1,4 @@ +export * from "./GetLpListRequestSort.js"; export * from "./GetLpListRequestSortField.js"; export * from "./GetLpListResponse.js"; export * from "./GetParameterSubscriptionInfoResponse.js"; diff --git a/src/api/resources/reward/client/Client.ts b/src/api/resources/reward/client/Client.ts index dd836b7..5e4df1a 100644 --- a/src/api/resources/reward/client/Client.ts +++ b/src/api/resources/reward/client/Client.ts @@ -67,7 +67,7 @@ export class RewardClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -161,7 +161,11 @@ export class RewardClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -254,7 +258,7 @@ export class RewardClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -344,7 +348,7 @@ export class RewardClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -439,7 +443,7 @@ export class RewardClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -544,7 +548,7 @@ export class RewardClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -643,7 +647,11 @@ export class RewardClient { ), method: "DELETE", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -723,7 +731,7 @@ export class RewardClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -819,7 +827,11 @@ export class RewardClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -930,7 +942,11 @@ export class RewardClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/reward/client/requests/CreateVoucherRequest.ts b/src/api/resources/reward/client/requests/CreateVoucherRequest.ts index 2ef3851..47850ec 100644 --- a/src/api/resources/reward/client/requests/CreateVoucherRequest.ts +++ b/src/api/resources/reward/client/requests/CreateVoucherRequest.ts @@ -24,4 +24,6 @@ export interface CreateVoucherRequest { rewardId: string; /** Value of the selected reward config */ value?: number; + /** Date from which the voucher becomes valid. Accepts RFC 3339 or DD/MM/YYYY HH:MM AM/PM format. Converted to UTC using the organization's timezone. */ + validFrom?: string; } diff --git a/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts b/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts index d7c38b1..defac8f 100644 --- a/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts +++ b/src/api/resources/reward/client/requests/RedeemVoucherRequest.ts @@ -25,6 +25,8 @@ export interface RedeemVoucherRequest { rewardId?: string; /** Time to live in seconds for the redemption request */ ttl?: number; + /** Whether the redemption should be automatically completed */ + autoComplete?: boolean; } export namespace RedeemVoucherRequest { diff --git a/src/api/resources/reward/types/CreateRewardResponse.ts b/src/api/resources/reward/types/CreateRewardResponse.ts index f65d5f0..ce03cf1 100644 --- a/src/api/resources/reward/types/CreateRewardResponse.ts +++ b/src/api/resources/reward/types/CreateRewardResponse.ts @@ -1,20 +1,20 @@ // This file was auto-generated by Fern from our API Definition. export interface CreateRewardResponse { - /** Timestamp when the reward was created */ - createdAt?: string | undefined; /** Unique identifier for the reward */ id?: string | undefined; - /** Id of the loyalty program to which the current reward belongs to */ + /** Loyalty program to which the reward belongs */ loyaltyProgramId?: string | undefined; /** Name of the reward */ name?: string | undefined; - /** Public description for the reward */ + /** Public description of the reward */ publicDescription?: string | undefined; - /** Public Image for the reward */ + /** Public image URL of the reward */ publicImage?: string | undefined; - /** Public name for the reward */ + /** Public name of the reward */ publicName?: string | undefined; - /** Timestamp for when this reward was last updated. */ + /** Timestamp when the reward was created */ + createdAt?: string | undefined; + /** Timestamp when the reward was last updated */ updatedAt?: string | undefined; } diff --git a/src/api/resources/reward/types/CreateVoucherResponse.ts b/src/api/resources/reward/types/CreateVoucherResponse.ts index 56901dd..12bb420 100644 --- a/src/api/resources/reward/types/CreateVoucherResponse.ts +++ b/src/api/resources/reward/types/CreateVoucherResponse.ts @@ -23,4 +23,6 @@ export interface CreateVoucherResponse { updatedAt?: string | undefined; /** Value of the selected reward config */ value?: number | undefined; + /** Date from which the voucher becomes valid */ + validFrom?: string | undefined; } diff --git a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts index 1e72ee3..d571a98 100644 --- a/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts +++ b/src/api/resources/reward/types/GetLoyaltyOfferProgramsPidVouchersResponse.ts @@ -38,6 +38,8 @@ export namespace GetLoyaltyOfferProgramsPidVouchersResponse { updatedAt?: string | undefined; /** Value of the selected reward config */ value?: number | undefined; + /** Date from which the voucher becomes valid */ + validFrom?: string | undefined; } } } diff --git a/src/api/resources/senders/client/Client.ts b/src/api/resources/senders/client/Client.ts index 4edf96a..8ae5586 100644 --- a/src/api/resources/senders/client/Client.ts +++ b/src/api/resources/senders/client/Client.ts @@ -84,7 +84,11 @@ export class SendersClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -196,7 +200,7 @@ export class SendersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -270,7 +274,7 @@ export class SendersClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -391,7 +395,7 @@ export class SendersClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -471,7 +475,7 @@ export class SendersClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -552,7 +556,7 @@ export class SendersClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -640,7 +644,7 @@ export class SendersClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/senders/types/GetIpsResponse.ts b/src/api/resources/senders/types/GetIpsResponse.ts index 4614c77..a507d52 100644 --- a/src/api/resources/senders/types/GetIpsResponse.ts +++ b/src/api/resources/senders/types/GetIpsResponse.ts @@ -13,12 +13,12 @@ export namespace GetIpsResponse { export namespace Ips { export interface Item { + /** ID of the dedicated IP */ + id: number; /** Status of the IP (true=active, false=inactive) */ active: boolean; /** Domain associated to the IP */ domain: string; - /** ID of the dedicated IP */ - id: number; /** Dedicated IP address */ ip: string; } diff --git a/src/api/resources/smsCampaigns/client/Client.ts b/src/api/resources/smsCampaigns/client/Client.ts index 7bf2355..e552162 100644 --- a/src/api/resources/smsCampaigns/client/Client.ts +++ b/src/api/resources/smsCampaigns/client/Client.ts @@ -23,6 +23,8 @@ export class SmsCampaignsClient { } /** + * Retrieve a paginated list of all your SMS campaigns with their statistics and recipient information. Results can be filtered by status and date range, with a default limit of 500 and maximum of 1000 per page. The sort order defaults to descending by creation date; date filters are only available when status is not passed or is set to sent. + * * @param {Brevo.GetSmsCampaignsRequest} request * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -66,7 +68,11 @@ export class SmsCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -94,6 +100,8 @@ export class SmsCampaignsClient { } /** + * Create a new SMS campaign with the required name, sender, and content fields. The sender name is limited to 11 alphanumeric characters or 15 numeric characters, and the content should stay within 160 characters per SMS segment. If a scheduledAt date is provided, listIds in recipients become mandatory; accounts under validation are limited to 4 total campaigns and campaigns with more than 10 recipients will be saved as draft. + * * @param {Brevo.CreateSmsCampaignRequest} request * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -133,7 +141,7 @@ export class SmsCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -163,6 +171,8 @@ export class SmsCampaignsClient { } /** + * Retrieve detailed information about a specific SMS campaign by its ID, including campaign content, sender, recipients with list names, statistics (delivered, sent, bounces, unsubscriptions, answered), and tags. Unlike the list endpoint, recipients are returned as objects with id and name fields rather than plain IDs. + * * @param {Brevo.GetSmsCampaignRequest} request * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -201,7 +211,7 @@ export class SmsCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -231,6 +241,8 @@ export class SmsCampaignsClient { } /** + * Update an existing SMS campaign''s properties such as name, sender, content, recipients, scheduled date, organisation prefix, and unsubscribe instructions. The request body must contain at least one valid field to update. The campaign must exist and must be of type SMS; if a scheduledAt is provided, valid recipients must be present either in the request or already configured on the campaign. + * * @param {Brevo.UpdateSmsCampaignRequest} request * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -270,7 +282,7 @@ export class SmsCampaignsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -302,6 +314,8 @@ export class SmsCampaignsClient { } /** + * Delete an SMS campaign by its campaign ID. Only campaigns that have not been scheduled or sent can be deleted; attempting to delete a campaign that is queued, in process, or has been sent with recipients will return a 403 permission denied error. + * * @param {Brevo.DeleteSmsCampaignRequest} request * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -340,7 +354,7 @@ export class SmsCampaignsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -412,7 +426,7 @@ export class SmsCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -452,6 +466,8 @@ export class SmsCampaignsClient { } /** + * Send an existing SMS campaign immediately by scheduling it for the current time. The system verifies your account''s SMS credit balance before dispatching; if credits are insufficient or the remaining credit is less than the number of recipients, a 402 error is returned. The campaign must have valid recipients and content already configured. + * * @param {Brevo.SendSmsCampaignNowRequest} request * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -491,7 +507,7 @@ export class SmsCampaignsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -578,7 +594,7 @@ export class SmsCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -615,6 +631,8 @@ export class SmsCampaignsClient { } /** + * Send a test SMS to a specified phone number to preview the campaign before sending it to all recipients. The phone number must belong to one of your existing contacts in your Brevo account and must not be blacklisted. The number should include the country code (e.g. 33689965433). + * * @param {Brevo.SendTestSmsRequest} request * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -654,7 +672,7 @@ export class SmsCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -691,6 +709,8 @@ export class SmsCampaignsClient { } /** + * Update the status of an SMS campaign, such as suspending, archiving, or replicating it. Available status values include suspended, archive, darchive, sent, queued, replicate, replicateTemplate, cancel, and draft. Note that the replicateTemplate status is only available for template type campaigns. + * * @param {Brevo.UpdateSmsCampaignStatusRequest} request * @param {SmsCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -731,7 +751,7 @@ export class SmsCampaignsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignsRequest.ts b/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignsRequest.ts index 31e8ff6..b99e102 100644 --- a/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignsRequest.ts +++ b/src/api/resources/smsCampaigns/client/requests/GetSmsCampaignsRequest.ts @@ -9,11 +9,11 @@ import type * as Brevo from "../../../../index.js"; export interface GetSmsCampaignsRequest { /** Status of campaign. */ status?: Brevo.GetSmsCampaignsRequestStatus; - /** **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) */ + /** **Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent SMS campaigns. **Prefer to pass your timezone in date-time format for accurate result.** Only available if `status` is not passed or is set to `sent`. `startDate` must not be in the future. */ startDate?: string; - /** **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' ) */ + /** **Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent SMS campaigns. **Prefer to pass your timezone in date-time format for accurate result.** Only available if `status` is not passed or is set to `sent`. `endDate` must not be in the future. */ endDate?: string; - /** Number limitation for the result returned */ + /** Number of documents per page */ limit?: number; /** Beginning point in the list to retrieve from. */ offset?: number; diff --git a/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts b/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts index e58d7f3..8301516 100644 --- a/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts +++ b/src/api/resources/smsCampaigns/types/GetSmsCampaignResponse.ts @@ -13,14 +13,23 @@ export interface GetSmsCampaignResponse { modifiedAt: string; /** Name of the SMS Campaign */ name: string; - /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ + /** A recognizable prefix added as the Brand Name before the message content. Empty string if not set. */ + organisationPrefix?: string | undefined; + /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format. Empty string if not scheduled. */ scheduledAt?: string | undefined; /** Sender of the SMS Campaign */ sender: string; + /** UTC date-time on which the SMS campaign was sent (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if the campaign status is 'sent'. */ + sentDate?: string | undefined; /** Status of the SMS Campaign */ status: GetSmsCampaignResponse.Status; - recipients: Brevo.GetCampaignRecipients; + /** Instructions to unsubscribe from future communications. Empty string if not set. */ + unsubscribeInstruction?: string | undefined; + /** Recipients of the SMS campaign. For a single campaign, lists and exclusion lists are returned as objects with id and name. */ + recipients: GetSmsCampaignResponse.Recipients; statistics: Brevo.GetSmsCampaignStats; + /** Tags (labels) associated with the SMS campaign. Only available when retrieving a single campaign. */ + tags?: string[] | undefined; } export namespace GetSmsCampaignResponse { @@ -34,4 +43,36 @@ export namespace GetSmsCampaignResponse { InProcess: "inProcess", } as const; export type Status = (typeof Status)[keyof typeof Status]; + + /** + * Recipients of the SMS campaign. For a single campaign, lists and exclusion lists are returned as objects with id and name. + */ + export interface Recipients { + exclusionLists?: Recipients.ExclusionLists.Item[] | undefined; + lists?: Recipients.Lists.Item[] | undefined; + } + + export namespace Recipients { + export type ExclusionLists = ExclusionLists.Item[]; + + export namespace ExclusionLists { + export interface Item { + /** ID of the exclusion list */ + id?: number | undefined; + /** Name of the exclusion list */ + name?: string | undefined; + } + } + + export type Lists = Lists.Item[]; + + export namespace Lists { + export interface Item { + /** ID of the list */ + id?: number | undefined; + /** Name of the list */ + name?: string | undefined; + } + } + } } diff --git a/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts b/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts index 2e07b14..db58610 100644 --- a/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts +++ b/src/api/resources/smsCampaigns/types/GetSmsCampaignsResponse.ts @@ -23,12 +23,18 @@ export namespace GetSmsCampaignsResponse { modifiedAt: string; /** Name of the SMS Campaign */ name: string; - /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ + /** A recognizable prefix added as the Brand Name before the message content. Empty string if not set. */ + organisationPrefix?: string | undefined; + /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format. Empty string if not scheduled. */ scheduledAt?: string | undefined; /** Sender of the SMS Campaign */ sender: string; + /** UTC date-time on which the SMS campaign was sent (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if the campaign status is 'sent'. */ + sentDate?: string | undefined; /** Status of the SMS Campaign */ status: Item.Status; + /** Instructions to unsubscribe from future communications. Empty string if not set. */ + unsubscribeInstruction?: string | undefined; recipients: Brevo.GetCampaignRecipients; statistics: Brevo.GetSmsCampaignStats; } diff --git a/src/api/resources/smsTemplates/client/Client.ts b/src/api/resources/smsTemplates/client/Client.ts index b9c2fd2..7535b93 100644 --- a/src/api/resources/smsTemplates/client/Client.ts +++ b/src/api/resources/smsTemplates/client/Client.ts @@ -63,7 +63,11 @@ export class SmsTemplatesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/tasks/client/Client.ts b/src/api/resources/tasks/client/Client.ts index 4e85ecc..477bee5 100644 --- a/src/api/resources/tasks/client/Client.ts +++ b/src/api/resources/tasks/client/Client.ts @@ -23,6 +23,8 @@ export class TasksClient { } /** + * Retrieve a paginated list of CRM tasks with optional filtering by task type, status, date range, assignee, and linked entities (contacts, deals, companies). Results are sorted by creation date in descending order by default, with a default limit of 50 tasks per page. + * * @param {Brevo.GetCrmTasksRequest} request * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -89,7 +91,11 @@ export class TasksClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -117,6 +123,8 @@ export class TasksClient { } /** + * Create a new CRM task with the specified name, type, due date, and optional associations to contacts, companies, or deals. A task requires a name, task type ID, and due date at minimum. You can also set a duration, notes, a reminder, and assign the task to a specific user. + * * @param {Brevo.PostCrmTasksRequest} request * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -125,7 +133,7 @@ export class TasksClient { * @example * await client.tasks.createATask({ * date: "2021-11-01T17:44:54Z", - * name: "Task: Connect with client_dev", + * name: "Task: Connect with client", * taskTypeId: "61a5cd07ca1347c82306ad09" * }) */ @@ -156,7 +164,7 @@ export class TasksClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -186,6 +194,8 @@ export class TasksClient { } /** + * Retrieve the full details of a single CRM task by its identifier. The response includes the task''s name, type, status, due date, duration, notes, assignee, reminder settings, and linked contacts, companies, or deals. + * * @param {Brevo.GetCrmTasksIdRequest} request * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -224,7 +234,7 @@ export class TasksClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -254,6 +264,8 @@ export class TasksClient { } /** + * Permanently delete a CRM task by its identifier. This removes the task and cancels any associated reminders. The requesting user must be the task assignee or have manage permission on tasks. + * * @param {Brevo.DeleteCrmTasksIdRequest} request * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -292,7 +304,7 @@ export class TasksClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -322,6 +334,8 @@ export class TasksClient { } /** + * Update an existing CRM task''s properties such as name, type, due date, status, duration, notes, assignee, reminder, or linked entities. Only the fields provided in the request body will be updated; omitted fields remain unchanged. + * * @param {Brevo.PatchCrmTasksIdRequest} request * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -361,7 +375,7 @@ export class TasksClient { method: "PATCH", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -393,20 +407,24 @@ export class TasksClient { } /** + * Retrieve the list of all available task types, such as Email, Call, Meeting, Todo, Lunch, Deadline, and LinkedIn. If no task types exist yet, the default set is automatically created and returned. Use the task type ID when creating or updating tasks. + * * @param {TasksClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.tasks.getAllTaskTypes() */ public getAllTaskTypes( requestOptions?: TasksClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getAllTaskTypes(requestOptions)); } private async __getAllTaskTypes( requestOptions?: TasksClient.RequestOptions, - ): Promise> { + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -422,7 +440,7 @@ export class TasksClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -430,15 +448,20 @@ export class TasksClient { logging: this._options.logging, }); if (_response.ok) { - return { data: _response.body as Brevo.GetCrmTasktypesResponse, rawResponse: _response.rawResponse }; + return { data: _response.body as Brevo.GetCrmTasktypesResponseItem[], rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/crm/tasktypes"); diff --git a/src/api/resources/tasks/client/requests/PostCrmTasksRequest.ts b/src/api/resources/tasks/client/requests/PostCrmTasksRequest.ts index 407964c..ff65e41 100644 --- a/src/api/resources/tasks/client/requests/PostCrmTasksRequest.ts +++ b/src/api/resources/tasks/client/requests/PostCrmTasksRequest.ts @@ -6,7 +6,7 @@ import type * as Brevo from "../../../../index.js"; * @example * { * date: "2021-11-01T17:44:54Z", - * name: "Task: Connect with client_dev", + * name: "Task: Connect with client", * taskTypeId: "61a5cd07ca1347c82306ad09" * } */ diff --git a/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts b/src/api/resources/tasks/types/GetCrmTasktypesResponseItem.ts similarity index 71% rename from src/api/resources/tasks/types/GetCrmTasktypesResponse.ts rename to src/api/resources/tasks/types/GetCrmTasktypesResponseItem.ts index b9317e3..48532c6 100644 --- a/src/api/resources/tasks/types/GetCrmTasktypesResponse.ts +++ b/src/api/resources/tasks/types/GetCrmTasktypesResponseItem.ts @@ -1,9 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -/** - * Task types details - */ -export interface GetCrmTasktypesResponse { +export interface GetCrmTasktypesResponseItem { /** Id of task type */ id?: string | undefined; /** Title of task type */ diff --git a/src/api/resources/tasks/types/index.ts b/src/api/resources/tasks/types/index.ts index cb1bf53..2426afd 100644 --- a/src/api/resources/tasks/types/index.ts +++ b/src/api/resources/tasks/types/index.ts @@ -2,5 +2,5 @@ export * from "./GetCrmTasksRequestFilterDate.js"; export * from "./GetCrmTasksRequestFilterStatus.js"; export * from "./GetCrmTasksRequestSort.js"; export * from "./GetCrmTasksResponse.js"; -export * from "./GetCrmTasktypesResponse.js"; +export * from "./GetCrmTasktypesResponseItem.js"; export * from "./PostCrmTasksResponse.js"; diff --git a/src/api/resources/tier/client/Client.ts b/src/api/resources/tier/client/Client.ts index d97c22b..453ef50 100644 --- a/src/api/resources/tier/client/Client.ts +++ b/src/api/resources/tier/client/Client.ts @@ -70,7 +70,7 @@ export class TierClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -164,7 +164,11 @@ export class TierClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -254,7 +258,7 @@ export class TierClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -349,7 +353,11 @@ export class TierClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -442,7 +450,7 @@ export class TierClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -533,7 +541,7 @@ export class TierClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -626,7 +634,7 @@ export class TierClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -718,7 +726,11 @@ export class TierClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -810,7 +822,7 @@ export class TierClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -900,7 +912,7 @@ export class TierClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts b/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts index 642d878..f2eaf20 100644 --- a/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts +++ b/src/api/resources/tier/client/requests/CreateTierGroupRequest.ts @@ -20,6 +20,10 @@ export interface CreateTierGroupRequest { tierOrder?: string[]; /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ upgradeStrategy?: CreateTierGroupRequest.UpgradeStrategy; + /** Schedule configuration for tier upgrades. Required when upgradeStrategy is set to a schedule-based strategy. */ + upgradeSchedule?: CreateTierGroupRequest.UpgradeSchedule; + /** Schedule configuration for tier downgrades. Required when downgradeStrategy is set to a schedule-based strategy. */ + downgradeSchedule?: CreateTierGroupRequest.DowngradeSchedule; } export namespace CreateTierGroupRequest { @@ -48,4 +52,66 @@ export namespace CreateTierGroupRequest { TierAnniversary: "tier_anniversary", } as const; export type UpgradeStrategy = (typeof UpgradeStrategy)[keyof typeof UpgradeStrategy]; + + /** + * Schedule configuration for tier upgrades. Required when upgradeStrategy is set to a schedule-based strategy. + */ + export interface UpgradeSchedule { + /** Duration value for the schedule. */ + durationValue?: number | undefined; + /** Duration unit for the schedule. */ + durationUnit?: UpgradeSchedule.DurationUnit | undefined; + /** Modifier for the duration. */ + durationModifier?: UpgradeSchedule.DurationModifier | undefined; + /** Scheduled date in DD/MM format. */ + scheduledDate?: string | undefined; + } + + export namespace UpgradeSchedule { + /** Duration unit for the schedule. */ + export const DurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit]; + /** Modifier for the duration. */ + export const DurationModifier = { + StartOfPeriod: "start_of_period", + EndOfPeriod: "end_of_period", + } as const; + export type DurationModifier = (typeof DurationModifier)[keyof typeof DurationModifier]; + } + + /** + * Schedule configuration for tier downgrades. Required when downgradeStrategy is set to a schedule-based strategy. + */ + export interface DowngradeSchedule { + /** Duration value for the schedule. */ + durationValue?: number | undefined; + /** Duration unit for the schedule. */ + durationUnit?: DowngradeSchedule.DurationUnit | undefined; + /** Modifier for the duration. */ + durationModifier?: DowngradeSchedule.DurationModifier | undefined; + /** Scheduled date in DD/MM format. */ + scheduledDate?: string | undefined; + } + + export namespace DowngradeSchedule { + /** Duration unit for the schedule. */ + export const DurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit]; + /** Modifier for the duration. */ + export const DurationModifier = { + StartOfPeriod: "start_of_period", + EndOfPeriod: "end_of_period", + } as const; + export type DurationModifier = (typeof DurationModifier)[keyof typeof DurationModifier]; + } } diff --git a/src/api/resources/transactionalEmails/client/Client.ts b/src/api/resources/transactionalEmails/client/Client.ts index 4d7da71..d0eb476 100644 --- a/src/api/resources/transactionalEmails/client/Client.ts +++ b/src/api/resources/transactionalEmails/client/Client.ts @@ -23,6 +23,8 @@ export class TransactionalEmailsClient { } /** + * Retrieve a paginated list of transactional contacts that have been blocked or unsubscribed, along with the reason for blocking (e.g. hard bounce, admin blocked, spam complaint, or unsubscription via email/API/Marketing Automation). Both `startDate` and `endDate` must be provided together when filtering by date range, and neither date can be in the future. Results default to 50 per page (max 100) and are sorted in descending order of record creation unless overridden with the `sort` parameter. + * * @param {Brevo.GetTransacBlockedContactsRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -66,7 +68,12 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .add("senders", _queryParams.senders, { style: "comma" }) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -97,6 +104,8 @@ export class TransactionalEmailsClient { } /** + * Unblock or resubscribe a transactional contact by removing their email address from the blacklist. The email address must be URL-encoded in the path parameter and must be a valid email format. If the contact is not found in the blocklist, a 404 error is returned. + * * @param {Brevo.DeleteSmtpBlockedContactsEmailRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -137,7 +146,7 @@ export class TransactionalEmailsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -176,6 +185,8 @@ export class TransactionalEmailsClient { * * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * * @example * await client.transactionalEmails.getBlockedDomains() */ @@ -203,7 +214,7 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -215,11 +226,16 @@ export class TransactionalEmailsClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/blockedDomains"); @@ -265,7 +281,7 @@ export class TransactionalEmailsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -335,7 +351,7 @@ export class TransactionalEmailsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -407,7 +423,7 @@ export class TransactionalEmailsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -437,6 +453,8 @@ export class TransactionalEmailsClient { } /** + * Send a transactional email to one or more recipients, either using inline HTML content or a pre-built template via `templateId`. You can schedule emails for future delivery using `scheduledAt` (UTC, up to 5-minute delay), send multiple personalized versions with `messageVersions` (max 2000 total recipients, 99 per version), and attach files via URL or base64-encoded content. A `sender` and `subject` are required when no `templateId` is provided; when a `templateId` is used, the template''s sender and subject are applied unless overridden. + * * @param {Brevo.SendTransacEmailRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -501,7 +519,7 @@ export class TransactionalEmailsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -571,7 +589,7 @@ export class TransactionalEmailsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -651,7 +669,11 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -733,7 +755,11 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -768,6 +794,9 @@ export class TransactionalEmailsClient { * @param {Brevo.GetTransacEmailContentRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link Brevo.BadRequestError} + * @throws {@link Brevo.NotFoundError} + * * @example * await client.transactionalEmails.getTransacEmailContent({ * uuid: "uuid" @@ -800,7 +829,7 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -812,17 +841,26 @@ export class TransactionalEmailsClient { } if (_response.error.reason === "status-code") { - throw new errors.BrevoError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); + switch (_response.error.statusCode) { + case 400: + throw new Brevo.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 404: + throw new Brevo.NotFoundError(_response.error.body as unknown, _response.rawResponse); + default: + throw new errors.BrevoError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/smtp/emails/{uuid}"); } /** + * Delete SMTP transactional log entries identified by a message ID (enclosed in angle brackets with an @ sign) or a valid email address. Optionally narrow the deletion to a specific date range using `from_date` and `to_date` query parameters (YYYY-MM-DD format). The operation also removes any associated stored email preview content. + * * @param {Brevo.DeleteSmtpLogIdentifierRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -845,7 +883,11 @@ export class TransactionalEmailsClient { request: Brevo.DeleteSmtpLogIdentifierRequest, requestOptions?: TransactionalEmailsClient.RequestOptions, ): Promise> { - const { identifier } = request; + const { identifier, from_date: fromDate, to_date: toDate } = request; + const _queryParams: Record = { + from_date: fromDate, + to_date: toDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -861,7 +903,11 @@ export class TransactionalEmailsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -934,7 +980,11 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1020,7 +1070,11 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1048,6 +1102,8 @@ export class TransactionalEmailsClient { } /** + * This endpoint will show the aggregated stats per day for the past 10 days by default if `startDate` and `endDate` OR `days` is not passed. The date range can not exceed 30 days. + * * @param {Brevo.GetSmtpReportRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1092,7 +1148,11 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1120,7 +1180,9 @@ export class TransactionalEmailsClient { } /** - * @param {unknown} request + * Generate a fully rendered preview of a transactional email template by resolving dynamic variables. Provide either an `email` address (to populate variables from the contact''s attributes) or a `params` object with key-value pairs for manual substitution; at least one of these is required alongside the mandatory `templateId`. The response includes the rendered HTML, subject, sender details, preview text, and any feed names used in the template. + * + * @param {Brevo.PostPreviewSmtpEmailTemplatesRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} @@ -1131,14 +1193,14 @@ export class TransactionalEmailsClient { * }) */ public postPreviewSmtpEmailTemplates( - request?: unknown, + request: Brevo.PostPreviewSmtpEmailTemplatesRequest, requestOptions?: TransactionalEmailsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__postPreviewSmtpEmailTemplates(request, requestOptions)); } private async __postPreviewSmtpEmailTemplates( - request?: unknown, + request: Brevo.PostPreviewSmtpEmailTemplatesRequest, requestOptions?: TransactionalEmailsClient.RequestOptions, ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -1157,7 +1219,7 @@ export class TransactionalEmailsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1190,6 +1252,8 @@ export class TransactionalEmailsClient { } /** + * Retrieve a paginated list of all transactional email templates (including automation templates) with their details such as name, subject, sender, status, HTML content, and timestamps. Results default to 50 per page (max 1000) and are sorted in descending creation order unless overridden. You can filter by active/inactive status using `templateStatus` and by editor type using `editorType` (currently only `richTextEditor` is supported). + * * @param {Brevo.GetSmtpTemplatesRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1209,12 +1273,13 @@ export class TransactionalEmailsClient { request: Brevo.GetSmtpTemplatesRequest = {}, requestOptions?: TransactionalEmailsClient.RequestOptions, ): Promise> { - const { templateStatus, limit, offset, sort } = request; + const { templateStatus, limit, offset, sort, editorType } = request; const _queryParams: Record = { templateStatus, limit, offset, sort: sort != null ? sort : undefined, + editorType: editorType != null ? editorType : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -1231,7 +1296,11 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1259,6 +1328,8 @@ export class TransactionalEmailsClient { } /** + * Create a new transactional email template with the specified sender, subject, and content. The `sender`, `subject`, and `templateName` fields are required. Template content can be provided via `htmlContent` (minimum 10 characters) or `htmlUrl`; at least one must be supplied. Templates are created as inactive by default unless `isActive` is explicitly set to `true`. + * * @param {Brevo.CreateSmtpTemplateRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1298,7 +1369,7 @@ export class TransactionalEmailsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1328,6 +1399,8 @@ export class TransactionalEmailsClient { } /** + * Retrieve the full details of a specific transactional email template by its numeric ID or custom template identifier string. The response includes the template name, subject, sender information, HTML content, active status, creation and modification timestamps, reply-to address, tag, and a `doiTemplate` flag indicating whether the template is a double opt-in template (detected by the presence of optin-related tags or variables in the content). + * * @param {Brevo.GetSmtpTemplateRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1366,7 +1439,7 @@ export class TransactionalEmailsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1396,6 +1469,8 @@ export class TransactionalEmailsClient { } /** + * Update an existing transactional email template by its numeric ID or custom template identifier string. All fields in the request body are optional; only the provided fields will be updated. You can update the template name, subject, sender, reply-to address, HTML content (via `htmlContent` or `htmlUrl`), active status, tag, attachment URL, and the personalized `toField`. Only one of sender email or sender ID should be provided per request. + * * @param {Brevo.UpdateSmtpTemplateRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1435,7 +1510,7 @@ export class TransactionalEmailsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -1467,6 +1542,8 @@ export class TransactionalEmailsClient { } /** + * Permanently delete a transactional email template by its numeric ID. Only inactive templates can be deleted; attempting to delete an active template returns a 405 error. To deactivate a template before deletion, use `PUT /smtp/templates/{templateId}` with `isActive` set to `false`. Deletion also removes associated newsletter template data and triggers asynchronous cleanup of shared assets. + * * @param {Brevo.DeleteSmtpTemplateRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1505,7 +1582,7 @@ export class TransactionalEmailsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1540,6 +1617,8 @@ export class TransactionalEmailsClient { } /** + * Send a test email of the specified transactional template to one or more recipients. Provide an array of email addresses in the `emailTo` field; if left empty, the test mail is sent to your entire test list. You can send a maximum of 50 test emails per day, and all provided email addresses must be valid. + * * @param {Brevo.SendTestTemplateRequest} request * @param {TransactionalEmailsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -1580,7 +1659,7 @@ export class TransactionalEmailsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, diff --git a/src/api/resources/transactionalEmails/client/requests/DeleteScheduledEmailByIdRequest.ts b/src/api/resources/transactionalEmails/client/requests/DeleteScheduledEmailByIdRequest.ts index 8d943ea..13a0d9a 100644 --- a/src/api/resources/transactionalEmails/client/requests/DeleteScheduledEmailByIdRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/DeleteScheduledEmailByIdRequest.ts @@ -7,6 +7,6 @@ * } */ export interface DeleteScheduledEmailByIdRequest { - /** The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. */ + /** The `batchId` of scheduled emails batch (must be a valid UUIDv4) or the `messageId` of scheduled email (enclosed in angle brackets with @ sign, e.g. `<...@domain>`). */ identifier: string; } diff --git a/src/api/resources/transactionalEmails/client/requests/DeleteSmtpLogIdentifierRequest.ts b/src/api/resources/transactionalEmails/client/requests/DeleteSmtpLogIdentifierRequest.ts index 2b0e9d8..a4a24f1 100644 --- a/src/api/resources/transactionalEmails/client/requests/DeleteSmtpLogIdentifierRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/DeleteSmtpLogIdentifierRequest.ts @@ -7,6 +7,10 @@ * } */ export interface DeleteSmtpLogIdentifierRequest { - /** MessageId of the transactional log(s) to delete */ + /** MessageId or email address of the transactional log(s) to delete. Must be a valid message ID (enclosed in angle brackets with @ sign) or a valid email address. */ identifier: string; + /** Starting date (YYYY-MM-DD) to narrow down logs for deletion */ + from_date?: string; + /** Ending date (YYYY-MM-DD) to narrow down logs for deletion */ + to_date?: string; } diff --git a/src/api/resources/transactionalEmails/client/requests/GetAggregatedSmtpReportRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetAggregatedSmtpReportRequest.ts index a2871dd..1269716 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetAggregatedSmtpReportRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetAggregatedSmtpReportRequest.ts @@ -9,7 +9,7 @@ export interface GetAggregatedSmtpReportRequest { startDate?: string; /** **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate */ endDate?: string; - /** Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ */ + /** Number of days in the past including today (positive integer, maximum 90). _Not compatible with 'startDate' and 'endDate'_. Defaults to 90 if neither dates nor days are provided. */ days?: number; /** Tag of the emails */ tag?: string; diff --git a/src/api/resources/transactionalEmails/client/requests/GetEmailEventReportRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetEmailEventReportRequest.ts index 7da330b..80c8300 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetEmailEventReportRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetEmailEventReportRequest.ts @@ -15,7 +15,7 @@ export interface GetEmailEventReportRequest { startDate?: string; /** **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate */ endDate?: string; - /** Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ */ + /** Number of days in the past including today (positive integer, maximum 90). _Not compatible with 'startDate' and 'endDate'_. Defaults to 30 if neither dates nor days are provided. */ days?: number; /** Filter the report for a specific email addresses */ email?: string; diff --git a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts index 1f724df..b9a6e91 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetScheduledEmailByIdRequest.ts @@ -11,9 +11,9 @@ import type * as Brevo from "../../../../index.js"; * } */ export interface GetScheduledEmailByIdRequest { - /** The `batchId` of scheduled emails batch (Should be a valid UUIDv4) or the `messageId` of scheduled email. */ + /** The `batchId` of scheduled emails batch (must be a valid UUIDv4) or the `messageId` of scheduled email (enclosed in angle brackets with @ sign, e.g. `<...@domain>`). When using `messageId`, the `limit`, `offset`, `sort`, and `status` query parameters are ignored. */ identifier: string; - /** Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Can be maximum 30 days older tha current date. */ + /** Mandatory if `endDate` is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Cannot be more than 30 days older than the current date. */ startDate?: string; /** Mandatory if `startDate` is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. */ endDate?: string; diff --git a/src/api/resources/transactionalEmails/client/requests/GetSmtpReportRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetSmtpReportRequest.ts index f2fd0b2..b313520 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetSmtpReportRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetSmtpReportRequest.ts @@ -15,7 +15,7 @@ export interface GetSmtpReportRequest { startDate?: string; /** **Mandatory if startDate is used.** Ending date of the report (YYYY-MM-DD) */ endDate?: string; - /** Number of days in the past including today (positive integer). _Not compatible with 'startDate' and 'endDate'_ */ + /** Number of days in the past including today (positive integer, maximum 30). _Not compatible with 'startDate' and 'endDate'_ */ days?: number; /** Tag of the emails */ tag?: string; diff --git a/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplateRequest.ts index b674209..29bd0a9 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplateRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplateRequest.ts @@ -1,5 +1,7 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Brevo from "../../../../index.js"; + /** * @example * { @@ -7,6 +9,6 @@ * } */ export interface GetSmtpTemplateRequest { - /** id of the template */ - templateId: number; + /** ID of the template. Can be a numeric template ID or a custom template identifier string (alphanumeric, hyphens, and underscores only, max 64 characters, must start with a letter). */ + templateId: Brevo.GetSmtpTemplateRequestTemplateId; } diff --git a/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplatesRequest.ts b/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplatesRequest.ts index 368e057..81f4b20 100644 --- a/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplatesRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/GetSmtpTemplatesRequest.ts @@ -15,4 +15,6 @@ export interface GetSmtpTemplatesRequest { offset?: number; /** Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed */ sort?: Brevo.GetSmtpTemplatesRequestSort; + /** Filter on the editor type used to create the template. Currently only `richTextEditor` is supported as a filter value. */ + editorType?: "richTextEditor"; } diff --git a/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts b/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts index ef44548..8a2581c 100644 --- a/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/UpdateSmtpTemplateRequest.ts @@ -1,5 +1,7 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Brevo from "../../../../index.js"; + /** * @example * { @@ -7,8 +9,8 @@ * } */ export interface UpdateSmtpTemplateRequest { - /** id of the template */ - templateId: number; + /** ID of the template. Can be a numeric template ID or a custom template identifier string. */ + templateId: Brevo.UpdateSmtpTemplateRequestTemplateId; /** Absolute url of the attachment (**no local file**). Extensions allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps */ attachmentUrl?: string; /** **Required if htmlUrl is empty**. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters) */ diff --git a/src/api/resources/transactionalEmails/types/GetSmtpTemplateRequestTemplateId.ts b/src/api/resources/transactionalEmails/types/GetSmtpTemplateRequestTemplateId.ts new file mode 100644 index 0000000..29ae6f7 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/GetSmtpTemplateRequestTemplateId.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type GetSmtpTemplateRequestTemplateId = number | string; diff --git a/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts b/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts index 810cecd..32002f7 100644 --- a/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts +++ b/src/api/resources/transactionalEmails/types/GetTransacEmailContentResponse.ts @@ -2,9 +2,9 @@ export interface GetTransacEmailContentResponse { /** Count of the attachments that were sent in the email */ - attachmentCount: number; + attachmentCount?: number | undefined; /** Actual content of the transactional email that has been sent */ - body: string; + body?: string | undefined; /** Date on which transactional email was sent */ date: string; /** Email address to which transactional email has been sent */ diff --git a/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesRequest.ts b/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesRequest.ts new file mode 100644 index 0000000..a7e99c4 --- /dev/null +++ b/src/api/resources/transactionalEmails/types/PostPreviewSmtpEmailTemplatesRequest.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type PostPreviewSmtpEmailTemplatesRequest = unknown; diff --git a/src/api/resources/transactionalEmails/types/UpdateSmtpTemplateRequestTemplateId.ts b/src/api/resources/transactionalEmails/types/UpdateSmtpTemplateRequestTemplateId.ts new file mode 100644 index 0000000..158368f --- /dev/null +++ b/src/api/resources/transactionalEmails/types/UpdateSmtpTemplateRequestTemplateId.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type UpdateSmtpTemplateRequestTemplateId = number | string; diff --git a/src/api/resources/transactionalEmails/types/index.ts b/src/api/resources/transactionalEmails/types/index.ts index cc5fc42..e880a1b 100644 --- a/src/api/resources/transactionalEmails/types/index.ts +++ b/src/api/resources/transactionalEmails/types/index.ts @@ -9,6 +9,7 @@ export * from "./GetScheduledEmailByIdRequestStatus.js"; export * from "./GetScheduledEmailByIdResponse.js"; export * from "./GetSmtpReportRequestSort.js"; export * from "./GetSmtpReportResponse.js"; +export * from "./GetSmtpTemplateRequestTemplateId.js"; export * from "./GetSmtpTemplatesRequestSort.js"; export * from "./GetSmtpTemplatesResponse.js"; export * from "./GetTransacBlockedContactsRequestSort.js"; @@ -16,5 +17,7 @@ export * from "./GetTransacBlockedContactsResponse.js"; export * from "./GetTransacEmailContentResponse.js"; export * from "./GetTransacEmailsListRequestSort.js"; export * from "./GetTransacEmailsListResponse.js"; +export * from "./PostPreviewSmtpEmailTemplatesRequest.js"; export * from "./PostPreviewSmtpEmailTemplatesResponse.js"; export * from "./SendTransacEmailResponse.js"; +export * from "./UpdateSmtpTemplateRequestTemplateId.js"; diff --git a/src/api/resources/transactionalSms/client/Client.ts b/src/api/resources/transactionalSms/client/Client.ts index 3ad1b61..1c9d8fd 100644 --- a/src/api/resources/transactionalSms/client/Client.ts +++ b/src/api/resources/transactionalSms/client/Client.ts @@ -65,7 +65,7 @@ export class TransactionalSmsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -100,11 +100,14 @@ export class TransactionalSmsClient { /** * @deprecated * + * Send a transactional SMS message to a single mobile number. The `sender`, `recipient`, and either `content` or `templateId` fields are required. The sender name is limited to 11 alphanumeric characters or 15 numeric characters, and the recipient must be a valid international phone number (6-15 digits, optional leading +). Tags can be a string or an array of up to 10 strings. The SMS type defaults to `transactional` but can be set to `marketing`; if the content includes a stop code, it is automatically treated as marketing. Returns the message ID, SMS count, credits used, and remaining credits. + * * @param {Brevo.SendTransacSms} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} * @throws {@link Brevo.PaymentRequiredError} + * @throws {@link Brevo.TooManyRequestsError} * * @example * await client.transactionalSms.sendTransacSms({ @@ -139,7 +142,7 @@ export class TransactionalSmsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -161,6 +164,11 @@ export class TransactionalSmsClient { _response.error.body as Brevo.ErrorModel, _response.rawResponse, ); + case 429: + throw new Brevo.TooManyRequestsError( + _response.error.body as Brevo.ErrorModel, + _response.rawResponse, + ); default: throw new errors.BrevoError({ statusCode: _response.error.statusCode, @@ -174,6 +182,8 @@ export class TransactionalSmsClient { } /** + * Retrieve an aggregated report of your transactional SMS activity over a specified time period, including counts for requests, delivered, hard bounces, soft bounces, blocked, unsubscribed, replied, accepted, rejected, and skipped messages. Filter by date range using `startDate` and `endDate` (both required together, YYYY-MM-DD format) or by a number of past `days` (not compatible with date range). You can further narrow results by `tag`. If no date filter is provided, the report covers all available data and returns the auto-detected date range. + * * @param {Brevo.GetTransacAggregatedSmsReportRequest} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -215,7 +225,11 @@ export class TransactionalSmsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -251,6 +265,8 @@ export class TransactionalSmsClient { } /** + * Retrieve a paginated list of individual SMS event records (unaggregated), including event type, phone number, message ID, timestamp, tag, and reason or reply content where applicable. Results default to 50 per page (max 100) and are sorted in descending order unless overridden. Filter by date range (`startDate`/`endDate`), past `days` (not compatible with date range), specific `event` type (e.g. delivered, bounces, replies), `phoneNumber`, or `tags`. Bounce events include the failure reason, and reply events include the reply content. + * * @param {Brevo.GetSmsEventsRequest} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -297,7 +313,11 @@ export class TransactionalSmsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -330,6 +350,8 @@ export class TransactionalSmsClient { } /** + * Retrieve a day-by-day breakdown of your transactional SMS activity, with each entry containing the date and counts for requests, delivered, hard bounces, soft bounces, blocked, unsubscribed, replied, accepted, rejected, and skipped messages. Filter by date range using `startDate` and `endDate` (both required together, YYYY-MM-DD format), by a number of past `days` (not compatible with date range), or by `tag`. Results are sorted in descending order by default unless overridden with the `sort` parameter. + * * @param {Brevo.GetTransacSmsReportRequest} request * @param {TransactionalSmsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -372,7 +394,11 @@ export class TransactionalSmsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/transactionalWhatsApp/client/Client.ts b/src/api/resources/transactionalWhatsApp/client/Client.ts index 9ef4c07..e4d3f96 100644 --- a/src/api/resources/transactionalWhatsApp/client/Client.ts +++ b/src/api/resources/transactionalWhatsApp/client/Client.ts @@ -66,7 +66,7 @@ export class TransactionalWhatsAppClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -143,7 +143,11 @@ export class TransactionalWhatsAppClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index dcc94ed..c05af50 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -23,6 +23,8 @@ export class UserClient { } /** + * Retrieves the list of all users associated with your organization, including both active and pending invited users. Each user entry includes their email address, owner status, current invitation status, and feature access levels for marketing, CRM, and conversations. + * * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Brevo.BadRequestError} @@ -54,7 +56,7 @@ export class UserClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -82,6 +84,8 @@ export class UserClient { } /** + * Revokes all permissions for an invited user in the organization, effectively removing their access to the platform. If the user''s plan change generated credit notes, they are returned in the response for billing reconciliation. + * * @param {Brevo.PutRevokeUserPermissionRequest} request * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -119,7 +123,7 @@ export class UserClient { ), method: "PUT", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -263,7 +267,7 @@ export class UserClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -298,6 +302,8 @@ export class UserClient { } /** + * Resends or cancels a pending invitation for a user in the organization, depending on the action path parameter. Use `resend` to send a new invitation email to the user, or `cancel` to revoke the pending invitation entirely and remove the user''s pending access. + * * @param {Brevo.PutresendcancelinvitationRequest} request * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -336,7 +342,7 @@ export class UserClient { ), method: "PUT", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -479,7 +485,7 @@ export class UserClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -514,6 +520,8 @@ export class UserClient { } /** + * Retrieves the granular feature-level permissions assigned to a specific user in the organization, identified by their email address. The response includes the user''s current status (active or pending) and a detailed list of privileges specifying which features and permission levels are granted. + * * @param {Brevo.GetUserPermissionRequest} request * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -551,7 +559,7 @@ export class UserClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index 1ce80b5..11d6401 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -78,7 +78,11 @@ export class WebhooksClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -126,7 +130,6 @@ export class WebhooksClient { * * @example * await client.webhooks.createWebhook({ - * events: ["sent"], * url: "http://requestb.in/173lyyx1" * }) */ @@ -157,7 +160,7 @@ export class WebhooksClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -237,7 +240,7 @@ export class WebhooksClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -321,7 +324,7 @@ export class WebhooksClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -402,7 +405,7 @@ export class WebhooksClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -483,7 +486,7 @@ export class WebhooksClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts index 0c734aa..c523d74 100644 --- a/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts +++ b/src/api/resources/webhooks/client/requests/CreateWebhookRequest.ts @@ -3,7 +3,6 @@ /** * @example * { - * events: ["sent"], * url: "http://requestb.in/173lyyx1" * } */ @@ -12,7 +11,7 @@ export interface CreateWebhookRequest { auth?: CreateWebhookRequest.Auth; /** To send batched webhooks */ batched?: boolean; - /** channel of webhook */ + /** Channel of the webhook */ channel?: CreateWebhookRequest.Channel; /** Description of the webhook */ description?: string; @@ -22,24 +21,18 @@ export interface CreateWebhookRequest { */ domain?: string; /** - * - Events triggering the webhook. Possible values for - * **Transactional** type webhook: #### `sent` OR `request`, - * `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, - * `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and - * `unsubscribed` - Possible values for **Marketing** type webhook: - * #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`, - * `unsubscribed`, `listAddition` & `delivered` - Possible values - * for **Inbound** type webhook: #### `inboundEmailProcessed` - - * Possible values for type **Transactional** and channel **SMS** - * #### - * `accepted`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`, - * `subscribe`,`sent`,`blacklisted`,`skip` - Possible values for - * type **Marketing** channel **SMS** #### - * `sent`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`, - * `subscribe`,`skip` - * #### `reply` + * Events triggering the webhook. Required for transactional and + * marketing types, optional for inbound type (defaults to + * `inboundEmailProcessed`). Possible values for **Transactional** + * type webhook: `sent` OR `request`, `delivered`, `hardBounce`, + * `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, + * `opened`, `uniqueOpened` and `unsubscribed`. Possible values for + * **Marketing** type webhook: `spam`, `opened`, `click`, + * `hardBounce`, `softBounce`, `unsubscribed`, `listAddition`, + * `delivered`, `contactUpdated` & `contactDeleted`. Possible values + * for **Inbound** type webhook: `inboundEmailProcessed`. */ - events: CreateWebhookRequest.Events.Item[]; + events?: CreateWebhookRequest.Events.Item[]; /** Custom headers to be send with webhooks */ headers?: CreateWebhookRequest.Headers.Item[]; /** Type of the webhook */ @@ -59,10 +52,10 @@ export namespace CreateWebhookRequest { type?: string | undefined; } - /** channel of webhook */ + /** Channel of the webhook */ export const Channel = { - Sms: "sms", Email: "email", + Sms: "sms", } as const; export type Channel = (typeof Channel)[keyof typeof Channel]; export type Events = Events.Item[]; diff --git a/src/api/resources/webhooks/client/requests/ExportWebhooksHistoryRequest.ts b/src/api/resources/webhooks/client/requests/ExportWebhooksHistoryRequest.ts index 354c438..39943b6 100644 --- a/src/api/resources/webhooks/client/requests/ExportWebhooksHistoryRequest.ts +++ b/src/api/resources/webhooks/client/requests/ExportWebhooksHistoryRequest.ts @@ -27,7 +27,7 @@ export interface ExportWebhooksHistoryRequest { * Filter the history for a specific message id. Applicable * only for transactional webhooks. */ - messageId?: number; + messageId?: string; /** Webhook URL to receive CSV file link */ notifyURL: string; /** Sorting order of records (asc or desc) */ diff --git a/src/api/resources/whatsAppCampaigns/client/Client.ts b/src/api/resources/whatsAppCampaigns/client/Client.ts index aa9e3b8..af60c91 100644 --- a/src/api/resources/whatsAppCampaigns/client/Client.ts +++ b/src/api/resources/whatsAppCampaigns/client/Client.ts @@ -23,6 +23,8 @@ export class WhatsAppCampaignsClient { } /** + * Retrieve a paginated list of all your WhatsApp campaigns with their statistics and metadata. Results can be filtered by creation date range using startDate and endDate, with a default limit of 50 and maximum of 100 per page. The sort order defaults to descending by modification date. + * * @param {Brevo.GetWhatsAppCampaignsRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -65,7 +67,11 @@ export class WhatsAppCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -139,7 +145,7 @@ export class WhatsAppCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -203,7 +209,7 @@ export class WhatsAppCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -274,7 +280,7 @@ export class WhatsAppCampaignsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: request, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -304,6 +310,8 @@ export class WhatsAppCampaignsClient { } /** + * Retrieve a paginated list of all your WhatsApp templates with their status, category, language, and metadata. Results can be filtered by creation date range and optionally by source (Automation or Conversations), with a default limit of 50 and maximum of 100 per page. The sort order defaults to descending by modification date. + * * @param {Brevo.GetWhatsAppTemplatesRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -347,7 +355,11 @@ export class WhatsAppCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -420,7 +432,7 @@ export class WhatsAppCampaignsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -497,7 +509,7 @@ export class WhatsAppCampaignsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -576,7 +588,7 @@ export class WhatsAppCampaignsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: _body, timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, @@ -611,6 +623,8 @@ export class WhatsAppCampaignsClient { } /** + * Delete a WhatsApp campaign by its campaign ID. The campaign must exist; if the campaign ID is not found, a 404 error is returned. This action is permanent and cannot be undone. + * * @param {Brevo.DeleteWhatsAppCampaignRequest} request * @param {WhatsAppCampaignsClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -649,7 +663,7 @@ export class WhatsAppCampaignsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts index 81b80ef..c5b8eec 100644 --- a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppCampaignResponse.ts @@ -15,6 +15,8 @@ export interface GetWhatsAppCampaignResponse { modifiedAt: string; /** UTC date-time on which WhatsApp campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ scheduledAt?: string | undefined; + /** Recipients of the WhatsApp Campaign */ + recipients: GetWhatsAppCampaignResponse.Recipients; /** Sender of the WhatsApp Campaign */ senderNumber: string; stats?: Brevo.WhatsappCampStats | undefined; @@ -35,6 +37,20 @@ export namespace GetWhatsAppCampaignResponse { } as const; export type CampaignStatus = (typeof CampaignStatus)[keyof typeof CampaignStatus]; + /** + * Recipients of the WhatsApp Campaign + */ + export interface Recipients { + /** List of excluded list IDs */ + excludedLists?: number[] | undefined; + /** List of included list IDs */ + includedLists?: number[] | undefined; + /** List of segment IDs */ + segments?: number[] | undefined; + /** Type of recipients (list or segment) */ + type?: string | undefined; + } + export interface Template { /** array of variables item variables */ body_variables?: Brevo.VariablesItems[] | undefined; diff --git a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts index d4ab0d9..ddef796 100644 --- a/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts +++ b/src/api/resources/whatsAppCampaigns/types/GetWhatsAppTemplatesResponse.ts @@ -27,6 +27,8 @@ export namespace GetWhatsAppTemplatesResponse { name: string; /** Status of the whatsApp template */ status: string; + /** Type of the whatsApp template */ + type: string; } } } diff --git a/src/api/types/BalanceDefinition.ts b/src/api/types/BalanceDefinition.ts index 7cf72c3..f4a08cf 100644 --- a/src/api/types/BalanceDefinition.ts +++ b/src/api/types/BalanceDefinition.ts @@ -1,54 +1,107 @@ // This file was auto-generated by Fern from our API Definition. export interface BalanceDefinition { - /** startOfPeriod depicts the balancy expiry on start of day/week/month/year. endOfPeriod depicts the balancy expiry on end of day/week/month/year */ - balanceAvailabilityDurationModifier?: BalanceDefinition.BalanceAvailabilityDurationModifier | undefined; - /** Unit of time for the balance's availability (e.g., day/week/month/year). */ - balanceAvailabilityDurationUnit?: string | undefined; - /** Number of days/weeks/month/year for balance expiry */ - balanceAvailabilityDurationValue?: number | undefined; - /** Date when the balance expires and can no longer be used, in dd/mm format. The balance will be expired when this date appears next in the calendar and only one of balanceExpirationDate or balance availability fields can be used. */ - balanceExpirationDate?: string | undefined; - /** Partial enables partial credit of balance if maximum balance limit is reaching. Strict enables rejection of transaction if it will breach the max credit amount limit. */ - balanceOptionAmountOvertakingStrategy?: string | undefined; - /** Rounding strategy for credit transactions. */ - balanceOptionCreditRounding?: string | undefined; - /** Rounding strategy for debit transactions. */ - balanceOptionDebitRounding?: string | undefined; - /** Timestamp of balance definition creation. */ - createdAt?: string | undefined; - /** Timestamp of balance definition deletion (nullable). */ - deletedAt?: string | undefined; - /** Short description of the balance definition. */ - description?: string | undefined; /** Unique identifier for the balance definition. */ id?: string | undefined; + /** Name of the balance definition. */ + name?: string | undefined; + /** Short description of the balance definition. */ + description?: string | undefined; /** Optional image reference URL. */ imageRef?: string | undefined; - /** Maximum allowable balance. */ - maxAmount?: number | undefined; - /** Max credit allowed per operation. */ - maxCreditAmountLimit?: number | undefined; - /** Max debit allowed per operation. */ - maxDebitAmountLimit?: number | undefined; /** Additional metadata for the balance definition. */ meta?: Record | undefined; + /** Unit of balance measurement. */ + unit?: BalanceDefinition.Unit | undefined; /** Minimum allowable balance. */ minAmount?: number | undefined; - /** Name of the balance definition. */ - name?: string | undefined; - /** Unit of balance (e.g., points, currency). */ - unit?: string | undefined; + /** Maximum allowable balance. */ + maxAmount?: number | undefined; + /** Maximum credit allowed per operation. */ + maxCreditAmountLimit?: number | undefined; + /** Maximum debit allowed per operation. */ + maxDebitAmountLimit?: number | undefined; + /** Partial enables partial credit of balance if maximum balance limit is reached. Strict enables rejection of a transaction if it will breach the max balance limit. */ + balanceOptionAmountOvertakingStrategy?: BalanceDefinition.BalanceOptionAmountOvertakingStrategy | undefined; + /** Rounding strategy for credit transactions. */ + balanceOptionCreditRounding?: BalanceDefinition.BalanceOptionCreditRounding | undefined; + /** Rounding strategy for debit transactions. */ + balanceOptionDebitRounding?: BalanceDefinition.BalanceOptionDebitRounding | undefined; + /** Number of time units before the balance expires. */ + balanceAvailabilityDurationValue?: number | undefined; + /** Unit of time for the balance availability duration. */ + balanceAvailabilityDurationUnit?: BalanceDefinition.BalanceAvailabilityDurationUnit | undefined; + /** Modifier for balance availability duration. startOfPeriod causes expiry at the start of the period, endOfPeriod at the end. noModification uses the exact duration from the credit date. */ + balanceAvailabilityDurationModifier?: BalanceDefinition.BalanceAvailabilityDurationModifier | undefined; + /** Fixed expiration date in dd/mm format. The balance expires when this date next appears in the calendar. Only one of balanceExpirationDate or balance availability duration fields can be used. */ + balanceExpirationDate?: string | undefined; + /** Timestamp of balance definition creation. */ + createdAt?: string | undefined; /** Timestamp of the last update. */ updatedAt?: string | undefined; + /** Timestamp of balance definition deletion (nullable). */ + deletedAt?: string | undefined; } export namespace BalanceDefinition { - /** startOfPeriod depicts the balancy expiry on start of day/week/month/year. endOfPeriod depicts the balancy expiry on end of day/week/month/year */ + /** Unit of balance measurement. */ + export const Unit = { + Points: "POINTS", + Eur: "EUR", + Usd: "USD", + Mxn: "MXN", + Gbp: "GBP", + Inr: "INR", + Cad: "CAD", + Sgd: "SGD", + Ron: "RON", + Jpy: "JPY", + Myr: "MYR", + Clp: "CLP", + Pen: "PEN", + Mad: "MAD", + Aud: "AUD", + Chf: "CHF", + Brl: "BRL", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; + /** Partial enables partial credit of balance if maximum balance limit is reached. Strict enables rejection of a transaction if it will breach the max balance limit. */ + export const BalanceOptionAmountOvertakingStrategy = { + Strict: "strict", + Partial: "partial", + } as const; + export type BalanceOptionAmountOvertakingStrategy = + (typeof BalanceOptionAmountOvertakingStrategy)[keyof typeof BalanceOptionAmountOvertakingStrategy]; + /** Rounding strategy for credit transactions. */ + export const BalanceOptionCreditRounding = { + Lower: "lower", + Upper: "upper", + Natural: "natural", + } as const; + export type BalanceOptionCreditRounding = + (typeof BalanceOptionCreditRounding)[keyof typeof BalanceOptionCreditRounding]; + /** Rounding strategy for debit transactions. */ + export const BalanceOptionDebitRounding = { + Lower: "lower", + Upper: "upper", + Natural: "natural", + } as const; + export type BalanceOptionDebitRounding = + (typeof BalanceOptionDebitRounding)[keyof typeof BalanceOptionDebitRounding]; + /** Unit of time for the balance availability duration. */ + export const BalanceAvailabilityDurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type BalanceAvailabilityDurationUnit = + (typeof BalanceAvailabilityDurationUnit)[keyof typeof BalanceAvailabilityDurationUnit]; + /** Modifier for balance availability duration. startOfPeriod causes expiry at the start of the period, endOfPeriod at the end. noModification uses the exact duration from the credit date. */ export const BalanceAvailabilityDurationModifier = { + NoModification: "noModification", StartOfPeriod: "startOfPeriod", EndOfPeriod: "endOfPeriod", - NoModification: "noModification", } as const; export type BalanceAvailabilityDurationModifier = (typeof BalanceAvailabilityDurationModifier)[keyof typeof BalanceAvailabilityDurationModifier]; diff --git a/src/api/types/BalanceLimit.ts b/src/api/types/BalanceLimit.ts index 4706149..ba55f3e 100644 --- a/src/api/types/BalanceLimit.ts +++ b/src/api/types/BalanceLimit.ts @@ -1,24 +1,48 @@ // This file was auto-generated by Fern from our API Definition. export interface BalanceLimit { - /** balance definition ID */ + /** Unique identifier for the balance limit. */ + id?: string | undefined; + /** Balance definition ID. */ balanceDefinitionId?: string | undefined; - /** Defines the type of constraint (e.g., transaction-based or amount-based). */ - constraintType?: string | undefined; - /** Timestamp of when the balance limit was created. */ - createdAt: string; - /** Time unit for the balance limit (day, week, month, year). */ - durationUnit?: string | undefined; + /** Specifies whether the limit applies to credit or debit transactions. */ + transactionType?: BalanceLimit.TransactionType | undefined; + /** Defines the type of constraint (transaction count or amount). */ + constraintType?: BalanceLimit.ConstraintType | undefined; /** Number of time units the balance limit applies to. */ durationValue?: number | undefined; - /** Unique identifier for the balance limit. */ - id?: string | undefined; + /** Time unit for the balance limit. */ + durationUnit?: BalanceLimit.DurationUnit | undefined; + /** The maximum allowed value for the defined constraint. */ + value?: number | undefined; /** Indicates if the limit resets periodically based on a sliding schedule. */ slidingSchedule?: boolean | undefined; - /** Specifies whether the limit applies to credit or debit transactions. */ - transactionType?: string | undefined; + /** Timestamp of when the balance limit was created. */ + createdAt?: string | undefined; /** Timestamp of the last update to the balance limit. */ - updatedAt: string; - /** The maximum allowed value for the defined constraint. */ - value?: number | undefined; + updatedAt?: string | undefined; +} + +export namespace BalanceLimit { + /** Specifies whether the limit applies to credit or debit transactions. */ + export const TransactionType = { + Credit: "credit", + Debit: "debit", + } as const; + export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; + /** Defines the type of constraint (transaction count or amount). */ + export const ConstraintType = { + Transaction: "transaction", + Amount: "amount", + } as const; + export type ConstraintType = (typeof ConstraintType)[keyof typeof ConstraintType]; + /** Time unit for the balance limit. */ + export const DurationUnit = { + Hour: "hour", + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit]; } diff --git a/src/api/types/Company.ts b/src/api/types/Company.ts index d5a58d3..1823c02 100644 --- a/src/api/types/Company.ts +++ b/src/api/types/Company.ts @@ -10,6 +10,6 @@ export interface Company { id?: string | undefined; /** Contact ids for contacts linked to this company */ linkedContactsIds?: number[] | undefined; - /** Deals ids for companies linked to this company */ + /** Deal ids for deals linked to this company */ linkedDealsIds?: string[] | undefined; } diff --git a/src/api/types/ConversationsMessage.ts b/src/api/types/ConversationsMessage.ts index b56c13c..d521e66 100644 --- a/src/api/types/ConversationsMessage.ts +++ b/src/api/types/ConversationsMessage.ts @@ -55,6 +55,14 @@ export interface ConversationsMessage { to?: ConversationsMessage.To.Item[] | undefined; /** `"agent"` for agents’ messages, `"visitor"` for visitors’ messages. */ type?: ConversationsMessage.Type | undefined; + /** ‘`true` if the message was sent via JavaScript API.’ */ + isSentViaJsApi?: boolean | undefined; + /** The type of message content (e.g. for integration-specific message types). */ + messageType?: string | undefined; + /** ‘`true` if the message is a forwarded message.’ */ + isForward?: boolean | undefined; + /** Source information for the message. */ + source?: Record | undefined; /** visitor’s ID */ visitorId?: string | undefined; } @@ -65,17 +73,39 @@ export namespace ConversationsMessage { export namespace Attachments { export interface Item { /** The name of the file. */ - fileName?: string | undefined; - /** The ID of the inline file. */ - inlineId?: string | undefined; + name?: string | undefined; + /** The URL of the file. */ + link?: string | undefined; + /** The MIME type of the file. */ + mimeType?: string | undefined; /** `true` for images. */ isImage?: boolean | undefined; + /** `true` for sticker files. */ + isSticker?: boolean | undefined; /** `true` for inline files. */ - isInline?: string | undefined; + isInline?: boolean | undefined; + /** The ID of the inline file. */ + inlineId?: string | undefined; /** The size of the file in bytes. */ size?: number | undefined; - /** The URL of the file. */ - url?: string | undefined; + /** Image information (only present for image files). */ + imageInfo?: Item.ImageInfo | undefined; + /** Whether the file extension is allowed for download. */ + isAllowedFileType?: boolean | undefined; + } + + export namespace Item { + /** + * Image information (only present for image files). + */ + export interface ImageInfo { + /** Width of the image in pixels. */ + width?: number | undefined; + /** Height of the image in pixels. */ + height?: number | undefined; + /** URL of the image preview. */ + previewLink?: string | undefined; + } } } @@ -98,29 +128,39 @@ export namespace ConversationsMessage { } export interface File_ { - /** Name of the file */ - filename?: string | undefined; - /** image info is passed in case the file is an image */ - imageInfo?: File_.ImageInfo | undefined; - /** Whether the file is an image */ + /** Name of the file. */ + name?: string | undefined; + /** URL of the file. */ + link?: string | undefined; + /** MIME type of the file. */ + mimeType?: string | undefined; + /** Whether the file is an image. */ isImage?: boolean | undefined; - /** Size in bytes */ + /** Whether the file is a sticker. */ + isSticker?: boolean | undefined; + /** Whether the file is inline. */ + isInline?: boolean | undefined; + /** The ID of the inline file. */ + inlineId?: string | undefined; + /** Size in bytes. */ size?: number | undefined; - /** URL of the file */ - url?: string | undefined; + /** Image info, present when the file is an image. */ + imageInfo?: File_.ImageInfo | undefined; + /** Whether the file extension is allowed for download. */ + isAllowedFileType?: boolean | undefined; } export namespace File_ { /** - * image info is passed in case the file is an image + * Image info, present when the file is an image. */ export interface ImageInfo { - /** height of the image */ - height?: number | undefined; - /** URL of the preview */ - previewUrl?: string | undefined; - /** Width of the image */ + /** Width of the image in pixels. */ width?: number | undefined; + /** Height of the image in pixels. */ + height?: number | undefined; + /** URL of the image preview. */ + previewLink?: string | undefined; } } diff --git a/src/api/types/Deal.ts b/src/api/types/Deal.ts index a0ad470..6afd225 100644 --- a/src/api/types/Deal.ts +++ b/src/api/types/Deal.ts @@ -4,12 +4,12 @@ * Deal Details */ export interface Deal { - /** Deal attributes with values */ - attributes?: Record | undefined; /** Unique deal id */ id?: string | undefined; - /** Companies ids for companies linked to this deal */ - linkedCompaniesIds?: string[] | undefined; + /** Deal attributes with values */ + attributes?: Record | undefined; /** Contact ids for contacts linked to this deal */ linkedContactsIds?: number[] | undefined; + /** Companies ids for companies linked to this deal */ + linkedCompaniesIds?: string[] | undefined; } diff --git a/src/api/types/FileData.ts b/src/api/types/FileData.ts index f528215..8d77a36 100644 --- a/src/api/types/FileData.ts +++ b/src/api/types/FileData.ts @@ -4,18 +4,20 @@ * File data that is uploaded */ export interface FileData { + /** Unique file id */ + id?: string | undefined; + /** Name of uploaded file */ + name?: string | undefined; /** Account id of user which created the file */ authorId?: string | undefined; - /** Company id linked to a file */ - companyId?: string | undefined; /** Contact id of contact on which file is uploaded */ contactId?: number | undefined; - /** File created date/time */ - createdAt?: string | undefined; /** Deal id linked to a file */ dealId?: string | undefined; - /** Name of uploaded file */ - name?: string | undefined; + /** Company id linked to a file */ + companyId?: string | undefined; /** Size of file in bytes */ size?: number | undefined; + /** File created date/time */ + createdAt?: string | undefined; } diff --git a/src/api/types/GetCampaignRecipients.ts b/src/api/types/GetCampaignRecipients.ts index 975fe8e..ecd745e 100644 --- a/src/api/types/GetCampaignRecipients.ts +++ b/src/api/types/GetCampaignRecipients.ts @@ -1,6 +1,10 @@ // This file was auto-generated by Fern from our API Definition. export interface GetCampaignRecipients { + /** Segment IDs excluded from the campaign */ + excludedSegments?: number[] | undefined; exclusionLists: number[]; lists: number[]; + /** Segment IDs included in the campaign */ + segments?: number[] | undefined; } diff --git a/src/api/types/GetCampaignStats.ts b/src/api/types/GetCampaignStats.ts index 76f44c9..9f34aac 100644 --- a/src/api/types/GetCampaignStats.ts +++ b/src/api/types/GetCampaignStats.ts @@ -11,9 +11,9 @@ export interface GetCampaignStats { deferred?: number | undefined; /** Number of delivered emails for the campaign */ delivered: number; - /** Rate of recipients without any privacy protection option enabled in their email client_dev, applied to all delivered emails */ + /** Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails */ estimatedViews?: number | undefined; - /** Number of harbounce for the campaign */ + /** Number of hard bounces for the campaign */ hardBounces: number; /** List Id of email campaign (only in case of get email campaign(s)(not for global stats)) */ listId?: number | undefined; @@ -25,9 +25,9 @@ export interface GetCampaignStats { sent: number; /** Number of softbounce for the campaign */ softBounces: number; - /** Recipients without any privacy protection option enabled in their email client_dev */ + /** Recipients without any privacy protection option enabled in their email email client */ trackableViews: number; - /** Rate of recipients without any privacy protection option enabled in their email client_dev */ + /** Rate of recipients without any privacy protection option enabled in their email client */ trackableViewsRate?: number | undefined; /** Number of unique clicks for the campaign */ uniqueClicks: number; diff --git a/src/api/types/GetContactDetails.ts b/src/api/types/GetContactDetails.ts index 124eb51..a6b854e 100644 --- a/src/api/types/GetContactDetails.ts +++ b/src/api/types/GetContactDetails.ts @@ -17,6 +17,8 @@ export interface GetContactDetails { modifiedAt: string; /** Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) */ smsBlacklisted: boolean; + /** Blacklist status for WhatsApp campaigns (true=blacklisted, false=not blacklisted) */ + whatsappBlacklisted: boolean; } export namespace GetContactDetails { diff --git a/src/api/types/GetEventsList.ts b/src/api/types/GetEventsList.ts index 5388d5d..9427184 100644 --- a/src/api/types/GetEventsList.ts +++ b/src/api/types/GetEventsList.ts @@ -23,8 +23,6 @@ export namespace GetEventsList { event_name?: string | undefined; /** Filter ID of the event */ event_filter_id?: string | undefined; - /** Source of the event */ - source?: string | undefined; /** Object type associated with the event */ object_type?: string | undefined; /** Event-level custom properties */ diff --git a/src/api/types/GetExtendedCampaignOverview.ts b/src/api/types/GetExtendedCampaignOverview.ts index 114e7e6..caecd00 100644 --- a/src/api/types/GetExtendedCampaignOverview.ts +++ b/src/api/types/GetExtendedCampaignOverview.ts @@ -31,8 +31,12 @@ export interface GetExtendedCampaignOverview { winnerCriteria?: string | undefined; /** The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` */ winnerDelay?: number | undefined; + /** URL of the attachment file associated with the campaign. Empty string if no attachment is present. */ + attachmentUrl?: string | undefined; /** Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; + /** Expiration date configuration for the email campaign, if set. Contains the duration and unit of the email expiry. */ + emailExpirationDate?: GetExtendedCampaignOverview.EmailExpirationDate | undefined; /** Footer of the campaign */ footer: string; /** Header of the campaign */ @@ -54,7 +58,7 @@ export interface GetExtendedCampaignOverview { sender: GetExtendedCampaignOverview.Sender; /** Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' */ sentDate?: string | undefined; - /** Link to share the campaign on social medias */ + /** Link to share the campaign on social media. For trigger campaigns, this returns a descriptive message instead of a URL. For classic campaigns that have not been sent, this also returns a descriptive message. */ shareLink?: string | undefined; /** Tag of the campaign */ tag?: string | undefined; @@ -64,12 +68,13 @@ export interface GetExtendedCampaignOverview { testSent: boolean; /** Customisation of the "to" field of the campaign */ toField?: string | undefined; - /** utm parameter associated with campaign */ + /** The utm_campaign value associated with the campaign. Only present if a UTM campaign value was set. */ utmCampaignValue?: string | undefined; - /** utm id active */ - utmIDActive?: boolean | undefined; + /** The campaign ID used as utm_id parameter. Only present if UTM campaign tracking with ID is enabled. */ + utmID?: number | undefined; + /** The utm_medium value. Set to "EMAIL" when UTM campaign tracking is enabled. */ utmMedium?: string | undefined; - /** source of utm */ + /** The utm_source value. Set to "Brevo" when UTM campaign tracking is enabled. */ utmSource?: string | undefined; } @@ -94,6 +99,26 @@ export namespace GetExtendedCampaignOverview { } as const; export type Type = (typeof Type)[keyof typeof Type]; + /** + * Expiration date configuration for the email campaign, if set. Contains the duration and unit of the email expiry. + */ + export interface EmailExpirationDate { + /** Duration of the email expiry */ + duration?: number | undefined; + /** Unit of the duration */ + unit?: EmailExpirationDate.Unit | undefined; + } + + export namespace EmailExpirationDate { + /** Unit of the duration */ + export const Unit = { + Days: "days", + Weeks: "weeks", + Months: "months", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; + } + export interface Sender { /** Sender email of the campaign */ email?: string | undefined; diff --git a/src/api/types/GetExtendedCampaignStats.ts b/src/api/types/GetExtendedCampaignStats.ts index 7f8b3fb..348b68e 100644 --- a/src/api/types/GetExtendedCampaignStats.ts +++ b/src/api/types/GetExtendedCampaignStats.ts @@ -7,23 +7,20 @@ export interface GetExtendedCampaignStats { campaignStats: Brevo.GetCampaignStats[]; /** Overall statistics of the campaign */ globalStats: Brevo.GetCampaignStats; - /** Statistics about the number of clicks for the links */ - linksStats: GetExtendedCampaignStats.LinksStats; + /** Statistics about the number of clicks for each link in the campaign. Keys are the link URLs, values are click counts. Only populated when the `statistics` query parameter is set to `linksStats`. */ + linksStats: Record; /** Number of clicks on mirror link */ mirrorClick: number; - /** Number of remaning emails to send */ + /** Number of remaining emails to send */ remaining: number; - statsByBrowser: Record; - statsByDevice: GetExtendedCampaignStats.StatsByDevice; - statsByDomain: Record; + /** Statistics of the campaign grouped by browser. Only available when retrieving a single campaign with the `statistics` query parameter set to `statsByBrowser`. */ + statsByBrowser?: Record | undefined; + statsByDevice?: GetExtendedCampaignStats.StatsByDevice | undefined; + /** Statistics of the campaign grouped by email domain. Only populated when the `statistics` query parameter is set to `statsByDomain`. */ + statsByDomain?: Record | undefined; } export namespace GetExtendedCampaignStats { - /** - * Statistics about the number of clicks for the links - */ - export type LinksStats = {}; - export interface StatsByDevice { /** Statistics of the campaign on the basis of desktop devices */ desktop?: Record | undefined; diff --git a/src/api/types/GetProductDetails.ts b/src/api/types/GetProductDetails.ts index ae430f8..8b948d2 100644 --- a/src/api/types/GetProductDetails.ts +++ b/src/api/types/GetProductDetails.ts @@ -13,7 +13,7 @@ export interface GetProductDetails { id: string; /** Absolute URL to the cover image of the product */ imageUrl?: string | undefined; - /** Product get deleted from the shop's database but not from Brevo */ + /** Product deleted from the shop's database but not from Brevo */ isDeleted?: boolean | undefined; /** Meta data of product such as description, vendor, producer, stock level, etc. */ metaInfo?: Record | undefined; @@ -25,6 +25,8 @@ export interface GetProductDetails { parentId?: string | undefined; /** Price of the product */ price?: number | undefined; + /** Alternative price of the product */ + alternativePrice?: number | undefined; /** S3 url of original image */ s3Original?: string | undefined; /** S3 thumbnail url of original image in 120x120 dimension for analytics section */ diff --git a/src/api/types/GetSmsCampaignOverview.ts b/src/api/types/GetSmsCampaignOverview.ts index 0339585..69bf580 100644 --- a/src/api/types/GetSmsCampaignOverview.ts +++ b/src/api/types/GetSmsCampaignOverview.ts @@ -11,12 +11,18 @@ export interface GetSmsCampaignOverview { modifiedAt: string; /** Name of the SMS Campaign */ name: string; - /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format */ + /** A recognizable prefix added as the Brand Name before the message content. Empty string if not set. */ + organisationPrefix?: string | undefined; + /** UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format. Empty string if not scheduled. */ scheduledAt?: string | undefined; /** Sender of the SMS Campaign */ sender: string; + /** UTC date-time on which the SMS campaign was sent (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if the campaign status is 'sent'. */ + sentDate?: string | undefined; /** Status of the SMS Campaign */ status: GetSmsCampaignOverview.Status; + /** Instructions to unsubscribe from future communications. Empty string if not set. */ + unsubscribeInstruction?: string | undefined; } export namespace GetSmsCampaignOverview { diff --git a/src/api/types/GetSmtpTemplateOverview.ts b/src/api/types/GetSmtpTemplateOverview.ts index 156e587..58bf0b6 100644 --- a/src/api/types/GetSmtpTemplateOverview.ts +++ b/src/api/types/GetSmtpTemplateOverview.ts @@ -26,6 +26,8 @@ export interface GetSmtpTemplateOverview { testSent: boolean; /** Customisation of the "to" field for the template */ toField: string; + /** Custom template identifier, if one was assigned during template creation. Only present when the template has a custom ID. */ + customTemplateId?: string | undefined; } export namespace GetSmtpTemplateOverview { @@ -34,7 +36,7 @@ export namespace GetSmtpTemplateOverview { email?: string | undefined; /** Sender id of the template */ id?: string | undefined; - /** From email for the template */ + /** Sender name for the template */ name?: string | undefined; } } diff --git a/src/api/types/GetWebhook.ts b/src/api/types/GetWebhook.ts index 15afb08..d79902f 100644 --- a/src/api/types/GetWebhook.ts +++ b/src/api/types/GetWebhook.ts @@ -8,8 +8,6 @@ export interface GetWebhook { * true */ batched?: boolean | undefined; - /** channel of webhook */ - channel?: GetWebhook.Channel | undefined; /** Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) */ createdAt: string; /** Description of the webhook */ @@ -20,23 +18,20 @@ export interface GetWebhook { id: number; /** Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) */ modifiedAt: string; - /** Type of webhook (marketing or transactional) */ + /** Type of webhook (marketing, transactional, or inbound) */ type: GetWebhook.Type; + /** Inbound domain of the webhook, only returned for inbound type webhooks */ + domain?: string | undefined; /** URL of the webhook */ url: string; } export namespace GetWebhook { - /** channel of webhook */ - export const Channel = { - Sms: "sms", - Email: "email", - } as const; - export type Channel = (typeof Channel)[keyof typeof Channel]; - /** Type of webhook (marketing or transactional) */ + /** Type of webhook (marketing, transactional, or inbound) */ export const Type = { Marketing: "marketing", Transactional: "transactional", + Inbound: "inbound", } as const; export type Type = (typeof Type)[keyof typeof Type]; } diff --git a/src/api/types/LoyaltyProgram.ts b/src/api/types/LoyaltyProgram.ts index 19a675b..d77d673 100644 --- a/src/api/types/LoyaltyProgram.ts +++ b/src/api/types/LoyaltyProgram.ts @@ -1,37 +1,40 @@ // This file was auto-generated by Fern from our API Definition. export interface LoyaltyProgram { - /** Loyalty Program code count */ - codeCount?: number | undefined; - /** Loyalty Program creation date */ - createdAt?: string | undefined; - /** Loyalty Program description */ - description?: string | undefined; - /** string */ - documentId?: string | undefined; - /** Loyalty Program ID */ + /** Loyalty Program unique identifier. */ id?: string | undefined; - /** Loyalty Program meta data */ - meta?: Record | undefined; - /** Loyalty Program name */ + /** Loyalty Program name. */ name?: string | undefined; - /** string */ - pattern?: string | undefined; - /** Loyalty Program state */ + /** Loyalty Program description. */ + description?: string | undefined; + /** Loyalty Program metadata. */ + meta?: Record | undefined; + /** Current state of the loyalty program. */ state?: LoyaltyProgram.State | undefined; - /** Loyalty Program subscription generator ID */ - subscriptionGeneratorId?: string | undefined; - /** Loyalty Program subscription pool ID */ + /** Loyalty Program subscription pool ID. */ subscriptionPoolId?: string | undefined; - /** Loyalty Program last modification date */ + /** Loyalty Program subscription generator ID. */ + subscriptionGeneratorId?: string | undefined; + /** Subscription code pattern. */ + pattern?: string | undefined; + /** Number of available subscription codes. */ + codeCount?: number | undefined; + /** Associated document identifier. */ + documentId?: string | undefined; + /** Contact attribute name used for birthday tracking. */ + birthdayAttribute?: string | undefined; + /** Timestamp when the loyalty program was created. */ + createdAt?: string | undefined; + /** Timestamp when the loyalty program was last modified. */ updatedAt?: string | undefined; } export namespace LoyaltyProgram { - /** Loyalty Program state */ + /** Current state of the loyalty program. */ export const State = { Inactive: "inactive", Active: "active", + Draft: "draft", } as const; export type State = (typeof State)[keyof typeof State]; } diff --git a/src/api/types/Note.ts b/src/api/types/Note.ts index e2dc39d..b178f0b 100644 --- a/src/api/types/Note.ts +++ b/src/api/types/Note.ts @@ -4,18 +4,20 @@ * Note Details */ export interface Note { - /** Account details of user which created the note */ - authorId?: Record | undefined; + /** Unique note Id */ + id?: string | undefined; + /** Content of the note. Supports HTML for rich text formatting. Supported tags include: `

` (paragraph), `` / `` (bold), `` / `` (italic), `` (underline), `
` (line break), `` (labelled hyperlink). Example labelled link: `Link text`. */ + text: string; /** Contact ids linked to a note */ contactIds?: number[] | undefined; - /** Note created date/time */ - createdAt?: string | undefined; + /** Company ids linked to a note */ + companyIds?: string[] | undefined; /** Deal ids linked to a note */ dealIds?: string[] | undefined; - /** Unique note Id */ - id?: string | undefined; - /** Text content of a note */ - text: string; + /** Account details of user which created the note */ + authorId?: Record | undefined; + /** Note created date/time */ + createdAt?: string | undefined; /** Note updated date/time */ updatedAt?: string | undefined; } diff --git a/src/api/types/NoteData.ts b/src/api/types/NoteData.ts index 7d9df9e..dcfc9e3 100644 --- a/src/api/types/NoteData.ts +++ b/src/api/types/NoteData.ts @@ -10,6 +10,6 @@ export interface NoteData { contactIds?: number[] | undefined; /** Deal Ids linked to a note */ dealIds?: string[] | undefined; - /** Text content of a note */ + /** Content of the note. Supports HTML for rich text formatting. Supported tags include: `

` (paragraph), `` / `` (bold), `` / `` (italic), `` (underline), `
` (line break), `` (labelled hyperlink). Example labelled link: `Link text`. */ text: string; } diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 34a51e7..9b6646f 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -13,7 +13,7 @@ export interface Order { id: string; /** Identifies the contact associated with the order. */ identifiers?: Order.Identifiers | undefined; - /** Meta data of order to store additional detal such as custom message, customer type, source. */ + /** Meta data of order to store additional detail such as custom message, customer type, source. */ metaInfo?: Record | undefined; products: Order.Products.Item[]; /** State of the order. */ diff --git a/src/api/types/Pipeline.ts b/src/api/types/Pipeline.ts index 72551f5..d43e5ae 100644 --- a/src/api/types/Pipeline.ts +++ b/src/api/types/Pipeline.ts @@ -1,14 +1,14 @@ // This file was auto-generated by Fern from our API Definition. /** - * List of stages + * Pipeline details with stages */ export interface Pipeline { /** Pipeline id */ pipeline?: string | undefined; /** Pipeline Name */ pipeline_name?: string | undefined; - /** List of stages */ + /** List of pipeline stages */ stages?: Pipeline.Stages.Item[] | undefined; } @@ -17,7 +17,7 @@ export namespace Pipeline { export namespace Stages { /** - * List of stages + * Stage details */ export interface Item { /** Stage id */ diff --git a/src/api/types/SendTransacSms.ts b/src/api/types/SendTransacSms.ts index ed8686c..14b0024 100644 --- a/src/api/types/SendTransacSms.ts +++ b/src/api/types/SendTransacSms.ts @@ -3,11 +3,11 @@ export interface SendTransacSms { /** A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. **Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.** */ organisationPrefix?: string | undefined; - /** Mobile number to send SMS with the country code */ + /** Mobile number to send SMS with the country code. Must contain between 6 and 15 digits, optionally prefixed with '+'. */ recipient: string; - /** Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** */ + /** Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters.** Alphanumeric sender names (up to 11 characters) must contain only letters and digits. Numeric sender names (12-15 characters) must contain only digits. */ sender: string; - /** Tag of the message */ + /** Tag of the message. Can be a single string or an array of strings (maximum 10 tags). Each tag must be a non-empty string. */ tag?: SendTransacSms.Tag | undefined; /** Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. */ type?: SendTransacSms.Type | undefined; @@ -15,6 +15,8 @@ export interface SendTransacSms { unicodeEnabled?: boolean | undefined; /** Webhook to call for each event triggered by the message (delivered etc.) */ webUrl?: string | undefined; + /** Pass the set of attributes to customize the template. For example, {"FNAME":"Joe", "LNAME":"Doe"}. These are the placeholder variables in the template that will be replaced with the corresponding values passed in the params object. Applicable only if `templateId` is used. */ + params?: Record | undefined; /** Template ID to send SMS with the template. When provided, overrides the content parameter. Mandatory if 'content' is not passed. */ templateId?: number | undefined; /** Content of the message. If more than **160 characters** long, will be sent as multiple text messages. Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed. */ @@ -23,20 +25,9 @@ export interface SendTransacSms { export namespace SendTransacSms { /** - * Tag of the message + * Tag of the message. Can be a single string or an array of strings (maximum 10 tags). Each tag must be a non-empty string. */ - export interface Tag { - /** A tag can be a string or an array of strings. */ - field?: Tag.Field | undefined; - } - - export namespace Tag { - /** - * A tag can be a string or an array of strings. - */ - export type Field = string | string[]; - } - + export type Tag = string | string[]; /** Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. */ export const Type = { Transactional: "transactional", diff --git a/src/api/types/Task.ts b/src/api/types/Task.ts index 455b6ab..7743987 100644 --- a/src/api/types/Task.ts +++ b/src/api/types/Task.ts @@ -4,16 +4,28 @@ * Task Details */ export interface Task { - /** Companies ids for companies a task is linked to */ - companiesIds?: string[] | undefined; - /** Contact ids for contacts linked to this task */ - contactsIds?: number[] | undefined; - /** Deal ids for deals a task is linked to */ - dealsIds?: string[] | undefined; /** Unique task id */ id?: string | undefined; - /** Name of task */ - name: string; /** Id for type of task e.g Call / Email / Meeting etc. */ taskTypeId: string; + /** Name of task */ + name: string; + /** Companies ids for companies a task is linked to */ + companiesIds?: string[] | undefined; + /** Deal ids for deals a task is linked to */ + dealsIds?: string[] | undefined; + /** Contact ids for contacts linked to this task */ + contactsIds?: number[] | undefined; + /** Account id of the user assigned to this task */ + assignToId?: string | undefined; + /** Task due date and time */ + date: string; + /** Notes added to a task */ + notes?: string | undefined; + /** Whether the task is marked as done */ + done?: boolean | undefined; + /** Task creation date/time */ + createdAt?: string | undefined; + /** Task last update date/time */ + updatedAt?: string | undefined; } diff --git a/src/api/types/TierGroup.ts b/src/api/types/TierGroup.ts index 758f977..9f23e76 100644 --- a/src/api/types/TierGroup.ts +++ b/src/api/types/TierGroup.ts @@ -17,6 +17,10 @@ export interface TierGroup { updatedAt?: string | undefined; /** Select real_time to upgrade tier on real time balance updates. Select membership_anniversary to upgrade tier on subscription anniversary. Select tier_anniversary to upgrade tier on tier anniversary. */ upgradeStrategy?: TierGroup.UpgradeStrategy | undefined; + /** Schedule configuration for tier upgrades. */ + upgradeSchedule?: TierGroup.UpgradeSchedule | undefined; + /** Schedule configuration for tier downgrades. */ + downgradeSchedule?: TierGroup.DowngradeSchedule | undefined; } export namespace TierGroup { @@ -34,4 +38,70 @@ export namespace TierGroup { TierAnniversary: "tier_anniversary", } as const; export type UpgradeStrategy = (typeof UpgradeStrategy)[keyof typeof UpgradeStrategy]; + + /** + * Schedule configuration for tier upgrades. + */ + export interface UpgradeSchedule { + /** Schedule strategy type. */ + strategy?: string | undefined; + /** Duration value for the schedule. */ + durationValue?: number | undefined; + /** Duration unit for the schedule. */ + durationUnit?: UpgradeSchedule.DurationUnit | undefined; + /** Modifier for the duration. */ + durationModifier?: UpgradeSchedule.DurationModifier | undefined; + /** Scheduled date in DD/MM format. */ + scheduledDate?: string | undefined; + } + + export namespace UpgradeSchedule { + /** Duration unit for the schedule. */ + export const DurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit]; + /** Modifier for the duration. */ + export const DurationModifier = { + StartOfPeriod: "start_of_period", + EndOfPeriod: "end_of_period", + } as const; + export type DurationModifier = (typeof DurationModifier)[keyof typeof DurationModifier]; + } + + /** + * Schedule configuration for tier downgrades. + */ + export interface DowngradeSchedule { + /** Schedule strategy type. */ + strategy?: string | undefined; + /** Duration value for the schedule. */ + durationValue?: number | undefined; + /** Duration unit for the schedule. */ + durationUnit?: DowngradeSchedule.DurationUnit | undefined; + /** Modifier for the duration. */ + durationModifier?: DowngradeSchedule.DurationModifier | undefined; + /** Scheduled date in DD/MM format. */ + scheduledDate?: string | undefined; + } + + export namespace DowngradeSchedule { + /** Duration unit for the schedule. */ + export const DurationUnit = { + Day: "day", + Week: "week", + Month: "month", + Year: "year", + } as const; + export type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit]; + /** Modifier for the duration. */ + export const DurationModifier = { + StartOfPeriod: "start_of_period", + EndOfPeriod: "end_of_period", + } as const; + export type DurationModifier = (typeof DurationModifier)[keyof typeof DurationModifier]; + } } diff --git a/src/api/types/Transaction.ts b/src/api/types/Transaction.ts index 48a8675..1050fc2 100644 --- a/src/api/types/Transaction.ts +++ b/src/api/types/Transaction.ts @@ -4,34 +4,54 @@ * Represents a transaction involving a balance, including status and timestamps. */ export interface Transaction { + /** Unique identifier (UUID) of the transaction. */ + id?: string | undefined; /** The transaction amount. */ amount?: number | undefined; + /** The type of the transaction. */ + transactionType?: Transaction.TransactionType | undefined; + /** Optional metadata associated with the transaction. */ + meta?: Record | undefined; + /** The current status of the transaction. */ + status?: Transaction.Status | undefined; + /** Unique identifier (UUID) of the associated loyalty program. */ + loyaltyProgramId?: string | undefined; /** Unique identifier (UUID) of the associated balance definition. */ balanceDefinitionId?: string | undefined; - /** Timestamp when the transaction was canceled (nullable). */ - cancelledAt?: string | undefined; - /** Timestamp when the transaction was completed (nullable). */ - completedAt?: string | undefined; /** Unique identifier of the contact associated with the transaction. */ contactId?: number | undefined; - /** Timestamp when the transaction was created. */ - createdAt?: string | undefined; - /** Optional timestamp indicating when the transaction event occurred. */ + /** Optional timestamp indicating when the transaction event occurred (ISO 8601 format). */ eventTime?: string | undefined; - /** Expiry date of the transaction (nullable). */ - expirationDate?: string | undefined; - /** Unique identifier (UUID) of the transaction. */ - id?: string | undefined; - /** Unique identifier (UUID) of the associated loyalty program. */ - loyaltyProgramId?: string | undefined; - /** Optional metadata associated with the transaction. */ - meta?: Record | undefined; /** Reason for rejection if the transaction was declined (nullable). */ rejectReason?: string | undefined; /** Timestamp when the transaction was rejected (nullable). */ rejectedAt?: string | undefined; - /** The current status of the transaction (e.g., pending, completed, rejected). */ - status?: string | undefined; + /** Expiry date of the transaction (nullable). */ + expirationDate?: string | undefined; + /** Timestamp when the transaction was completed (nullable). */ + completedAt?: string | undefined; + /** Timestamp when the transaction was canceled (nullable). */ + cancelledAt?: string | undefined; + /** Timestamp when the transaction was created. */ + createdAt?: string | undefined; /** Timestamp when the transaction was last updated. */ updatedAt?: string | undefined; } + +export namespace Transaction { + /** The type of the transaction. */ + export const TransactionType = { + Credit: "credit", + Debit: "debit", + } as const; + export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; + /** The current status of the transaction. */ + export const Status = { + Pending: "pending", + Complete: "complete", + Rejected: "rejected", + Cancelled: "cancelled", + Expired: "expired", + } as const; + export type Status = (typeof Status)[keyof typeof Status]; +} diff --git a/src/core/auth/AuthProvider.ts b/src/core/auth/AuthProvider.ts index 895a50f..c947866 100644 --- a/src/core/auth/AuthProvider.ts +++ b/src/core/auth/AuthProvider.ts @@ -4,3 +4,12 @@ import type { AuthRequest } from "./AuthRequest.js"; export interface AuthProvider { getAuthRequest(arg?: { endpointMetadata?: EndpointMetadata }): Promise; } + +export function isAuthProvider(value: unknown): value is AuthProvider { + return ( + typeof value === "object" && + value !== null && + "getAuthRequest" in value && + typeof value.getAuthRequest === "function" + ); +} diff --git a/src/core/auth/index.ts b/src/core/auth/index.ts index 2215b22..77effd0 100644 --- a/src/core/auth/index.ts +++ b/src/core/auth/index.ts @@ -1,4 +1,4 @@ -export type { AuthProvider } from "./AuthProvider.js"; +export { type AuthProvider, isAuthProvider } from "./AuthProvider.js"; export type { AuthRequest } from "./AuthRequest.js"; export { BasicAuth } from "./BasicAuth.js"; export { BearerToken } from "./BearerToken.js"; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 928dfea..943ec1b 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -21,7 +21,13 @@ export declare namespace Fetcher { method: string; contentType?: string; headers?: Record; + /** + * @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`). + * Retained for backwards compatibility with custom fetchers and callers that + * still construct request args with a query-parameter object. + */ queryParameters?: Record; + queryString?: string; body?: unknown; timeoutMs?: number; maxRetries?: number; @@ -118,17 +124,15 @@ const SENSITIVE_QUERY_PARAMS = new Set([ "session-id", ]); -function redactQueryParameters(queryParameters?: Record): Record | undefined { +function redactQueryParameters( + queryParameters: Record | undefined, +): Record | undefined { if (queryParameters == null) { - return queryParameters; + return undefined; } const redacted: Record = {}; for (const [key, value] of Object.entries(queryParameters)) { - if (SENSITIVE_QUERY_PARAMS.has(key.toLowerCase())) { - redacted[key] = "[REDACTED]"; - } else { - redacted[key] = value; - } + redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value; } return redacted; } @@ -251,7 +255,12 @@ async function getHeaders(args: Fetcher.Args): Promise { } export async function fetcherImpl(args: Fetcher.Args): Promise> { - const url = createRequestUrl(args.url, args.queryParameters); + let url = args.url; + if (args.queryString != null && args.queryString.length > 0) { + url = `${url}?${args.queryString}`; + } else { + url = createRequestUrl(args.url, args.queryParameters); + } const requestBody: BodyInit | undefined = await getRequestBody({ body: args.body, type: args.requestType ?? "other", diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index 1f68968..5e66b93 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -3,6 +3,10 @@ const MAX_RETRY_DELAY = 60000; // in milliseconds const DEFAULT_MAX_RETRIES = 2; const JITTER_FACTOR = 0.2; // 20% random jitter +function isRetryableStatusCode(statusCode: number): boolean { + return [408, 429].includes(statusCode) || statusCode >= 500; +} + function addPositiveJitter(delay: number): number { const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; return delay * jitterMultiplier; @@ -51,7 +55,7 @@ export async function requestWithRetries( let response: Response = await requestFn(); for (let i = 0; i < maxRetries; ++i) { - if ([408, 429].includes(response.status) || response.status >= 500) { + if (isRetryableStatusCode(response.status)) { const delay = getRetryDelayFromHeaders(response, i); await new Promise((resolve) => setTimeout(resolve, delay)); diff --git a/src/core/url/QueryStringBuilder.ts b/src/core/url/QueryStringBuilder.ts new file mode 100644 index 0000000..b045221 --- /dev/null +++ b/src/core/url/QueryStringBuilder.ts @@ -0,0 +1,87 @@ +import { toQueryString } from "./qs.js"; + +/** + * Creates a fluent builder for constructing URL query strings. + * + * Each `.add()` call serializes its value immediately (like C#'s builder), + * so no format tracking is needed — the style is applied at add-time. + * + * Usage (generated code): + * + * const qs = core.url.queryBuilder() + * .add("limit", limit) + * .add("tags", tags, { style: "comma" }) // explode: false + * .mergeAdditional(requestOptions?.queryParams) + * .build(); + */ +export function queryBuilder(): QueryStringBuilder { + return new QueryStringBuilder(); +} + +class QueryStringBuilder { + private parts: Map = new Map(); + + /** + * Adds a query parameter, serializing it immediately. + * + * By default arrays use "repeat" format (`key=a&key=b`). + * Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters + * to get comma-separated values (`key=a,b,c`). + * + * Null / undefined values are silently skipped. + */ + add(key: string, value: unknown, options?: { style?: "comma" }): this { + if (value === undefined || value === null) { + return this; + } + const serialized = toQueryString( + { [key]: value }, + { arrayFormat: options?.style === "comma" ? "comma" : "repeat" }, + ); + if (serialized.length > 0) { + this.parts.set(key, serialized); + } + return this; + } + + /** + * Adds multiple query parameters at once from a record. + * All parameters use the default "repeat" array format. + * Null / undefined values are silently skipped. + */ + addMany(params: Record): this { + if (params != null) { + for (const [key, value] of Object.entries(params)) { + this.add(key, value); + } + } + return this; + } + + /** + * Merges additional query parameters supplied at call-time via + * `requestOptions.queryParams`. Overrides existing keys (last-write-wins). + */ + mergeAdditional(additionalParams?: Record): this { + if (additionalParams != null) { + for (const [key, value] of Object.entries(additionalParams)) { + if (value === undefined || value === null) { + continue; + } + const serialized = toQueryString({ [key]: value }, { arrayFormat: "repeat" }); + if (serialized.length > 0) { + this.parts.set(key, serialized); + } + } + } + return this; + } + + /** + * Returns the assembled query string (without the leading `?`). + * Returns an empty string when no parameters were added. + */ + build(): string { + return [...this.parts.values()].join("&"); + } +} diff --git a/src/core/url/index.ts b/src/core/url/index.ts index f2e0fa2..ca9d4fb 100644 --- a/src/core/url/index.ts +++ b/src/core/url/index.ts @@ -1,3 +1,4 @@ export { encodePathParam } from "./encodePathParam.js"; export { join } from "./join.js"; +export { queryBuilder } from "./QueryStringBuilder.js"; export { toQueryString } from "./qs.js"; diff --git a/src/core/url/qs.ts b/src/core/url/qs.ts index 13e89be..f8b4556 100644 --- a/src/core/url/qs.ts +++ b/src/core/url/qs.ts @@ -1,5 +1,7 @@ +type ArrayFormat = "indices" | "repeat" | "comma"; + interface QueryStringOptions { - arrayFormat?: "indices" | "repeat"; + arrayFormat?: ArrayFormat; encode?: boolean; } @@ -33,18 +35,29 @@ function stringifyObject(obj: Record, prefix = "", options: Req if (value.length === 0) { continue; } - for (let i = 0; i < value.length; i++) { - const item = value[i]; - if (item === undefined) { - continue; + const effectiveFormat = options.arrayFormat; + if (effectiveFormat === "comma") { + const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; + const encodedValues = value + .filter((item) => item !== undefined && item !== null) + .map((item) => encodeValue(item, options.encode)); + if (encodedValues.length > 0) { + parts.push(`${encodedKey}=${encodedValues.join(",")}`); } - if (typeof item === "object" && !Array.isArray(item) && item !== null) { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - parts.push(...stringifyObject(item as Record, arrayKey, options)); - } else { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; - parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } else { + for (let i = 0; i < value.length; i++) { + const item = value[i]; + if (item === undefined) { + continue; + } + if (typeof item === "object" && !Array.isArray(item) && item !== null) { + const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + parts.push(...stringifyObject(item as Record, arrayKey, options)); + } else { + const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; + parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } } } } else if (typeof value === "object" && value !== null) { diff --git a/src/version.ts b/src/version.ts index cbd547a..7ba3a93 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "5.0.4"; +export const SDK_VERSION = "6.0.0"; diff --git a/tests/unit/fetcher/createRequestUrl.test.ts b/tests/unit/fetcher/createRequestUrl.test.ts index a92f1b5..f8afeaf 100644 --- a/tests/unit/fetcher/createRequestUrl.test.ts +++ b/tests/unit/fetcher/createRequestUrl.test.ts @@ -160,4 +160,8 @@ describe("Test createRequestUrl", () => { expect(createRequestUrl(baseUrl, queryParams)).toBe(expected); }); }); + + it("should default to repeat format for arrays", () => { + expect(createRequestUrl(BASE_URL, { items: ["a", "b"] })).toBe("https://api.example.com?items=a&items=b"); + }); }); diff --git a/tests/unit/fetcher/makePassthroughRequest.test.ts b/tests/unit/fetcher/makePassthroughRequest.test.ts index 1850d1f..cb8f226 100644 --- a/tests/unit/fetcher/makePassthroughRequest.test.ts +++ b/tests/unit/fetcher/makePassthroughRequest.test.ts @@ -246,7 +246,7 @@ describe("makePassthroughRequest", () => { }); it("should use requestOptions maxRetries over client maxRetries", async () => { - mockFetch.mockResolvedValue(new Response("", { status: 500 })); + mockFetch.mockResolvedValue(new Response("", { status: 502 })); vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { process.nextTick(callback); return null as any; diff --git a/tests/unit/fetcher/redacting.test.ts b/tests/unit/fetcher/redacting.test.ts index d599376..685f1dd 100644 --- a/tests/unit/fetcher/redacting.test.ts +++ b/tests/unit/fetcher/redacting.test.ts @@ -703,6 +703,112 @@ describe("Redacting Logic", () => { }); }); + describe("Query String Redaction", () => { + it("should redact api_key in queryString via URL", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryString: "api_key=secret-key&page=1", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?api_key=[REDACTED]&page=1", + }), + ); + }); + + it("should redact multiple sensitive params in queryString", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryString: "token=t&password=p&page=1", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?token=[REDACTED]&password=[REDACTED]&page=1", + }), + ); + }); + + it("should not redact non-sensitive params in queryString", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryString: "page=1&limit=10&sort=name", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?page=1&limit=10&sort=name", + }), + ); + }); + + it("should prefer queryString over queryParameters when both provided", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryString: "page=1", + queryParameters: { api_key: "secret-key" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?page=1", + queryParameters: expect.objectContaining({ + api_key: "[REDACTED]", + }), + }), + ); + }); + }); + describe("URL Redaction", () => { it("should redact credentials in URL", async () => { const mockLogger = createMockLogger(); diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index d226613..7c98c0a 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -36,13 +36,13 @@ describe("requestWithRetries", () => { vi.clearAllTimers(); }); - it("should retry on retryable status codes", async () => { + it("should retry on retryable status codes (legacy mode)", async () => { setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { process.nextTick(callback); return null as any; }); - const retryableStatuses = [408, 429, 500, 502]; + const retryableStatuses = [408, 429, 500, 501, 502, 503, 504, 505]; let callCount = 0; mockFetch.mockImplementation(async () => { @@ -60,6 +60,24 @@ describe("requestWithRetries", () => { expect(response.status).toBe(200); }); + it("should retry on 500 Internal Server Error in legacy mode", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce(new Response("", { status: 500 })) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 3); + await vi.runAllTimersAsync(); + const response = await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(2); + expect(response.status).toBe(200); + }); + it("should respect maxRetries limit", async () => { setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { process.nextTick(callback); @@ -67,14 +85,48 @@ describe("requestWithRetries", () => { }); const maxRetries = 2; - mockFetch.mockResolvedValue(new Response("", { status: 500 })); + mockFetch.mockResolvedValue(new Response("", { status: 503 })); const responsePromise = requestWithRetries(() => mockFetch(), maxRetries); await vi.runAllTimersAsync(); const response = await responsePromise; expect(mockFetch).toHaveBeenCalledTimes(maxRetries + 1); - expect(response.status).toBe(500); + expect(response.status).toBe(503); + }); + + it("should retry on status 599 (upper boundary of retryable 5xx in legacy mode)", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce(new Response("", { status: 599 })) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 3); + await vi.runAllTimersAsync(); + const response = await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(2); + expect(response.status).toBe(200); + }); + + it("should not retry on non-retryable client error (400)", async () => { + setTimeoutSpy = vi.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch.mockResolvedValueOnce(new Response("", { status: 400 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 3); + await vi.runAllTimersAsync(); + const response = await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(1); + expect(response.status).toBe(400); }); it("should not retry on success status codes", async () => { @@ -166,7 +218,7 @@ describe("requestWithRetries", () => { return null as any; }); - mockFetch.mockResolvedValue(new Response("", { status: 500 })); + mockFetch.mockResolvedValue(new Response("", { status: 502 })); const maxRetries = 3; const expectedDelays = [1000, 2000, 4000]; @@ -190,8 +242,8 @@ describe("requestWithRetries", () => { }); mockFetch - .mockResolvedValueOnce(new Response("", { status: 500 })) - .mockResolvedValueOnce(new Response("", { status: 500 })) + .mockResolvedValueOnce(new Response("", { status: 502 })) + .mockResolvedValueOnce(new Response("", { status: 502 })) .mockResolvedValueOnce(new Response("", { status: 200 })) .mockResolvedValueOnce(new Response("", { status: 200 })); diff --git a/tests/unit/url/QueryStringBuilder.test.ts b/tests/unit/url/QueryStringBuilder.test.ts new file mode 100644 index 0000000..1afa2d2 --- /dev/null +++ b/tests/unit/url/QueryStringBuilder.test.ts @@ -0,0 +1,236 @@ +import { queryBuilder } from "../../../src/core/url/QueryStringBuilder"; + +describe("QueryStringBuilder", () => { + describe("add() — default repeat format", () => { + it("adds a scalar string value", () => { + const qs = queryBuilder().add("key", "value").build(); + expect(qs).toBe("key=value"); + }); + + it("adds a scalar number value", () => { + const qs = queryBuilder().add("limit", 10).build(); + expect(qs).toBe("limit=10"); + }); + + it("adds a boolean value", () => { + const qs = queryBuilder().add("active", true).build(); + expect(qs).toBe("active=true"); + }); + + it("skips undefined values", () => { + const qs = queryBuilder().add("key", undefined).build(); + expect(qs).toBe(""); + }); + + it("skips null values", () => { + const qs = queryBuilder().add("key", null).build(); + expect(qs).toBe(""); + }); + + it("repeats array elements as separate key=value pairs", () => { + const qs = queryBuilder().add("color", ["red", "blue", "green"]).build(); + expect(qs).toBe("color=red&color=blue&color=green"); + }); + + it("skips undefined items within arrays", () => { + const qs = queryBuilder().add("color", ["red", undefined, "blue"]).build(); + expect(qs).toBe("color=red&color=blue"); + }); + + it("returns empty string for empty array", () => { + const qs = queryBuilder().add("color", []).build(); + expect(qs).toBe(""); + }); + + it("encodes special characters in keys and values", () => { + const qs = queryBuilder().add("my key", "hello world").build(); + expect(qs).toBe("my%20key=hello%20world"); + }); + + it("handles nested objects", () => { + const qs = queryBuilder().add("filter", { status: "active" }).build(); + expect(qs).toBe("filter%5Bstatus%5D=active"); + }); + }); + + describe("add() — comma style", () => { + it("joins array values with literal commas", () => { + const qs = queryBuilder().add("tags", ["a", "b", "c"], { style: "comma" }).build(); + expect(qs).toBe("tags=a,b,c"); + }); + + it("handles single-element array", () => { + const qs = queryBuilder().add("tags", ["only"], { style: "comma" }).build(); + expect(qs).toBe("tags=only"); + }); + + it("returns empty string for empty array", () => { + const qs = queryBuilder().add("tags", [], { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("skips undefined values", () => { + const qs = queryBuilder().add("tags", undefined, { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("skips null values", () => { + const qs = queryBuilder().add("tags", null, { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("treats scalar values same as default add()", () => { + const qs = queryBuilder().add("tag", "single", { style: "comma" }).build(); + expect(qs).toBe("tag=single"); + }); + + it("encodes commas within individual values as %2C", () => { + const qs = queryBuilder().add("items", ["a,b", "c"], { style: "comma" }).build(); + expect(qs).toBe("items=a%2Cb,c"); + }); + + it("encodes special characters in values", () => { + const qs = queryBuilder().add("tags", ["hello world", "foo&bar"], { style: "comma" }).build(); + expect(qs).toBe("tags=hello%20world,foo%26bar"); + }); + }); + + describe("chaining", () => { + it("chains multiple add() calls", () => { + const qs = queryBuilder().add("limit", 10).add("offset", 20).build(); + expect(qs).toBe("limit=10&offset=20"); + }); + + it("chains add() with default and comma styles", () => { + const qs = queryBuilder() + .add("limit", 10) + .add("tags", ["ACCESS_GRANTED", "COPY", "DELETE"], { style: "comma" }) + .add("active", true) + .build(); + expect(qs).toBe("limit=10&tags=ACCESS_GRANTED,COPY,DELETE&active=true"); + }); + + it("skips undefined/null params in chain without breaking", () => { + const qs = queryBuilder() + .add("a", "1") + .add("b", undefined) + .add("c", null, { style: "comma" }) + .add("d", "4") + .build(); + expect(qs).toBe("a=1&d=4"); + }); + }); + + describe("addMany()", () => { + it("adds all params from a record", () => { + const qs = queryBuilder().addMany({ limit: 10, offset: 20, name: "test" }).build(); + expect(qs).toBe("limit=10&offset=20&name=test"); + }); + + it("skips null and undefined values", () => { + const qs = queryBuilder().addMany({ a: "1", b: null, c: undefined, d: "4" }).build(); + expect(qs).toBe("a=1&d=4"); + }); + + it("handles empty record", () => { + const qs = queryBuilder().addMany({}).build(); + expect(qs).toBe(""); + }); + + it("works with comma-style override after addMany", () => { + const params = { limit: 10, tags: ["a", "b"], active: true }; + const qs = queryBuilder().addMany(params).add("tags", params.tags, { style: "comma" }).build(); + expect(qs).toBe("limit=10&tags=a,b&active=true"); + }); + + it("handles array values with default repeat format", () => { + const qs = queryBuilder() + .addMany({ ids: [1, 2, 3] }) + .build(); + expect(qs).toBe("ids=1&ids=2&ids=3"); + }); + }); + + describe("mergeAdditional()", () => { + it("appends additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: "value" }).build(); + expect(qs).toBe("limit=10&extra=value"); + }); + + it("overrides existing keys (last-write-wins)", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ limit: 20 }).build(); + expect(qs).toBe("limit=20"); + }); + + it("handles undefined additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional(undefined).build(); + expect(qs).toBe("limit=10"); + }); + + it("skips undefined values in additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: undefined }).build(); + expect(qs).toBe("limit=10"); + }); + + it("skips null values in additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: null }).build(); + expect(qs).toBe("limit=10"); + }); + + it("handles array values in additional params using repeat format", () => { + const qs = queryBuilder() + .mergeAdditional({ ids: [1, 2, 3] }) + .build(); + expect(qs).toBe("ids=1&ids=2&ids=3"); + }); + + it("overrides a comma-style param with repeat format", () => { + const qs = queryBuilder() + .add("tags", ["a", "b"], { style: "comma" }) + .mergeAdditional({ tags: ["x", "y"] }) + .build(); + expect(qs).toBe("tags=x&tags=y"); + }); + }); + + describe("build()", () => { + it("returns empty string when no params added", () => { + const qs = queryBuilder().build(); + expect(qs).toBe(""); + }); + + it("does not include leading ?", () => { + const qs = queryBuilder().add("key", "value").build(); + expect(qs).not.toContain("?"); + }); + }); + + describe("end-to-end scenarios", () => { + it("matches expected query-parameters-openapi output pattern", () => { + const params: Record = { + limit: 1, + id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + date: "2023-01-15", + deadline: "2024-01-15T09:30:00.000Z", + bytes: "SGVsbG8gd29ybGQh", + user: "user", + userList: ["user"], + optionalString: "optionalString", + nestedUser: "nestedUser", + excludeUser: "excludeUser", + filter: "filter", + tags: ["tags"], + optionalTags: undefined, + }; + const qs = queryBuilder() + .addMany(params) + .add("tags", params.tags, { style: "comma" }) + .add("optionalTags", params.optionalTags, { style: "comma" }) + .mergeAdditional(undefined) + .build(); + expect(qs).toContain("limit=1"); + expect(qs).toContain("tags=tags"); + expect(qs).not.toContain("optionalTags"); + }); + }); +}); diff --git a/tests/unit/url/qs.test.ts b/tests/unit/url/qs.test.ts index 42cdffb..1099b95 100644 --- a/tests/unit/url/qs.test.ts +++ b/tests/unit/url/qs.test.ts @@ -34,7 +34,7 @@ describe("Test qs toQueryString", () => { interface ArrayTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices" }; + options?: { arrayFormat?: "repeat" | "indices" | "comma" }; expected: string; } @@ -150,7 +150,7 @@ describe("Test qs toQueryString", () => { interface MixedTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices" }; + options?: { arrayFormat?: "repeat" | "indices" | "comma" }; expected: string; } @@ -241,11 +241,107 @@ describe("Test qs toQueryString", () => { }); }); + describe("Comma array format", () => { + interface CommaTestCase { + description: string; + input: any; + options?: { arrayFormat?: "comma"; encode?: boolean }; + expected: string; + } + + const commaTests: CommaTestCase[] = [ + { + description: "should join array values with commas", + input: { event_type: ["ACCESS_GRANTED", "COPY", "DELETE"] }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED,COPY,DELETE", + }, + { + description: "should handle single-element array", + input: { event_type: ["ACCESS_GRANTED"] }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED", + }, + { + description: "should handle empty array", + input: { event_type: [] }, + options: { arrayFormat: "comma" }, + expected: "", + }, + { + description: "should not percent-encode commas", + input: { items: ["a", "b", "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,b,c", + }, + { + description: "should encode values but not commas", + input: { items: ["a b", "c d"] }, + options: { arrayFormat: "comma" }, + expected: "items=a%20b,c%20d", + }, + { + description: "should not encode when encode is false", + input: { items: ["a b", "c d"] }, + options: { arrayFormat: "comma", encode: false }, + expected: "items=a b,c d", + }, + { + description: "should handle mixed parameters with comma and non-array values", + input: { event_type: ["ACCESS_GRANTED", "COPY", "DELETE"], limit: 10, offset: 0 }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED,COPY,DELETE&limit=10&offset=0", + }, + { + description: "should handle numeric array values", + input: { ids: [1, 2, 3] }, + options: { arrayFormat: "comma" }, + expected: "ids=1,2,3", + }, + { + description: "should handle boolean array values", + input: { flags: [true, false, true] }, + options: { arrayFormat: "comma" }, + expected: "flags=true,false,true", + }, + { + description: "should skip null values in comma format", + input: { items: ["a", null, "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,c", + }, + { + description: "should skip undefined values in comma format", + input: { items: ["a", undefined, "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,c", + }, + { + description: "should produce empty string for all-null array in comma format", + input: { items: [null, undefined] }, + options: { arrayFormat: "comma" }, + expected: "", + }, + { + description: "should encode commas within values while keeping separator commas literal", + input: { items: ["a,b", "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a%2Cb,c", + }, + ]; + + commaTests.forEach(({ description, input, options, expected }) => { + it(description, () => { + expect(toQueryString(input, options)).toBe(expected); + }); + }); + }); + describe("Options combinations", () => { interface OptionsTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices"; encode?: boolean }; + options?: { arrayFormat?: "repeat" | "indices" | "comma"; encode?: boolean }; expected: string; } diff --git a/tests/wire/account.test.ts b/tests/wire/account.test.ts index 130fc50..93757d0 100644 --- a/tests/wire/account.test.ts +++ b/tests/wire/account.test.ts @@ -5,7 +5,7 @@ import { BrevoClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("AccountClient", () => { - test("getAccount", async () => { + test("getAccount (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -18,7 +18,6 @@ describe("AccountClient", () => { firstName: "Michael", lastName: "Davis", address: { city: "New York", country: "United States", street: "456 Business Ave", zipCode: "10001" }, - dateTimePreferences: { timezone: "America/New_York", timeFormat: "12", dateFormat: "mm-dd-yyyy" }, marketingAutomation: { enabled: true, key: "ma8k2x9v4h7p3d6f1c5e8b2a" }, plan: [ { @@ -74,6 +73,19 @@ describe("AccountClient", () => { expect(response).toEqual(rawResponseBody); }); + test("getAccount (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/account").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.account.getAccount(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + test("getAccountActivity (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); diff --git a/tests/wire/balance.test.ts b/tests/wire/balance.test.ts index e7649d2..844e44d 100644 --- a/tests/wire/balance.test.ts +++ b/tests/wire/balance.test.ts @@ -10,16 +10,13 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { + count: 1000000, + loyaltyProgramId: "loyaltyProgramId", + contactId: 1000000, balanceDefinitionId: "balanceDefinitionId", - constraintType: "constraintType", - createdAt: "createdAt", - durationUnit: "durationUnit", - durationValue: 1, - id: "id", - slidingSchedule: true, - transactionType: "transactionType", - updatedAt: "updatedAt", - value: 1, + activeBalances: [ + { id: "id", amount: 1.1, createdAt: "2024-01-15T09:30:00Z", expiresAt: "2024-01-15T09:30:00Z" }, + ], }; server @@ -32,8 +29,8 @@ describe("BalanceClient", () => { const response = await client.balance.getActiveBalancesApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1000000, + balanceDefinitionId: "balanceDefinitionId", }); expect(response).toEqual(rawResponseBody); }); @@ -55,8 +52,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getActiveBalancesApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1000000, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnauthorizedError); }); @@ -78,8 +75,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getActiveBalancesApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1000000, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.ForbiddenError); }); @@ -101,8 +98,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getActiveBalancesApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1000000, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.NotFoundError); }); @@ -124,8 +121,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getActiveBalancesApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1000000, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnprocessableEntityError); }); @@ -147,8 +144,8 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getActiveBalancesApi({ pid: "pid", - contact_id: 1, - balance_definition_id: "balance_definition_id", + contactId: 1000000, + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.InternalServerError); }); @@ -160,26 +157,26 @@ describe("BalanceClient", () => { const rawResponseBody = { items: [ { - balanceAvailabilityDurationModifier: "startOfPeriod", - balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", - balanceAvailabilityDurationValue: 1, - balanceExpirationDate: "2024-01-15T09:30:00Z", - balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", - balanceOptionCreditRounding: "balanceOptionCreditRounding", - balanceOptionDebitRounding: "balanceOptionDebitRounding", - createdAt: "2024-01-15T09:30:00Z", - deletedAt: "deletedAt", - description: "description", id: "id", + name: "name", + description: "description", imageRef: "imageRef", + meta: { key: "value" }, + unit: "POINTS", + minAmount: 1.1, maxAmount: 1.1, maxCreditAmountLimit: 1.1, maxDebitAmountLimit: 1.1, - meta: { key: "value" }, - minAmount: 1.1, - name: "name", - unit: "unit", - updatedAt: "updatedAt", + balanceOptionAmountOvertakingStrategy: "strict", + balanceOptionCreditRounding: "lower", + balanceOptionDebitRounding: "lower", + balanceAvailabilityDurationValue: 1, + balanceAvailabilityDurationUnit: "day", + balanceAvailabilityDurationModifier: "noModification", + balanceExpirationDate: "balanceExpirationDate", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", }, ], }; @@ -287,26 +284,26 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { - balanceAvailabilityDurationModifier: "startOfPeriod", - balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", - balanceAvailabilityDurationValue: 1, - balanceExpirationDate: "2024-01-15T09:30:00Z", - balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", - balanceOptionCreditRounding: "balanceOptionCreditRounding", - balanceOptionDebitRounding: "balanceOptionDebitRounding", - createdAt: "2024-01-15T09:30:00Z", - deletedAt: "deletedAt", - description: "description", id: "id", + name: "name", + description: "description", imageRef: "imageRef", + meta: { key: "value" }, + unit: "POINTS", + minAmount: 1.1, maxAmount: 1.1, maxCreditAmountLimit: 1.1, maxDebitAmountLimit: 1.1, - meta: { key: "value" }, - minAmount: 1.1, - name: "name", - unit: "unit", - updatedAt: "updatedAt", + balanceOptionAmountOvertakingStrategy: "strict", + balanceOptionCreditRounding: "lower", + balanceOptionDebitRounding: "lower", + balanceAvailabilityDurationValue: 1, + balanceAvailabilityDurationUnit: "day", + balanceAvailabilityDurationModifier: "noModification", + balanceExpirationDate: "balanceExpirationDate", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", }; server @@ -451,26 +448,26 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - balanceAvailabilityDurationModifier: "startOfPeriod", - balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", - balanceAvailabilityDurationValue: 1, - balanceExpirationDate: "2024-01-15T09:30:00Z", - balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", - balanceOptionCreditRounding: "balanceOptionCreditRounding", - balanceOptionDebitRounding: "balanceOptionDebitRounding", - createdAt: "2024-01-15T09:30:00Z", - deletedAt: "deletedAt", - description: "description", id: "id", + name: "name", + description: "description", imageRef: "imageRef", + meta: { key: "value" }, + unit: "POINTS", + minAmount: 1.1, maxAmount: 1.1, maxCreditAmountLimit: 1.1, maxDebitAmountLimit: 1.1, - meta: { key: "value" }, - minAmount: 1.1, - name: "name", - unit: "unit", - updatedAt: "updatedAt", + balanceOptionAmountOvertakingStrategy: "strict", + balanceOptionCreditRounding: "lower", + balanceOptionDebitRounding: "lower", + balanceAvailabilityDurationValue: 1, + balanceAvailabilityDurationUnit: "day", + balanceAvailabilityDurationModifier: "noModification", + balanceExpirationDate: "balanceExpirationDate", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", }; server @@ -603,26 +600,26 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name", unit: "POINTS" }; const rawResponseBody = { - balanceAvailabilityDurationModifier: "startOfPeriod", - balanceAvailabilityDurationUnit: "balanceAvailabilityDurationUnit", - balanceAvailabilityDurationValue: 1, - balanceExpirationDate: "2024-01-15T09:30:00Z", - balanceOptionAmountOvertakingStrategy: "balanceOptionAmountOvertakingStrategy", - balanceOptionCreditRounding: "balanceOptionCreditRounding", - balanceOptionDebitRounding: "balanceOptionDebitRounding", - createdAt: "2024-01-15T09:30:00Z", - deletedAt: "deletedAt", - description: "description", id: "id", + name: "name", + description: "description", imageRef: "imageRef", + meta: { key: "value" }, + unit: "POINTS", + minAmount: 1.1, maxAmount: 1.1, maxCreditAmountLimit: 1.1, maxDebitAmountLimit: 1.1, - meta: { key: "value" }, - minAmount: 1.1, - name: "name", - unit: "unit", - updatedAt: "updatedAt", + balanceOptionAmountOvertakingStrategy: "strict", + balanceOptionCreditRounding: "lower", + balanceOptionDebitRounding: "lower", + balanceAvailabilityDurationValue: 1, + balanceAvailabilityDurationUnit: "day", + balanceAvailabilityDurationModifier: "noModification", + balanceExpirationDate: "balanceExpirationDate", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", }; server @@ -932,16 +929,16 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { + id: "id", balanceDefinitionId: "balanceDefinitionId", - constraintType: "constraintType", - createdAt: "createdAt", - durationUnit: "durationUnit", + transactionType: "credit", + constraintType: "transaction", durationValue: 1, - id: "id", + durationUnit: "hour", + value: 1.1, slidingSchedule: true, - transactionType: "transactionType", - updatedAt: "updatedAt", - value: 1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -1140,16 +1137,16 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { + id: "id", balanceDefinitionId: "balanceDefinitionId", - constraintType: "constraintType", - createdAt: "createdAt", - durationUnit: "durationUnit", + transactionType: "credit", + constraintType: "transaction", durationValue: 1, - id: "id", + durationUnit: "hour", + value: 1.1, slidingSchedule: true, - transactionType: "transactionType", - updatedAt: "updatedAt", - value: 1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -1294,16 +1291,16 @@ describe("BalanceClient", () => { value: 1, }; const rawResponseBody = { + id: "id", balanceDefinitionId: "balanceDefinitionId", - constraintType: "constraintType", - createdAt: "createdAt", - durationUnit: "durationUnit", + transactionType: "credit", + constraintType: "transaction", durationValue: 1, - id: "id", + durationUnit: "hour", + value: 1.1, slidingSchedule: true, - transactionType: "transactionType", - updatedAt: "updatedAt", - value: 1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -1660,6 +1657,7 @@ describe("BalanceClient", () => { const response = await client.balance.getContactBalances({ pid: "pid", + balanceDefinitionId: "balanceDefinitionId", }); expect(response).toEqual(rawResponseBody); }); @@ -1681,6 +1679,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getContactBalances({ pid: "pid", + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnauthorizedError); }); @@ -1702,6 +1701,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getContactBalances({ pid: "pid", + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.ForbiddenError); }); @@ -1723,6 +1723,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getContactBalances({ pid: "pid", + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.NotFoundError); }); @@ -1744,6 +1745,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getContactBalances({ pid: "pid", + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnprocessableEntityError); }); @@ -1765,6 +1767,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getContactBalances({ pid: "pid", + balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.InternalServerError); }); @@ -1777,7 +1780,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }; const rawResponseBody = { amount: 1.1, @@ -1809,7 +1812,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }); expect(response).toEqual(rawResponseBody); }); @@ -1822,7 +1825,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }; const rawResponseBody = { key: "value" }; @@ -1842,7 +1845,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }); }).rejects.toThrow(Brevo.UnauthorizedError); }); @@ -1855,7 +1858,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }; const rawResponseBody = { key: "value" }; @@ -1875,7 +1878,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }); }).rejects.toThrow(Brevo.ForbiddenError); }); @@ -1888,7 +1891,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }; const rawResponseBody = { message: "message" }; @@ -1908,7 +1911,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }); }).rejects.toThrow(Brevo.UnprocessableEntityError); }); @@ -1921,7 +1924,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }; const rawResponseBody = { key: "value" }; @@ -1941,7 +1944,7 @@ describe("BalanceClient", () => { balanceDefinitionId: "balanceDefinitionId", contactId: 1, dueAt: "dueAt", - source: "source", + source: "engine", }); }).rejects.toThrow(Brevo.InternalServerError); }); @@ -1950,7 +1953,11 @@ describe("BalanceClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = { balance: [{ balanceDefinitionId: "balanceDefinitionId", value: 1.1 }] }; + const rawResponseBody = { + loyaltyProgramId: "loyaltyProgramId", + contactId: 1000000, + balance: [{ balanceDefinitionId: "balanceDefinitionId", value: 1.1 }], + }; server .mockEndpoint() @@ -2082,15 +2089,15 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - consumedAt: "consumedAt", - contactId: 1, - createdAt: "createdAt", - expiresAt: "expiresAt", id: "id", + amount: 1.1, loyaltyProgramId: "loyaltyProgramId", - organizationId: 1, + organizationId: 1000000, + contactId: 1000000, + balanceDefinitionId: "balanceDefinitionId", + createdAt: "2024-01-15T09:30:00Z", + expiresAt: "2024-01-15T09:30:00Z", + consumedAt: "2024-01-15T09:30:00Z", }; server @@ -2242,6 +2249,7 @@ describe("BalanceClient", () => { transactionHistory: [ { amount: 1.1, + transactionType: "credit", balanceExpirationDate: "balanceExpirationDate", cancelledAt: "cancelledAt", completedAt: "completedAt", @@ -2265,7 +2273,7 @@ describe("BalanceClient", () => { const response = await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, + contactId: 1000000, balanceDefinitionId: "balanceDefinitionId", }); expect(response).toEqual(rawResponseBody); @@ -2288,7 +2296,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, + contactId: 1000000, balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnauthorizedError); @@ -2311,7 +2319,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, + contactId: 1000000, balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.ForbiddenError); @@ -2334,7 +2342,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, + contactId: 1000000, balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.NotFoundError); @@ -2357,7 +2365,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, + contactId: 1000000, balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.UnprocessableEntityError); @@ -2380,7 +2388,7 @@ describe("BalanceClient", () => { await expect(async () => { return await client.balance.getTransactionHistoryApi({ pid: "pid", - contactId: 1, + contactId: 1000000, balanceDefinitionId: "balanceDefinitionId", }); }).rejects.toThrow(Brevo.InternalServerError); @@ -2391,21 +2399,22 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { amount: 1.1, balanceDefinitionId: "balanceDefinitionId" }; const rawResponseBody = { - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - cancelledAt: "cancelledAt", - completedAt: "completedAt", - contactId: 1, - createdAt: "createdAt", - eventTime: "eventTime", - expirationDate: "expirationDate", id: "id", - loyaltyProgramId: "loyaltyProgramId", + amount: 1.1, + transactionType: "credit", meta: { key: "value" }, + status: "pending", + loyaltyProgramId: "loyaltyProgramId", + balanceDefinitionId: "balanceDefinitionId", + contactId: 1000000, + eventTime: "2024-01-15T09:30:00Z", rejectReason: "rejectReason", - rejectedAt: "rejectedAt", - status: "status", - updatedAt: "updatedAt", + rejectedAt: "2024-01-15T09:30:00Z", + expirationDate: "2024-01-15T09:30:00Z", + completedAt: "2024-01-15T09:30:00Z", + cancelledAt: "2024-01-15T09:30:00Z", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -2550,21 +2559,22 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - cancelledAt: "cancelledAt", - completedAt: "completedAt", - contactId: 1, - createdAt: "createdAt", - eventTime: "eventTime", - expirationDate: "expirationDate", id: "id", - loyaltyProgramId: "loyaltyProgramId", + amount: 1.1, + transactionType: "credit", meta: { key: "value" }, + status: "pending", + loyaltyProgramId: "loyaltyProgramId", + balanceDefinitionId: "balanceDefinitionId", + contactId: 1000000, + eventTime: "2024-01-15T09:30:00Z", rejectReason: "rejectReason", - rejectedAt: "rejectedAt", - status: "status", - updatedAt: "updatedAt", + rejectedAt: "2024-01-15T09:30:00Z", + expirationDate: "2024-01-15T09:30:00Z", + completedAt: "2024-01-15T09:30:00Z", + cancelledAt: "2024-01-15T09:30:00Z", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -2697,21 +2707,22 @@ describe("BalanceClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - amount: 1.1, - balanceDefinitionId: "balanceDefinitionId", - cancelledAt: "cancelledAt", - completedAt: "completedAt", - contactId: 1, - createdAt: "createdAt", - eventTime: "eventTime", - expirationDate: "expirationDate", id: "id", - loyaltyProgramId: "loyaltyProgramId", + amount: 1.1, + transactionType: "credit", meta: { key: "value" }, + status: "pending", + loyaltyProgramId: "loyaltyProgramId", + balanceDefinitionId: "balanceDefinitionId", + contactId: 1000000, + eventTime: "2024-01-15T09:30:00Z", rejectReason: "rejectReason", - rejectedAt: "rejectedAt", - status: "status", - updatedAt: "updatedAt", + rejectedAt: "2024-01-15T09:30:00Z", + expirationDate: "2024-01-15T09:30:00Z", + completedAt: "2024-01-15T09:30:00Z", + cancelledAt: "2024-01-15T09:30:00Z", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts index 0913181..f4bf916 100644 --- a/tests/wire/companies.test.ts +++ b/tests/wire/companies.test.ts @@ -482,17 +482,18 @@ describe("CompaniesClient", () => { }).rejects.toThrow(Brevo.NotFoundError); }); - test("getCompanyAttributes", async () => { + test("getCompanyAttributes (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = [ { - attributeOptions: [{ key: "custom key", value: "custom label" }], - attributeTypeName: "text", internalName: "name", - isRequired: true, + attributeTypeName: "text", label: "Company Name", + attributeOptions: [{ key: "custom key", value: "custom label" }], + isRequired: true, + isValueReadonly: false, }, ]; @@ -507,4 +508,23 @@ describe("CompaniesClient", () => { const response = await client.companies.getCompanyAttributes(); expect(response).toEqual(rawResponseBody); }); + + test("getCompanyAttributes (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/crm/attributes/companies") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.companies.getCompanyAttributes(); + }).rejects.toThrow(Brevo.BadRequestError); + }); }); diff --git a/tests/wire/contacts.test.ts b/tests/wire/contacts.test.ts index 2eb22f7..79b0bb8 100644 --- a/tests/wire/contacts.test.ts +++ b/tests/wire/contacts.test.ts @@ -21,6 +21,7 @@ describe("ContactsClient", () => { listUnsubscribed: [1000000], modifiedAt: "2017-05-01T17:05:03Z", smsBlacklisted: true, + whatsappBlacklisted: false, }, { attributes: {}, @@ -32,6 +33,7 @@ describe("ContactsClient", () => { listUnsubscribed: [1000000], modifiedAt: "2017-05-01T17:05:03Z", smsBlacklisted: false, + whatsappBlacklisted: false, }, ], count: 3, @@ -128,7 +130,7 @@ describe("ContactsClient", () => { }).rejects.toThrow(Brevo.TooEarlyError); }); - test("getAttributes", async () => { + test("getAttributes (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -137,7 +139,7 @@ describe("ContactsClient", () => { { calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", category: "normal", - enumeration: [{ label: "Women", value: 1 }], + enumeration: [{ label: "Women", value: 1, valueStr: "1" }], multiCategoryOptions: ["USA"], name: "LASTNAME", type: "text", @@ -145,7 +147,7 @@ describe("ContactsClient", () => { { calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", category: "normal", - enumeration: [{ label: "Women", value: 1 }], + enumeration: [{ label: "Women", value: 1, valueStr: "1" }], multiCategoryOptions: ["USA"], name: "FIRSTNAME", type: "text", @@ -153,7 +155,7 @@ describe("ContactsClient", () => { { calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", category: "normal", - enumeration: [{ label: "Women", value: 1 }], + enumeration: [{ label: "Women", value: 1, valueStr: "1" }], multiCategoryOptions: ["USA"], name: "DOB", type: "date", @@ -162,18 +164,29 @@ describe("ContactsClient", () => { calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", category: "category", enumeration: [ - { label: "Men", value: 1 }, - { label: "Women", value: 2 }, - { label: "Kid", value: 3 }, + { label: "Men", value: 1, valueStr: "1" }, + { label: "Women", value: 2, valueStr: "2" }, + { label: "Kid", value: 3, valueStr: "3" }, ], multiCategoryOptions: ["USA"], name: "GENDER", type: "text", }, + { + calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", + category: "category", + enumeration: [ + { label: "English", value: 0, valueStr: "en" }, + { label: "French", value: 0, valueStr: "fr" }, + ], + multiCategoryOptions: ["USA"], + name: "LANGUAGE", + type: "text", + }, { calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", category: "normal", - enumeration: [{ label: "Women", value: 1 }], + enumeration: [{ label: "Women", value: 1, valueStr: "1" }], multiCategoryOptions: ["USA"], name: "BDO", type: "user", @@ -181,7 +194,7 @@ describe("ContactsClient", () => { { calculatedValue: "COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)]", category: "normal", - enumeration: [{ label: "Women", value: 1 }], + enumeration: [{ label: "Women", value: 1, valueStr: "1" }], multiCategoryOptions: ["USA", "India", "France"], name: "COUNTRY", type: "multiple-choice", @@ -201,6 +214,25 @@ describe("ContactsClient", () => { expect(response).toEqual(rawResponseBody); }); + test("getAttributes (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/contacts/attributes") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getAttributes(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + test("createAttribute (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -1293,6 +1325,7 @@ describe("ContactsClient", () => { listUnsubscribed: [1, 2], modifiedAt: "2017-05-12T12:30:00Z", smsBlacklisted: true, + whatsappBlacklisted: false, }, { attributes: {}, @@ -1304,6 +1337,7 @@ describe("ContactsClient", () => { listUnsubscribed: [1], modifiedAt: "2017-05-12T12:30:00Z", smsBlacklisted: false, + whatsappBlacklisted: false, }, { attributes: {}, @@ -1315,6 +1349,7 @@ describe("ContactsClient", () => { listUnsubscribed: [1], modifiedAt: "2017-05-12T12:30:00Z", smsBlacklisted: false, + whatsappBlacklisted: false, }, ], count: 17655, @@ -1376,6 +1411,27 @@ describe("ContactsClient", () => { }).rejects.toThrow(Brevo.NotFoundError); }); + test("getContactsFromList (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + + server + .mockEndpoint() + .get("/contacts/lists/1000000/contacts") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.contacts.getContactsFromList({ + listId: 1000000, + }); + }).rejects.toThrow(Brevo.TooManyRequestsError); + }); + test("addContactToList (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -1947,6 +2003,7 @@ describe("ContactsClient", () => { listUnsubscribed: [1000000], modifiedAt: "2017-05-02T16:40:31Z", smsBlacklisted: false, + whatsappBlacklisted: false, statistics: { clicked: [ { diff --git a/tests/wire/conversations.test.ts b/tests/wire/conversations.test.ts index 964985e..916ed4c 100644 --- a/tests/wire/conversations.test.ts +++ b/tests/wire/conversations.test.ts @@ -83,28 +83,36 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1482512803740, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, @@ -124,6 +132,10 @@ describe("ConversationsClient", () => { text: "Hello! How can I help you?", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -160,28 +172,36 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1482512803740, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, @@ -201,6 +221,10 @@ describe("ConversationsClient", () => { text: "Hello! How can I help you?", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -238,28 +262,36 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1482512803740, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, @@ -279,6 +311,10 @@ describe("ConversationsClient", () => { text: "Hello! How can I help you?", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -303,7 +339,7 @@ describe("ConversationsClient", () => { test("sendAMessageAsAnAgent (4)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { text: { key: "value" }, visitorId: { key: "value" } }; + const rawRequestBody = { text: "text", visitorId: "visitorId" }; const rawResponseBody = { key: "value" }; server @@ -317,12 +353,8 @@ describe("ConversationsClient", () => { await expect(async () => { return await client.conversations.sendAMessageAsAnAgent({ - text: { - key: "value", - }, - visitorId: { - key: "value", - }, + text: "text", + visitorId: "visitorId", }); }).rejects.toThrow(Brevo.BadRequestError); }); @@ -337,28 +369,36 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1482512803740, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, @@ -378,6 +418,10 @@ describe("ConversationsClient", () => { text: "Hello! How can I help you?", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -447,32 +491,40 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1482512803740, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, - html: "Hello! How can I help you?", + html: "Good morning! How can I help you?", id: "eYBEm3gq3zc5ayE2g", integrations: { key: "value" }, isBot: true, @@ -485,9 +537,13 @@ describe("ConversationsClient", () => { replyTo: { email: "email", name: "name" }, sourceMessageId: "sourceMessageId", subject: "Invitation to a meeting", - text: "Hello! How can I help you?", + text: "Good morning! How can I help you?", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -612,7 +668,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { groupId: "PjRBMhWGen6aRHjif", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; const rawResponseBody = { @@ -621,32 +677,40 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1470222622433, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, - html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + html: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", id: "AXCR3k9bpSY7bpuh7", integrations: { key: "value" }, isBot: true, @@ -659,9 +723,13 @@ describe("ConversationsClient", () => { replyTo: { email: "email", name: "name" }, sourceMessageId: "sourceMessageId", subject: "Invitation to a meeting", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -676,7 +744,7 @@ describe("ConversationsClient", () => { const response = await client.conversations.sendAnAutomatedMessageToAVisitor({ groupId: "PjRBMhWGen6aRHjif", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); expect(response).toEqual(rawResponseBody); @@ -686,7 +754,7 @@ describe("ConversationsClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; const rawResponseBody = { @@ -695,32 +763,40 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1470222622433, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, - html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + html: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", id: "AXCR3k9bpSY7bpuh7", integrations: { key: "value" }, isBot: true, @@ -733,9 +809,13 @@ describe("ConversationsClient", () => { replyTo: { email: "email", name: "name" }, sourceMessageId: "sourceMessageId", subject: "Invitation to a meeting", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -749,7 +829,7 @@ describe("ConversationsClient", () => { .build(); const response = await client.conversations.sendAnAutomatedMessageToAVisitor({ - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); expect(response).toEqual(rawResponseBody); @@ -760,7 +840,7 @@ describe("ConversationsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { agentId: "d9nKoegKSjmCtyK78", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; const rawResponseBody = { @@ -769,32 +849,40 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1470222622433, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, - html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + html: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", id: "AXCR3k9bpSY7bpuh7", integrations: { key: "value" }, isBot: true, @@ -807,9 +895,13 @@ describe("ConversationsClient", () => { replyTo: { email: "email", name: "name" }, sourceMessageId: "sourceMessageId", subject: "Invitation to a meeting", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -824,7 +916,7 @@ describe("ConversationsClient", () => { const response = await client.conversations.sendAnAutomatedMessageToAVisitor({ agentId: "d9nKoegKSjmCtyK78", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }); expect(response).toEqual(rawResponseBody); @@ -833,7 +925,7 @@ describe("ConversationsClient", () => { test("sendAnAutomatedMessageToAVisitor (4)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { text: { key: "value" }, visitorId: { key: "value" } }; + const rawRequestBody = { text: "text", visitorId: "visitorId" }; const rawResponseBody = { key: "value" }; server @@ -847,12 +939,8 @@ describe("ConversationsClient", () => { await expect(async () => { return await client.conversations.sendAnAutomatedMessageToAVisitor({ - text: { - key: "value", - }, - visitorId: { - key: "value", - }, + text: "text", + visitorId: "visitorId", }); }).rejects.toThrow(Brevo.BadRequestError); }); @@ -867,32 +955,40 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1470222622433, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, - html: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + html: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", id: "AXCR3k9bpSY7bpuh7", integrations: { key: "value" }, isBot: true, @@ -905,9 +1001,13 @@ describe("ConversationsClient", () => { replyTo: { email: "email", name: "name" }, sourceMessageId: "sourceMessageId", subject: "Invitation to a meeting", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88", + text: "Your order has shipped! Here's your tracking number: 9114 5847 3325 9667 4328 88", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -971,7 +1071,7 @@ describe("ConversationsClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { - text: "Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54", + text: "Your order has shipped! Here's your tracking number: 9114 5847 4668 7775 9233 54", }; const rawResponseBody = { agentId: "d9nKoegKSjmCtyK78", @@ -979,32 +1079,40 @@ describe("ConversationsClient", () => { agentUserpic: "https://www.brevo.com/", attachments: [ { - fileName: "fileName", - inlineId: "inlineId", + name: "name", + link: "link", + mimeType: "mimeType", isImage: true, - isInline: "isInline", + isSticker: true, + isInline: true, + inlineId: "inlineId", size: 1000000, - url: "url", + isAllowedFileType: true, }, ], bcc: [{ email: "email", name: "name" }], cc: [{ email: "email", name: "name" }], createdAt: 1470222622433, file: { - filename: "conversations.png", + name: "conversations.png", + link: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + mimeType: "mimeType", + isImage: true, + isSticker: true, + isInline: true, + inlineId: "inlineId", + size: 15538, imageInfo: { - height: 525, - previewUrl: - "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/lighter/", width: 1129, + height: 525, + previewLink: + "https://ucarecdn.com/03cd56cd-1de9-4f65-996d-08afdf27fa1b/-/preview/800x800/-/quality/better/", }, - isImage: true, - size: 15538, - url: "https://ucarecdn.com/cee5c10c-8302-45c1-b1fb-43860ca941a9/", + isAllowedFileType: true, }, forwardedToSourceStatus: { error: "error", isSuccess: true }, from: { email: "email", name: "name" }, - html: "Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54", + html: "Your order has shipped! Here's your tracking number: 9114 5847 4668 7775 9233 54", id: "AXCR3k9bpSY7bpuh7", integrations: { key: "value" }, isBot: true, @@ -1017,9 +1125,13 @@ describe("ConversationsClient", () => { replyTo: { email: "email", name: "name" }, sourceMessageId: "sourceMessageId", subject: "Invitation to a meeting", - text: "Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54", + text: "Your order has shipped! Here's your tracking number: 9114 5847 4668 7775 9233 54", to: [{ email: "email", name: "name" }], type: "agent", + isSentViaJsApi: true, + messageType: "messageType", + isForward: true, + source: { key: "value" }, visitorId: "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg", }; @@ -1034,7 +1146,7 @@ describe("ConversationsClient", () => { const response = await client.conversations.updateAnAutomatedMessage({ id: "id", - text: "Your order has shipped! Here\u2019s your tracking number: 9114 5847 4668 7775 9233 54", + text: "Your order has shipped! Here's your tracking number: 9114 5847 4668 7775 9233 54", }); expect(response).toEqual(rawResponseBody); }); diff --git a/tests/wire/customObjects.test.ts b/tests/wire/customObjects.test.ts index 6a6779b..a18fdbd 100644 --- a/tests/wire/customObjects.test.ts +++ b/tests/wire/customObjects.test.ts @@ -8,7 +8,22 @@ describe("CustomObjectsClient", () => { test("upsertrecords (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { records: [{}] }; + const rawRequestBody = { + records: [ + { + associations: [ + { object_type: "garage", action: "link", records: [{ identifiers: { id: 435435 } }] }, + { + object_type: "garage", + action: "unlink", + records: [{ identifiers: { ext_id: "old-garage-001" } }], + }, + ], + attributes: { make: "Toyota", model: "Camry", year: 2020, engine_type: "hybrid" }, + identifiers: { ext_id: "VIN123" }, + }, + ], + }; const rawResponseBody = { message: "Batch object records are being processed", processId: 21 }; server @@ -22,12 +37,115 @@ describe("CustomObjectsClient", () => { const response = await client.customObjects.upsertrecords({ object_type: "vehicle", - records: [{}], + records: [ + { + associations: [ + { + object_type: "garage", + action: "link", + records: [ + { + identifiers: { + id: 435435, + }, + }, + ], + }, + { + object_type: "garage", + action: "unlink", + records: [ + { + identifiers: { + ext_id: "old-garage-001", + }, + }, + ], + }, + ], + attributes: { + make: "Toyota", + model: "Camry", + year: 2020, + engine_type: "hybrid", + }, + identifiers: { + ext_id: "VIN123", + }, + }, + ], }); expect(response).toEqual(rawResponseBody); }); test("upsertrecords (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + records: [{ attributes: { make: "Honda", model: "Civic", year: 2023, engine_type: "petrol" } }], + }; + const rawResponseBody = { message: "Batch object records are being processed", processId: 21 }; + + server + .mockEndpoint() + .post("/objects/vehicle/batch/upsert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.customObjects.upsertrecords({ + object_type: "vehicle", + records: [ + { + attributes: { + make: "Honda", + model: "Civic", + year: 2023, + engine_type: "petrol", + }, + }, + ], + }); + expect(response).toEqual(rawResponseBody); + }); + + test("upsertrecords (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + records: [{ attributes: { color: "red", engine_type: "diesel" }, identifiers: { id: 42 } }], + }; + const rawResponseBody = { message: "Batch object records are being processed", processId: 21 }; + + server + .mockEndpoint() + .post("/objects/vehicle/batch/upsert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.customObjects.upsertrecords({ + object_type: "vehicle", + records: [ + { + attributes: { + color: "red", + engine_type: "diesel", + }, + identifiers: { + id: 42, + }, + }, + ], + }); + expect(response).toEqual(rawResponseBody); + }); + + test("upsertrecords (4)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}, {}] }; @@ -50,7 +168,7 @@ describe("CustomObjectsClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); - test("upsertrecords (3)", async () => { + test("upsertrecords (5)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}, {}] }; @@ -73,7 +191,7 @@ describe("CustomObjectsClient", () => { }).rejects.toThrow(Brevo.ForbiddenError); }); - test("upsertrecords (4)", async () => { + test("upsertrecords (6)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}, {}] }; @@ -96,7 +214,7 @@ describe("CustomObjectsClient", () => { }).rejects.toThrow(Brevo.NotFoundError); }); - test("upsertrecords (5)", async () => { + test("upsertrecords (7)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { records: [{}, {}] }; @@ -128,7 +246,7 @@ describe("CustomObjectsClient", () => { records: [ { associations: [{ object_type: "garage", records: [{ identifiers: { id: 12345 } }] }], - attributes: { color: "Black", engine_type: "Hybrid", make: "Toyoto", model: "Corolla", year: 2020 }, + attributes: { make: "Toyota", model: "Corolla", color: "Black", year: 2020, engine_type: "hybrid" }, createdAt: "2025-07-22T10:20:30Z", identifiers: { ext_id: "507f1f77bc", id: 16789 }, updatedAt: "2025-07-22T10:20:30Z", @@ -248,7 +366,7 @@ describe("CustomObjectsClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { identifiers: { ext_ids: ["ext-001", "ext-002"] } }; - const rawResponseBody = { processId: 21, message: "Batch object records are being processed for deletion." }; + const rawResponseBody = { processId: 21, message: "Batch object records are being processed for deletion" }; server .mockEndpoint() @@ -318,28 +436,6 @@ describe("CustomObjectsClient", () => { const rawRequestBody = {}; const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/objects/object_type/batch/delete") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.customObjects.batchDeleteObjectRecords({ - object_type: "object_type", - }); - }).rejects.toThrow(Brevo.NotFoundError); - }); - - test("batchDeleteObjectRecords (5)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server .mockEndpoint() .post("/objects/object_type/batch/delete") diff --git a/tests/wire/deals.test.ts b/tests/wire/deals.test.ts index a22f7fb..2966168 100644 --- a/tests/wire/deals.test.ts +++ b/tests/wire/deals.test.ts @@ -5,17 +5,18 @@ import { BrevoClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("DealsClient", () => { - test("getDealAttributes", async () => { + test("getDealAttributes (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = [ { - attributeOptions: [{ key: "custom key", value: "custom label" }], - attributeTypeName: "text", internalName: "deal_name", - isRequired: true, + attributeTypeName: "text", label: "Deal Name", + attributeOptions: [{ key: "custom key", value: "custom label" }], + isRequired: true, + isValueReadonly: false, }, ]; @@ -31,6 +32,25 @@ describe("DealsClient", () => { expect(response).toEqual(rawResponseBody); }); + test("getDealAttributes (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/crm/attributes/deals") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.deals.getDealAttributes(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + test("getAllDeals (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -38,6 +58,7 @@ describe("DealsClient", () => { const rawResponseBody = { items: [ { + id: "629475917295261d9b1f4403", attributes: { amount: 12, created_at: "2022-05-30T07:42:05.671Z", @@ -51,13 +72,12 @@ describe("DealsClient", () => { pipeline: "6093d296ad1e9c5cf2140a58", stage_updated_at: "2022-05-30T07:42:05.671Z", }, - id: "629475917295261d9b1f4403", + linkedContactsIds: [1, 2, 3], linkedCompaniesIds: [ "61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992", ], - linkedContactsIds: [1, 2, 3], }, ], }; @@ -170,6 +190,7 @@ describe("DealsClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { + id: "629475917295261d9b1f4403", attributes: { amount: 12, created_at: "2022-05-30T07:42:05.671Z", @@ -178,15 +199,13 @@ describe("DealsClient", () => { deal_stage: "9e577ff7-8e42-4ab3-be26-2b5e01b42518", last_activity_date: "2022-06-06T08:38:36.000Z", last_updated_date: "2022-06-06T08:38:36.761Z", - next_activity_date: { key: "value" }, number_of_activities: 0, number_of_contacts: 1, pipeline: "6093d296ad1e9c5cf2140a58", stage_updated_at: "2022-05-30T07:42:05.671Z", }, - id: "629475917295261d9b1f4403", - linkedCompaniesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], linkedContactsIds: [1, 2, 3], + linkedCompaniesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], }; server.mockEndpoint().get("/crm/deals/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); @@ -326,7 +345,7 @@ describe("DealsClient", () => { }).rejects.toThrow(Brevo.NotFoundError); }); - test("getPipelineStages", async () => { + test("getPipelineStages (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -348,6 +367,25 @@ describe("DealsClient", () => { expect(response).toEqual(rawResponseBody); }); + test("getPipelineStages (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/crm/pipeline/details") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.deals.getPipelineStages(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + test("getAllPipelines (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); diff --git a/tests/wire/ecommerce.test.ts b/tests/wire/ecommerce.test.ts index 0235741..78769f7 100644 --- a/tests/wire/ecommerce.test.ts +++ b/tests/wire/ecommerce.test.ts @@ -54,7 +54,7 @@ describe("EcommerceClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: "CAT123" }; - const rawResponseBody = { id: 21 }; + const rawResponseBody = { id: "CAT123" }; server .mockEndpoint() @@ -269,6 +269,7 @@ describe("EcommerceClient", () => { const response = await client.ecommerce.getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows({ periodFrom: "2022-01-02T00:00:00Z", periodTo: "2022-01-03T00:00:00Z", + "emailCampaignId[]": ["sale"], }); expect(response).toEqual(rawResponseBody); }); @@ -861,6 +862,7 @@ describe("EcommerceClient", () => { name: "Alpina Panoma Classic", parentId: "parentId", price: 49.95, + alternativePrice: 39.95, s3Original: "https://img-ecom.mailinblue.com/path-to-original/img.jpg", s3ThumbAnalytics: "https://img-ecom.mailinblue.com/path-to-analytics/img.jpg", s3ThumbEditor: "https://img-ecom.mailinblue.com/path-to-editor/img.jpg", @@ -881,6 +883,7 @@ describe("EcommerceClient", () => { name: "Alpina Panoma Classic2", parentId: "parentId", price: 49.95, + alternativePrice: 44.95, s3Original: "https://img-ecom.mailinblue.com/path-to-original/img.jpg", s3ThumbAnalytics: "https://img-ecom.mailinblue.com/path-to-analytics/img.jpg", s3ThumbEditor: "https://img-ecom.mailinblue.com/path-to-editor/img.jpg", @@ -914,7 +917,7 @@ describe("EcommerceClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { id: "P11", name: "Iphone 11" }; - const rawResponseBody = { id: 21 }; + const rawResponseBody = { id: "P11" }; server .mockEndpoint() @@ -1034,6 +1037,7 @@ describe("EcommerceClient", () => { name: "Iphone 11", parentId: "parentId", price: 1.1, + alternativePrice: 1.1, s3Original: "s3Original", s3ThumbAnalytics: "s3ThumbAnalytics", s3ThumbEditor: "s3ThumbEditor", diff --git a/tests/wire/emailCampaigns.test.ts b/tests/wire/emailCampaigns.test.ts index 2571a78..0a6b8e2 100644 --- a/tests/wire/emailCampaigns.test.ts +++ b/tests/wire/emailCampaigns.test.ts @@ -27,7 +27,9 @@ describe("EmailCampaignsClient", () => { type: "classic", winnerCriteria: "open", winnerDelay: 50, + attachmentUrl: "https://attachment.domain.com/file.pdf", createdAt: "2017-05-01T12:30:00Z", + emailExpirationDate: { duration: 30 }, footer: "[DEFAULT_FOOTER]", header: "[DEFAULT_HEADER]", htmlContent: "This is my HTML Content", @@ -45,10 +47,10 @@ describe("EmailCampaignsClient", () => { testSent: true, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", - utmIDActive: true, + utmID: 12, utmMedium: "EMAIL", utmSource: "Brevo", - recipients: { exclusionLists: [13], lists: [5] }, + recipients: { excludedSegments: [14], exclusionLists: [13], lists: [5], segments: [23] }, statistics: { campaignStats: [ { @@ -92,13 +94,9 @@ describe("EmailCampaignsClient", () => { unsubscriptions: 2, viewed: 8999, }, - linksStats: {}, + linksStats: { "http://myUrl1.domain.com": 80 }, mirrorClick: 120, remaining: 1000, - statsByBrowser: { - key: { clickers: 2665, uniqueClicks: 2300, uniqueViews: 7779, viewed: 8999 }, - }, - statsByDevice: {}, statsByDomain: { "hotmail.co.uk": { appleMppOpens: 10, @@ -159,7 +157,9 @@ describe("EmailCampaignsClient", () => { type: "classic", winnerCriteria: "open", winnerDelay: 50, + attachmentUrl: "https://attachment.domain.com/file.pdf", createdAt: "2017-05-01T12:30:00Z", + emailExpirationDate: { duration: 30 }, footer: "[DEFAULT_FOOTER]", header: "[DEFAULT_HEADER]", htmlContent: "This is my HTML Content", @@ -177,10 +177,10 @@ describe("EmailCampaignsClient", () => { testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", - utmIDActive: true, + utmID: 12, utmMedium: "EMAIL", utmSource: "Brevo", - recipients: { exclusionLists: [45], lists: [10] }, + recipients: { excludedSegments: [14], exclusionLists: [45], lists: [10], segments: [23] }, statistics: { campaignStats: [ { @@ -224,13 +224,13 @@ describe("EmailCampaignsClient", () => { unsubscriptions: 2, viewed: 8999, }, - linksStats: {}, + linksStats: { + "http://myUrl1.domain.com": 1000000, + "http://myUrl2.domain.com": 1000000, + "http://myUrl3.domain.com": 1000000, + }, mirrorClick: 120, remaining: 1000, - statsByBrowser: { - key: { clickers: 2665, uniqueClicks: 2300, uniqueViews: 7779, viewed: 8999 }, - }, - statsByDevice: {}, statsByDomain: { aol: { appleMppOpens: 10, @@ -343,6 +343,29 @@ describe("EmailCampaignsClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); + test("createEmailCampaign (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name", sender: {} }; + const rawResponseBody = { message: "message" }; + + server + .mockEndpoint() + .post("/emailCampaigns") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(405) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.createEmailCampaign({ + name: "name", + sender: {}, + }); + }).rejects.toThrow(Brevo.MethodNotAllowedError); + }); + test("uploadImageToGallery (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -408,7 +431,9 @@ describe("EmailCampaignsClient", () => { type: "classic", winnerCriteria: "open", winnerDelay: 50, + attachmentUrl: "https://attachment.domain.com/file.pdf", createdAt: "2017-05-01T12:30:00Z", + emailExpirationDate: { duration: 30, unit: "days" }, footer: "[DEFAULT_FOOTER]", header: "[DEFAULT_HEADER]", htmlContent: "This is my HTML Content", @@ -426,10 +451,10 @@ describe("EmailCampaignsClient", () => { testSent: false, toField: "{FNAME} {LNAME}", utmCampaignValue: "myutm", - utmIDActive: true, + utmID: 12, utmMedium: "EMAIL", utmSource: "Brevo", - recipients: { exclusionLists: [45], lists: [22] }, + recipients: { excludedSegments: [14], exclusionLists: [45], lists: [22], segments: [23] }, statistics: { campaignStats: [ { @@ -473,7 +498,11 @@ describe("EmailCampaignsClient", () => { unsubscriptions: 2, viewed: 8999, }, - linksStats: {}, + linksStats: { + "http://myUrl1.domain.com": 1000000, + "http://myUrl2.domain.com": 1000000, + "http://myUrl3.domain.com": 1000000, + }, mirrorClick: 120, remaining: 1000, statsByBrowser: { @@ -634,6 +663,28 @@ describe("EmailCampaignsClient", () => { }).rejects.toThrow(Brevo.NotFoundError); }); + test("updateEmailCampaign (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { message: "message" }; + + server + .mockEndpoint() + .put("/emailCampaigns/1000000") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(405) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.updateEmailCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.MethodNotAllowedError); + }); + test("deleteEmailCampaign (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -673,6 +724,27 @@ describe("EmailCampaignsClient", () => { const rawResponseBody = { key: "value" }; + server + .mockEndpoint() + .delete("/emailCampaigns/1000000") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.emailCampaigns.deleteEmailCampaign({ + campaignId: 1000000, + }); + }).rejects.toThrow(Brevo.ForbiddenError); + }); + + test("deleteEmailCampaign (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() .delete("/emailCampaigns/1000000") diff --git a/tests/wire/event.test.ts b/tests/wire/event.test.ts index 7718d19..4b0c398 100644 --- a/tests/wire/event.test.ts +++ b/tests/wire/event.test.ts @@ -16,7 +16,6 @@ describe("EventClient", () => { event_date: "2024-02-06T20:59:23Z", event_name: "order_created", event_filter_id: "abc123", - source: "api", object_type: "subscription", event_properties: { duration: 142, video_title: "Brevo — The most approachable CRM suite" }, contact_properties: { AGE: 32, GENDER: "FEMALE" }, @@ -133,7 +132,7 @@ describe("EventClient", () => { test("createBatchEvents (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = [{ event_name: "order_created", identifiers: {} }]; + const rawRequestBody = { events: [{ event_name: "order_created", identifiers: {} }] }; const rawResponseBody = { message: "Batch accepted. Valid events have been added to the processing queue.", count: 7, @@ -148,22 +147,26 @@ describe("EventClient", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.event.createBatchEvents([ - { - event_name: "order_created", - identifiers: {}, - }, - ]); + const response = await client.event.createBatchEvents({ + events: [ + { + event_name: "order_created", + identifiers: {}, + }, + ], + }); expect(response).toEqual(rawResponseBody); }); test("createBatchEvents (2)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = [ - { event_name: "event_name", identifiers: {} }, - { event_name: "event_name", identifiers: {} }, - ]; + const rawRequestBody = { + events: [ + { event_name: "event_name", identifiers: {} }, + { event_name: "event_name", identifiers: {} }, + ], + }; const rawResponseBody = { key: "value" }; server @@ -176,26 +179,30 @@ describe("EventClient", () => { .build(); await expect(async () => { - return await client.event.createBatchEvents([ - { - event_name: "event_name", - identifiers: {}, - }, - { - event_name: "event_name", - identifiers: {}, - }, - ]); + return await client.event.createBatchEvents({ + events: [ + { + event_name: "event_name", + identifiers: {}, + }, + { + event_name: "event_name", + identifiers: {}, + }, + ], + }); }).rejects.toThrow(Brevo.BadRequestError); }); test("createBatchEvents (3)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = [ - { event_name: "event_name", identifiers: {} }, - { event_name: "event_name", identifiers: {} }, - ]; + const rawRequestBody = { + events: [ + { event_name: "event_name", identifiers: {} }, + { event_name: "event_name", identifiers: {} }, + ], + }; const rawResponseBody = { key: "value" }; server @@ -208,16 +215,18 @@ describe("EventClient", () => { .build(); await expect(async () => { - return await client.event.createBatchEvents([ - { - event_name: "event_name", - identifiers: {}, - }, - { - event_name: "event_name", - identifiers: {}, - }, - ]); + return await client.event.createBatchEvents({ + events: [ + { + event_name: "event_name", + identifiers: {}, + }, + { + event_name: "event_name", + identifiers: {}, + }, + ], + }); }).rejects.toThrow(Brevo.UnauthorizedError); }); }); diff --git a/tests/wire/externalFeeds.test.ts b/tests/wire/externalFeeds.test.ts index b89e271..a26bdd5 100644 --- a/tests/wire/externalFeeds.test.ts +++ b/tests/wire/externalFeeds.test.ts @@ -15,7 +15,6 @@ describe("ExternalFeedsClient", () => { { id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", name: "Product Catalog Feed", - alias: "product_catalog_feed", url: "https://api.example.com/products", authType: "noAuth", username: "apiuser", @@ -23,7 +22,6 @@ describe("ExternalFeedsClient", () => { token: "abc123token456", maxRetries: 3, cache: true, - isInternal: false, headers: [{ name: "Authorization", value: "Bearer xyz789" }], createdAt: "2025-09-18T13:29:27Z", modifiedAt: "2025-09-18T13:29:27Z", @@ -31,15 +29,13 @@ describe("ExternalFeedsClient", () => { { id: "c2d3e4f5-a6b7-48c9-90d1-e2f3a4b5c6d7", name: "Blog News Feed", - alias: "blog_news_feed", url: "https://blog.example.com/api/posts", - authType: "noAuth", + authType: "token", username: "apiuser", password: "apipass", token: "abc123token456", maxRetries: 3, cache: true, - isInternal: true, headers: [{ name: "Authorization", value: "Bearer xyz789" }], createdAt: "2025-09-17T16:03:25Z", modifiedAt: "2025-09-17T16:03:25Z", @@ -47,15 +43,13 @@ describe("ExternalFeedsClient", () => { { id: "d3e4f5a6-b7c8-49d0-91e2-f3a4b5c6d7e8", name: "Public Data Feed", - alias: "public_data_feed", url: "https://jsonplaceholder.typicode.com/posts", - authType: "noAuth", + authType: "basic", username: "apiuser", password: "apipass", token: "abc123token456", maxRetries: 3, cache: true, - isInternal: true, headers: [{ name: "Authorization", value: "Bearer xyz789" }], createdAt: "2025-09-05T09:06:42Z", modifiedAt: "2025-09-05T09:06:42Z", @@ -223,12 +217,12 @@ describe("ExternalFeedsClient", () => { id: "b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6", name: "Product Catalog Feed", url: "https://api.example.com/products", - authType: "noAuth", - personalization: false, - defaultAttr: "", - defaultContact: "", - maxRetries: 0, - cache: false, + authType: "token", + username: "api_user", + password: "secure_pass123", + token: "abc123token456", + maxRetries: 3, + cache: true, createdAt: "2025-09-18T13:29:27Z", modifiedAt: "2025-09-18T13:29:27Z", }; @@ -255,12 +249,12 @@ describe("ExternalFeedsClient", () => { id: "c2d3e4f5-a6b7-48c9-90d1-e2f3a4b5c6d7", name: "Internal Blog Feed", url: "https://blog.example.com/api/posts", - authType: "noAuth", - personalization: false, - defaultAttr: "", - defaultContact: "", - maxRetries: 0, - cache: false, + authType: "basic", + username: "apiuser", + password: "apipass", + token: "token_abc123", + maxRetries: 5, + cache: true, createdAt: "2025-09-17T16:03:25Z", modifiedAt: "2025-09-17T16:03:25Z", }; @@ -288,11 +282,11 @@ describe("ExternalFeedsClient", () => { name: "Public Data Feed", url: "https://jsonplaceholder.typicode.com/posts", authType: "noAuth", - personalization: false, - defaultAttr: "", - defaultContact: "", - maxRetries: 0, - cache: false, + username: "api_user", + password: "secure_pass123", + token: "token_abc123", + maxRetries: 5, + cache: true, createdAt: "2025-09-05T09:06:42Z", modifiedAt: "2025-09-05T09:06:42Z", }; diff --git a/tests/wire/files.test.ts b/tests/wire/files.test.ts index 36bdc74..b2bd983 100644 --- a/tests/wire/files.test.ts +++ b/tests/wire/files.test.ts @@ -11,13 +11,14 @@ describe("FilesClient", () => { const rawResponseBody = [ { - authorId: "61a5ce58y5d4795761045991", - companyId: "61a5ce58c5d4795761045991", + id: "61a5ce58c5d4795761045991", + name: "example.png", + authorId: "61a5ce58c5d4795761045991", contactId: 1, - createdAt: "2017-05-01T17:05:03Z", dealId: "61a5ce58c5d4795761045991", - name: "example.png", + companyId: "61a5ce58c5d4795761045991", size: 10, + createdAt: "2017-05-01T17:05:03Z", }, ]; @@ -131,13 +132,14 @@ describe("FilesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - authorId: "61a5ce58y5d4795761045991", - companyId: "61a5ce58c5d4795761045991", + id: "61a5ce58c5d4795761045991", + name: "example.png", + authorId: "61a5ce58c5d4795761045991", contactId: 1, - createdAt: "2017-05-01T17:05:03Z", dealId: "61a5ce58c5d4795761045991", - name: "example.png", + companyId: "61a5ce58c5d4795761045991", size: 10, + createdAt: "2017-05-01T17:05:03Z", }; server.mockEndpoint().get("/crm/files/id/data").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); diff --git a/tests/wire/inboundParsing.test.ts b/tests/wire/inboundParsing.test.ts index 71a3e14..ba38b8f 100644 --- a/tests/wire/inboundParsing.test.ts +++ b/tests/wire/inboundParsing.test.ts @@ -98,4 +98,25 @@ describe("InboundParsingClient", () => { }); }).rejects.toThrow(Brevo.BadRequestError); }); + + test("getInboundEmailEventsByUuid (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/inbound/events/uuid") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.inboundParsing.getInboundEmailEventsByUuid({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); }); diff --git a/tests/wire/masterAccount.test.ts b/tests/wire/masterAccount.test.ts index 799cec6..cedc79b 100644 --- a/tests/wire/masterAccount.test.ts +++ b/tests/wire/masterAccount.test.ts @@ -91,7 +91,7 @@ describe("MasterAccountClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); - test("getAGroupDetails", async () => { + test("getAGroupDetails (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -121,6 +121,27 @@ describe("MasterAccountClient", () => { expect(response).toEqual(rawResponseBody); }); + test("getAGroupDetails (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/corporate/group/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.getAGroupDetails({ + id: "id", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + test("updateAGroupOfSubAccounts (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -189,7 +210,7 @@ describe("MasterAccountClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); - test("getSubAccountGroups", async () => { + test("getSubAccountGroups (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -205,7 +226,20 @@ describe("MasterAccountClient", () => { expect(response).toEqual(rawResponseBody); }); - test("getCorporateInvitedUsersList", async () => { + test("getSubAccountGroups (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/corporate/groups").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.masterAccount.getSubAccountGroups(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getCorporateInvitedUsersList (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -258,7 +292,26 @@ describe("MasterAccountClient", () => { expect(response).toEqual(rawResponseBody); }); - test("listOfAllIPs", async () => { + test("getCorporateInvitedUsersList (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/corporate/invited/users") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.masterAccount.getCorporateInvitedUsersList(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("listOfAllIPs (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -273,6 +326,19 @@ describe("MasterAccountClient", () => { expect(response).toEqual(rawResponseBody); }); + test("listOfAllIPs (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/corporate/ip").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.masterAccount.listOfAllIPs(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + test("getTheDetailsOfRequestedMasterAccount (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); diff --git a/tests/wire/notes.test.ts b/tests/wire/notes.test.ts index a6c59fb..010c7c9 100644 --- a/tests/wire/notes.test.ts +++ b/tests/wire/notes.test.ts @@ -11,6 +11,11 @@ describe("NotesClient", () => { const rawResponseBody = [ { + id: "61a5cd07ca1347c82306ad09", + text: '

Meeting notes: Action item - visit Brevo for details.

', + contactIds: [247, 1, 2], + companyIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], + dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], authorId: { email: "johndoe@example.com", id: "61a5ce58y5d4795761045991", @@ -18,11 +23,7 @@ describe("NotesClient", () => { name: { fullName: "John Doe" }, timezone: "Asia/Kolkata", }, - contactIds: [247, 1, 2], createdAt: "2017-05-01T17:05:03Z", - dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], - id: "61a5cd07ca1347c82306ad09", - text: "In communication with client_dev for resolution of queries.", updatedAt: "2017-05-01T17:05:03Z", }, ]; @@ -49,7 +50,9 @@ describe("NotesClient", () => { test("createANote (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { text: "In communication with client_dev for resolution of queries." }; + const rawRequestBody = { + text: '

Meeting notes: Action item - visit Brevo for details.

', + }; const rawResponseBody = { id: "61a5cd07ca1347c82306ad09" }; server @@ -62,7 +65,7 @@ describe("NotesClient", () => { .build(); const response = await client.notes.createANote({ - text: "In communication with client_dev for resolution of queries.", + text: '

Meeting notes: Action item - visit Brevo for details.

', }); expect(response).toEqual(rawResponseBody); }); @@ -116,6 +119,11 @@ describe("NotesClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { + id: "61a5cd07ca1347c82306ad09", + text: '

Meeting notes: Action item - visit Brevo for details.

', + contactIds: [247, 1, 2], + companyIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], + dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], authorId: { email: "johndoe@example.com", id: "61a5ce58y5d4795761045991", @@ -123,11 +131,7 @@ describe("NotesClient", () => { name: { fullName: "John Doe" }, timezone: "Asia/Kolkata", }, - contactIds: [247, 1, 2], createdAt: "2017-05-01T17:05:03Z", - dealIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991"], - id: "61a5cd07ca1347c82306ad09", - text: "In communication with client_dev for resolution of queries.", updatedAt: "2017-05-01T17:05:03Z", }; @@ -214,14 +218,16 @@ describe("NotesClient", () => { test("updateANote (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { text: "In communication with client_dev for resolution of queries." }; + const rawRequestBody = { + text: '

Meeting notes: Action item - visit Brevo for details.

', + }; server.mockEndpoint().patch("/crm/notes/id").jsonBody(rawRequestBody).respondWith().statusCode(200).build(); const response = await client.notes.updateANote({ id: "id", body: { - text: "In communication with client_dev for resolution of queries.", + text: '

Meeting notes: Action item - visit Brevo for details.

', }, }); expect(response).toEqual(undefined); diff --git a/tests/wire/process.test.ts b/tests/wire/process.test.ts index 24a7ae6..30a6b00 100644 --- a/tests/wire/process.test.ts +++ b/tests/wire/process.test.ts @@ -17,27 +17,18 @@ describe("ProcessClient", () => { name: "IMPORTUSER", status: "completed", export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:35:00Z", }, { id: 213, name: "SEARCH_EXPORT_USERS", status: "completed", export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:35:00Z", }, { id: 212, name: "IMPORTUSER", status: "queued", export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:35:00Z", }, ], }; @@ -71,20 +62,16 @@ describe("ProcessClient", () => { status: "queued", info: { import: { - invalid_emails: 2, - duplicate_contact_id: 0, - duplicate_ext_id: 1, + invalid_emails: "invalid_emails", + duplicate_contact_id: "duplicate_contact_id", + duplicate_ext_id: "duplicate_ext_id", duplicate_email_id: "duplicate_email_id", - duplicate_phone_id: 1, - duplicate_whatsapp_id: 1, - duplicate_landline_number_id: 1, + duplicate_phone_id: "duplicate_phone_id", + duplicate_whatsapp_id: "duplicate_whatsapp_id", + duplicate_landline_number_id: "duplicate_landline_number_id", }, - export: { total_records: 1250, file_size: 102400 }, }, export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded after 30 minutes", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:32:15Z", }; server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); @@ -103,11 +90,7 @@ describe("ProcessClient", () => { id: 217, name: "IMPORTUSER", status: "completed", - info: { export: { total_records: 1250, file_size: 102400 } }, export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded after 30 minutes", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:32:15Z", }; server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); @@ -128,20 +111,16 @@ describe("ProcessClient", () => { status: "completed", info: { import: { - invalid_emails: 2, - duplicate_contact_id: 0, - duplicate_ext_id: 1, + invalid_emails: "invalid_emails", + duplicate_contact_id: "duplicate_contact_id", + duplicate_ext_id: "duplicate_ext_id", duplicate_email_id: "duplicate_email_id", - duplicate_phone_id: 1, - duplicate_whatsapp_id: 1, - duplicate_landline_number_id: 1, + duplicate_phone_id: "duplicate_phone_id", + duplicate_whatsapp_id: "duplicate_whatsapp_id", + duplicate_landline_number_id: "duplicate_landline_number_id", }, - export: { total_records: 1250, file_size: 102400 }, }, export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded after 30 minutes", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:32:15Z", }; server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); @@ -156,40 +135,6 @@ describe("ProcessClient", () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = { - id: 189, - name: "TRANS-GLOBAL-CALC", - status: "failed", - info: { - import: { - invalid_emails: 2, - duplicate_contact_id: 0, - duplicate_ext_id: 1, - duplicate_email_id: "duplicate_email_id", - duplicate_phone_id: 1, - duplicate_whatsapp_id: 1, - duplicate_landline_number_id: 1, - }, - export: { total_records: 1250, file_size: 102400 }, - }, - export_url: "https://s3.eu-west-1.amazonaws.com/api-export.example.com/upload/contacts_export.csv", - error: "Processing timeout exceeded after 30 minutes", - created_at: "2024-01-15T10:30:00Z", - completed_at: "2024-01-15T10:32:15Z", - }; - - server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - - const response = await client.process.getProcess({ - processId: 1000000, - }); - expect(response).toEqual(rawResponseBody); - }); - - test("getProcess (5)", async () => { - const server = mockServerPool.createServer(); - const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = { key: "value" }; server.mockEndpoint().get("/processes/1000000").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); @@ -201,7 +146,7 @@ describe("ProcessClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); - test("getProcess (6)", async () => { + test("getProcess (5)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); diff --git a/tests/wire/program.test.ts b/tests/wire/program.test.ts index 0f222d5..2e9497a 100644 --- a/tests/wire/program.test.ts +++ b/tests/wire/program.test.ts @@ -12,18 +12,19 @@ describe("ProgramClient", () => { const rawResponseBody = { items: [ { - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", id: "id", - meta: { key: "value" }, name: "name", - pattern: "pattern", + description: "description", + meta: { key: "value" }, state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", + subscriptionGeneratorId: "subscriptionGeneratorId", + pattern: "pattern", + codeCount: 1000000, + documentId: "documentId", + birthdayAttribute: "birthdayAttribute", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }, ], }; @@ -159,18 +160,19 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", id: "id", - meta: { key: "value" }, name: "name", - pattern: "pattern", + description: "description", + meta: { key: "value" }, state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", + subscriptionGeneratorId: "subscriptionGeneratorId", + pattern: "pattern", + codeCount: 1000000, + documentId: "documentId", + birthdayAttribute: "birthdayAttribute", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -303,18 +305,19 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", id: "id", - meta: { key: "value" }, name: "name", - pattern: "pattern", + description: "description", + meta: { key: "value" }, state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", + subscriptionGeneratorId: "subscriptionGeneratorId", + pattern: "pattern", + codeCount: 1000000, + documentId: "documentId", + birthdayAttribute: "birthdayAttribute", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -441,18 +444,19 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", id: "id", - meta: { key: "value" }, name: "name", - pattern: "pattern", + description: "description", + meta: { key: "value" }, state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", + subscriptionGeneratorId: "subscriptionGeneratorId", + pattern: "pattern", + codeCount: 1000000, + documentId: "documentId", + birthdayAttribute: "birthdayAttribute", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -731,18 +735,19 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { - codeCount: 1, - createdAt: "createdAt", - description: "description", - documentId: "documentId", id: "id", - meta: { key: "value" }, name: "name", - pattern: "pattern", + description: "description", + meta: { key: "value" }, state: "inactive", - subscriptionGeneratorId: "subscriptionGeneratorId", subscriptionPoolId: "subscriptionPoolId", - updatedAt: "updatedAt", + subscriptionGeneratorId: "subscriptionGeneratorId", + pattern: "pattern", + codeCount: 1000000, + documentId: "documentId", + birthdayAttribute: "birthdayAttribute", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -909,7 +914,8 @@ describe("ProgramClient", () => { loyaltyProgramId: "loyaltyProgramId", meta: { key: "value" }, rewardId: "rewardId", - updatedAt: "updatedAt", + updatedAt: "2024-01-15T09:30:00Z", + validFrom: "2024-01-15T09:30:00Z", }, ], tier: [ @@ -1311,11 +1317,11 @@ describe("ProgramClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { memberContactIds: [1] }; const rawResponseBody = { - createdAt: "createdAt", - memberContactIds: [1], - organizationId: 1, - ownerContactId: 1, - updatedAt: "updatedAt", + organizationId: 1000000, + ownerContactId: 1000000, + memberContactIds: [1000000], + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -1625,15 +1631,16 @@ describe("ProgramClient", () => { test("subscribeToLoyaltyProgram (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { contactId: 1 }; + const rawRequestBody = { contactId: 1000000 }; const rawResponseBody = { - contactId: 1, - createdAt: "createdAt", + organizationId: 1000000, loyaltyProgramId: "loyaltyProgramId", - loyaltySubscriptionId: "loyaltySubscriptionId", - organizationId: 1, - updatedAt: "updatedAt", versionId: 1, + contactId: 1000000, + loyaltySubscriptionId: "loyaltySubscriptionId", + meta: { key: "value" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -1647,7 +1654,7 @@ describe("ProgramClient", () => { const response = await client.program.subscribeToLoyaltyProgram({ pid: "pid", - contactId: 1, + contactId: 1000000, }); expect(response).toEqual(rawResponseBody); }); @@ -1655,7 +1662,7 @@ describe("ProgramClient", () => { test("subscribeToLoyaltyProgram (2)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { contactId: 1 }; + const rawRequestBody = { contactId: 1000000 }; const rawResponseBody = { key: "value" }; server @@ -1670,7 +1677,7 @@ describe("ProgramClient", () => { await expect(async () => { return await client.program.subscribeToLoyaltyProgram({ pid: "pid", - contactId: 1, + contactId: 1000000, }); }).rejects.toThrow(Brevo.BadRequestError); }); @@ -1678,7 +1685,7 @@ describe("ProgramClient", () => { test("subscribeToLoyaltyProgram (3)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { contactId: 1 }; + const rawRequestBody = { contactId: 1000000 }; const rawResponseBody = { key: "value" }; server @@ -1693,7 +1700,7 @@ describe("ProgramClient", () => { await expect(async () => { return await client.program.subscribeToLoyaltyProgram({ pid: "pid", - contactId: 1, + contactId: 1000000, }); }).rejects.toThrow(Brevo.UnauthorizedError); }); @@ -1701,7 +1708,7 @@ describe("ProgramClient", () => { test("subscribeToLoyaltyProgram (4)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { contactId: 1 }; + const rawRequestBody = { contactId: 1000000 }; const rawResponseBody = { key: "value" }; server @@ -1716,7 +1723,7 @@ describe("ProgramClient", () => { await expect(async () => { return await client.program.subscribeToLoyaltyProgram({ pid: "pid", - contactId: 1, + contactId: 1000000, }); }).rejects.toThrow(Brevo.ForbiddenError); }); @@ -1724,7 +1731,7 @@ describe("ProgramClient", () => { test("subscribeToLoyaltyProgram (5)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { contactId: 1 }; + const rawRequestBody = { contactId: 1000000 }; const rawResponseBody = { key: "value" }; server @@ -1739,7 +1746,7 @@ describe("ProgramClient", () => { await expect(async () => { return await client.program.subscribeToLoyaltyProgram({ pid: "pid", - contactId: 1, + contactId: 1000000, }); }).rejects.toThrow(Brevo.NotFoundError); }); @@ -1747,7 +1754,7 @@ describe("ProgramClient", () => { test("subscribeToLoyaltyProgram (6)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { contactId: 1 }; + const rawRequestBody = { contactId: 1000000 }; const rawResponseBody = { message: "message" }; server @@ -1762,7 +1769,7 @@ describe("ProgramClient", () => { await expect(async () => { return await client.program.subscribeToLoyaltyProgram({ pid: "pid", - contactId: 1, + contactId: 1000000, }); }).rejects.toThrow(Brevo.UnprocessableEntityError); }); @@ -1770,7 +1777,7 @@ describe("ProgramClient", () => { test("subscribeToLoyaltyProgram (7)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { contactId: 1 }; + const rawRequestBody = { contactId: 1000000 }; const rawResponseBody = { key: "value" }; server @@ -1785,7 +1792,7 @@ describe("ProgramClient", () => { await expect(async () => { return await client.program.subscribeToLoyaltyProgram({ pid: "pid", - contactId: 1, + contactId: 1000000, }); }).rejects.toThrow(Brevo.InternalServerError); }); diff --git a/tests/wire/reward.test.ts b/tests/wire/reward.test.ts index 053a4f1..fa1d7a6 100644 --- a/tests/wire/reward.test.ts +++ b/tests/wire/reward.test.ts @@ -302,14 +302,14 @@ describe("RewardClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { name: "name" }; const rawResponseBody = { - createdAt: "2024-01-15T09:30:00Z", id: "id", loyaltyProgramId: "loyaltyProgramId", name: "name", publicDescription: "publicDescription", publicImage: "publicImage", publicName: "publicName", - updatedAt: "updatedAt", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }; server @@ -436,6 +436,7 @@ describe("RewardClient", () => { rewardId: "rewardId", updatedAt: "2024-01-15T09:30:00Z", value: 1.1, + validFrom: "2024-01-15T09:30:00Z", }; server @@ -1472,6 +1473,7 @@ describe("RewardClient", () => { unit: "unit", updatedAt: "updatedAt", value: 1.1, + validFrom: "2024-01-15T09:30:00Z", }, ], count: 1, diff --git a/tests/wire/senders.test.ts b/tests/wire/senders.test.ts index cb39ccd..91ebe04 100644 --- a/tests/wire/senders.test.ts +++ b/tests/wire/senders.test.ts @@ -254,7 +254,7 @@ describe("SendersClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - ips: [{ active: true, domain: "mailing.enterprise.com", id: 3, ip: "192.168.1.100" }], + ips: [{ id: 1, active: true, domain: "mailing.enterprise.com", ip: "192.168.1.100" }], }; server.mockEndpoint().get("/senders/ips").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); @@ -269,9 +269,9 @@ describe("SendersClient", () => { const rawResponseBody = { ips: [ - { active: true, domain: "mailing.enterprise.com", id: 3, ip: "192.168.1.100" }, - { active: true, domain: "newsletter.enterprise.com", id: 5, ip: "192.168.1.101" }, - { active: false, domain: "notifications.enterprise.com", id: 6, ip: "192.168.1.102" }, + { id: 1, active: true, domain: "mailing.enterprise.com", ip: "192.168.1.100" }, + { id: 1, active: true, domain: "newsletter.enterprise.com", ip: "192.168.1.101" }, + { id: 1, active: false, domain: "notifications.enterprise.com", ip: "192.168.1.102" }, ], }; diff --git a/tests/wire/smsCampaigns.test.ts b/tests/wire/smsCampaigns.test.ts index 6d6a40c..479aded 100644 --- a/tests/wire/smsCampaigns.test.ts +++ b/tests/wire/smsCampaigns.test.ts @@ -17,10 +17,13 @@ describe("SmsCampaignsClient", () => { id: 2, modifiedAt: "2017-05-01T12:30:00Z", name: "PROMO CODE", + organisationPrefix: "MyCompany", scheduledAt: "2017-06-01T12:30:00Z", sender: "MyCompany", + sentDate: "2017-06-01T12:30:00Z", status: "sent", - recipients: { exclusionLists: [13], lists: [21] }, + unsubscribeInstruction: "send Stop if you want to unsubscribe.", + recipients: { excludedSegments: [14], exclusionLists: [13], lists: [21], segments: [23] }, statistics: { answered: 2, delivered: 2987, @@ -37,10 +40,13 @@ describe("SmsCampaignsClient", () => { id: 10, modifiedAt: "2017-05-01T12:30:00Z", name: "SUMMER SALE", + organisationPrefix: "", scheduledAt: "2017-08-04T12:30:00Z", sender: "MyCompany", + sentDate: "2017-06-01T12:30:00Z", status: "draft", - recipients: { exclusionLists: [13], lists: [21] }, + unsubscribeInstruction: "", + recipients: { excludedSegments: [14], exclusionLists: [13], lists: [21], segments: [23] }, statistics: { answered: 2, delivered: 2987, @@ -135,10 +141,16 @@ describe("SmsCampaignsClient", () => { id: 2, modifiedAt: "2017-05-01T12:30:00Z", name: "PROMO CODE", + organisationPrefix: "MyCompany", scheduledAt: "2017-06-01T12:30:00Z", sender: "MyCompany", + sentDate: "2017-06-01T12:30:00Z", status: "sent", - recipients: { exclusionLists: [13], lists: [21] }, + unsubscribeInstruction: "send Stop if you want to unsubscribe.", + recipients: { + exclusionLists: [{ id: 13, name: "Exclusion List" }], + lists: [{ id: 21, name: "Main List" }], + }, statistics: { answered: 2, delivered: 2987, @@ -148,6 +160,7 @@ describe("SmsCampaignsClient", () => { softBounces: 3, unsubscriptions: 3, }, + tags: ["promo"], }; server diff --git a/tests/wire/tasks.test.ts b/tests/wire/tasks.test.ts index 9c2f9e8..ae99a5d 100644 --- a/tests/wire/tasks.test.ts +++ b/tests/wire/tasks.test.ts @@ -12,12 +12,18 @@ describe("TasksClient", () => { const rawResponseBody = { items: [ { - companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - contactsIds: [1, 2, 3], - dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], id: "61a5cd07ca1347c82306ad06", - name: "Task: Connect with client_dev", taskTypeId: "61a5cd07ca1347c82306ad09", + name: "Task: Connect with client", + companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + contactsIds: [1, 2, 3], + assignToId: "5faab4b7f195bb3c4c31e62a", + date: "2021-11-01T17:44:54Z", + notes: "In communication with client for resolution of queries.", + done: false, + createdAt: "2021-11-01T17:44:54Z", + updatedAt: "2021-11-01T17:44:54Z", }, ], }; @@ -48,7 +54,7 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { date: "2021-11-01T17:44:54Z", - name: "Task: Connect with client_dev", + name: "Task: Connect with client", taskTypeId: "61a5cd07ca1347c82306ad09", }; const rawResponseBody = { id: "61a5cd07ca1347c82306ad06" }; @@ -64,7 +70,7 @@ describe("TasksClient", () => { const response = await client.tasks.createATask({ date: "2021-11-01T17:44:54Z", - name: "Task: Connect with client_dev", + name: "Task: Connect with client", taskTypeId: "61a5cd07ca1347c82306ad09", }); expect(response).toEqual(rawResponseBody); @@ -99,12 +105,18 @@ describe("TasksClient", () => { const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], - contactsIds: [1, 2, 3], - dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], id: "61a5cd07ca1347c82306ad06", - name: "Task: Connect with client_dev", taskTypeId: "61a5cd07ca1347c82306ad09", + name: "Task: Connect with client", + companiesIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + dealsIds: ["61a5ce58c5d4795761045990", "61a5ce58c5d4795761045991", "61a5ce58c5d4795761045992"], + contactsIds: [1, 2, 3], + assignToId: "5faab4b7f195bb3c4c31e62a", + date: "2021-11-01T17:44:54Z", + notes: "In communication with client for resolution of queries.", + done: false, + createdAt: "2021-11-01T17:44:54Z", + updatedAt: "2021-11-01T17:44:54Z", }; server.mockEndpoint().get("/crm/tasks/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); @@ -244,15 +256,28 @@ describe("TasksClient", () => { }).rejects.toThrow(Brevo.NotFoundError); }); - test("getAllTaskTypes", async () => { + test("getAllTaskTypes (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawResponseBody = { id: "61a88a2eb7a574180261234", title: "Email" }; + const rawResponseBody = [{ id: "61a88a2eb7a574180261234", title: "Email" }]; server.mockEndpoint().get("/crm/tasktypes").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.tasks.getAllTaskTypes(); expect(response).toEqual(rawResponseBody); }); + + test("getAllTaskTypes (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/crm/tasktypes").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.tasks.getAllTaskTypes(); + }).rejects.toThrow(Brevo.BadRequestError); + }); }); diff --git a/tests/wire/tier.test.ts b/tests/wire/tier.test.ts index 0bca4c0..0cd7b61 100644 --- a/tests/wire/tier.test.ts +++ b/tests/wire/tier.test.ts @@ -347,6 +347,20 @@ describe("TierClient", () => { tierOrder: ["tierOrder"], updatedAt: "2024-01-15T09:30:00Z", upgradeStrategy: "real_time", + upgradeSchedule: { + strategy: "strategy", + durationValue: 1, + durationUnit: "day", + durationModifier: "start_of_period", + scheduledDate: "scheduledDate", + }, + downgradeSchedule: { + strategy: "strategy", + durationValue: 1, + durationUnit: "day", + durationModifier: "start_of_period", + scheduledDate: "scheduledDate", + }, }; server @@ -516,6 +530,20 @@ describe("TierClient", () => { tierOrder: ["tierOrder"], updatedAt: "2024-01-15T09:30:00Z", upgradeStrategy: "real_time", + upgradeSchedule: { + strategy: "strategy", + durationValue: 1, + durationUnit: "day", + durationModifier: "start_of_period", + scheduledDate: "scheduledDate", + }, + downgradeSchedule: { + strategy: "strategy", + durationValue: 1, + durationUnit: "day", + durationModifier: "start_of_period", + scheduledDate: "scheduledDate", + }, }; server @@ -661,6 +689,20 @@ describe("TierClient", () => { tierOrder: ["tierOrder"], updatedAt: "2024-01-15T09:30:00Z", upgradeStrategy: "real_time", + upgradeSchedule: { + strategy: "strategy", + durationValue: 1, + durationUnit: "day", + durationModifier: "start_of_period", + scheduledDate: "scheduledDate", + }, + downgradeSchedule: { + strategy: "strategy", + durationValue: 1, + durationUnit: "day", + durationModifier: "start_of_period", + scheduledDate: "scheduledDate", + }, }; server diff --git a/tests/wire/transactionalEmails.test.ts b/tests/wire/transactionalEmails.test.ts index 682b720..e8c92b9 100644 --- a/tests/wire/transactionalEmails.test.ts +++ b/tests/wire/transactionalEmails.test.ts @@ -106,7 +106,7 @@ describe("TransactionalEmailsClient", () => { }).rejects.toThrow(Brevo.NotFoundError); }); - test("getBlockedDomains", async () => { + test("getBlockedDomains (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -124,6 +124,25 @@ describe("TransactionalEmailsClient", () => { expect(response).toEqual(rawResponseBody); }); + test("getBlockedDomains (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/smtp/blockedDomains") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalEmails.getBlockedDomains(); + }).rejects.toThrow(Brevo.BadRequestError); + }); + test("blockNewDomain (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -564,7 +583,7 @@ describe("TransactionalEmailsClient", () => { }).rejects.toThrow(Brevo.BadRequestError); }); - test("getTransacEmailContent", async () => { + test("getTransacEmailContent (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -590,6 +609,36 @@ describe("TransactionalEmailsClient", () => { expect(response).toEqual(rawResponseBody); }); + test("getTransacEmailContent (2)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/smtp/emails/uuid").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.transactionalEmails.getTransacEmailContent({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.BadRequestError); + }); + + test("getTransacEmailContent (3)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/smtp/emails/uuid").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.transactionalEmails.getTransacEmailContent({ + uuid: "uuid", + }); + }).rejects.toThrow(Brevo.NotFoundError); + }); + test("deleteAnSmtpTransactionalLog (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -710,7 +759,7 @@ describe("TransactionalEmailsClient", () => { link: "https://www.someexamplelink.com", messageId: "<201798300811.5787683@example.domain.com>", reason: "Error connection timeout", - subject: "Sib client_dev test", + subject: "Sib client test", tag: "OrderConfirmation", templateId: 4, }, @@ -723,7 +772,7 @@ describe("TransactionalEmailsClient", () => { link: "https://www.someexamplelink.com", messageId: "<201798300811.5787683@example.domain.com>", reason: "Error connection timeout", - subject: "Sib client_dev test", + subject: "Sib client test", tag: "OrderConfirmation", templateId: 5, }, @@ -897,11 +946,12 @@ describe("TransactionalEmailsClient", () => { modifiedAt: "2016-02-24T15:37:11Z", name: "ChristomasTimeTemplate", replyTo: "replyto@domain.com", - sender: { email: "john.smith@example.com", id: "43", name: "John" }, + sender: { email: "john.smith@example.com", id: "id", name: "John" }, subject: "Merry Christmas", tag: "Festival", testSent: false, toField: "", + customTemplateId: "my-custom-template-001", }, { createdAt: "2016-02-25T11:53:26Z", @@ -912,11 +962,12 @@ describe("TransactionalEmailsClient", () => { modifiedAt: "2016-02-25T11:53:26Z", name: "SummerSales2017Template", replyTo: "replyto@domain.com", - sender: { email: "john.smith@example.com", id: "43", name: "John" }, + sender: { email: "john.smith@example.com", id: "id", name: "John" }, subject: "Enjoy our summer Sales !", tag: "Summer", testSent: false, toField: "", + customTemplateId: "my-custom-template-001", }, ], }; @@ -1004,11 +1055,12 @@ describe("TransactionalEmailsClient", () => { modifiedAt: "2016-02-25T11:53:26Z", name: "OrderConfirmation", replyTo: "replyto@domain.com", - sender: { email: "john.smith@example.com", id: "43", name: "John" }, + sender: { email: "john.smith@example.com", id: "id", name: "John" }, subject: "Order Confirmation : Thanks for your Purchase !", tag: "", testSent: false, toField: "", + customTemplateId: "my-custom-template-001", }; server diff --git a/tests/wire/transactionalSms.test.ts b/tests/wire/transactionalSms.test.ts index 5d6adfe..5d019af 100644 --- a/tests/wire/transactionalSms.test.ts +++ b/tests/wire/transactionalSms.test.ts @@ -124,6 +124,29 @@ describe("TransactionalSmsClient", () => { }).rejects.toThrow(Brevo.PaymentRequiredError); }); + test("sendTransacSms (4)", async () => { + const server = mockServerPool.createServer(); + const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { recipient: "recipient", sender: "sender" }; + const rawResponseBody = { message: "message" }; + + server + .mockEndpoint() + .post("/transactionalSMS/sms") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.transactionalSms.sendTransacSms({ + recipient: "recipient", + sender: "sender", + }); + }).rejects.toThrow(Brevo.TooManyRequestsError); + }); + test("getTransacAggregatedSmsReport (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts index 9d3e4ec..57bcbb2 100644 --- a/tests/wire/webhooks.test.ts +++ b/tests/wire/webhooks.test.ts @@ -14,7 +14,6 @@ describe("WebhooksClient", () => { { auth: { token: "test-auth-token1234", type: "bearer" }, batched: true, - channel: "email", createdAt: "2016-07-18T12:30:09Z", description: "Webhook triggered on campaign openings", events: ["opened"], @@ -22,19 +21,20 @@ describe("WebhooksClient", () => { id: 9864, modifiedAt: "2016-07-18T16:00:50Z", type: "transactional", + domain: "example.com", url: "https://example.domain.com/webhook/events/kzfxxxxxxxx0uyo1", }, { auth: { token: "test-auth-token1234", type: "bearer" }, batched: true, - channel: "sms", createdAt: "2017-02-20T14:30:00Z", description: "Webhook triggered on campaign hard bounces", - events: ["hardBounces"], + events: ["hardBounce"], headers: [{ key: "cf-secret", value: "test-header-value" }], id: 22770, modifiedAt: "2017-02-20T19:00:00Z", type: "marketing", + domain: "example.com", url: "http://exmaple.domain.com/15kxxxxxn1", }, ], @@ -62,7 +62,7 @@ describe("WebhooksClient", () => { test("createWebhook (1)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { events: ["sent"], url: "http://requestb.in/173lyyx1" }; + const rawRequestBody = { url: "http://requestb.in/173lyyx1" }; const rawResponseBody = { id: 5 }; server @@ -75,7 +75,6 @@ describe("WebhooksClient", () => { .build(); const response = await client.webhooks.createWebhook({ - events: ["sent"], url: "http://requestb.in/173lyyx1", }); expect(response).toEqual(rawResponseBody); @@ -84,7 +83,7 @@ describe("WebhooksClient", () => { test("createWebhook (2)", async () => { const server = mockServerPool.createServer(); const client = new BrevoClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { events: ["sent", "sent"], url: "url" }; + const rawRequestBody = { url: "url" }; const rawResponseBody = { key: "value" }; server @@ -98,7 +97,6 @@ describe("WebhooksClient", () => { await expect(async () => { return await client.webhooks.createWebhook({ - events: ["sent", "sent"], url: "url", }); }).rejects.toThrow(Brevo.BadRequestError); @@ -158,14 +156,14 @@ describe("WebhooksClient", () => { const rawResponseBody = { auth: { token: "test-auth-token1234", type: "bearer" }, batched: true, - channel: "sms", createdAt: "2016-06-07T09:10:10Z", description: "Webhook triggered on campaign openings and addition of lists", - events: ["listAdditions", "opened"], + events: ["listAddition", "opened"], headers: [{ key: "cf-secret", value: "test-header-value" }], id: 7287, modifiedAt: "2016-06-08T11:30:00Z", type: "marketing", + domain: "example.com", url: "http://example.domain.com/1brxxxxxx5p1", }; diff --git a/tests/wire/whatsAppCampaigns.test.ts b/tests/wire/whatsAppCampaigns.test.ts index bf2f877..9f365dd 100644 --- a/tests/wire/whatsAppCampaigns.test.ts +++ b/tests/wire/whatsAppCampaigns.test.ts @@ -215,6 +215,7 @@ describe("WhatsAppCampaignsClient", () => { modifiedAt: "2017-05-01T12:30:00Z", name: "campaign_22", status: "approved", + type: "whatsapp", }, { category: "MARKETING", @@ -225,6 +226,7 @@ describe("WhatsAppCampaignsClient", () => { modifiedAt: "2017-05-01T12:30:00Z", name: "test-template", status: "draft", + type: "whatsapp", }, ], }; @@ -309,6 +311,7 @@ describe("WhatsAppCampaignsClient", () => { id: 1672035851100690, modifiedAt: "2022-12-26T08:50:00Z", scheduledAt: "2022-12-27T09:50:00Z", + recipients: { excludedLists: [45], includedLists: [22], segments: [23], type: "list" }, senderNumber: "senderNumber", stats: { delivered: 3, notSent: 4, read: 2, sent: 3, unsubscribe: 0 }, template: {