@trycourier/courier 6.3.1 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +84 -109
- package/Client.js +118 -148
- package/api/client/requests/SendMessageRequest.d.ts +45 -78
- package/api/resources/audiences/client/Client.d.ts +16 -16
- package/api/resources/audiences/client/Client.js +63 -86
- 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 +10 -4
- package/api/resources/auditEvents/client/Client.js +35 -37
- package/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +1 -3
- package/api/resources/authTokens/client/Client.d.ts +11 -3
- package/api/resources/authTokens/client/Client.js +28 -25
- package/api/resources/authTokens/client/requests/IssueTokenParams.d.ts +2 -2
- package/api/resources/automations/client/Client.d.ts +15 -13
- package/api/resources/automations/client/Client.js +38 -48
- 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 +22 -58
- package/api/resources/brands/client/Client.js +65 -126
- 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 +30 -121
- package/api/resources/bulk/client/Client.js +73 -193
- 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.js +17 -7
- package/api/resources/commons/errors/BadRequestError.js +17 -7
- package/api/resources/commons/errors/ConflictError.js +17 -7
- package/api/resources/commons/errors/MessageNotFoundError.js +17 -7
- package/api/resources/commons/errors/NotFoundError.js +17 -7
- package/api/resources/commons/errors/PaymentRequiredError.js +17 -7
- 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 +9 -1
- package/api/resources/inbound/client/Client.js +26 -21
- package/api/resources/index.js +17 -7
- package/api/resources/lists/client/Client.d.ts +31 -34
- package/api/resources/lists/client/Client.js +108 -161
- 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 +15 -24
- package/api/resources/messages/client/Client.js +65 -104
- 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 +20 -11
- package/api/resources/notifications/client/Client.js +69 -88
- 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 +35 -23
- package/api/resources/profiles/client/Client.js +95 -125
- 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 +9 -3
- package/api/resources/templates/client/Client.js +28 -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 +23 -37
- package/api/resources/tenants/client/Client.js +80 -127
- 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 +10 -2
- package/api/resources/translations/client/Client.js +33 -33
- 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 +13 -9
- package/api/resources/users/resources/preferences/client/Client.js +46 -55
- 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 +23 -21
- package/api/resources/users/resources/tenants/client/Client.js +68 -89
- 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 +27 -29
- package/api/resources/users/resources/tokens/client/Client.js +74 -104
- 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 +1 -1
- package/core/fetcher/Fetcher.d.ts +7 -3
- package/core/fetcher/Fetcher.js +30 -135
- 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/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/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 +84 -109
- package/dist/Client.js +118 -148
- package/dist/api/client/requests/SendMessageRequest.d.ts +45 -78
- package/dist/api/resources/audiences/client/Client.d.ts +16 -16
- package/dist/api/resources/audiences/client/Client.js +63 -86
- 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 +10 -4
- package/dist/api/resources/auditEvents/client/Client.js +35 -37
- package/dist/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +1 -3
- package/dist/api/resources/authTokens/client/Client.d.ts +11 -3
- package/dist/api/resources/authTokens/client/Client.js +28 -25
- package/dist/api/resources/authTokens/client/requests/IssueTokenParams.d.ts +2 -2
- package/dist/api/resources/automations/client/Client.d.ts +15 -13
- package/dist/api/resources/automations/client/Client.js +38 -48
- 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 +22 -58
- package/dist/api/resources/brands/client/Client.js +65 -126
- 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 +30 -121
- package/dist/api/resources/bulk/client/Client.js +73 -193
- 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.js +17 -7
- package/dist/api/resources/commons/errors/BadRequestError.js +17 -7
- package/dist/api/resources/commons/errors/ConflictError.js +17 -7
- package/dist/api/resources/commons/errors/MessageNotFoundError.js +17 -7
- package/dist/api/resources/commons/errors/NotFoundError.js +17 -7
- package/dist/api/resources/commons/errors/PaymentRequiredError.js +17 -7
- 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 +9 -1
- package/dist/api/resources/inbound/client/Client.js +26 -21
- package/dist/api/resources/index.js +17 -7
- package/dist/api/resources/lists/client/Client.d.ts +31 -34
- package/dist/api/resources/lists/client/Client.js +108 -161
- 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 +15 -24
- package/dist/api/resources/messages/client/Client.js +65 -104
- 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 +20 -11
- package/dist/api/resources/notifications/client/Client.js +69 -88
- 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 +35 -23
- package/dist/api/resources/profiles/client/Client.js +95 -125
- 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 +9 -3
- package/dist/api/resources/templates/client/Client.js +28 -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 +23 -37
- package/dist/api/resources/tenants/client/Client.js +80 -127
- 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 +10 -2
- package/dist/api/resources/translations/client/Client.js +33 -33
- 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 +13 -9
- package/dist/api/resources/users/resources/preferences/client/Client.js +46 -55
- 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 +23 -21
- package/dist/api/resources/users/resources/tenants/client/Client.js +68 -89
- 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 +27 -29
- package/dist/api/resources/users/resources/tokens/client/Client.js +74 -104
- 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 +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +7 -3
- package/dist/core/fetcher/Fetcher.js +30 -135
- 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/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/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.js +2 -1
- 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.js +2 -1
- 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 +23 -14
- package/reference.md +5180 -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 Audiences {
|
|
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 Audiences {
|
|
@@ -25,7 +33,7 @@ export declare class Audiences {
|
|
|
25
33
|
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
34
|
*
|
|
27
35
|
* @example
|
|
28
|
-
* await
|
|
36
|
+
* await client.audiences.get("audience_id")
|
|
29
37
|
*/
|
|
30
38
|
get(audienceId: string, requestOptions?: Audiences.RequestOptions): Promise<Courier.Audience>;
|
|
31
39
|
/**
|
|
@@ -36,14 +44,10 @@ export declare class Audiences {
|
|
|
36
44
|
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
45
|
*
|
|
38
46
|
* @example
|
|
39
|
-
* await
|
|
40
|
-
* name:
|
|
41
|
-
* description:
|
|
42
|
-
* filter:
|
|
43
|
-
* value: "string",
|
|
44
|
-
* path: "string",
|
|
45
|
-
* operator: Courier.ComparisonOperator.EndsWith
|
|
46
|
-
* }
|
|
47
|
+
* await client.audiences.update("audience_id", {
|
|
48
|
+
* name: undefined,
|
|
49
|
+
* description: undefined,
|
|
50
|
+
* filter: undefined
|
|
47
51
|
* })
|
|
48
52
|
*/
|
|
49
53
|
update(audienceId: string, request?: Courier.AudienceUpdateParams, requestOptions?: Audiences.RequestOptions): Promise<Courier.AudienceUpdateResponse>;
|
|
@@ -54,7 +58,7 @@ export declare class Audiences {
|
|
|
54
58
|
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
59
|
*
|
|
56
60
|
* @example
|
|
57
|
-
* await
|
|
61
|
+
* await client.audiences.delete("audience_id")
|
|
58
62
|
*/
|
|
59
63
|
delete(audienceId: string, requestOptions?: Audiences.RequestOptions): Promise<void>;
|
|
60
64
|
/**
|
|
@@ -67,9 +71,7 @@ export declare class Audiences {
|
|
|
67
71
|
* @throws {@link Courier.BadRequestError}
|
|
68
72
|
*
|
|
69
73
|
* @example
|
|
70
|
-
* await
|
|
71
|
-
* cursor: "string"
|
|
72
|
-
* })
|
|
74
|
+
* await client.audiences.listMembers("audience_id")
|
|
73
75
|
*/
|
|
74
76
|
listMembers(audienceId: string, request?: Courier.AudienceMembersListParams, requestOptions?: Audiences.RequestOptions): Promise<Courier.AudienceMemberListResponse>;
|
|
75
77
|
/**
|
|
@@ -81,9 +83,7 @@ export declare class Audiences {
|
|
|
81
83
|
* @throws {@link Courier.BadRequestError}
|
|
82
84
|
*
|
|
83
85
|
* @example
|
|
84
|
-
* await
|
|
85
|
-
* cursor: "string"
|
|
86
|
-
* })
|
|
86
|
+
* await client.audiences.listAudiences()
|
|
87
87
|
*/
|
|
88
88
|
listAudiences(request?: Courier.AudiencesListParams, requestOptions?: Audiences.RequestOptions): Promise<Courier.AudienceListResponse>;
|
|
89
89
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
@@ -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) {
|
|
@@ -55,25 +65,20 @@ class Audiences {
|
|
|
55
65
|
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
66
|
*
|
|
57
67
|
* @example
|
|
58
|
-
* await
|
|
68
|
+
* await client.audiences.get("audience_id")
|
|
59
69
|
*/
|
|
60
70
|
get(audienceId, requestOptions) {
|
|
61
|
-
var _a, _b;
|
|
62
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
var _a, _b, _c;
|
|
63
73
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
64
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
74
|
+
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, `/audiences/${encodeURIComponent(audienceId)}`),
|
|
65
75
|
method: "GET",
|
|
66
|
-
headers: {
|
|
67
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
68
|
-
"X-Fern-Language": "JavaScript",
|
|
69
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
70
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
71
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
72
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
73
|
-
},
|
|
76
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
74
77
|
contentType: "application/json",
|
|
78
|
+
requestType: "json",
|
|
75
79
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
76
80
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
81
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
77
82
|
});
|
|
78
83
|
if (_response.ok) {
|
|
79
84
|
return _response.body;
|
|
@@ -91,7 +96,7 @@ class Audiences {
|
|
|
91
96
|
body: _response.error.rawBody,
|
|
92
97
|
});
|
|
93
98
|
case "timeout":
|
|
94
|
-
throw new errors.CourierTimeoutError();
|
|
99
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /audiences/{audience_id}.");
|
|
95
100
|
case "unknown":
|
|
96
101
|
throw new errors.CourierError({
|
|
97
102
|
message: _response.error.errorMessage,
|
|
@@ -107,34 +112,25 @@ class Audiences {
|
|
|
107
112
|
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
113
|
*
|
|
109
114
|
* @example
|
|
110
|
-
* await
|
|
111
|
-
* name:
|
|
112
|
-
* description:
|
|
113
|
-
* filter:
|
|
114
|
-
* value: "string",
|
|
115
|
-
* path: "string",
|
|
116
|
-
* operator: Courier.ComparisonOperator.EndsWith
|
|
117
|
-
* }
|
|
115
|
+
* await client.audiences.update("audience_id", {
|
|
116
|
+
* name: undefined,
|
|
117
|
+
* description: undefined,
|
|
118
|
+
* filter: undefined
|
|
118
119
|
* })
|
|
119
120
|
*/
|
|
120
|
-
update(
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
update(audienceId_1) {
|
|
122
|
+
return __awaiter(this, arguments, void 0, function* (audienceId, request = {}, requestOptions) {
|
|
123
|
+
var _a, _b, _c;
|
|
123
124
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
124
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
125
|
+
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, `/audiences/${encodeURIComponent(audienceId)}`),
|
|
125
126
|
method: "PUT",
|
|
126
|
-
headers: {
|
|
127
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
128
|
-
"X-Fern-Language": "JavaScript",
|
|
129
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
130
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
131
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
132
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
133
|
-
},
|
|
127
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
134
128
|
contentType: "application/json",
|
|
129
|
+
requestType: "json",
|
|
135
130
|
body: request,
|
|
136
131
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
137
132
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
133
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
138
134
|
});
|
|
139
135
|
if (_response.ok) {
|
|
140
136
|
return _response.body;
|
|
@@ -152,7 +148,7 @@ class Audiences {
|
|
|
152
148
|
body: _response.error.rawBody,
|
|
153
149
|
});
|
|
154
150
|
case "timeout":
|
|
155
|
-
throw new errors.CourierTimeoutError();
|
|
151
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling PUT /audiences/{audience_id}.");
|
|
156
152
|
case "unknown":
|
|
157
153
|
throw new errors.CourierError({
|
|
158
154
|
message: _response.error.errorMessage,
|
|
@@ -167,25 +163,20 @@ class Audiences {
|
|
|
167
163
|
* @param {Audiences.RequestOptions} requestOptions - Request-specific configuration.
|
|
168
164
|
*
|
|
169
165
|
* @example
|
|
170
|
-
* await
|
|
166
|
+
* await client.audiences.delete("audience_id")
|
|
171
167
|
*/
|
|
172
168
|
delete(audienceId, requestOptions) {
|
|
173
|
-
var _a, _b;
|
|
174
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
var _a, _b, _c;
|
|
175
171
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
176
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
172
|
+
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, `/audiences/${encodeURIComponent(audienceId)}`),
|
|
177
173
|
method: "DELETE",
|
|
178
|
-
headers: {
|
|
179
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
180
|
-
"X-Fern-Language": "JavaScript",
|
|
181
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
182
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
183
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
184
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
185
|
-
},
|
|
174
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
186
175
|
contentType: "application/json",
|
|
176
|
+
requestType: "json",
|
|
187
177
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
188
178
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
179
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
189
180
|
});
|
|
190
181
|
if (_response.ok) {
|
|
191
182
|
return;
|
|
@@ -203,7 +194,7 @@ class Audiences {
|
|
|
203
194
|
body: _response.error.rawBody,
|
|
204
195
|
});
|
|
205
196
|
case "timeout":
|
|
206
|
-
throw new errors.CourierTimeoutError();
|
|
197
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling DELETE /audiences/{audience_id}.");
|
|
207
198
|
case "unknown":
|
|
208
199
|
throw new errors.CourierError({
|
|
209
200
|
message: _response.error.errorMessage,
|
|
@@ -221,33 +212,26 @@ class Audiences {
|
|
|
221
212
|
* @throws {@link Courier.BadRequestError}
|
|
222
213
|
*
|
|
223
214
|
* @example
|
|
224
|
-
* await
|
|
225
|
-
* cursor: "string"
|
|
226
|
-
* })
|
|
215
|
+
* await client.audiences.listMembers("audience_id")
|
|
227
216
|
*/
|
|
228
|
-
listMembers(
|
|
229
|
-
|
|
230
|
-
|
|
217
|
+
listMembers(audienceId_1) {
|
|
218
|
+
return __awaiter(this, arguments, void 0, function* (audienceId, request = {}, requestOptions) {
|
|
219
|
+
var _a, _b, _c;
|
|
231
220
|
const { cursor } = request;
|
|
232
221
|
const _queryParams = {};
|
|
233
222
|
if (cursor != null) {
|
|
234
223
|
_queryParams["cursor"] = cursor;
|
|
235
224
|
}
|
|
236
225
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
237
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
226
|
+
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, `/audiences/${encodeURIComponent(audienceId)}/members`),
|
|
238
227
|
method: "GET",
|
|
239
|
-
headers: {
|
|
240
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
241
|
-
"X-Fern-Language": "JavaScript",
|
|
242
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
243
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
244
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
245
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
246
|
-
},
|
|
228
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
247
229
|
contentType: "application/json",
|
|
248
230
|
queryParameters: _queryParams,
|
|
231
|
+
requestType: "json",
|
|
249
232
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
250
233
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
234
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
251
235
|
});
|
|
252
236
|
if (_response.ok) {
|
|
253
237
|
return _response.body;
|
|
@@ -270,7 +254,7 @@ class Audiences {
|
|
|
270
254
|
body: _response.error.rawBody,
|
|
271
255
|
});
|
|
272
256
|
case "timeout":
|
|
273
|
-
throw new errors.CourierTimeoutError();
|
|
257
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /audiences/{audience_id}/members.");
|
|
274
258
|
case "unknown":
|
|
275
259
|
throw new errors.CourierError({
|
|
276
260
|
message: _response.error.errorMessage,
|
|
@@ -287,33 +271,26 @@ class Audiences {
|
|
|
287
271
|
* @throws {@link Courier.BadRequestError}
|
|
288
272
|
*
|
|
289
273
|
* @example
|
|
290
|
-
* await
|
|
291
|
-
* cursor: "string"
|
|
292
|
-
* })
|
|
274
|
+
* await client.audiences.listAudiences()
|
|
293
275
|
*/
|
|
294
|
-
listAudiences(
|
|
295
|
-
|
|
296
|
-
|
|
276
|
+
listAudiences() {
|
|
277
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
278
|
+
var _a, _b, _c;
|
|
297
279
|
const { cursor } = request;
|
|
298
280
|
const _queryParams = {};
|
|
299
281
|
if (cursor != null) {
|
|
300
282
|
_queryParams["cursor"] = cursor;
|
|
301
283
|
}
|
|
302
284
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
303
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
285
|
+
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, "/audiences"),
|
|
304
286
|
method: "GET",
|
|
305
|
-
headers: {
|
|
306
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
307
|
-
"X-Fern-Language": "JavaScript",
|
|
308
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
309
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
310
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
311
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
312
|
-
},
|
|
287
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
313
288
|
contentType: "application/json",
|
|
314
289
|
queryParameters: _queryParams,
|
|
290
|
+
requestType: "json",
|
|
315
291
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
316
292
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
293
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
317
294
|
});
|
|
318
295
|
if (_response.ok) {
|
|
319
296
|
return _response.body;
|
|
@@ -336,7 +313,7 @@ class Audiences {
|
|
|
336
313
|
body: _response.error.rawBody,
|
|
337
314
|
});
|
|
338
315
|
case "timeout":
|
|
339
|
-
throw new errors.CourierTimeoutError();
|
|
316
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /audiences.");
|
|
340
317
|
case "unknown":
|
|
341
318
|
throw new errors.CourierError({
|
|
342
319
|
message: _response.error.errorMessage,
|
|
@@ -345,12 +322,12 @@ class Audiences {
|
|
|
345
322
|
});
|
|
346
323
|
}
|
|
347
324
|
_getAuthorizationHeader() {
|
|
348
|
-
var _a;
|
|
349
325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
326
|
+
var _a;
|
|
350
327
|
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"];
|
|
351
328
|
if (bearer == null) {
|
|
352
329
|
throw new errors.CourierError({
|
|
353
|
-
message: "Please specify
|
|
330
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a COURIER_AUTH_TOKEN environment variable",
|
|
354
331
|
});
|
|
355
332
|
}
|
|
356
333
|
return `Bearer ${bearer}`;
|
|
@@ -5,13 +5,9 @@ import * as Courier from "../../../../index";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* name:
|
|
9
|
-
* description:
|
|
10
|
-
* filter:
|
|
11
|
-
* value: "string",
|
|
12
|
-
* path: "string",
|
|
13
|
-
* operator: Courier.ComparisonOperator.EndsWith
|
|
14
|
-
* }
|
|
8
|
+
* name: undefined,
|
|
9
|
+
* description: undefined,
|
|
10
|
+
* filter: undefined
|
|
15
11
|
* }
|
|
16
12
|
*/
|
|
17
13
|
export interface AudienceUpdateParams {
|
|
@@ -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 ComparisonOperator = "ENDS_WITH" | "EQ" | "EXISTS" | "GT" | "GTE" | "INCLUDES" | "IS_AFTER" | "IS_BEFORE" | "LT" | "LTE" | "NEQ" | "OMIT" | "STARTS_WITH";
|
|
5
5
|
export declare const ComparisonOperator: {
|
|
6
6
|
readonly EndsWith: "ENDS_WITH";
|
|
7
7
|
readonly Eq: "EQ";
|
|
@@ -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 Filter = Courier.SingleFilterConfig | Courier.NestedFilterConfig;
|
|
@@ -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 FilterConfig = Courier.SingleFilterConfig | Courier.NestedFilterConfig;
|
|
@@ -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 Operator = Courier.ComparisonOperator | Courier.LogicalOperator;
|
|
@@ -7,12 +7,20 @@ import * as Courier from "../../../index";
|
|
|
7
7
|
export declare namespace AuditEvents {
|
|
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 AuditEvents {
|
|
@@ -25,9 +33,7 @@ export declare class AuditEvents {
|
|
|
25
33
|
* @param {AuditEvents.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
34
|
*
|
|
27
35
|
* @example
|
|
28
|
-
* await
|
|
29
|
-
* cursor: "string"
|
|
30
|
-
* })
|
|
36
|
+
* await client.auditEvents.list()
|
|
31
37
|
*/
|
|
32
38
|
list(request?: Courier.ListAuditEventsRequest, requestOptions?: AuditEvents.RequestOptions): Promise<Courier.ListAuditEventsResponse>;
|
|
33
39
|
/**
|
|
@@ -37,7 +43,7 @@ export declare class AuditEvents {
|
|
|
37
43
|
* @param {AuditEvents.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
44
|
*
|
|
39
45
|
* @example
|
|
40
|
-
* await
|
|
46
|
+
* await client.auditEvents.get("audit-event-id")
|
|
41
47
|
*/
|
|
42
48
|
get(auditEventId: string, requestOptions?: AuditEvents.RequestOptions): Promise<Courier.AuditEvent>;
|
|
43
49
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
@@ -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) {
|
|
@@ -54,33 +64,26 @@ class AuditEvents {
|
|
|
54
64
|
* @param {AuditEvents.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
65
|
*
|
|
56
66
|
* @example
|
|
57
|
-
* await
|
|
58
|
-
* cursor: "string"
|
|
59
|
-
* })
|
|
67
|
+
* await client.auditEvents.list()
|
|
60
68
|
*/
|
|
61
|
-
list(
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
list() {
|
|
70
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
71
|
+
var _a, _b, _c;
|
|
64
72
|
const { cursor } = request;
|
|
65
73
|
const _queryParams = {};
|
|
66
74
|
if (cursor != null) {
|
|
67
75
|
_queryParams["cursor"] = cursor;
|
|
68
76
|
}
|
|
69
77
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
70
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
78
|
+
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, "/audit-events"),
|
|
71
79
|
method: "GET",
|
|
72
|
-
headers: {
|
|
73
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
74
|
-
"X-Fern-Language": "JavaScript",
|
|
75
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
76
|
-
"X-Fern-SDK-Version": "v6.3.1",
|
|
77
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
78
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
79
|
-
},
|
|
80
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
80
81
|
contentType: "application/json",
|
|
81
82
|
queryParameters: _queryParams,
|
|
83
|
+
requestType: "json",
|
|
82
84
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
83
85
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
86
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
84
87
|
});
|
|
85
88
|
if (_response.ok) {
|
|
86
89
|
return _response.body;
|
|
@@ -98,7 +101,7 @@ class AuditEvents {
|
|
|
98
101
|
body: _response.error.rawBody,
|
|
99
102
|
});
|
|
100
103
|
case "timeout":
|
|
101
|
-
throw new errors.CourierTimeoutError();
|
|
104
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /audit-events.");
|
|
102
105
|
case "unknown":
|
|
103
106
|
throw new errors.CourierError({
|
|
104
107
|
message: _response.error.errorMessage,
|
|
@@ -113,25 +116,20 @@ class AuditEvents {
|
|
|
113
116
|
* @param {AuditEvents.RequestOptions} requestOptions - Request-specific configuration.
|
|
114
117
|
*
|
|
115
118
|
* @example
|
|
116
|
-
* await
|
|
119
|
+
* await client.auditEvents.get("audit-event-id")
|
|
117
120
|
*/
|
|
118
121
|
get(auditEventId, requestOptions) {
|
|
119
|
-
var _a, _b;
|
|
120
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
var _a, _b, _c;
|
|
121
124
|
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.
|
|
125
|
+
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, `/audit-events/${encodeURIComponent(auditEventId)}`),
|
|
123
126
|
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
|
-
},
|
|
127
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.0", "User-Agent": "@trycourier/courier/6.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
132
128
|
contentType: "application/json",
|
|
129
|
+
requestType: "json",
|
|
133
130
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
134
131
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
132
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
135
133
|
});
|
|
136
134
|
if (_response.ok) {
|
|
137
135
|
return _response.body;
|
|
@@ -149,7 +147,7 @@ class AuditEvents {
|
|
|
149
147
|
body: _response.error.rawBody,
|
|
150
148
|
});
|
|
151
149
|
case "timeout":
|
|
152
|
-
throw new errors.CourierTimeoutError();
|
|
150
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /audit-events/{audit-event-id}.");
|
|
153
151
|
case "unknown":
|
|
154
152
|
throw new errors.CourierError({
|
|
155
153
|
message: _response.error.errorMessage,
|
|
@@ -158,12 +156,12 @@ class AuditEvents {
|
|
|
158
156
|
});
|
|
159
157
|
}
|
|
160
158
|
_getAuthorizationHeader() {
|
|
161
|
-
var _a;
|
|
162
159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
var _a;
|
|
163
161
|
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"];
|
|
164
162
|
if (bearer == null) {
|
|
165
163
|
throw new errors.CourierError({
|
|
166
|
-
message: "Please specify
|
|
164
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a COURIER_AUTH_TOKEN environment variable",
|
|
167
165
|
});
|
|
168
166
|
}
|
|
169
167
|
return `Bearer ${bearer}`;
|