@trycourier/courier 6.3.1 → 6.4.1
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 +49 -108
- package/Client.js +89 -148
- package/README.md +113 -808
- package/api/client/requests/SendMessageRequest.d.ts +8 -76
- package/api/resources/audiences/client/Client.d.ts +26 -21
- package/api/resources/audiences/client/Client.js +97 -90
- package/api/resources/audiences/client/requests/AudienceMembersListParams.d.ts +1 -3
- package/api/resources/audiences/client/requests/AudienceUpdateParams.d.ts +3 -7
- package/api/resources/audiences/client/requests/AudiencesListParams.d.ts +1 -3
- package/api/resources/audiences/types/ComparisonOperator.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/LogicalOperator.d.ts +1 -1
- package/api/resources/audiences/types/Operator.d.ts +1 -1
- package/api/resources/auditEvents/client/Client.d.ts +14 -6
- package/api/resources/auditEvents/client/Client.js +48 -38
- package/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +1 -3
- package/api/resources/authTokens/client/Client.d.ts +13 -4
- package/api/resources/authTokens/client/Client.js +35 -26
- package/api/resources/authTokens/client/requests/IssueTokenParams.d.ts +2 -2
- package/api/resources/automations/client/Client.d.ts +19 -15
- package/api/resources/automations/client/Client.js +52 -50
- package/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +1 -1
- package/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +1 -1
- package/api/resources/automations/types/AutomationAddToBatchScope.d.ts +1 -1
- package/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +1 -1
- package/api/resources/automations/types/AutomationStepOption.d.ts +1 -1
- package/api/resources/automations/types/AutomationThrottleScope.d.ts +1 -1
- package/api/resources/automations/types/MergeAlgorithm.d.ts +1 -1
- package/api/resources/automations/types/Profile.d.ts +1 -1
- package/api/resources/brands/client/Client.d.ts +32 -63
- package/api/resources/brands/client/Client.js +103 -134
- package/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +3 -26
- package/api/resources/brands/client/requests/ListBrandsRequest.d.ts +1 -3
- package/api/resources/bulk/client/Client.d.ts +40 -126
- package/api/resources/bulk/client/Client.js +111 -201
- package/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +6 -86
- package/api/resources/bulk/client/requests/BulkGetUsersParams.d.ts +1 -3
- package/api/resources/bulk/types/BulkJobStatus.d.ts +1 -1
- package/api/resources/bulk/types/BulkJobUserStatus.d.ts +1 -1
- package/api/resources/bulk/types/InboundBulkMessageV2.d.ts +3 -5
- package/api/resources/commons/errors/AlreadyExistsError.d.ts +2 -1
- package/api/resources/commons/errors/AlreadyExistsError.js +19 -8
- package/api/resources/commons/errors/BadRequestError.d.ts +2 -1
- package/api/resources/commons/errors/BadRequestError.js +19 -8
- package/api/resources/commons/errors/ConflictError.d.ts +2 -1
- package/api/resources/commons/errors/ConflictError.js +19 -8
- package/api/resources/commons/errors/MessageNotFoundError.d.ts +2 -1
- package/api/resources/commons/errors/MessageNotFoundError.js +19 -8
- package/api/resources/commons/errors/NotFoundError.d.ts +2 -1
- package/api/resources/commons/errors/NotFoundError.js +19 -8
- package/api/resources/commons/errors/PaymentRequiredError.d.ts +2 -1
- package/api/resources/commons/errors/PaymentRequiredError.js +19 -8
- package/api/resources/commons/types/ChannelClassification.d.ts +1 -1
- package/api/resources/commons/types/NotificationPreferences.d.ts +1 -1
- package/api/resources/commons/types/PreferenceStatus.d.ts +1 -1
- package/api/resources/inbound/client/Client.d.ts +11 -2
- package/api/resources/inbound/client/Client.js +35 -24
- package/api/resources/index.js +17 -7
- package/api/resources/lists/client/Client.d.ts +51 -44
- package/api/resources/lists/client/Client.js +181 -174
- package/api/resources/lists/client/requests/AddSubscribersToList.d.ts +5 -5
- package/api/resources/lists/client/requests/GetAllListsRequest.d.ts +1 -4
- package/api/resources/lists/client/requests/GetSubscriptionForListRequest.d.ts +1 -3
- package/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +1 -4
- package/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +5 -5
- package/api/resources/messages/client/Client.d.ts +26 -29
- package/api/resources/messages/client/Client.js +111 -114
- package/api/resources/messages/client/requests/GetMessageHistoryRequest.d.ts +1 -3
- package/api/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -16
- package/api/resources/messages/types/MessageDetailsExtended.d.ts +7 -0
- package/api/resources/messages/types/MessageDetailsExtended.js +5 -0
- package/api/resources/messages/types/MessageStatus.d.ts +25 -5
- package/api/resources/messages/types/MessageStatus.js +6 -1
- package/api/resources/messages/types/Reason.d.ts +1 -1
- package/api/resources/messages/types/index.d.ts +1 -0
- package/api/resources/messages/types/index.js +1 -0
- package/api/resources/notifications/client/Client.d.ts +32 -17
- package/api/resources/notifications/client/Client.js +119 -93
- package/api/resources/notifications/client/requests/NotificationListParams.d.ts +1 -4
- package/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.d.ts +6 -2
- package/api/resources/notifications/types/BlockType.d.ts +1 -1
- package/api/resources/notifications/types/CheckStatus.d.ts +1 -1
- package/api/resources/notifications/types/MessageRoutingChannel.d.ts +1 -1
- package/api/resources/notifications/types/MessageRoutingMethod.d.ts +1 -1
- package/api/resources/notifications/types/NotificationContent.d.ts +1 -1
- package/api/resources/profiles/client/Client.d.ts +50 -30
- package/api/resources/profiles/client/Client.js +160 -139
- package/api/resources/profiles/client/requests/GetListSubscriptionsRequest.d.ts +1 -3
- package/api/resources/profiles/client/requests/MergeProfileRequest.d.ts +1 -1
- package/api/resources/profiles/client/requests/ReplaceProfileRequest.d.ts +1 -1
- package/api/resources/profiles/types/DeviceType.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/MsTeams.d.ts +1 -1
- package/api/resources/profiles/types/ProfileUpdateRequest.d.ts +8 -0
- package/api/resources/profiles/types/ProfileUpdateRequest.js +5 -0
- package/api/resources/profiles/types/Slack.d.ts +1 -1
- package/api/resources/profiles/types/SnoozeRuleType.d.ts +1 -1
- package/api/resources/profiles/types/UserProfileFirebaseToken.d.ts +1 -1
- package/api/resources/profiles/types/WebhookAuthMode.d.ts +1 -1
- package/api/resources/profiles/types/WebhookMethod.d.ts +1 -1
- package/api/resources/profiles/types/WebhookProfileType.d.ts +1 -1
- package/api/resources/profiles/types/index.d.ts +1 -0
- package/api/resources/profiles/types/index.js +1 -0
- package/api/resources/send/types/Attachment.d.ts +1 -1
- package/api/resources/send/types/ChannelSource.d.ts +1 -1
- package/api/resources/send/types/Content.d.ts +1 -1
- package/api/resources/send/types/Criteria.d.ts +1 -1
- package/api/resources/send/types/ElementalNode.d.ts +1 -1
- package/api/resources/send/types/ExpiresInType.d.ts +1 -1
- package/api/resources/send/types/IActionButtonStyle.d.ts +1 -1
- package/api/resources/send/types/IAlignment.d.ts +1 -1
- package/api/resources/send/types/IPreferences.d.ts +1 -1
- package/api/resources/send/types/InAppPlacement.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/MessageChannels.d.ts +1 -1
- package/api/resources/send/types/MessageData.d.ts +1 -1
- package/api/resources/send/types/MessageProviders.d.ts +1 -1
- package/api/resources/send/types/MessageRecipient.d.ts +1 -1
- package/api/resources/send/types/Recipient.d.ts +1 -1
- package/api/resources/send/types/RecipientData.d.ts +1 -1
- package/api/resources/send/types/RoutingChannel.d.ts +1 -1
- package/api/resources/send/types/RoutingMethod.d.ts +1 -1
- package/api/resources/send/types/RuleType.d.ts +1 -1
- package/api/resources/send/types/TextAlign.d.ts +1 -1
- package/api/resources/send/types/TextStyle.d.ts +1 -1
- package/api/resources/templates/client/Client.d.ts +11 -4
- package/api/resources/templates/client/Client.js +34 -25
- package/api/resources/templates/client/requests/ListTemplatesRequest.d.ts +1 -3
- package/api/resources/templates/types/ChannelIdentifier.d.ts +1 -1
- package/api/resources/templates/types/RoutingStrategyMethod.d.ts +1 -1
- package/api/resources/tenants/client/Client.d.ts +37 -44
- package/api/resources/tenants/client/Client.js +130 -135
- package/api/resources/tenants/client/requests/ListTenantParams.d.ts +1 -5
- package/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +1 -4
- package/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -21
- package/api/resources/tenants/types/SubscriptionTopicStatus.d.ts +1 -1
- package/api/resources/tenants/types/TemplateProperty.d.ts +1 -1
- package/api/resources/translations/client/Client.d.ts +14 -4
- package/api/resources/translations/client/Client.js +49 -37
- package/api/resources/users/client/Client.d.ts +5 -7
- package/api/resources/users/resources/index.js +17 -7
- package/api/resources/users/resources/preferences/client/Client.d.ts +19 -12
- package/api/resources/users/resources/preferences/client/Client.js +77 -59
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +1 -3
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +1 -3
- package/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +2 -2
- package/api/resources/users/resources/tenants/client/Client.d.ts +33 -26
- package/api/resources/users/resources/tenants/client/Client.js +104 -92
- package/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts +9 -8
- package/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts +1 -5
- package/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +1 -4
- package/api/resources/users/resources/tokens/client/Client.d.ts +39 -35
- package/api/resources/users/resources/tokens/client/Client.js +121 -115
- package/api/resources/users/resources/tokens/types/ExpiryDate.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/GetAllTokensResponse.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/PatchOp.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/ProviderKey.d.ts +1 -1
- package/api/resources/users/resources/tokens/types/TokenStatus.d.ts +1 -1
- package/core/auth/BearerToken.d.ts +1 -1
- package/core/fetcher/APIResponse.d.ts +11 -1
- package/core/fetcher/Fetcher.d.ts +7 -3
- package/core/fetcher/Fetcher.js +37 -135
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +12 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +68 -0
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +54 -0
- package/core/fetcher/index.d.ts +3 -0
- package/core/fetcher/index.js +7 -1
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +40 -0
- package/core/fetcher/signals.d.ts +11 -0
- package/core/fetcher/signals.js +36 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +57 -36
- package/dist/Client.d.ts +49 -108
- package/dist/Client.js +89 -148
- package/dist/api/client/requests/SendMessageRequest.d.ts +8 -76
- package/dist/api/resources/audiences/client/Client.d.ts +26 -21
- package/dist/api/resources/audiences/client/Client.js +97 -90
- package/dist/api/resources/audiences/client/requests/AudienceMembersListParams.d.ts +1 -3
- package/dist/api/resources/audiences/client/requests/AudienceUpdateParams.d.ts +3 -7
- package/dist/api/resources/audiences/client/requests/AudiencesListParams.d.ts +1 -3
- package/dist/api/resources/audiences/types/ComparisonOperator.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/LogicalOperator.d.ts +1 -1
- package/dist/api/resources/audiences/types/Operator.d.ts +1 -1
- package/dist/api/resources/auditEvents/client/Client.d.ts +14 -6
- package/dist/api/resources/auditEvents/client/Client.js +48 -38
- package/dist/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +1 -3
- package/dist/api/resources/authTokens/client/Client.d.ts +13 -4
- package/dist/api/resources/authTokens/client/Client.js +35 -26
- package/dist/api/resources/authTokens/client/requests/IssueTokenParams.d.ts +2 -2
- package/dist/api/resources/automations/client/Client.d.ts +19 -15
- package/dist/api/resources/automations/client/Client.js +52 -50
- package/dist/api/resources/automations/types/AutomationAddToBatchMaxItemsType.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationAddToBatchRetainType.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationAddToBatchScope.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationFetchDataWebhookMethod.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationStepOption.d.ts +1 -1
- package/dist/api/resources/automations/types/AutomationThrottleScope.d.ts +1 -1
- package/dist/api/resources/automations/types/MergeAlgorithm.d.ts +1 -1
- package/dist/api/resources/automations/types/Profile.d.ts +1 -1
- package/dist/api/resources/brands/client/Client.d.ts +32 -63
- package/dist/api/resources/brands/client/Client.js +103 -134
- package/dist/api/resources/brands/client/requests/BrandUpdateParameters.d.ts +3 -26
- package/dist/api/resources/brands/client/requests/ListBrandsRequest.d.ts +1 -3
- package/dist/api/resources/bulk/client/Client.d.ts +40 -126
- package/dist/api/resources/bulk/client/Client.js +111 -201
- package/dist/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +6 -86
- package/dist/api/resources/bulk/client/requests/BulkGetUsersParams.d.ts +1 -3
- package/dist/api/resources/bulk/types/BulkJobStatus.d.ts +1 -1
- package/dist/api/resources/bulk/types/BulkJobUserStatus.d.ts +1 -1
- package/dist/api/resources/bulk/types/InboundBulkMessageV2.d.ts +3 -5
- package/dist/api/resources/commons/errors/AlreadyExistsError.d.ts +2 -1
- package/dist/api/resources/commons/errors/AlreadyExistsError.js +19 -8
- package/dist/api/resources/commons/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/commons/errors/BadRequestError.js +19 -8
- package/dist/api/resources/commons/errors/ConflictError.d.ts +2 -1
- package/dist/api/resources/commons/errors/ConflictError.js +19 -8
- package/dist/api/resources/commons/errors/MessageNotFoundError.d.ts +2 -1
- package/dist/api/resources/commons/errors/MessageNotFoundError.js +19 -8
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +2 -1
- package/dist/api/resources/commons/errors/NotFoundError.js +19 -8
- package/dist/api/resources/commons/errors/PaymentRequiredError.d.ts +2 -1
- package/dist/api/resources/commons/errors/PaymentRequiredError.js +19 -8
- package/dist/api/resources/commons/types/ChannelClassification.d.ts +1 -1
- package/dist/api/resources/commons/types/NotificationPreferences.d.ts +1 -1
- package/dist/api/resources/commons/types/PreferenceStatus.d.ts +1 -1
- package/dist/api/resources/inbound/client/Client.d.ts +11 -2
- package/dist/api/resources/inbound/client/Client.js +35 -24
- package/dist/api/resources/index.js +17 -7
- package/dist/api/resources/lists/client/Client.d.ts +51 -44
- package/dist/api/resources/lists/client/Client.js +181 -174
- package/dist/api/resources/lists/client/requests/AddSubscribersToList.d.ts +5 -5
- package/dist/api/resources/lists/client/requests/GetAllListsRequest.d.ts +1 -4
- package/dist/api/resources/lists/client/requests/GetSubscriptionForListRequest.d.ts +1 -3
- package/dist/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +1 -4
- package/dist/api/resources/lists/client/requests/SubscribeUsersToListRequest.d.ts +5 -5
- package/dist/api/resources/messages/client/Client.d.ts +26 -29
- package/dist/api/resources/messages/client/Client.js +111 -114
- package/dist/api/resources/messages/client/requests/GetMessageHistoryRequest.d.ts +1 -3
- package/dist/api/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -16
- package/dist/api/resources/messages/types/MessageDetailsExtended.d.ts +7 -0
- package/dist/api/resources/messages/types/MessageDetailsExtended.js +5 -0
- package/dist/api/resources/messages/types/MessageStatus.d.ts +25 -5
- package/dist/api/resources/messages/types/MessageStatus.js +6 -1
- package/dist/api/resources/messages/types/Reason.d.ts +1 -1
- package/dist/api/resources/messages/types/index.d.ts +1 -0
- package/dist/api/resources/messages/types/index.js +1 -0
- package/dist/api/resources/notifications/client/Client.d.ts +32 -17
- package/dist/api/resources/notifications/client/Client.js +119 -93
- package/dist/api/resources/notifications/client/requests/NotificationListParams.d.ts +1 -4
- package/dist/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.d.ts +6 -2
- package/dist/api/resources/notifications/types/BlockType.d.ts +1 -1
- package/dist/api/resources/notifications/types/CheckStatus.d.ts +1 -1
- package/dist/api/resources/notifications/types/MessageRoutingChannel.d.ts +1 -1
- package/dist/api/resources/notifications/types/MessageRoutingMethod.d.ts +1 -1
- package/dist/api/resources/notifications/types/NotificationContent.d.ts +1 -1
- package/dist/api/resources/profiles/client/Client.d.ts +50 -30
- package/dist/api/resources/profiles/client/Client.js +160 -139
- package/dist/api/resources/profiles/client/requests/GetListSubscriptionsRequest.d.ts +1 -3
- package/dist/api/resources/profiles/client/requests/MergeProfileRequest.d.ts +1 -1
- package/dist/api/resources/profiles/client/requests/ReplaceProfileRequest.d.ts +1 -1
- package/dist/api/resources/profiles/types/DeviceType.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/MsTeams.d.ts +1 -1
- package/dist/api/resources/profiles/types/ProfileUpdateRequest.d.ts +8 -0
- package/dist/api/resources/profiles/types/ProfileUpdateRequest.js +5 -0
- package/dist/api/resources/profiles/types/Slack.d.ts +1 -1
- package/dist/api/resources/profiles/types/SnoozeRuleType.d.ts +1 -1
- package/dist/api/resources/profiles/types/UserProfileFirebaseToken.d.ts +1 -1
- package/dist/api/resources/profiles/types/WebhookAuthMode.d.ts +1 -1
- package/dist/api/resources/profiles/types/WebhookMethod.d.ts +1 -1
- package/dist/api/resources/profiles/types/WebhookProfileType.d.ts +1 -1
- package/dist/api/resources/profiles/types/index.d.ts +1 -0
- package/dist/api/resources/profiles/types/index.js +1 -0
- package/dist/api/resources/send/types/Attachment.d.ts +1 -1
- package/dist/api/resources/send/types/ChannelSource.d.ts +1 -1
- package/dist/api/resources/send/types/Content.d.ts +1 -1
- package/dist/api/resources/send/types/Criteria.d.ts +1 -1
- package/dist/api/resources/send/types/ElementalNode.d.ts +1 -1
- package/dist/api/resources/send/types/ExpiresInType.d.ts +1 -1
- package/dist/api/resources/send/types/IActionButtonStyle.d.ts +1 -1
- package/dist/api/resources/send/types/IAlignment.d.ts +1 -1
- package/dist/api/resources/send/types/IPreferences.d.ts +1 -1
- package/dist/api/resources/send/types/InAppPlacement.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/MessageChannels.d.ts +1 -1
- package/dist/api/resources/send/types/MessageData.d.ts +1 -1
- package/dist/api/resources/send/types/MessageProviders.d.ts +1 -1
- package/dist/api/resources/send/types/MessageRecipient.d.ts +1 -1
- package/dist/api/resources/send/types/Recipient.d.ts +1 -1
- package/dist/api/resources/send/types/RecipientData.d.ts +1 -1
- package/dist/api/resources/send/types/RoutingChannel.d.ts +1 -1
- package/dist/api/resources/send/types/RoutingMethod.d.ts +1 -1
- package/dist/api/resources/send/types/RuleType.d.ts +1 -1
- package/dist/api/resources/send/types/TextAlign.d.ts +1 -1
- package/dist/api/resources/send/types/TextStyle.d.ts +1 -1
- package/dist/api/resources/templates/client/Client.d.ts +11 -4
- package/dist/api/resources/templates/client/Client.js +34 -25
- package/dist/api/resources/templates/client/requests/ListTemplatesRequest.d.ts +1 -3
- package/dist/api/resources/templates/types/ChannelIdentifier.d.ts +1 -1
- package/dist/api/resources/templates/types/RoutingStrategyMethod.d.ts +1 -1
- package/dist/api/resources/tenants/client/Client.d.ts +37 -44
- package/dist/api/resources/tenants/client/Client.js +130 -135
- package/dist/api/resources/tenants/client/requests/ListTenantParams.d.ts +1 -5
- package/dist/api/resources/tenants/client/requests/ListUsersForTenantParams.d.ts +1 -4
- package/dist/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts +6 -21
- package/dist/api/resources/tenants/types/SubscriptionTopicStatus.d.ts +1 -1
- package/dist/api/resources/tenants/types/TemplateProperty.d.ts +1 -1
- package/dist/api/resources/translations/client/Client.d.ts +14 -4
- package/dist/api/resources/translations/client/Client.js +49 -37
- package/dist/api/resources/users/client/Client.d.ts +5 -7
- package/dist/api/resources/users/resources/index.js +17 -7
- package/dist/api/resources/users/resources/preferences/client/Client.d.ts +19 -12
- package/dist/api/resources/users/resources/preferences/client/Client.js +77 -59
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesParams.d.ts +1 -3
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesTopicParams.d.ts +1 -3
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts +2 -2
- package/dist/api/resources/users/resources/tenants/client/Client.d.ts +33 -26
- package/dist/api/resources/users/resources/tenants/client/Client.js +104 -92
- package/dist/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts +9 -8
- package/dist/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts +1 -5
- package/dist/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +1 -4
- package/dist/api/resources/users/resources/tokens/client/Client.d.ts +39 -35
- package/dist/api/resources/users/resources/tokens/client/Client.js +121 -115
- package/dist/api/resources/users/resources/tokens/types/ExpiryDate.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/GetAllTokensResponse.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/PatchOp.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/ProviderKey.d.ts +1 -1
- package/dist/api/resources/users/resources/tokens/types/TokenStatus.d.ts +1 -1
- package/dist/core/auth/BearerToken.d.ts +1 -1
- package/dist/core/fetcher/APIResponse.d.ts +11 -1
- package/dist/core/fetcher/Fetcher.d.ts +7 -3
- package/dist/core/fetcher/Fetcher.js +37 -135
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/index.d.ts +3 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.d.ts +11 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +57 -36
- package/dist/environments.d.ts +1 -1
- package/dist/errors/CourierError.d.ts +4 -1
- package/dist/errors/CourierError.js +6 -8
- package/dist/errors/CourierTimeoutError.d.ts +1 -1
- package/dist/errors/CourierTimeoutError.js +2 -2
- package/dist/index.js +17 -7
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/environments.d.ts +1 -1
- package/errors/CourierError.d.ts +4 -1
- package/errors/CourierError.js +6 -8
- package/errors/CourierTimeoutError.d.ts +1 -1
- package/errors/CourierTimeoutError.js +2 -2
- package/index.js +17 -7
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +25 -15
- package/reference.md +5142 -0
- package/scripts/rename-to-esm-files.js +115 -0
- package/version.d.ts +1 -0
- package/version.js +4 -0
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Courier from "../../../index";
|
|
5
|
-
export
|
|
5
|
+
export type InboundBulkMessageV2 =
|
|
6
6
|
/**
|
|
7
7
|
* Describes the content of the message in a way that will
|
|
8
|
-
* work for email, push, chat, or any channel.
|
|
9
|
-
* */
|
|
8
|
+
* work for email, push, chat, or any channel. */
|
|
10
9
|
Courier.InboundBulkTemplateMessage
|
|
11
10
|
/**
|
|
12
11
|
* A template for a type of message that can be sent more than once.
|
|
13
12
|
* For example, you might create an "Appointment Reminder" Notification or
|
|
14
|
-
* “Reset Password” Notifications.
|
|
15
|
-
* */
|
|
13
|
+
* “Reset Password” Notifications. */
|
|
16
14
|
| Courier.InboundBulkContentMessage;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
5
|
import * as Courier from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
6
7
|
export declare class AlreadyExistsError extends errors.CourierError {
|
|
7
|
-
constructor(body: Courier.AlreadyExists);
|
|
8
|
+
constructor(body: Courier.AlreadyExists, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -18,22 +18,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.AlreadyExistsError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../../../errors/index"));
|
|
31
41
|
class AlreadyExistsError extends errors.CourierError {
|
|
32
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
33
43
|
super({
|
|
34
44
|
message: "AlreadyExistsError",
|
|
35
45
|
statusCode: 409,
|
|
36
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
37
48
|
});
|
|
38
49
|
Object.setPrototypeOf(this, AlreadyExistsError.prototype);
|
|
39
50
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
5
|
import * as Courier from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
6
7
|
export declare class BadRequestError extends errors.CourierError {
|
|
7
|
-
constructor(body: Courier.BadRequest);
|
|
8
|
+
constructor(body: Courier.BadRequest, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -18,22 +18,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.BadRequestError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../../../errors/index"));
|
|
31
41
|
class BadRequestError extends errors.CourierError {
|
|
32
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
33
43
|
super({
|
|
34
44
|
message: "BadRequestError",
|
|
35
45
|
statusCode: 400,
|
|
36
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
37
48
|
});
|
|
38
49
|
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
39
50
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
5
|
import * as Courier from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
6
7
|
export declare class ConflictError extends errors.CourierError {
|
|
7
|
-
constructor(body: Courier.Conflict);
|
|
8
|
+
constructor(body: Courier.Conflict, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -18,22 +18,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.ConflictError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../../../errors/index"));
|
|
31
41
|
class ConflictError extends errors.CourierError {
|
|
32
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
33
43
|
super({
|
|
34
44
|
message: "ConflictError",
|
|
35
45
|
statusCode: 409,
|
|
36
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
37
48
|
});
|
|
38
49
|
Object.setPrototypeOf(this, ConflictError.prototype);
|
|
39
50
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
5
|
import * as Courier from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
6
7
|
export declare class MessageNotFoundError extends errors.CourierError {
|
|
7
|
-
constructor(body: Courier.MessageNotFound);
|
|
8
|
+
constructor(body: Courier.MessageNotFound, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -18,22 +18,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.MessageNotFoundError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../../../errors/index"));
|
|
31
41
|
class MessageNotFoundError extends errors.CourierError {
|
|
32
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
33
43
|
super({
|
|
34
44
|
message: "MessageNotFoundError",
|
|
35
45
|
statusCode: 404,
|
|
36
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
37
48
|
});
|
|
38
49
|
Object.setPrototypeOf(this, MessageNotFoundError.prototype);
|
|
39
50
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
5
|
import * as Courier from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
6
7
|
export declare class NotFoundError extends errors.CourierError {
|
|
7
|
-
constructor(body: Courier.NotFound);
|
|
8
|
+
constructor(body: Courier.NotFound, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -18,22 +18,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.NotFoundError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../../../errors/index"));
|
|
31
41
|
class NotFoundError extends errors.CourierError {
|
|
32
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
33
43
|
super({
|
|
34
44
|
message: "NotFoundError",
|
|
35
45
|
statusCode: 404,
|
|
36
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
37
48
|
});
|
|
38
49
|
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
39
50
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
5
|
import * as Courier from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
6
7
|
export declare class PaymentRequiredError extends errors.CourierError {
|
|
7
|
-
constructor(body: Courier.PaymentRequired);
|
|
8
|
+
constructor(body: Courier.PaymentRequired, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -18,22 +18,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.PaymentRequiredError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../../../errors/index"));
|
|
31
41
|
class PaymentRequiredError extends errors.CourierError {
|
|
32
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
33
43
|
super({
|
|
34
44
|
message: "PaymentRequiredError",
|
|
35
45
|
statusCode: 402,
|
|
36
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
37
48
|
});
|
|
38
49
|
Object.setPrototypeOf(this, PaymentRequiredError.prototype);
|
|
39
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type ChannelClassification = "direct_message" | "email" | "push" | "sms" | "webhook" | "inbox";
|
|
5
5
|
export declare const ChannelClassification: {
|
|
6
6
|
readonly DirectMessage: "direct_message";
|
|
7
7
|
readonly Email: "email";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Courier from "../../../index";
|
|
5
|
-
export
|
|
5
|
+
export type NotificationPreferences = Record<string, Courier.NotificationPreferenceDetails>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type PreferenceStatus = "OPTED_IN" | "OPTED_OUT" | "REQUIRED";
|
|
5
5
|
export declare const PreferenceStatus: {
|
|
6
6
|
readonly OptedIn: "OPTED_IN";
|
|
7
7
|
readonly OptedOut: "OPTED_OUT";
|
|
@@ -7,12 +7,20 @@ import * as Courier from "../../../index";
|
|
|
7
7
|
export declare namespace Inbound {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
13
15
|
interface RequestOptions {
|
|
16
|
+
/** The maximum time to wait for a response in seconds. */
|
|
14
17
|
timeoutInSeconds?: number;
|
|
18
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
15
19
|
maxRetries?: number;
|
|
20
|
+
/** A hook to abort the request. */
|
|
21
|
+
abortSignal?: AbortSignal;
|
|
22
|
+
/** Additional headers to include in the request. */
|
|
23
|
+
headers?: Record<string, string>;
|
|
16
24
|
}
|
|
17
25
|
}
|
|
18
26
|
export declare class Inbound {
|
|
@@ -26,7 +34,7 @@ export declare class Inbound {
|
|
|
26
34
|
* @throws {@link Courier.ConflictError}
|
|
27
35
|
*
|
|
28
36
|
* @example
|
|
29
|
-
* await
|
|
37
|
+
* await client.inbound.track({
|
|
30
38
|
* event: "New Order Placed",
|
|
31
39
|
* messageId: "4c62c457-b329-4bea-9bfc-17bba86c393f",
|
|
32
40
|
* userId: "1234",
|
|
@@ -38,6 +46,7 @@ export declare class Inbound {
|
|
|
38
46
|
* }
|
|
39
47
|
* })
|
|
40
48
|
*/
|
|
41
|
-
track(request: Courier.InboundTrackEvent, requestOptions?: Inbound.RequestOptions):
|
|
49
|
+
track(request: Courier.InboundTrackEvent, requestOptions?: Inbound.RequestOptions): core.HttpResponsePromise<Courier.TrackAcceptedResponse>;
|
|
50
|
+
private __track;
|
|
42
51
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
43
52
|
}
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -56,7 +66,7 @@ class Inbound {
|
|
|
56
66
|
* @throws {@link Courier.ConflictError}
|
|
57
67
|
*
|
|
58
68
|
* @example
|
|
59
|
-
* await
|
|
69
|
+
* await client.inbound.track({
|
|
60
70
|
* event: "New Order Placed",
|
|
61
71
|
* messageId: "4c62c457-b329-4bea-9bfc-17bba86c393f",
|
|
62
72
|
* userId: "1234",
|
|
@@ -69,37 +79,36 @@ class Inbound {
|
|
|
69
79
|
* })
|
|
70
80
|
*/
|
|
71
81
|
track(request, requestOptions) {
|
|
72
|
-
|
|
82
|
+
return core.HttpResponsePromise.fromPromise(this.__track(request, requestOptions));
|
|
83
|
+
}
|
|
84
|
+
__track(request, requestOptions) {
|
|
73
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
var _a, _b, _c;
|
|
74
87
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
75
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
88
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, "/inbound/courier"),
|
|
76
89
|
method: "POST",
|
|
77
|
-
headers: {
|
|
78
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
79
|
-
"X-Fern-Language": "JavaScript",
|
|
80
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
81
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
82
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
83
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
84
|
-
},
|
|
90
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.1", "User-Agent": "@trycourier/courier/6.4.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
85
91
|
contentType: "application/json",
|
|
92
|
+
requestType: "json",
|
|
86
93
|
body: request,
|
|
87
94
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
88
95
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
96
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
89
97
|
});
|
|
90
98
|
if (_response.ok) {
|
|
91
|
-
return _response.body;
|
|
99
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
92
100
|
}
|
|
93
101
|
if (_response.error.reason === "status-code") {
|
|
94
102
|
switch (_response.error.statusCode) {
|
|
95
103
|
case 400:
|
|
96
|
-
throw new Courier.BadRequestError(_response.error.body);
|
|
104
|
+
throw new Courier.BadRequestError(_response.error.body, _response.rawResponse);
|
|
97
105
|
case 409:
|
|
98
|
-
throw new Courier.ConflictError(_response.error.body);
|
|
106
|
+
throw new Courier.ConflictError(_response.error.body, _response.rawResponse);
|
|
99
107
|
default:
|
|
100
108
|
throw new errors.CourierError({
|
|
101
109
|
statusCode: _response.error.statusCode,
|
|
102
110
|
body: _response.error.body,
|
|
111
|
+
rawResponse: _response.rawResponse,
|
|
103
112
|
});
|
|
104
113
|
}
|
|
105
114
|
}
|
|
@@ -108,23 +117,25 @@ class Inbound {
|
|
|
108
117
|
throw new errors.CourierError({
|
|
109
118
|
statusCode: _response.error.statusCode,
|
|
110
119
|
body: _response.error.rawBody,
|
|
120
|
+
rawResponse: _response.rawResponse,
|
|
111
121
|
});
|
|
112
122
|
case "timeout":
|
|
113
|
-
throw new errors.CourierTimeoutError();
|
|
123
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling POST /inbound/courier.");
|
|
114
124
|
case "unknown":
|
|
115
125
|
throw new errors.CourierError({
|
|
116
126
|
message: _response.error.errorMessage,
|
|
127
|
+
rawResponse: _response.rawResponse,
|
|
117
128
|
});
|
|
118
129
|
}
|
|
119
130
|
});
|
|
120
131
|
}
|
|
121
132
|
_getAuthorizationHeader() {
|
|
122
|
-
var _a;
|
|
123
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
var _a;
|
|
124
135
|
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"];
|
|
125
136
|
if (bearer == null) {
|
|
126
137
|
throw new errors.CourierError({
|
|
127
|
-
message: "Please specify
|
|
138
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a COURIER_AUTH_TOKEN environment variable",
|
|
128
139
|
});
|
|
129
140
|
}
|
|
130
141
|
return `Bearer ${bearer}`;
|
package/api/resources/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|