@trycourier/courier 6.1.0 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +31 -2
- package/Client.js +35 -6
- package/README.md +5 -5
- package/api/client/requests/SendMessageRequest.d.ts +28 -1
- package/api/client/requests/index.d.ts +1 -1
- package/api/resources/audiences/client/Client.d.ts +47 -1
- package/api/resources/audiences/client/Client.js +68 -12
- package/api/resources/audiences/client/requests/AudienceMembersListParams.d.ts +6 -0
- package/api/resources/audiences/client/requests/AudienceUpdateParams.d.ts +13 -1
- package/api/resources/audiences/client/requests/AudiencesListParams.d.ts +6 -0
- package/api/resources/audiences/client/requests/index.d.ts +3 -3
- package/api/resources/audiences/types/Audience.d.ts +1 -1
- package/api/resources/audiences/types/AudienceListResponse.d.ts +1 -1
- package/api/resources/audiences/types/AudienceMemberGetResponse.d.ts +1 -1
- package/api/resources/audiences/types/AudienceMemberListResponse.d.ts +1 -1
- package/api/resources/audiences/types/AudienceUpdateResponse.d.ts +1 -1
- package/api/resources/audiences/types/BaseFilterConfig.d.ts +1 -1
- package/api/resources/audiences/types/Filter.d.ts +1 -1
- package/api/resources/audiences/types/FilterConfig.d.ts +1 -1
- package/api/resources/audiences/types/NestedFilterConfig.d.ts +1 -1
- package/api/resources/audiences/types/Operator.d.ts +1 -1
- package/api/resources/audiences/types/SingleFilterConfig.d.ts +1 -1
- package/api/resources/auditEvents/client/Client.d.ts +15 -1
- package/api/resources/auditEvents/client/Client.js +23 -5
- package/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +6 -0
- package/api/resources/auditEvents/client/requests/index.d.ts +1 -1
- package/api/resources/auditEvents/types/AuditEvent.d.ts +1 -1
- package/api/resources/auditEvents/types/ListAuditEventsResponse.d.ts +1 -1
- package/api/resources/authTokens/client/Client.d.ts +11 -2
- package/api/resources/authTokens/client/Client.js +15 -6
- package/api/resources/authTokens/client/requests/IssueTokenParams.d.ts +7 -0
- package/api/resources/authTokens/client/requests/index.d.ts +1 -1
- package/api/resources/automations/client/Client.d.ts +45 -2
- package/api/resources/automations/client/Client.js +54 -11
- package/api/resources/automations/types/AccessorType.d.ts +6 -0
- package/api/resources/automations/types/AccessorType.js +5 -0
- package/api/resources/automations/types/Automation.d.ts +1 -1
- package/api/resources/automations/types/AutomationAdHocInvokeParams.d.ts +1 -1
- package/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +4 -0
- package/api/resources/automations/types/AutomationAddToBatchMaxItemsType.js +5 -0
- package/api/resources/automations/types/AutomationAddToBatchRetain.d.ts +34 -0
- package/api/resources/automations/types/AutomationAddToBatchRetain.js +5 -0
- package/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +10 -0
- package/api/resources/automations/types/AutomationAddToBatchRetainType.js +12 -0
- package/api/resources/automations/types/AutomationAddToBatchScope.d.ts +9 -0
- package/api/resources/automations/types/AutomationAddToBatchScope.js +11 -0
- package/api/resources/automations/types/AutomationAddToBatchStep.d.ts +39 -0
- package/api/resources/automations/types/AutomationAddToBatchStep.js +5 -0
- package/api/resources/automations/types/AutomationAddToDigestStep.d.ts +16 -0
- package/api/resources/automations/types/AutomationAddToDigestStep.js +5 -0
- package/api/resources/automations/types/AutomationCancelStep.d.ts +1 -1
- package/api/resources/automations/types/AutomationDelayStep.d.ts +4 -1
- package/api/resources/automations/types/AutomationFetchDataStep.d.ts +31 -0
- package/api/resources/automations/types/AutomationFetchDataStep.js +5 -0
- package/api/resources/automations/types/AutomationFetchDataWebhook.d.ts +11 -0
- package/api/resources/automations/types/AutomationFetchDataWebhook.js +5 -0
- package/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +8 -0
- package/api/resources/automations/types/AutomationFetchDataWebhookMethod.js +10 -0
- package/api/resources/automations/types/AutomationInvokeParams.d.ts +1 -1
- package/api/resources/automations/types/AutomationInvokeStep.d.ts +1 -1
- package/api/resources/automations/types/AutomationInvokeTemplateParams.d.ts +1 -1
- package/api/resources/automations/types/AutomationRunContext.d.ts +1 -1
- package/api/resources/automations/types/AutomationSendListStep.d.ts +1 -1
- package/api/resources/automations/types/AutomationSendStep.d.ts +1 -1
- package/api/resources/automations/types/AutomationStepOption.d.ts +2 -2
- package/api/resources/automations/types/AutomationThrottleOnThrottle.d.ts +7 -0
- package/api/resources/automations/types/AutomationThrottleOnThrottle.js +5 -0
- package/api/resources/automations/types/AutomationThrottleScope.d.ts +9 -0
- package/api/resources/automations/types/AutomationThrottleScope.js +11 -0
- package/api/resources/automations/types/AutomationThrottleStep.d.ts +31 -0
- package/api/resources/automations/types/AutomationThrottleStep.js +5 -0
- package/api/resources/automations/types/AutomationUpdateProfileStep.d.ts +1 -1
- package/api/resources/automations/types/AutomationV2SendStep.d.ts +1 -1
- package/api/resources/automations/types/index.d.ts +13 -1
- package/api/resources/automations/types/index.js +13 -1
- package/api/resources/brands/client/Client.d.ts +57 -2
- package/api/resources/brands/client/Client.js +77 -14
- package/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +21 -1
- package/api/resources/brands/client/requests/ListBrandsRequest.d.ts +6 -0
- package/api/resources/brands/client/requests/index.d.ts +2 -2
- package/api/resources/brands/types/Brand.d.ts +1 -1
- package/api/resources/brands/types/BrandGetAllResponse.d.ts +1 -1
- package/api/resources/brands/types/BrandParameters.d.ts +1 -1
- package/api/resources/brands/types/BrandSettings.d.ts +1 -1
- package/api/resources/brands/types/BrandSnippets.d.ts +1 -1
- package/api/resources/brands/types/BrandsResponse.d.ts +1 -1
- package/api/resources/bulk/client/Client.d.ts +67 -2
- package/api/resources/bulk/client/Client.js +90 -21
- package/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +24 -1
- package/api/resources/bulk/client/requests/index.d.ts +1 -1
- package/api/resources/bulk/types/BulkGetJobResponse.d.ts +1 -1
- package/api/resources/bulk/types/BulkGetJobUsersResponse.d.ts +1 -1
- package/api/resources/bulk/types/BulkIngestUsersParams.d.ts +1 -1
- package/api/resources/bulk/types/BulkIngestUsersResponse.d.ts +1 -1
- package/api/resources/bulk/types/BulkMessageUserResponse.d.ts +1 -1
- package/api/resources/bulk/types/InboundBulkContentMessage.d.ts +1 -1
- package/api/resources/bulk/types/InboundBulkMessage.d.ts +1 -1
- package/api/resources/bulk/types/InboundBulkMessageUser.d.ts +1 -1
- package/api/resources/bulk/types/InboundBulkMessageV2.d.ts +1 -1
- package/api/resources/bulk/types/InboundBulkTemplateMessage.d.ts +1 -1
- package/api/resources/bulk/types/JobDetails.d.ts +1 -1
- package/api/resources/commons/errors/AlreadyExistsError.d.ts +2 -2
- package/api/resources/commons/errors/AlreadyExistsError.js +1 -1
- package/api/resources/commons/errors/BadRequestError.d.ts +2 -2
- package/api/resources/commons/errors/BadRequestError.js +1 -1
- package/api/resources/commons/errors/ConflictError.d.ts +2 -2
- package/api/resources/commons/errors/ConflictError.js +1 -1
- package/api/resources/commons/errors/MessageNotFoundError.d.ts +2 -2
- package/api/resources/commons/errors/MessageNotFoundError.js +1 -1
- package/api/resources/commons/errors/NotFoundError.d.ts +2 -2
- package/api/resources/commons/errors/NotFoundError.js +1 -1
- package/api/resources/commons/errors/PaymentRequiredError.d.ts +2 -2
- package/api/resources/commons/errors/PaymentRequiredError.js +1 -1
- package/api/resources/commons/types/AlreadyExists.d.ts +1 -1
- package/api/resources/commons/types/BadRequest.d.ts +1 -1
- package/api/resources/commons/types/ChannelPreference.d.ts +1 -1
- package/api/resources/commons/types/Conflict.d.ts +1 -1
- package/api/resources/commons/types/MessageNotFound.d.ts +1 -1
- package/api/resources/commons/types/NotFound.d.ts +1 -1
- package/api/resources/commons/types/NotificationPreferenceDetails.d.ts +1 -1
- package/api/resources/commons/types/NotificationPreferences.d.ts +1 -1
- package/api/resources/commons/types/PaymentRequired.d.ts +1 -1
- package/api/resources/commons/types/RecipientPreferences.d.ts +1 -1
- package/api/resources/commons/types/UserTenantAssociation.d.ts +4 -3
- package/api/resources/lists/client/Client.d.ts +197 -4
- package/api/resources/lists/client/Client.js +236 -25
- package/api/resources/lists/client/requests/AddSubscribersToList.d.ts +41 -0
- package/api/resources/lists/client/requests/AddSubscribersToList.js +5 -0
- package/api/resources/lists/client/requests/GetAllListsRequest.d.ts +7 -0
- package/api/resources/lists/client/requests/GetSubscriptionForListRequest.d.ts +6 -0
- package/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +32 -1
- package/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +41 -0
- package/api/resources/lists/client/requests/SubscribeUsersToListRequest.js +5 -0
- package/api/resources/lists/client/requests/index.d.ts +5 -3
- package/api/resources/lists/types/ListGetAllResponse.d.ts +1 -1
- package/api/resources/lists/types/ListGetSubscriptionsResponse.d.ts +1 -1
- package/api/resources/lists/types/ListPutParams.d.ts +1 -1
- package/api/resources/lists/types/ListSubscriptionRecipient.d.ts +1 -1
- package/api/resources/lists/types/PutSubscriptionsRecipient.d.ts +1 -1
- package/api/resources/messages/client/Client.d.ts +59 -2
- package/api/resources/messages/client/Client.js +110 -19
- package/api/resources/messages/client/requests/GetMessageHistoryRequest.d.ts +6 -0
- package/api/resources/messages/client/requests/ListMessagesRequest.d.ts +34 -3
- package/api/resources/messages/client/requests/index.d.ts +2 -2
- package/api/resources/messages/types/ListMessagesResponse.d.ts +1 -1
- package/api/resources/messages/types/MessageDetails.d.ts +1 -1
- package/api/resources/messages/types/MessageHistoryResponse.d.ts +1 -2
- package/api/resources/messages/types/MessageStatus.d.ts +4 -0
- package/api/resources/messages/types/MessageStatus.js +1 -0
- package/api/resources/messages/types/RenderOutput.d.ts +1 -1
- package/api/resources/messages/types/RenderOutputResponse.d.ts +1 -1
- package/api/resources/messages/types/RenderedMessageContent.d.ts +1 -1
- package/api/resources/notifications/client/Client.d.ts +113 -1
- package/api/resources/notifications/client/Client.js +145 -17
- package/api/resources/notifications/client/requests/NotificationDraftUpdateVariationsParams.d.ts +26 -1
- package/api/resources/notifications/client/requests/NotificationListParams.d.ts +6 -0
- package/api/resources/notifications/client/requests/NotificationUpdateVariationsParams.d.ts +26 -1
- package/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.d.ts +11 -1
- package/api/resources/notifications/client/requests/index.d.ts +4 -4
- package/api/resources/notifications/types/BaseCheck.d.ts +1 -1
- package/api/resources/notifications/types/Check.d.ts +1 -1
- package/api/resources/notifications/types/MessageRouting.d.ts +1 -1
- package/api/resources/notifications/types/MessageRoutingChannel.d.ts +1 -1
- package/api/resources/notifications/types/Notification.d.ts +5 -1
- package/api/resources/notifications/types/NotificationBlock.d.ts +1 -1
- package/api/resources/notifications/types/NotificationChannel.d.ts +1 -1
- package/api/resources/notifications/types/NotificationContent.d.ts +1 -1
- package/api/resources/notifications/types/NotificationGetContentResponse.d.ts +1 -1
- package/api/resources/notifications/types/NotificationListResponse.d.ts +1 -1
- package/api/resources/notifications/types/NotificationTag.d.ts +7 -0
- package/api/resources/notifications/types/NotificationTag.js +5 -0
- package/api/resources/notifications/types/NotificationTagData.d.ts +7 -0
- package/api/resources/notifications/types/NotificationTagData.js +5 -0
- package/api/resources/notifications/types/SubmissionChecksGetResponse.d.ts +1 -1
- package/api/resources/notifications/types/SubmissionChecksReplaceResponse.d.ts +1 -1
- package/api/resources/notifications/types/index.d.ts +2 -0
- package/api/resources/notifications/types/index.js +2 -0
- package/api/resources/profiles/client/Client.d.ts +71 -2
- package/api/resources/profiles/client/Client.js +102 -23
- package/api/resources/profiles/client/requests/GetListSubscriptionsRequest.d.ts +6 -0
- package/api/resources/profiles/client/requests/MergeProfileRequest.d.ts +10 -0
- package/api/resources/profiles/client/requests/ReplaceProfileRequest.d.ts +10 -0
- package/api/resources/profiles/client/requests/index.d.ts +3 -3
- package/api/resources/profiles/types/AirshipProfile.d.ts +1 -1
- package/api/resources/profiles/types/Discord.d.ts +1 -1
- package/api/resources/profiles/types/Expo.d.ts +1 -1
- package/api/resources/profiles/types/GetListSubscriptionsList.d.ts +1 -1
- package/api/resources/profiles/types/GetListSubscriptionsResponse.d.ts +1 -1
- package/api/resources/profiles/types/Intercom.d.ts +1 -1
- package/api/resources/profiles/types/MsTeams.d.ts +1 -1
- package/api/resources/profiles/types/MultipleTokens.d.ts +1 -1
- package/api/resources/profiles/types/ProfileGetResponse.d.ts +1 -1
- package/api/resources/profiles/types/SendToMsTeamsChannelId.d.ts +1 -1
- package/api/resources/profiles/types/SendToMsTeamsChannelName.d.ts +1 -1
- package/api/resources/profiles/types/SendToMsTeamsConversationId.d.ts +1 -1
- package/api/resources/profiles/types/SendToMsTeamsEmail.d.ts +1 -1
- package/api/resources/profiles/types/SendToMsTeamsUserId.d.ts +1 -1
- package/api/resources/profiles/types/SendToSlackChannel.d.ts +1 -1
- package/api/resources/profiles/types/SendToSlackEmail.d.ts +1 -1
- package/api/resources/profiles/types/SendToSlackUserId.d.ts +1 -1
- package/api/resources/profiles/types/Slack.d.ts +1 -1
- package/api/resources/profiles/types/SnoozeRule.d.ts +1 -1
- package/api/resources/profiles/types/SubscribeToListsRequest.d.ts +1 -1
- package/api/resources/profiles/types/SubscribeToListsRequestListObject.d.ts +1 -1
- package/api/resources/profiles/types/UserProfile.d.ts +1 -1
- package/api/resources/send/types/AudienceRecipient.d.ts +1 -1
- package/api/resources/send/types/BaseMessage.d.ts +1 -1
- package/api/resources/send/types/BaseMessageSendTo.d.ts +8 -0
- package/api/resources/send/types/BaseMessageSendTo.js +5 -0
- package/api/resources/send/types/BrandSettingsEmail.d.ts +1 -1
- package/api/resources/send/types/BrandSettingsInApp.d.ts +1 -1
- package/api/resources/send/types/BrandSettingsSocialPresence.d.ts +1 -1
- package/api/resources/send/types/BrandTemplateOverride.d.ts +1 -1
- package/api/resources/send/types/Channel.d.ts +1 -1
- package/api/resources/send/types/ChannelMetadata.d.ts +1 -1
- package/api/resources/send/types/Content.d.ts +1 -1
- package/api/resources/send/types/ContentMessage.d.ts +2 -4
- package/api/resources/send/types/ElementalActionNode.d.ts +1 -1
- package/api/resources/send/types/ElementalChannelNode.d.ts +1 -1
- package/api/resources/send/types/ElementalContent.d.ts +1 -1
- package/api/resources/send/types/ElementalDividerNode.d.ts +1 -1
- package/api/resources/send/types/ElementalGroupNode.d.ts +1 -1
- package/api/resources/send/types/ElementalImageNode.d.ts +1 -1
- package/api/resources/send/types/ElementalMetaNode.d.ts +1 -1
- package/api/resources/send/types/ElementalNode.d.ts +1 -1
- package/api/resources/send/types/ElementalQuoteNode.d.ts +1 -1
- package/api/resources/send/types/ElementalTextNode.d.ts +1 -1
- package/api/resources/send/types/EmailHeader.d.ts +1 -1
- package/api/resources/send/types/Expiry.d.ts +1 -1
- package/api/resources/send/types/IPreferences.d.ts +1 -1
- package/api/resources/send/types/IProfilePreferences.d.ts +1 -1
- package/api/resources/send/types/ListPatternRecipient.d.ts +1 -1
- package/api/resources/send/types/ListRecipient.d.ts +1 -1
- package/api/resources/send/types/Locales.d.ts +1 -1
- package/api/resources/send/types/Message.d.ts +1 -1
- package/api/resources/send/types/MessageChannelEmailOverride.d.ts +1 -1
- package/api/resources/send/types/MessageChannels.d.ts +1 -1
- package/api/resources/send/types/MessageMetadata.d.ts +1 -1
- package/api/resources/send/types/MessageProviders.d.ts +1 -1
- package/api/resources/send/types/MessageProvidersType.d.ts +1 -1
- package/api/resources/send/types/MessageRecipient.d.ts +1 -1
- package/api/resources/send/types/Metadata.d.ts +1 -1
- package/api/resources/send/types/MsTeamsRecipient.d.ts +1 -1
- package/api/resources/send/types/Preference.d.ts +1 -1
- package/api/resources/send/types/Recipient.d.ts +2 -2
- package/api/resources/send/types/RecipientData.d.ts +4 -0
- package/api/resources/send/types/RecipientData.js +5 -0
- package/api/resources/send/types/Routing.d.ts +1 -1
- package/api/resources/send/types/RoutingChannel.d.ts +1 -1
- package/api/resources/send/types/RoutingStrategyChannel.d.ts +1 -1
- package/api/resources/send/types/RoutingStrategyProvider.d.ts +1 -1
- package/api/resources/send/types/SlackRecipient.d.ts +1 -1
- package/api/resources/send/types/TemplateMessage.d.ts +2 -4
- package/api/resources/send/types/Timeout.d.ts +1 -1
- package/api/resources/send/types/UserRecipient.d.ts +1 -1
- package/api/resources/send/types/index.d.ts +2 -0
- package/api/resources/send/types/index.js +2 -0
- package/api/resources/templates/client/Client.d.ts +9 -1
- package/api/resources/templates/client/Client.js +13 -3
- package/api/resources/templates/client/requests/ListTemplatesRequest.d.ts +6 -0
- package/api/resources/templates/client/requests/index.d.ts +1 -1
- package/api/resources/templates/types/ListTemplatesResponse.d.ts +1 -1
- package/api/resources/templates/types/NotificationTemplates.d.ts +1 -1
- package/api/resources/templates/types/RoutingStrategy.d.ts +1 -1
- package/api/resources/templates/types/Tag.d.ts +1 -1
- package/api/resources/tenants/client/Client.d.ts +82 -1
- package/api/resources/tenants/client/Client.js +190 -13
- package/api/resources/tenants/client/requests/ListTenantParams.d.ts +13 -1
- package/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +7 -0
- package/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +23 -2
- package/api/resources/tenants/client/requests/index.d.ts +3 -3
- package/api/resources/tenants/types/DefaultPreferences.d.ts +2 -2
- package/api/resources/tenants/types/ListUsersForTenantResponse.d.ts +1 -1
- package/api/resources/tenants/types/SubscriptionTopic.d.ts +2 -3
- package/api/resources/tenants/types/SubscriptionTopicNew.d.ts +11 -0
- package/api/resources/tenants/types/SubscriptionTopicNew.js +5 -0
- package/api/resources/tenants/types/TemplateProperty.d.ts +3 -0
- package/api/resources/tenants/types/Tenant.d.ts +2 -2
- package/api/resources/tenants/types/TenantListResponse.d.ts +1 -1
- package/api/resources/tenants/types/index.d.ts +1 -0
- package/api/resources/tenants/types/index.js +1 -0
- package/api/resources/translations/client/Client.d.ts +17 -0
- package/api/resources/translations/client/Client.js +28 -7
- package/api/resources/users/resources/preferences/client/Client.d.ts +31 -1
- package/api/resources/users/resources/preferences/client/Client.js +45 -9
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +12 -6
- package/api/resources/users/resources/preferences/client/requests/index.d.ts +1 -1
- package/api/resources/users/resources/preferences/types/TopicPreference.d.ts +1 -1
- package/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.d.ts +10 -0
- package/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.js +5 -0
- package/api/resources/users/resources/preferences/types/UserPreferencesGetResponse.d.ts +1 -1
- package/api/resources/users/resources/preferences/types/UserPreferencesListResponse.d.ts +1 -1
- package/api/resources/users/resources/preferences/types/index.d.ts +1 -0
- package/api/resources/users/resources/preferences/types/index.js +1 -0
- package/api/resources/users/resources/tenants/client/Client.d.ts +57 -2
- package/api/resources/users/resources/tenants/client/Client.js +78 -13
- package/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts +16 -1
- package/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts +11 -2
- package/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +7 -0
- package/api/resources/users/resources/tenants/client/requests/index.d.ts +3 -3
- package/api/resources/users/resources/tenants/types/AddUserToSingleTenantsParamsProfile.d.ts +3 -0
- package/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.d.ts +1 -1
- package/api/resources/users/resources/tokens/client/Client.d.ts +64 -1
- package/api/resources/users/resources/tokens/client/Client.js +86 -13
- package/api/resources/users/resources/tokens/types/GetAllTokensResponse.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/GetUserTokenResponse.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/PatchUserTokenOpts.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/PutUserTokenOpts.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/PutUserTokensOpts.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/UserToken.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +2 -2
- package/core/fetcher/Fetcher.js +60 -6
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +8 -0
- package/core/runtime/runtime.js +82 -0
- package/dist/Client.d.ts +31 -2
- package/dist/Client.js +35 -6
- package/dist/api/client/requests/SendMessageRequest.d.ts +28 -1
- package/dist/api/client/requests/index.d.ts +1 -1
- package/dist/api/resources/audiences/client/Client.d.ts +47 -1
- package/dist/api/resources/audiences/client/Client.js +68 -12
- package/dist/api/resources/audiences/client/requests/AudienceMembersListParams.d.ts +6 -0
- package/dist/api/resources/audiences/client/requests/AudienceUpdateParams.d.ts +13 -1
- package/dist/api/resources/audiences/client/requests/AudiencesListParams.d.ts +6 -0
- package/dist/api/resources/audiences/client/requests/index.d.ts +3 -3
- package/dist/api/resources/audiences/types/Audience.d.ts +1 -1
- package/dist/api/resources/audiences/types/AudienceListResponse.d.ts +1 -1
- package/dist/api/resources/audiences/types/AudienceMemberGetResponse.d.ts +1 -1
- package/dist/api/resources/audiences/types/AudienceMemberListResponse.d.ts +1 -1
- package/dist/api/resources/audiences/types/AudienceUpdateResponse.d.ts +1 -1
- package/dist/api/resources/audiences/types/BaseFilterConfig.d.ts +1 -1
- package/dist/api/resources/audiences/types/Filter.d.ts +1 -1
- package/dist/api/resources/audiences/types/FilterConfig.d.ts +1 -1
- package/dist/api/resources/audiences/types/NestedFilterConfig.d.ts +1 -1
- package/dist/api/resources/audiences/types/Operator.d.ts +1 -1
- package/dist/api/resources/audiences/types/SingleFilterConfig.d.ts +1 -1
- package/dist/api/resources/auditEvents/client/Client.d.ts +15 -1
- package/dist/api/resources/auditEvents/client/Client.js +23 -5
- package/dist/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +6 -0
- package/dist/api/resources/auditEvents/client/requests/index.d.ts +1 -1
- package/dist/api/resources/auditEvents/types/AuditEvent.d.ts +1 -1
- package/dist/api/resources/auditEvents/types/ListAuditEventsResponse.d.ts +1 -1
- package/dist/api/resources/authTokens/client/Client.d.ts +11 -2
- package/dist/api/resources/authTokens/client/Client.js +15 -6
- package/dist/api/resources/authTokens/client/requests/IssueTokenParams.d.ts +7 -0
- package/dist/api/resources/authTokens/client/requests/index.d.ts +1 -1
- package/dist/api/resources/automations/client/Client.d.ts +45 -2
- package/dist/api/resources/automations/client/Client.js +54 -11
- package/dist/api/resources/automations/types/AccessorType.d.ts +6 -0
- package/dist/api/resources/automations/types/AccessorType.js +5 -0
- package/dist/api/resources/automations/types/Automation.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationAdHocInvokeParams.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +4 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchMaxItemsType.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetain.d.ts +34 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetain.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +10 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchRetainType.js +12 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchScope.d.ts +9 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchScope.js +11 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchStep.d.ts +39 -0
- package/dist/api/resources/automations/types/AutomationAddToBatchStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationAddToDigestStep.d.ts +16 -0
- package/dist/api/resources/automations/types/AutomationAddToDigestStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationCancelStep.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationDelayStep.d.ts +4 -1
- package/dist/api/resources/automations/types/AutomationFetchDataStep.d.ts +31 -0
- package/dist/api/resources/automations/types/AutomationFetchDataStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhook.d.ts +11 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhook.js +5 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +8 -0
- package/dist/api/resources/automations/types/AutomationFetchDataWebhookMethod.js +10 -0
- package/dist/api/resources/automations/types/AutomationInvokeParams.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationInvokeStep.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationInvokeTemplateParams.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationRunContext.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationSendListStep.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationSendStep.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationStepOption.d.ts +2 -2
- package/dist/api/resources/automations/types/AutomationThrottleOnThrottle.d.ts +7 -0
- package/dist/api/resources/automations/types/AutomationThrottleOnThrottle.js +5 -0
- package/dist/api/resources/automations/types/AutomationThrottleScope.d.ts +9 -0
- package/dist/api/resources/automations/types/AutomationThrottleScope.js +11 -0
- package/dist/api/resources/automations/types/AutomationThrottleStep.d.ts +31 -0
- package/dist/api/resources/automations/types/AutomationThrottleStep.js +5 -0
- package/dist/api/resources/automations/types/AutomationUpdateProfileStep.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationV2SendStep.d.ts +1 -1
- package/dist/api/resources/automations/types/index.d.ts +13 -1
- package/dist/api/resources/automations/types/index.js +13 -1
- package/dist/api/resources/brands/client/Client.d.ts +57 -2
- package/dist/api/resources/brands/client/Client.js +77 -14
- package/dist/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +21 -1
- package/dist/api/resources/brands/client/requests/ListBrandsRequest.d.ts +6 -0
- package/dist/api/resources/brands/client/requests/index.d.ts +2 -2
- package/dist/api/resources/brands/types/Brand.d.ts +1 -1
- package/dist/api/resources/brands/types/BrandGetAllResponse.d.ts +1 -1
- package/dist/api/resources/brands/types/BrandParameters.d.ts +1 -1
- package/dist/api/resources/brands/types/BrandSettings.d.ts +1 -1
- package/dist/api/resources/brands/types/BrandSnippets.d.ts +1 -1
- package/dist/api/resources/brands/types/BrandsResponse.d.ts +1 -1
- package/dist/api/resources/bulk/client/Client.d.ts +67 -2
- package/dist/api/resources/bulk/client/Client.js +90 -21
- package/dist/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +24 -1
- package/dist/api/resources/bulk/client/requests/index.d.ts +1 -1
- package/dist/api/resources/bulk/types/BulkGetJobResponse.d.ts +1 -1
- package/dist/api/resources/bulk/types/BulkGetJobUsersResponse.d.ts +1 -1
- package/dist/api/resources/bulk/types/BulkIngestUsersParams.d.ts +1 -1
- package/dist/api/resources/bulk/types/BulkIngestUsersResponse.d.ts +1 -1
- package/dist/api/resources/bulk/types/BulkMessageUserResponse.d.ts +1 -1
- package/dist/api/resources/bulk/types/InboundBulkContentMessage.d.ts +1 -1
- package/dist/api/resources/bulk/types/InboundBulkMessage.d.ts +1 -1
- package/dist/api/resources/bulk/types/InboundBulkMessageUser.d.ts +1 -1
- package/dist/api/resources/bulk/types/InboundBulkMessageV2.d.ts +1 -1
- package/dist/api/resources/bulk/types/InboundBulkTemplateMessage.d.ts +1 -1
- package/dist/api/resources/bulk/types/JobDetails.d.ts +1 -1
- package/dist/api/resources/commons/errors/AlreadyExistsError.d.ts +2 -2
- package/dist/api/resources/commons/errors/AlreadyExistsError.js +1 -1
- package/dist/api/resources/commons/errors/BadRequestError.d.ts +2 -2
- package/dist/api/resources/commons/errors/BadRequestError.js +1 -1
- package/dist/api/resources/commons/errors/ConflictError.d.ts +2 -2
- package/dist/api/resources/commons/errors/ConflictError.js +1 -1
- package/dist/api/resources/commons/errors/MessageNotFoundError.d.ts +2 -2
- package/dist/api/resources/commons/errors/MessageNotFoundError.js +1 -1
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +2 -2
- package/dist/api/resources/commons/errors/NotFoundError.js +1 -1
- package/dist/api/resources/commons/errors/PaymentRequiredError.d.ts +2 -2
- package/dist/api/resources/commons/errors/PaymentRequiredError.js +1 -1
- package/dist/api/resources/commons/types/AlreadyExists.d.ts +1 -1
- package/dist/api/resources/commons/types/BadRequest.d.ts +1 -1
- package/dist/api/resources/commons/types/ChannelPreference.d.ts +1 -1
- package/dist/api/resources/commons/types/Conflict.d.ts +1 -1
- package/dist/api/resources/commons/types/MessageNotFound.d.ts +1 -1
- package/dist/api/resources/commons/types/NotFound.d.ts +1 -1
- package/dist/api/resources/commons/types/NotificationPreferenceDetails.d.ts +1 -1
- package/dist/api/resources/commons/types/NotificationPreferences.d.ts +1 -1
- package/dist/api/resources/commons/types/PaymentRequired.d.ts +1 -1
- package/dist/api/resources/commons/types/RecipientPreferences.d.ts +1 -1
- package/dist/api/resources/commons/types/UserTenantAssociation.d.ts +4 -3
- package/dist/api/resources/lists/client/Client.d.ts +197 -4
- package/dist/api/resources/lists/client/Client.js +236 -25
- package/dist/api/resources/lists/client/requests/AddSubscribersToList.d.ts +41 -0
- package/dist/api/resources/lists/client/requests/AddSubscribersToList.js +5 -0
- package/dist/api/resources/lists/client/requests/GetAllListsRequest.d.ts +7 -0
- package/dist/api/resources/lists/client/requests/GetSubscriptionForListRequest.d.ts +6 -0
- package/dist/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +32 -1
- package/dist/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +41 -0
- package/dist/api/resources/lists/client/requests/SubscribeUsersToListRequest.js +5 -0
- package/dist/api/resources/lists/client/requests/index.d.ts +5 -3
- package/dist/api/resources/lists/types/ListGetAllResponse.d.ts +1 -1
- package/dist/api/resources/lists/types/ListGetSubscriptionsResponse.d.ts +1 -1
- package/dist/api/resources/lists/types/ListPutParams.d.ts +1 -1
- package/dist/api/resources/lists/types/ListSubscriptionRecipient.d.ts +1 -1
- package/dist/api/resources/lists/types/PutSubscriptionsRecipient.d.ts +1 -1
- package/dist/api/resources/messages/client/Client.d.ts +59 -2
- package/dist/api/resources/messages/client/Client.js +110 -19
- package/dist/api/resources/messages/client/requests/GetMessageHistoryRequest.d.ts +6 -0
- package/dist/api/resources/messages/client/requests/ListMessagesRequest.d.ts +34 -3
- package/dist/api/resources/messages/client/requests/index.d.ts +2 -2
- package/dist/api/resources/messages/types/ListMessagesResponse.d.ts +1 -1
- package/dist/api/resources/messages/types/MessageDetails.d.ts +1 -1
- package/dist/api/resources/messages/types/MessageHistoryResponse.d.ts +1 -2
- package/dist/api/resources/messages/types/MessageStatus.d.ts +4 -0
- package/dist/api/resources/messages/types/MessageStatus.js +1 -0
- package/dist/api/resources/messages/types/RenderOutput.d.ts +1 -1
- package/dist/api/resources/messages/types/RenderOutputResponse.d.ts +1 -1
- package/dist/api/resources/messages/types/RenderedMessageContent.d.ts +1 -1
- package/dist/api/resources/notifications/client/Client.d.ts +113 -1
- package/dist/api/resources/notifications/client/Client.js +145 -17
- package/dist/api/resources/notifications/client/requests/NotificationDraftUpdateVariationsParams.d.ts +26 -1
- package/dist/api/resources/notifications/client/requests/NotificationListParams.d.ts +6 -0
- package/dist/api/resources/notifications/client/requests/NotificationUpdateVariationsParams.d.ts +26 -1
- package/dist/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.d.ts +11 -1
- package/dist/api/resources/notifications/client/requests/index.d.ts +4 -4
- package/dist/api/resources/notifications/types/BaseCheck.d.ts +1 -1
- package/dist/api/resources/notifications/types/Check.d.ts +1 -1
- package/dist/api/resources/notifications/types/MessageRouting.d.ts +1 -1
- package/dist/api/resources/notifications/types/MessageRoutingChannel.d.ts +1 -1
- package/dist/api/resources/notifications/types/Notification.d.ts +5 -1
- package/dist/api/resources/notifications/types/NotificationBlock.d.ts +1 -1
- package/dist/api/resources/notifications/types/NotificationChannel.d.ts +1 -1
- package/dist/api/resources/notifications/types/NotificationContent.d.ts +1 -1
- package/dist/api/resources/notifications/types/NotificationGetContentResponse.d.ts +1 -1
- package/dist/api/resources/notifications/types/NotificationListResponse.d.ts +1 -1
- package/dist/api/resources/notifications/types/NotificationTag.d.ts +7 -0
- package/dist/api/resources/notifications/types/NotificationTag.js +5 -0
- package/dist/api/resources/notifications/types/NotificationTagData.d.ts +7 -0
- package/dist/api/resources/notifications/types/NotificationTagData.js +5 -0
- package/dist/api/resources/notifications/types/SubmissionChecksGetResponse.d.ts +1 -1
- package/dist/api/resources/notifications/types/SubmissionChecksReplaceResponse.d.ts +1 -1
- package/dist/api/resources/notifications/types/index.d.ts +2 -0
- package/dist/api/resources/notifications/types/index.js +2 -0
- package/dist/api/resources/profiles/client/Client.d.ts +71 -2
- package/dist/api/resources/profiles/client/Client.js +102 -23
- package/dist/api/resources/profiles/client/requests/GetListSubscriptionsRequest.d.ts +6 -0
- package/dist/api/resources/profiles/client/requests/MergeProfileRequest.d.ts +10 -0
- package/dist/api/resources/profiles/client/requests/ReplaceProfileRequest.d.ts +10 -0
- package/dist/api/resources/profiles/client/requests/index.d.ts +3 -3
- package/dist/api/resources/profiles/types/AirshipProfile.d.ts +1 -1
- package/dist/api/resources/profiles/types/Discord.d.ts +1 -1
- package/dist/api/resources/profiles/types/Expo.d.ts +1 -1
- package/dist/api/resources/profiles/types/GetListSubscriptionsList.d.ts +1 -1
- package/dist/api/resources/profiles/types/GetListSubscriptionsResponse.d.ts +1 -1
- package/dist/api/resources/profiles/types/Intercom.d.ts +1 -1
- package/dist/api/resources/profiles/types/MsTeams.d.ts +1 -1
- package/dist/api/resources/profiles/types/MultipleTokens.d.ts +1 -1
- package/dist/api/resources/profiles/types/ProfileGetResponse.d.ts +1 -1
- package/dist/api/resources/profiles/types/SendToMsTeamsChannelId.d.ts +1 -1
- package/dist/api/resources/profiles/types/SendToMsTeamsChannelName.d.ts +1 -1
- package/dist/api/resources/profiles/types/SendToMsTeamsConversationId.d.ts +1 -1
- package/dist/api/resources/profiles/types/SendToMsTeamsEmail.d.ts +1 -1
- package/dist/api/resources/profiles/types/SendToMsTeamsUserId.d.ts +1 -1
- package/dist/api/resources/profiles/types/SendToSlackChannel.d.ts +1 -1
- package/dist/api/resources/profiles/types/SendToSlackEmail.d.ts +1 -1
- package/dist/api/resources/profiles/types/SendToSlackUserId.d.ts +1 -1
- package/dist/api/resources/profiles/types/Slack.d.ts +1 -1
- package/dist/api/resources/profiles/types/SnoozeRule.d.ts +1 -1
- package/dist/api/resources/profiles/types/SubscribeToListsRequest.d.ts +1 -1
- package/dist/api/resources/profiles/types/SubscribeToListsRequestListObject.d.ts +1 -1
- package/dist/api/resources/profiles/types/UserProfile.d.ts +1 -1
- package/dist/api/resources/send/types/AudienceRecipient.d.ts +1 -1
- package/dist/api/resources/send/types/BaseMessage.d.ts +1 -1
- package/dist/api/resources/send/types/BaseMessageSendTo.d.ts +8 -0
- package/dist/api/resources/send/types/BaseMessageSendTo.js +5 -0
- package/dist/api/resources/send/types/BrandSettingsEmail.d.ts +1 -1
- package/dist/api/resources/send/types/BrandSettingsInApp.d.ts +1 -1
- package/dist/api/resources/send/types/BrandSettingsSocialPresence.d.ts +1 -1
- package/dist/api/resources/send/types/BrandTemplateOverride.d.ts +1 -1
- package/dist/api/resources/send/types/Channel.d.ts +1 -1
- package/dist/api/resources/send/types/ChannelMetadata.d.ts +1 -1
- package/dist/api/resources/send/types/Content.d.ts +1 -1
- package/dist/api/resources/send/types/ContentMessage.d.ts +2 -4
- package/dist/api/resources/send/types/ElementalActionNode.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalChannelNode.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalContent.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalDividerNode.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalGroupNode.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalImageNode.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalMetaNode.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalNode.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalQuoteNode.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalTextNode.d.ts +1 -1
- package/dist/api/resources/send/types/EmailHeader.d.ts +1 -1
- package/dist/api/resources/send/types/Expiry.d.ts +1 -1
- package/dist/api/resources/send/types/IPreferences.d.ts +1 -1
- package/dist/api/resources/send/types/IProfilePreferences.d.ts +1 -1
- package/dist/api/resources/send/types/ListPatternRecipient.d.ts +1 -1
- package/dist/api/resources/send/types/ListRecipient.d.ts +1 -1
- package/dist/api/resources/send/types/Locales.d.ts +1 -1
- package/dist/api/resources/send/types/Message.d.ts +1 -1
- package/dist/api/resources/send/types/MessageChannelEmailOverride.d.ts +1 -1
- package/dist/api/resources/send/types/MessageChannels.d.ts +1 -1
- package/dist/api/resources/send/types/MessageMetadata.d.ts +1 -1
- package/dist/api/resources/send/types/MessageProviders.d.ts +1 -1
- package/dist/api/resources/send/types/MessageProvidersType.d.ts +1 -1
- package/dist/api/resources/send/types/MessageRecipient.d.ts +1 -1
- package/dist/api/resources/send/types/Metadata.d.ts +1 -1
- package/dist/api/resources/send/types/MsTeamsRecipient.d.ts +1 -1
- package/dist/api/resources/send/types/Preference.d.ts +1 -1
- package/dist/api/resources/send/types/Recipient.d.ts +2 -2
- package/dist/api/resources/send/types/RecipientData.d.ts +4 -0
- package/dist/api/resources/send/types/RecipientData.js +5 -0
- package/dist/api/resources/send/types/Routing.d.ts +1 -1
- package/dist/api/resources/send/types/RoutingChannel.d.ts +1 -1
- package/dist/api/resources/send/types/RoutingStrategyChannel.d.ts +1 -1
- package/dist/api/resources/send/types/RoutingStrategyProvider.d.ts +1 -1
- package/dist/api/resources/send/types/SlackRecipient.d.ts +1 -1
- package/dist/api/resources/send/types/TemplateMessage.d.ts +2 -4
- package/dist/api/resources/send/types/Timeout.d.ts +1 -1
- package/dist/api/resources/send/types/UserRecipient.d.ts +1 -1
- package/dist/api/resources/send/types/index.d.ts +2 -0
- package/dist/api/resources/send/types/index.js +2 -0
- package/dist/api/resources/templates/client/Client.d.ts +9 -1
- package/dist/api/resources/templates/client/Client.js +13 -3
- package/dist/api/resources/templates/client/requests/ListTemplatesRequest.d.ts +6 -0
- package/dist/api/resources/templates/client/requests/index.d.ts +1 -1
- package/dist/api/resources/templates/types/ListTemplatesResponse.d.ts +1 -1
- package/dist/api/resources/templates/types/NotificationTemplates.d.ts +1 -1
- package/dist/api/resources/templates/types/RoutingStrategy.d.ts +1 -1
- package/dist/api/resources/templates/types/Tag.d.ts +1 -1
- package/dist/api/resources/tenants/client/Client.d.ts +82 -1
- package/dist/api/resources/tenants/client/Client.js +190 -13
- package/dist/api/resources/tenants/client/requests/ListTenantParams.d.ts +13 -1
- package/dist/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +7 -0
- package/dist/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +23 -2
- package/dist/api/resources/tenants/client/requests/index.d.ts +3 -3
- package/dist/api/resources/tenants/types/DefaultPreferences.d.ts +2 -2
- package/dist/api/resources/tenants/types/ListUsersForTenantResponse.d.ts +1 -1
- package/dist/api/resources/tenants/types/SubscriptionTopic.d.ts +2 -3
- package/dist/api/resources/tenants/types/SubscriptionTopicNew.d.ts +11 -0
- package/dist/api/resources/tenants/types/SubscriptionTopicNew.js +5 -0
- package/dist/api/resources/tenants/types/TemplateProperty.d.ts +3 -0
- package/dist/api/resources/tenants/types/Tenant.d.ts +2 -2
- package/dist/api/resources/tenants/types/TenantListResponse.d.ts +1 -1
- package/dist/api/resources/tenants/types/index.d.ts +1 -0
- package/dist/api/resources/tenants/types/index.js +1 -0
- package/dist/api/resources/translations/client/Client.d.ts +17 -0
- package/dist/api/resources/translations/client/Client.js +28 -7
- package/dist/api/resources/users/resources/preferences/client/Client.d.ts +31 -1
- package/dist/api/resources/users/resources/preferences/client/Client.js +45 -9
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +12 -6
- package/dist/api/resources/users/resources/preferences/client/requests/index.d.ts +1 -1
- package/dist/api/resources/users/resources/preferences/types/TopicPreference.d.ts +1 -1
- package/dist/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.d.ts +10 -0
- package/dist/api/resources/users/resources/preferences/types/TopicPreferenceUpdate.js +5 -0
- package/dist/api/resources/users/resources/preferences/types/UserPreferencesGetResponse.d.ts +1 -1
- package/dist/api/resources/users/resources/preferences/types/UserPreferencesListResponse.d.ts +1 -1
- package/dist/api/resources/users/resources/preferences/types/index.d.ts +1 -0
- package/dist/api/resources/users/resources/preferences/types/index.js +1 -0
- package/dist/api/resources/users/resources/tenants/client/Client.d.ts +57 -2
- package/dist/api/resources/users/resources/tenants/client/Client.js +78 -13
- package/dist/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts +16 -1
- package/dist/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts +11 -2
- package/dist/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +7 -0
- package/dist/api/resources/users/resources/tenants/client/requests/index.d.ts +3 -3
- package/dist/api/resources/users/resources/tenants/types/AddUserToSingleTenantsParamsProfile.d.ts +3 -0
- package/dist/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/client/Client.d.ts +64 -1
- package/dist/api/resources/users/resources/tokens/client/Client.js +86 -13
- package/dist/api/resources/users/resources/tokens/types/GetAllTokensResponse.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/GetUserTokenResponse.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/PatchUserTokenOpts.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/PutUserTokenOpts.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/PutUserTokensOpts.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/UserToken.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +2 -2
- package/dist/core/fetcher/Fetcher.js +60 -6
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +8 -0
- package/dist/core/runtime/runtime.js +82 -0
- package/jest.config.js +2 -2
- package/package.json +8 -6
- package/api/resources/automations/types/AutomationStepAction.d.ts +0 -12
- package/api/resources/automations/types/AutomationStepAction.js +0 -14
- package/dist/api/resources/automations/types/AutomationStepAction.d.ts +0 -12
- package/dist/api/resources/automations/types/AutomationStepAction.js +0 -14
- package/tests/client.test.ts +0 -11
|
@@ -42,7 +42,7 @@ exports.Tenants = void 0;
|
|
|
42
42
|
const environments = __importStar(require("../../../../../../environments"));
|
|
43
43
|
const core = __importStar(require("../../../../../../core"));
|
|
44
44
|
const url_join_1 = __importDefault(require("url-join"));
|
|
45
|
-
const errors = __importStar(require("../../../../../../errors"));
|
|
45
|
+
const errors = __importStar(require("../../../../../../errors/index"));
|
|
46
46
|
class Tenants {
|
|
47
47
|
constructor(_options = {}) {
|
|
48
48
|
this._options = _options;
|
|
@@ -53,18 +53,38 @@ class Tenants {
|
|
|
53
53
|
* A custom profile can also be supplied for each tenant.
|
|
54
54
|
* This profile will be merged with the user's main
|
|
55
55
|
* profile when sending to the user with that tenant.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
58
|
+
* @param {Courier.users.AddUserToMultipleTenantsParams} request
|
|
59
|
+
* @param {Tenants.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* await courier.users.tenants.addMultple("string", {
|
|
63
|
+
* tenants: [{
|
|
64
|
+
* user_id: "string",
|
|
65
|
+
* type: "user",
|
|
66
|
+
* tenant_id: "string",
|
|
67
|
+
* profile: {
|
|
68
|
+
* "string": {
|
|
69
|
+
* "key": "value"
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
* }]
|
|
73
|
+
* })
|
|
56
74
|
*/
|
|
57
75
|
addMultple(userId, request, requestOptions) {
|
|
58
76
|
var _a, _b;
|
|
59
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
61
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${userId}/tenants`),
|
|
79
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants`),
|
|
62
80
|
method: "PUT",
|
|
63
81
|
headers: {
|
|
64
82
|
Authorization: yield this._getAuthorizationHeader(),
|
|
65
83
|
"X-Fern-Language": "JavaScript",
|
|
66
84
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
67
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
85
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
86
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
87
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
68
88
|
},
|
|
69
89
|
contentType: "application/json",
|
|
70
90
|
body: request,
|
|
@@ -101,18 +121,34 @@ class Tenants {
|
|
|
101
121
|
* A custom profile can also be supplied with the tenant.
|
|
102
122
|
* This profile will be merged with the user's main profile
|
|
103
123
|
* when sending to the user with that tenant.
|
|
124
|
+
*
|
|
125
|
+
* @param {string} userId - Id of the user to be added to the supplied tenant.
|
|
126
|
+
* @param {string} tenantId - Id of the tenant the user should be added to.
|
|
127
|
+
* @param {Courier.users.AddUserToSingleTenantsParams} request
|
|
128
|
+
* @param {Tenants.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* await courier.users.tenants.add("string", "string", {
|
|
132
|
+
* profile: {
|
|
133
|
+
* "string": {
|
|
134
|
+
* "key": "value"
|
|
135
|
+
* }
|
|
136
|
+
* }
|
|
137
|
+
* })
|
|
104
138
|
*/
|
|
105
|
-
add(userId, tenantId, request, requestOptions) {
|
|
139
|
+
add(userId, tenantId, request = {}, requestOptions) {
|
|
106
140
|
var _a, _b;
|
|
107
141
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
142
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
109
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${userId}/tenants/${tenantId}`),
|
|
143
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants/${encodeURIComponent(tenantId)}`),
|
|
110
144
|
method: "PUT",
|
|
111
145
|
headers: {
|
|
112
146
|
Authorization: yield this._getAuthorizationHeader(),
|
|
113
147
|
"X-Fern-Language": "JavaScript",
|
|
114
148
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
115
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
149
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
150
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
151
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
116
152
|
},
|
|
117
153
|
contentType: "application/json",
|
|
118
154
|
body: request,
|
|
@@ -145,18 +181,26 @@ class Tenants {
|
|
|
145
181
|
}
|
|
146
182
|
/**
|
|
147
183
|
* Removes a user from any tenants they may have been associated with.
|
|
184
|
+
*
|
|
185
|
+
* @param {string} userId - Id of the user to be removed from the supplied tenant.
|
|
186
|
+
* @param {Tenants.RequestOptions} requestOptions - Request-specific configuration.
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* await courier.users.tenants.removeAll("string")
|
|
148
190
|
*/
|
|
149
191
|
removeAll(userId, requestOptions) {
|
|
150
192
|
var _a, _b;
|
|
151
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
194
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
153
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${userId}/tenants`),
|
|
195
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants`),
|
|
154
196
|
method: "DELETE",
|
|
155
197
|
headers: {
|
|
156
198
|
Authorization: yield this._getAuthorizationHeader(),
|
|
157
199
|
"X-Fern-Language": "JavaScript",
|
|
158
200
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
159
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
201
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
202
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
203
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
160
204
|
},
|
|
161
205
|
contentType: "application/json",
|
|
162
206
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -188,18 +232,27 @@ class Tenants {
|
|
|
188
232
|
}
|
|
189
233
|
/**
|
|
190
234
|
* Removes a user from the supplied tenant.
|
|
235
|
+
*
|
|
236
|
+
* @param {string} userId - Id of the user to be removed from the supplied tenant.
|
|
237
|
+
* @param {string} tenantId - Id of the tenant the user should be removed from.
|
|
238
|
+
* @param {Tenants.RequestOptions} requestOptions - Request-specific configuration.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* await courier.users.tenants.remove("string", "string")
|
|
191
242
|
*/
|
|
192
243
|
remove(userId, tenantId, requestOptions) {
|
|
193
244
|
var _a, _b;
|
|
194
245
|
return __awaiter(this, void 0, void 0, function* () {
|
|
195
246
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
196
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${userId}/tenants/${tenantId}`),
|
|
247
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants/${encodeURIComponent(tenantId)}`),
|
|
197
248
|
method: "DELETE",
|
|
198
249
|
headers: {
|
|
199
250
|
Authorization: yield this._getAuthorizationHeader(),
|
|
200
251
|
"X-Fern-Language": "JavaScript",
|
|
201
252
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
202
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
253
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
254
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
255
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
203
256
|
},
|
|
204
257
|
contentType: "application/json",
|
|
205
258
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -231,6 +284,16 @@ class Tenants {
|
|
|
231
284
|
}
|
|
232
285
|
/**
|
|
233
286
|
* Returns a paginated list of user tenant associations.
|
|
287
|
+
*
|
|
288
|
+
* @param {string} userId - Id of the user to retrieve all associated tenants for.
|
|
289
|
+
* @param {Courier.users.ListTenantsForUserParams} request
|
|
290
|
+
* @param {Tenants.RequestOptions} requestOptions - Request-specific configuration.
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* await courier.users.tenants.list("string", {
|
|
294
|
+
* limit: 1,
|
|
295
|
+
* cursor: "string"
|
|
296
|
+
* })
|
|
234
297
|
*/
|
|
235
298
|
list(userId, request = {}, requestOptions) {
|
|
236
299
|
var _a, _b;
|
|
@@ -244,13 +307,15 @@ class Tenants {
|
|
|
244
307
|
_queryParams["cursor"] = cursor;
|
|
245
308
|
}
|
|
246
309
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
247
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${userId}/tenants`),
|
|
310
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants`),
|
|
248
311
|
method: "GET",
|
|
249
312
|
headers: {
|
|
250
313
|
Authorization: yield this._getAuthorizationHeader(),
|
|
251
314
|
"X-Fern-Language": "JavaScript",
|
|
252
315
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
253
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
316
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
317
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
318
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
254
319
|
},
|
|
255
320
|
contentType: "application/json",
|
|
256
321
|
queryParameters: _queryParams,
|
|
@@ -284,7 +349,7 @@ class Tenants {
|
|
|
284
349
|
_getAuthorizationHeader() {
|
|
285
350
|
var _a;
|
|
286
351
|
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
-
const bearer = (_a = (yield core.Supplier.get(this._options.authorizationToken))) !== null && _a !== void 0 ? _a : process.env["COURIER_AUTH_TOKEN"];
|
|
352
|
+
const bearer = (_a = (yield core.Supplier.get(this._options.authorizationToken))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["COURIER_AUTH_TOKEN"];
|
|
288
353
|
if (bearer == null) {
|
|
289
354
|
throw new errors.CourierError({
|
|
290
355
|
message: "Please specify COURIER_AUTH_TOKEN when instantiating the client.",
|
package/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Courier from "
|
|
4
|
+
import * as Courier from "../../../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* tenants: [{
|
|
9
|
+
* user_id: "string",
|
|
10
|
+
* type: "user",
|
|
11
|
+
* tenant_id: "string",
|
|
12
|
+
* profile: {
|
|
13
|
+
* "string": {
|
|
14
|
+
* "key": "value"
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* }]
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
5
20
|
export interface AddUserToMultipleTenantsParams {
|
|
6
21
|
tenants: Courier.UserTenantAssociation[];
|
|
7
22
|
}
|
package/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* profile: {
|
|
8
|
+
* "string": {
|
|
9
|
+
* "key": "value"
|
|
10
|
+
* }
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
5
14
|
export interface AddUserToSingleTenantsParams {
|
|
6
|
-
profile
|
|
15
|
+
profile?: Record<string, any>;
|
|
7
16
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AddUserToMultipleTenantsParams } from "./AddUserToMultipleTenantsParams";
|
|
2
|
-
export { AddUserToSingleTenantsParams } from "./AddUserToSingleTenantsParams";
|
|
3
|
-
export { ListTenantsForUserParams } from "./ListTenantsForUserParams";
|
|
1
|
+
export { type AddUserToMultipleTenantsParams } from "./AddUserToMultipleTenantsParams";
|
|
2
|
+
export { type AddUserToSingleTenantsParams } from "./AddUserToSingleTenantsParams";
|
|
3
|
+
export { type ListTenantsForUserParams } from "./ListTenantsForUserParams";
|
package/api/resources/users/resources/tenants/types/AddUserToSingleTenantsParamsProfile.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* AddUserToSingleTenantsParamsProfile is no longer used for Add a User to a Single Tenant
|
|
6
|
+
*/
|
|
4
7
|
export interface AddUserToSingleTenantsParamsProfile {
|
|
5
8
|
title: string;
|
|
6
9
|
/** Email Address */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Courier from "
|
|
4
|
+
import * as Courier from "../../../../../index";
|
|
5
5
|
export interface ListTenantsForUserResponse {
|
|
6
6
|
items?: Courier.UserTenantAssociation[];
|
|
7
7
|
/** Set to true when there are more pages that can be retrieved. */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "../../../../../../environments";
|
|
5
5
|
import * as core from "../../../../../../core";
|
|
6
|
-
import * as Courier from "
|
|
6
|
+
import * as Courier from "../../../../../index";
|
|
7
7
|
export declare namespace Tokens {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
@@ -20,27 +20,90 @@ export declare class Tokens {
|
|
|
20
20
|
constructor(_options?: Tokens.Options);
|
|
21
21
|
/**
|
|
22
22
|
* Adds multiple tokens to a user and overwrites matching existing tokens.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
25
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
|
+
*
|
|
23
27
|
* @throws {@link Courier.BadRequestError}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* await courier.users.tokens.addMultiple("string")
|
|
24
31
|
*/
|
|
25
32
|
addMultiple(userId: string, requestOptions?: Tokens.RequestOptions): Promise<void>;
|
|
26
33
|
/**
|
|
27
34
|
* Adds a single token to a user and overwrites a matching existing token.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
37
|
+
* @param {string} token - The full token string.
|
|
38
|
+
* @param {Courier.users.UserToken} request
|
|
39
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
+
*
|
|
28
41
|
* @throws {@link Courier.BadRequestError}
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* await courier.users.tokens.add("string", "string", {
|
|
45
|
+
* token: "string",
|
|
46
|
+
* provider_key: Courier.users.ProviderKey.FirebaseFcm,
|
|
47
|
+
* expiry_date: "string",
|
|
48
|
+
* properties: {
|
|
49
|
+
* "key": "value"
|
|
50
|
+
* },
|
|
51
|
+
* device: {
|
|
52
|
+
* app_id: "string",
|
|
53
|
+
* ad_id: "string",
|
|
54
|
+
* device_id: "string",
|
|
55
|
+
* platform: "string",
|
|
56
|
+
* manufacturer: "string",
|
|
57
|
+
* model: "string"
|
|
58
|
+
* },
|
|
59
|
+
* tracking: {
|
|
60
|
+
* os_version: "string",
|
|
61
|
+
* ip: "string",
|
|
62
|
+
* lat: "string",
|
|
63
|
+
* long: "string"
|
|
64
|
+
* }
|
|
65
|
+
* })
|
|
29
66
|
*/
|
|
30
67
|
add(userId: string, token: string, request: Courier.users.UserToken, requestOptions?: Tokens.RequestOptions): Promise<void>;
|
|
31
68
|
/**
|
|
32
69
|
* Apply a JSON Patch (RFC 6902) to the specified token.
|
|
70
|
+
*
|
|
71
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
72
|
+
* @param {string} token - The full token string.
|
|
73
|
+
* @param {Courier.users.PatchUserTokenOpts} request
|
|
74
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
|
+
*
|
|
33
76
|
* @throws {@link Courier.BadRequestError}
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* await courier.users.tokens.update("string", "string", {
|
|
80
|
+
* patch: [{}]
|
|
81
|
+
* })
|
|
34
82
|
*/
|
|
35
83
|
update(userId: string, token: string, request: Courier.users.PatchUserTokenOpts, requestOptions?: Tokens.RequestOptions): Promise<void>;
|
|
36
84
|
/**
|
|
37
85
|
* Get single token available for a `:token`
|
|
86
|
+
*
|
|
87
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
88
|
+
* @param {string} token - The full token string.
|
|
89
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
|
+
*
|
|
38
91
|
* @throws {@link Courier.BadRequestError}
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* await courier.users.tokens.get("string", "string")
|
|
39
95
|
*/
|
|
40
96
|
get(userId: string, token: string, requestOptions?: Tokens.RequestOptions): Promise<Courier.users.GetUserTokenResponse>;
|
|
41
97
|
/**
|
|
42
98
|
* Gets all tokens available for a :user_id
|
|
99
|
+
*
|
|
100
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
101
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
102
|
+
*
|
|
43
103
|
* @throws {@link Courier.BadRequestError}
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* await courier.users.tokens.list("string")
|
|
44
107
|
*/
|
|
45
108
|
list(userId: string, requestOptions?: Tokens.RequestOptions): Promise<Courier.users.GetAllTokensResponse>;
|
|
46
109
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
@@ -41,28 +41,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
41
|
exports.Tokens = void 0;
|
|
42
42
|
const environments = __importStar(require("../../../../../../environments"));
|
|
43
43
|
const core = __importStar(require("../../../../../../core"));
|
|
44
|
-
const Courier = __importStar(require("
|
|
44
|
+
const Courier = __importStar(require("../../../../../index"));
|
|
45
45
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
|
-
const errors = __importStar(require("../../../../../../errors"));
|
|
46
|
+
const errors = __importStar(require("../../../../../../errors/index"));
|
|
47
47
|
class Tokens {
|
|
48
48
|
constructor(_options = {}) {
|
|
49
49
|
this._options = _options;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Adds multiple tokens to a user and overwrites matching existing tokens.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
55
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
53
57
|
* @throws {@link Courier.BadRequestError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await courier.users.tokens.addMultiple("string")
|
|
54
61
|
*/
|
|
55
62
|
addMultiple(userId, requestOptions) {
|
|
56
63
|
var _a, _b;
|
|
57
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
65
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
59
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${userId}/tokens`),
|
|
66
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens`),
|
|
60
67
|
method: "PUT",
|
|
61
68
|
headers: {
|
|
62
69
|
Authorization: yield this._getAuthorizationHeader(),
|
|
63
70
|
"X-Fern-Language": "JavaScript",
|
|
64
71
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
65
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
72
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
73
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
74
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
66
75
|
},
|
|
67
76
|
contentType: "application/json",
|
|
68
77
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -99,19 +108,51 @@ class Tokens {
|
|
|
99
108
|
}
|
|
100
109
|
/**
|
|
101
110
|
* Adds a single token to a user and overwrites a matching existing token.
|
|
111
|
+
*
|
|
112
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
113
|
+
* @param {string} token - The full token string.
|
|
114
|
+
* @param {Courier.users.UserToken} request
|
|
115
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
116
|
+
*
|
|
102
117
|
* @throws {@link Courier.BadRequestError}
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* await courier.users.tokens.add("string", "string", {
|
|
121
|
+
* token: "string",
|
|
122
|
+
* provider_key: Courier.users.ProviderKey.FirebaseFcm,
|
|
123
|
+
* expiry_date: "string",
|
|
124
|
+
* properties: {
|
|
125
|
+
* "key": "value"
|
|
126
|
+
* },
|
|
127
|
+
* device: {
|
|
128
|
+
* app_id: "string",
|
|
129
|
+
* ad_id: "string",
|
|
130
|
+
* device_id: "string",
|
|
131
|
+
* platform: "string",
|
|
132
|
+
* manufacturer: "string",
|
|
133
|
+
* model: "string"
|
|
134
|
+
* },
|
|
135
|
+
* tracking: {
|
|
136
|
+
* os_version: "string",
|
|
137
|
+
* ip: "string",
|
|
138
|
+
* lat: "string",
|
|
139
|
+
* long: "string"
|
|
140
|
+
* }
|
|
141
|
+
* })
|
|
103
142
|
*/
|
|
104
143
|
add(userId, token, request, requestOptions) {
|
|
105
144
|
var _a, _b;
|
|
106
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
146
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
108
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${userId}/tokens/${token}`),
|
|
147
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens/${encodeURIComponent(token)}`),
|
|
109
148
|
method: "PUT",
|
|
110
149
|
headers: {
|
|
111
150
|
Authorization: yield this._getAuthorizationHeader(),
|
|
112
151
|
"X-Fern-Language": "JavaScript",
|
|
113
152
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
114
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
153
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
154
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
155
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
115
156
|
},
|
|
116
157
|
contentType: "application/json",
|
|
117
158
|
body: request,
|
|
@@ -149,19 +190,32 @@ class Tokens {
|
|
|
149
190
|
}
|
|
150
191
|
/**
|
|
151
192
|
* Apply a JSON Patch (RFC 6902) to the specified token.
|
|
193
|
+
*
|
|
194
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
195
|
+
* @param {string} token - The full token string.
|
|
196
|
+
* @param {Courier.users.PatchUserTokenOpts} request
|
|
197
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
|
+
*
|
|
152
199
|
* @throws {@link Courier.BadRequestError}
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* await courier.users.tokens.update("string", "string", {
|
|
203
|
+
* patch: [{}]
|
|
204
|
+
* })
|
|
153
205
|
*/
|
|
154
206
|
update(userId, token, request, requestOptions) {
|
|
155
207
|
var _a, _b;
|
|
156
208
|
return __awaiter(this, void 0, void 0, function* () {
|
|
157
209
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
158
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${userId}/tokens/${token}`),
|
|
210
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens/${encodeURIComponent(token)}`),
|
|
159
211
|
method: "PATCH",
|
|
160
212
|
headers: {
|
|
161
213
|
Authorization: yield this._getAuthorizationHeader(),
|
|
162
214
|
"X-Fern-Language": "JavaScript",
|
|
163
215
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
164
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
216
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
217
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
218
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
165
219
|
},
|
|
166
220
|
contentType: "application/json",
|
|
167
221
|
body: request,
|
|
@@ -199,19 +253,29 @@ class Tokens {
|
|
|
199
253
|
}
|
|
200
254
|
/**
|
|
201
255
|
* Get single token available for a `:token`
|
|
256
|
+
*
|
|
257
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
258
|
+
* @param {string} token - The full token string.
|
|
259
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
260
|
+
*
|
|
202
261
|
* @throws {@link Courier.BadRequestError}
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* await courier.users.tokens.get("string", "string")
|
|
203
265
|
*/
|
|
204
266
|
get(userId, token, requestOptions) {
|
|
205
267
|
var _a, _b;
|
|
206
268
|
return __awaiter(this, void 0, void 0, function* () {
|
|
207
269
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
208
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${userId}/tokens/${token}`),
|
|
270
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens/${encodeURIComponent(token)}`),
|
|
209
271
|
method: "GET",
|
|
210
272
|
headers: {
|
|
211
273
|
Authorization: yield this._getAuthorizationHeader(),
|
|
212
274
|
"X-Fern-Language": "JavaScript",
|
|
213
275
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
214
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
276
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
277
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
278
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
215
279
|
},
|
|
216
280
|
contentType: "application/json",
|
|
217
281
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -248,19 +312,28 @@ class Tokens {
|
|
|
248
312
|
}
|
|
249
313
|
/**
|
|
250
314
|
* Gets all tokens available for a :user_id
|
|
315
|
+
*
|
|
316
|
+
* @param {string} userId - The user's ID. This can be any uniquely identifiable string.
|
|
317
|
+
* @param {Tokens.RequestOptions} requestOptions - Request-specific configuration.
|
|
318
|
+
*
|
|
251
319
|
* @throws {@link Courier.BadRequestError}
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* await courier.users.tokens.list("string")
|
|
252
323
|
*/
|
|
253
324
|
list(userId, requestOptions) {
|
|
254
325
|
var _a, _b;
|
|
255
326
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
327
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
257
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${userId}/tokens`),
|
|
328
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens`),
|
|
258
329
|
method: "GET",
|
|
259
330
|
headers: {
|
|
260
331
|
Authorization: yield this._getAuthorizationHeader(),
|
|
261
332
|
"X-Fern-Language": "JavaScript",
|
|
262
333
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
263
|
-
"X-Fern-SDK-Version": "v6.1.
|
|
334
|
+
"X-Fern-SDK-Version": "v6.1.2",
|
|
335
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
336
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
264
337
|
},
|
|
265
338
|
contentType: "application/json",
|
|
266
339
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -298,7 +371,7 @@ class Tokens {
|
|
|
298
371
|
_getAuthorizationHeader() {
|
|
299
372
|
var _a;
|
|
300
373
|
return __awaiter(this, void 0, void 0, function* () {
|
|
301
|
-
const bearer = (_a = (yield core.Supplier.get(this._options.authorizationToken))) !== null && _a !== void 0 ? _a : process.env["COURIER_AUTH_TOKEN"];
|
|
374
|
+
const bearer = (_a = (yield core.Supplier.get(this._options.authorizationToken))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["COURIER_AUTH_TOKEN"];
|
|
302
375
|
if (bearer == null) {
|
|
303
376
|
throw new errors.CourierError({
|
|
304
377
|
message: "Please specify COURIER_AUTH_TOKEN when instantiating the client.",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Courier from "
|
|
4
|
+
import * as Courier from "../../../../../index";
|
|
5
5
|
export interface GetUserTokenResponse extends Courier.users.UserToken {
|
|
6
6
|
status?: Courier.users.TokenStatus;
|
|
7
7
|
/** The reason for the token status. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Courier from "
|
|
4
|
+
import * as Courier from "../../../../../index";
|
|
5
5
|
export interface UserToken {
|
|
6
6
|
/** Full body of the token. Must match token in URL. */
|
|
7
7
|
token?: string;
|