@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
|
@@ -7,12 +7,20 @@ import * as Courier from "../../../index";
|
|
|
7
7
|
export declare namespace Notifications {
|
|
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 Notifications {
|
|
@@ -23,37 +31,38 @@ export declare class Notifications {
|
|
|
23
31
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
32
|
*
|
|
25
33
|
* @example
|
|
26
|
-
* await
|
|
27
|
-
* cursor: "string",
|
|
28
|
-
* notes: true
|
|
29
|
-
* })
|
|
34
|
+
* await client.notifications.list()
|
|
30
35
|
*/
|
|
31
|
-
list(request?: Courier.NotificationListParams, requestOptions?: Notifications.RequestOptions):
|
|
36
|
+
list(request?: Courier.NotificationListParams, requestOptions?: Notifications.RequestOptions): core.HttpResponsePromise<Courier.NotificationListResponse>;
|
|
37
|
+
private __list;
|
|
32
38
|
/**
|
|
33
39
|
* @param {string} id
|
|
34
40
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
41
|
*
|
|
36
42
|
* @example
|
|
37
|
-
* await
|
|
43
|
+
* await client.notifications.getContent("id")
|
|
38
44
|
*/
|
|
39
|
-
getContent(id: string, requestOptions?: Notifications.RequestOptions):
|
|
45
|
+
getContent(id: string, requestOptions?: Notifications.RequestOptions): core.HttpResponsePromise<Courier.NotificationGetContentResponse>;
|
|
46
|
+
private __getContent;
|
|
40
47
|
/**
|
|
41
48
|
* @param {string} id
|
|
42
49
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
50
|
*
|
|
44
51
|
* @example
|
|
45
|
-
* await
|
|
52
|
+
* await client.notifications.getDraftContent("id")
|
|
46
53
|
*/
|
|
47
|
-
getDraftContent(id: string, requestOptions?: Notifications.RequestOptions):
|
|
54
|
+
getDraftContent(id: string, requestOptions?: Notifications.RequestOptions): core.HttpResponsePromise<Courier.NotificationGetContentResponse>;
|
|
55
|
+
private __getDraftContent;
|
|
48
56
|
/**
|
|
49
57
|
* @param {string} id
|
|
50
58
|
* @param {string} submissionId
|
|
51
59
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
60
|
*
|
|
53
61
|
* @example
|
|
54
|
-
* await
|
|
62
|
+
* await client.notifications.getSubmissionChecks("id", "submissionId")
|
|
55
63
|
*/
|
|
56
|
-
getSubmissionChecks(id: string, submissionId: string, requestOptions?: Notifications.RequestOptions):
|
|
64
|
+
getSubmissionChecks(id: string, submissionId: string, requestOptions?: Notifications.RequestOptions): core.HttpResponsePromise<Courier.SubmissionChecksGetResponse>;
|
|
65
|
+
private __getSubmissionChecks;
|
|
57
66
|
/**
|
|
58
67
|
* @param {string} id
|
|
59
68
|
* @param {string} submissionId
|
|
@@ -61,23 +70,29 @@ export declare class Notifications {
|
|
|
61
70
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
71
|
*
|
|
63
72
|
* @example
|
|
64
|
-
* await
|
|
73
|
+
* await client.notifications.replaceSubmissionChecks("id", "submissionId", {
|
|
65
74
|
* checks: [{
|
|
66
|
-
* id: "
|
|
67
|
-
* status:
|
|
75
|
+
* id: "id",
|
|
76
|
+
* status: "RESOLVED",
|
|
77
|
+
* type: "custom"
|
|
78
|
+
* }, {
|
|
79
|
+
* id: "id",
|
|
80
|
+
* status: "RESOLVED",
|
|
68
81
|
* type: "custom"
|
|
69
82
|
* }]
|
|
70
83
|
* })
|
|
71
84
|
*/
|
|
72
|
-
replaceSubmissionChecks(id: string, submissionId: string, request: Courier.SubmissionChecksReplaceParams, requestOptions?: Notifications.RequestOptions):
|
|
85
|
+
replaceSubmissionChecks(id: string, submissionId: string, request: Courier.SubmissionChecksReplaceParams, requestOptions?: Notifications.RequestOptions): core.HttpResponsePromise<Courier.SubmissionChecksReplaceResponse>;
|
|
86
|
+
private __replaceSubmissionChecks;
|
|
73
87
|
/**
|
|
74
88
|
* @param {string} id
|
|
75
89
|
* @param {string} submissionId
|
|
76
90
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
91
|
*
|
|
78
92
|
* @example
|
|
79
|
-
* await
|
|
93
|
+
* await client.notifications.cancelSubmission("id", "submissionId")
|
|
80
94
|
*/
|
|
81
|
-
cancelSubmission(id: string, submissionId: string, requestOptions?: Notifications.RequestOptions):
|
|
95
|
+
cancelSubmission(id: string, submissionId: string, requestOptions?: Notifications.RequestOptions): core.HttpResponsePromise<void>;
|
|
96
|
+
private __cancelSubmission;
|
|
82
97
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
83
98
|
}
|
|
@@ -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) {
|
|
@@ -52,14 +62,14 @@ class Notifications {
|
|
|
52
62
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
63
|
*
|
|
54
64
|
* @example
|
|
55
|
-
* await
|
|
56
|
-
* cursor: "string",
|
|
57
|
-
* notes: true
|
|
58
|
-
* })
|
|
65
|
+
* await client.notifications.list()
|
|
59
66
|
*/
|
|
60
67
|
list(request = {}, requestOptions) {
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
69
|
+
}
|
|
70
|
+
__list() {
|
|
71
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
72
|
+
var _a, _b, _c;
|
|
63
73
|
const { cursor, notes } = request;
|
|
64
74
|
const _queryParams = {};
|
|
65
75
|
if (cursor != null) {
|
|
@@ -69,28 +79,24 @@ class Notifications {
|
|
|
69
79
|
_queryParams["notes"] = notes.toString();
|
|
70
80
|
}
|
|
71
81
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
72
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
82
|
+
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, "/notifications"),
|
|
73
83
|
method: "GET",
|
|
74
|
-
headers: {
|
|
75
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
76
|
-
"X-Fern-Language": "JavaScript",
|
|
77
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
78
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
79
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
80
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
81
|
-
},
|
|
84
|
+
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),
|
|
82
85
|
contentType: "application/json",
|
|
83
86
|
queryParameters: _queryParams,
|
|
87
|
+
requestType: "json",
|
|
84
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
85
89
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
90
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
91
|
});
|
|
87
92
|
if (_response.ok) {
|
|
88
|
-
return _response.body;
|
|
93
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
89
94
|
}
|
|
90
95
|
if (_response.error.reason === "status-code") {
|
|
91
96
|
throw new errors.CourierError({
|
|
92
97
|
statusCode: _response.error.statusCode,
|
|
93
98
|
body: _response.error.body,
|
|
99
|
+
rawResponse: _response.rawResponse,
|
|
94
100
|
});
|
|
95
101
|
}
|
|
96
102
|
switch (_response.error.reason) {
|
|
@@ -98,12 +104,14 @@ class Notifications {
|
|
|
98
104
|
throw new errors.CourierError({
|
|
99
105
|
statusCode: _response.error.statusCode,
|
|
100
106
|
body: _response.error.rawBody,
|
|
107
|
+
rawResponse: _response.rawResponse,
|
|
101
108
|
});
|
|
102
109
|
case "timeout":
|
|
103
|
-
throw new errors.CourierTimeoutError();
|
|
110
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /notifications.");
|
|
104
111
|
case "unknown":
|
|
105
112
|
throw new errors.CourierError({
|
|
106
113
|
message: _response.error.errorMessage,
|
|
114
|
+
rawResponse: _response.rawResponse,
|
|
107
115
|
});
|
|
108
116
|
}
|
|
109
117
|
});
|
|
@@ -113,33 +121,35 @@ class Notifications {
|
|
|
113
121
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
114
122
|
*
|
|
115
123
|
* @example
|
|
116
|
-
* await
|
|
124
|
+
* await client.notifications.getContent("id")
|
|
117
125
|
*/
|
|
118
126
|
getContent(id, requestOptions) {
|
|
119
|
-
|
|
127
|
+
return core.HttpResponsePromise.fromPromise(this.__getContent(id, requestOptions));
|
|
128
|
+
}
|
|
129
|
+
__getContent(id, requestOptions) {
|
|
120
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
var _a, _b, _c;
|
|
121
132
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
122
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
133
|
+
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, `/notifications/${encodeURIComponent(id)}/content`),
|
|
123
134
|
method: "GET",
|
|
124
|
-
headers: {
|
|
125
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
126
|
-
"X-Fern-Language": "JavaScript",
|
|
127
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
128
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
129
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
130
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
131
|
-
},
|
|
135
|
+
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),
|
|
132
136
|
contentType: "application/json",
|
|
137
|
+
requestType: "json",
|
|
133
138
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
134
139
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
140
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
135
141
|
});
|
|
136
142
|
if (_response.ok) {
|
|
137
|
-
return
|
|
143
|
+
return {
|
|
144
|
+
data: _response.body,
|
|
145
|
+
rawResponse: _response.rawResponse,
|
|
146
|
+
};
|
|
138
147
|
}
|
|
139
148
|
if (_response.error.reason === "status-code") {
|
|
140
149
|
throw new errors.CourierError({
|
|
141
150
|
statusCode: _response.error.statusCode,
|
|
142
151
|
body: _response.error.body,
|
|
152
|
+
rawResponse: _response.rawResponse,
|
|
143
153
|
});
|
|
144
154
|
}
|
|
145
155
|
switch (_response.error.reason) {
|
|
@@ -147,12 +157,14 @@ class Notifications {
|
|
|
147
157
|
throw new errors.CourierError({
|
|
148
158
|
statusCode: _response.error.statusCode,
|
|
149
159
|
body: _response.error.rawBody,
|
|
160
|
+
rawResponse: _response.rawResponse,
|
|
150
161
|
});
|
|
151
162
|
case "timeout":
|
|
152
|
-
throw new errors.CourierTimeoutError();
|
|
163
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /notifications/{id}/content.");
|
|
153
164
|
case "unknown":
|
|
154
165
|
throw new errors.CourierError({
|
|
155
166
|
message: _response.error.errorMessage,
|
|
167
|
+
rawResponse: _response.rawResponse,
|
|
156
168
|
});
|
|
157
169
|
}
|
|
158
170
|
});
|
|
@@ -162,33 +174,35 @@ class Notifications {
|
|
|
162
174
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
163
175
|
*
|
|
164
176
|
* @example
|
|
165
|
-
* await
|
|
177
|
+
* await client.notifications.getDraftContent("id")
|
|
166
178
|
*/
|
|
167
179
|
getDraftContent(id, requestOptions) {
|
|
168
|
-
|
|
180
|
+
return core.HttpResponsePromise.fromPromise(this.__getDraftContent(id, requestOptions));
|
|
181
|
+
}
|
|
182
|
+
__getDraftContent(id, requestOptions) {
|
|
169
183
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
var _a, _b, _c;
|
|
170
185
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
171
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
186
|
+
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, `/notifications/${encodeURIComponent(id)}/draft/content`),
|
|
172
187
|
method: "GET",
|
|
173
|
-
headers: {
|
|
174
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
175
|
-
"X-Fern-Language": "JavaScript",
|
|
176
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
177
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
178
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
179
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
180
|
-
},
|
|
188
|
+
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),
|
|
181
189
|
contentType: "application/json",
|
|
190
|
+
requestType: "json",
|
|
182
191
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
183
192
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
193
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
184
194
|
});
|
|
185
195
|
if (_response.ok) {
|
|
186
|
-
return
|
|
196
|
+
return {
|
|
197
|
+
data: _response.body,
|
|
198
|
+
rawResponse: _response.rawResponse,
|
|
199
|
+
};
|
|
187
200
|
}
|
|
188
201
|
if (_response.error.reason === "status-code") {
|
|
189
202
|
throw new errors.CourierError({
|
|
190
203
|
statusCode: _response.error.statusCode,
|
|
191
204
|
body: _response.error.body,
|
|
205
|
+
rawResponse: _response.rawResponse,
|
|
192
206
|
});
|
|
193
207
|
}
|
|
194
208
|
switch (_response.error.reason) {
|
|
@@ -196,12 +210,14 @@ class Notifications {
|
|
|
196
210
|
throw new errors.CourierError({
|
|
197
211
|
statusCode: _response.error.statusCode,
|
|
198
212
|
body: _response.error.rawBody,
|
|
213
|
+
rawResponse: _response.rawResponse,
|
|
199
214
|
});
|
|
200
215
|
case "timeout":
|
|
201
|
-
throw new errors.CourierTimeoutError();
|
|
216
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /notifications/{id}/draft/content.");
|
|
202
217
|
case "unknown":
|
|
203
218
|
throw new errors.CourierError({
|
|
204
219
|
message: _response.error.errorMessage,
|
|
220
|
+
rawResponse: _response.rawResponse,
|
|
205
221
|
});
|
|
206
222
|
}
|
|
207
223
|
});
|
|
@@ -212,33 +228,32 @@ class Notifications {
|
|
|
212
228
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
213
229
|
*
|
|
214
230
|
* @example
|
|
215
|
-
* await
|
|
231
|
+
* await client.notifications.getSubmissionChecks("id", "submissionId")
|
|
216
232
|
*/
|
|
217
233
|
getSubmissionChecks(id, submissionId, requestOptions) {
|
|
218
|
-
|
|
234
|
+
return core.HttpResponsePromise.fromPromise(this.__getSubmissionChecks(id, submissionId, requestOptions));
|
|
235
|
+
}
|
|
236
|
+
__getSubmissionChecks(id, submissionId, requestOptions) {
|
|
219
237
|
return __awaiter(this, void 0, void 0, function* () {
|
|
238
|
+
var _a, _b, _c;
|
|
220
239
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
221
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
240
|
+
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, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
|
|
222
241
|
method: "GET",
|
|
223
|
-
headers: {
|
|
224
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
225
|
-
"X-Fern-Language": "JavaScript",
|
|
226
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
227
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
228
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
229
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
230
|
-
},
|
|
242
|
+
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),
|
|
231
243
|
contentType: "application/json",
|
|
244
|
+
requestType: "json",
|
|
232
245
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
233
246
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
247
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
234
248
|
});
|
|
235
249
|
if (_response.ok) {
|
|
236
|
-
return _response.body;
|
|
250
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
237
251
|
}
|
|
238
252
|
if (_response.error.reason === "status-code") {
|
|
239
253
|
throw new errors.CourierError({
|
|
240
254
|
statusCode: _response.error.statusCode,
|
|
241
255
|
body: _response.error.body,
|
|
256
|
+
rawResponse: _response.rawResponse,
|
|
242
257
|
});
|
|
243
258
|
}
|
|
244
259
|
switch (_response.error.reason) {
|
|
@@ -246,12 +261,14 @@ class Notifications {
|
|
|
246
261
|
throw new errors.CourierError({
|
|
247
262
|
statusCode: _response.error.statusCode,
|
|
248
263
|
body: _response.error.rawBody,
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
249
265
|
});
|
|
250
266
|
case "timeout":
|
|
251
|
-
throw new errors.CourierTimeoutError();
|
|
267
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /notifications/{id}/{submissionId}/checks.");
|
|
252
268
|
case "unknown":
|
|
253
269
|
throw new errors.CourierError({
|
|
254
270
|
message: _response.error.errorMessage,
|
|
271
|
+
rawResponse: _response.rawResponse,
|
|
255
272
|
});
|
|
256
273
|
}
|
|
257
274
|
});
|
|
@@ -263,40 +280,46 @@ class Notifications {
|
|
|
263
280
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
264
281
|
*
|
|
265
282
|
* @example
|
|
266
|
-
* await
|
|
283
|
+
* await client.notifications.replaceSubmissionChecks("id", "submissionId", {
|
|
267
284
|
* checks: [{
|
|
268
|
-
* id: "
|
|
269
|
-
* status:
|
|
285
|
+
* id: "id",
|
|
286
|
+
* status: "RESOLVED",
|
|
287
|
+
* type: "custom"
|
|
288
|
+
* }, {
|
|
289
|
+
* id: "id",
|
|
290
|
+
* status: "RESOLVED",
|
|
270
291
|
* type: "custom"
|
|
271
292
|
* }]
|
|
272
293
|
* })
|
|
273
294
|
*/
|
|
274
295
|
replaceSubmissionChecks(id, submissionId, request, requestOptions) {
|
|
275
|
-
|
|
296
|
+
return core.HttpResponsePromise.fromPromise(this.__replaceSubmissionChecks(id, submissionId, request, requestOptions));
|
|
297
|
+
}
|
|
298
|
+
__replaceSubmissionChecks(id, submissionId, request, requestOptions) {
|
|
276
299
|
return __awaiter(this, void 0, void 0, function* () {
|
|
300
|
+
var _a, _b, _c;
|
|
277
301
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
278
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
302
|
+
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, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
|
|
279
303
|
method: "PUT",
|
|
280
|
-
headers: {
|
|
281
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
282
|
-
"X-Fern-Language": "JavaScript",
|
|
283
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
284
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
285
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
286
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
287
|
-
},
|
|
304
|
+
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),
|
|
288
305
|
contentType: "application/json",
|
|
306
|
+
requestType: "json",
|
|
289
307
|
body: request,
|
|
290
308
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
291
309
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
310
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
292
311
|
});
|
|
293
312
|
if (_response.ok) {
|
|
294
|
-
return
|
|
313
|
+
return {
|
|
314
|
+
data: _response.body,
|
|
315
|
+
rawResponse: _response.rawResponse,
|
|
316
|
+
};
|
|
295
317
|
}
|
|
296
318
|
if (_response.error.reason === "status-code") {
|
|
297
319
|
throw new errors.CourierError({
|
|
298
320
|
statusCode: _response.error.statusCode,
|
|
299
321
|
body: _response.error.body,
|
|
322
|
+
rawResponse: _response.rawResponse,
|
|
300
323
|
});
|
|
301
324
|
}
|
|
302
325
|
switch (_response.error.reason) {
|
|
@@ -304,12 +327,14 @@ class Notifications {
|
|
|
304
327
|
throw new errors.CourierError({
|
|
305
328
|
statusCode: _response.error.statusCode,
|
|
306
329
|
body: _response.error.rawBody,
|
|
330
|
+
rawResponse: _response.rawResponse,
|
|
307
331
|
});
|
|
308
332
|
case "timeout":
|
|
309
|
-
throw new errors.CourierTimeoutError();
|
|
333
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling PUT /notifications/{id}/{submissionId}/checks.");
|
|
310
334
|
case "unknown":
|
|
311
335
|
throw new errors.CourierError({
|
|
312
336
|
message: _response.error.errorMessage,
|
|
337
|
+
rawResponse: _response.rawResponse,
|
|
313
338
|
});
|
|
314
339
|
}
|
|
315
340
|
});
|
|
@@ -320,33 +345,32 @@ class Notifications {
|
|
|
320
345
|
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
321
346
|
*
|
|
322
347
|
* @example
|
|
323
|
-
* await
|
|
348
|
+
* await client.notifications.cancelSubmission("id", "submissionId")
|
|
324
349
|
*/
|
|
325
350
|
cancelSubmission(id, submissionId, requestOptions) {
|
|
326
|
-
|
|
351
|
+
return core.HttpResponsePromise.fromPromise(this.__cancelSubmission(id, submissionId, requestOptions));
|
|
352
|
+
}
|
|
353
|
+
__cancelSubmission(id, submissionId, requestOptions) {
|
|
327
354
|
return __awaiter(this, void 0, void 0, function* () {
|
|
355
|
+
var _a, _b, _c;
|
|
328
356
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
329
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
357
|
+
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, `/notifications/${encodeURIComponent(id)}/${encodeURIComponent(submissionId)}/checks`),
|
|
330
358
|
method: "DELETE",
|
|
331
|
-
headers: {
|
|
332
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
333
|
-
"X-Fern-Language": "JavaScript",
|
|
334
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
335
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
336
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
337
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
338
|
-
},
|
|
359
|
+
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),
|
|
339
360
|
contentType: "application/json",
|
|
361
|
+
requestType: "json",
|
|
340
362
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
341
363
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
364
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
342
365
|
});
|
|
343
366
|
if (_response.ok) {
|
|
344
|
-
return;
|
|
367
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
345
368
|
}
|
|
346
369
|
if (_response.error.reason === "status-code") {
|
|
347
370
|
throw new errors.CourierError({
|
|
348
371
|
statusCode: _response.error.statusCode,
|
|
349
372
|
body: _response.error.body,
|
|
373
|
+
rawResponse: _response.rawResponse,
|
|
350
374
|
});
|
|
351
375
|
}
|
|
352
376
|
switch (_response.error.reason) {
|
|
@@ -354,23 +378,25 @@ class Notifications {
|
|
|
354
378
|
throw new errors.CourierError({
|
|
355
379
|
statusCode: _response.error.statusCode,
|
|
356
380
|
body: _response.error.rawBody,
|
|
381
|
+
rawResponse: _response.rawResponse,
|
|
357
382
|
});
|
|
358
383
|
case "timeout":
|
|
359
|
-
throw new errors.CourierTimeoutError();
|
|
384
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling DELETE /notifications/{id}/{submissionId}/checks.");
|
|
360
385
|
case "unknown":
|
|
361
386
|
throw new errors.CourierError({
|
|
362
387
|
message: _response.error.errorMessage,
|
|
388
|
+
rawResponse: _response.rawResponse,
|
|
363
389
|
});
|
|
364
390
|
}
|
|
365
391
|
});
|
|
366
392
|
}
|
|
367
393
|
_getAuthorizationHeader() {
|
|
368
|
-
var _a;
|
|
369
394
|
return __awaiter(this, void 0, void 0, function* () {
|
|
395
|
+
var _a;
|
|
370
396
|
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"];
|
|
371
397
|
if (bearer == null) {
|
|
372
398
|
throw new errors.CourierError({
|
|
373
|
-
message: "Please specify
|
|
399
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a COURIER_AUTH_TOKEN environment variable",
|
|
374
400
|
});
|
|
375
401
|
}
|
|
376
402
|
return `Bearer ${bearer}`;
|
|
@@ -6,8 +6,12 @@ import * as Courier from "../../../../index";
|
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
8
|
* checks: [{
|
|
9
|
-
* id: "
|
|
10
|
-
* status:
|
|
9
|
+
* id: "id",
|
|
10
|
+
* status: "RESOLVED",
|
|
11
|
+
* type: "custom"
|
|
12
|
+
* }, {
|
|
13
|
+
* id: "id",
|
|
14
|
+
* status: "RESOLVED",
|
|
11
15
|
* type: "custom"
|
|
12
16
|
* }]
|
|
13
17
|
* }
|
|
@@ -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 BlockType = "action" | "divider" | "image" | "jsonnet" | "list" | "markdown" | "quote" | "template" | "text";
|
|
5
5
|
export declare const BlockType: {
|
|
6
6
|
readonly Action: "action";
|
|
7
7
|
readonly Divider: "divider";
|
|
@@ -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 CheckStatus = "RESOLVED" | "FAILED" | "PENDING";
|
|
5
5
|
export declare const CheckStatus: {
|
|
6
6
|
readonly Resolved: "RESOLVED";
|
|
7
7
|
readonly Failed: "FAILED";
|
|
@@ -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 MessageRoutingMethod = "all" | "single";
|
|
5
5
|
export declare const MessageRoutingMethod: {
|
|
6
6
|
readonly All: "all";
|
|
7
7
|
readonly Single: "single";
|
|
@@ -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 NotificationContent = string | Courier.NotificationContentHierarchy;
|