@trycourier/courier 6.3.0 → 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 +32 -120
- package/api/resources/bulk/client/Client.js +80 -191
- package/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +6 -86
- package/api/resources/bulk/client/requests/BulkGetUsersParams.d.ts +13 -0
- package/api/resources/bulk/client/requests/BulkGetUsersParams.js +5 -0
- package/api/resources/bulk/client/requests/index.d.ts +1 -0
- 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 +32 -120
- package/dist/api/resources/bulk/client/Client.js +80 -191
- package/dist/api/resources/bulk/client/requests/BulkCreateJobParams.d.ts +6 -86
- package/dist/api/resources/bulk/client/requests/BulkGetUsersParams.d.ts +13 -0
- package/dist/api/resources/bulk/client/requests/BulkGetUsersParams.js +5 -0
- package/dist/api/resources/bulk/client/requests/index.d.ts +1 -0
- 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
|
@@ -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) {
|
|
@@ -57,25 +67,20 @@ class Profiles {
|
|
|
57
67
|
* @throws {@link Courier.BadRequestError}
|
|
58
68
|
*
|
|
59
69
|
* @example
|
|
60
|
-
* await
|
|
70
|
+
* await client.profiles.get("user_id")
|
|
61
71
|
*/
|
|
62
72
|
get(userId, requestOptions) {
|
|
63
|
-
var _a, _b;
|
|
64
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
var _a, _b, _c;
|
|
65
75
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
66
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
76
|
+
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, `/profiles/${encodeURIComponent(userId)}`),
|
|
67
77
|
method: "GET",
|
|
68
|
-
headers: {
|
|
69
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
70
|
-
"X-Fern-Language": "JavaScript",
|
|
71
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
72
|
-
"X-Fern-SDK-Version": "v6.3.0",
|
|
73
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
74
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
75
|
-
},
|
|
78
|
+
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),
|
|
76
79
|
contentType: "application/json",
|
|
80
|
+
requestType: "json",
|
|
77
81
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
78
82
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
83
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
79
84
|
});
|
|
80
85
|
if (_response.ok) {
|
|
81
86
|
return _response.body;
|
|
@@ -98,7 +103,7 @@ class Profiles {
|
|
|
98
103
|
body: _response.error.rawBody,
|
|
99
104
|
});
|
|
100
105
|
case "timeout":
|
|
101
|
-
throw new errors.CourierTimeoutError();
|
|
106
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /profiles/{user_id}.");
|
|
102
107
|
case "unknown":
|
|
103
108
|
throw new errors.CourierError({
|
|
104
109
|
message: _response.error.errorMessage,
|
|
@@ -116,34 +121,27 @@ class Profiles {
|
|
|
116
121
|
* @throws {@link Courier.BadRequestError}
|
|
117
122
|
*
|
|
118
123
|
* @example
|
|
119
|
-
* await
|
|
124
|
+
* await client.profiles.create("user_id", {
|
|
120
125
|
* profile: {
|
|
121
|
-
* "
|
|
126
|
+
* "profile": {
|
|
122
127
|
* "key": "value"
|
|
123
128
|
* }
|
|
124
129
|
* }
|
|
125
130
|
* })
|
|
126
131
|
*/
|
|
127
132
|
create(userId, request, requestOptions) {
|
|
128
|
-
var _a, _b;
|
|
129
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
var _a, _b, _c;
|
|
130
135
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
131
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
136
|
+
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, `/profiles/${encodeURIComponent(userId)}`),
|
|
132
137
|
method: "POST",
|
|
133
|
-
headers: {
|
|
134
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
135
|
-
"X-Fern-Language": "JavaScript",
|
|
136
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
137
|
-
"X-Fern-SDK-Version": "v6.3.0",
|
|
138
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
139
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
140
|
-
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
141
|
-
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry : undefined,
|
|
142
|
-
},
|
|
138
|
+
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, "Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined, "X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry : undefined }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
143
139
|
contentType: "application/json",
|
|
140
|
+
requestType: "json",
|
|
144
141
|
body: request,
|
|
145
142
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
146
143
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
144
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
147
145
|
});
|
|
148
146
|
if (_response.ok) {
|
|
149
147
|
return _response.body;
|
|
@@ -166,7 +164,7 @@ class Profiles {
|
|
|
166
164
|
body: _response.error.rawBody,
|
|
167
165
|
});
|
|
168
166
|
case "timeout":
|
|
169
|
-
throw new errors.CourierTimeoutError();
|
|
167
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling POST /profiles/{user_id}.");
|
|
170
168
|
case "unknown":
|
|
171
169
|
throw new errors.CourierError({
|
|
172
170
|
message: _response.error.errorMessage,
|
|
@@ -187,32 +185,27 @@ class Profiles {
|
|
|
187
185
|
* @throws {@link Courier.BadRequestError}
|
|
188
186
|
*
|
|
189
187
|
* @example
|
|
190
|
-
* await
|
|
188
|
+
* await client.profiles.replace("user_id", {
|
|
191
189
|
* profile: {
|
|
192
|
-
* "
|
|
190
|
+
* "profile": {
|
|
193
191
|
* "key": "value"
|
|
194
192
|
* }
|
|
195
193
|
* }
|
|
196
194
|
* })
|
|
197
195
|
*/
|
|
198
196
|
replace(userId, request, requestOptions) {
|
|
199
|
-
var _a, _b;
|
|
200
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
var _a, _b, _c;
|
|
201
199
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
202
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
200
|
+
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, `/profiles/${encodeURIComponent(userId)}`),
|
|
203
201
|
method: "PUT",
|
|
204
|
-
headers: {
|
|
205
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
206
|
-
"X-Fern-Language": "JavaScript",
|
|
207
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
208
|
-
"X-Fern-SDK-Version": "v6.3.0",
|
|
209
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
210
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
211
|
-
},
|
|
202
|
+
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),
|
|
212
203
|
contentType: "application/json",
|
|
204
|
+
requestType: "json",
|
|
213
205
|
body: request,
|
|
214
206
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
215
207
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
208
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
216
209
|
});
|
|
217
210
|
if (_response.ok) {
|
|
218
211
|
return _response.body;
|
|
@@ -235,7 +228,7 @@ class Profiles {
|
|
|
235
228
|
body: _response.error.rawBody,
|
|
236
229
|
});
|
|
237
230
|
case "timeout":
|
|
238
|
-
throw new errors.CourierTimeoutError();
|
|
231
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling PUT /profiles/{user_id}.");
|
|
239
232
|
case "unknown":
|
|
240
233
|
throw new errors.CourierError({
|
|
241
234
|
message: _response.error.errorMessage,
|
|
@@ -245,34 +238,35 @@ class Profiles {
|
|
|
245
238
|
}
|
|
246
239
|
/**
|
|
247
240
|
* @param {string} userId - A unique identifier representing the user associated with the requested profile.
|
|
248
|
-
* @param {Courier.
|
|
241
|
+
* @param {Courier.ProfileUpdateRequest} request
|
|
249
242
|
* @param {Profiles.RequestOptions} requestOptions - Request-specific configuration.
|
|
250
243
|
*
|
|
251
244
|
* @example
|
|
252
|
-
* await
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
245
|
+
* await client.profiles.mergeProfile("user_id", {
|
|
246
|
+
* patch: [{
|
|
247
|
+
* op: "op",
|
|
248
|
+
* path: "path",
|
|
249
|
+
* value: "value"
|
|
250
|
+
* }, {
|
|
251
|
+
* op: "op",
|
|
252
|
+
* path: "path",
|
|
253
|
+
* value: "value"
|
|
254
|
+
* }]
|
|
255
|
+
* })
|
|
257
256
|
*/
|
|
258
257
|
mergeProfile(userId, request, requestOptions) {
|
|
259
|
-
var _a, _b;
|
|
260
258
|
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
+
var _a, _b, _c;
|
|
261
260
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
262
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
261
|
+
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, `/profiles/${encodeURIComponent(userId)}`),
|
|
263
262
|
method: "PATCH",
|
|
264
|
-
headers: {
|
|
265
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
266
|
-
"X-Fern-Language": "JavaScript",
|
|
267
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
268
|
-
"X-Fern-SDK-Version": "v6.3.0",
|
|
269
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
270
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
271
|
-
},
|
|
263
|
+
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),
|
|
272
264
|
contentType: "application/json",
|
|
265
|
+
requestType: "json",
|
|
273
266
|
body: request,
|
|
274
267
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
275
268
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
269
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
276
270
|
});
|
|
277
271
|
if (_response.ok) {
|
|
278
272
|
return;
|
|
@@ -290,7 +284,7 @@ class Profiles {
|
|
|
290
284
|
body: _response.error.rawBody,
|
|
291
285
|
});
|
|
292
286
|
case "timeout":
|
|
293
|
-
throw new errors.CourierTimeoutError();
|
|
287
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling PATCH /profiles/{user_id}.");
|
|
294
288
|
case "unknown":
|
|
295
289
|
throw new errors.CourierError({
|
|
296
290
|
message: _response.error.errorMessage,
|
|
@@ -307,25 +301,20 @@ class Profiles {
|
|
|
307
301
|
* @throws {@link Courier.BadRequestError}
|
|
308
302
|
*
|
|
309
303
|
* @example
|
|
310
|
-
* await
|
|
304
|
+
* await client.profiles.delete("user_id")
|
|
311
305
|
*/
|
|
312
306
|
delete(userId, requestOptions) {
|
|
313
|
-
var _a, _b;
|
|
314
307
|
return __awaiter(this, void 0, void 0, function* () {
|
|
308
|
+
var _a, _b, _c;
|
|
315
309
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
316
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
310
|
+
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, `/profiles/${encodeURIComponent(userId)}`),
|
|
317
311
|
method: "DELETE",
|
|
318
|
-
headers: {
|
|
319
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
320
|
-
"X-Fern-Language": "JavaScript",
|
|
321
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
322
|
-
"X-Fern-SDK-Version": "v6.3.0",
|
|
323
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
324
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
325
|
-
},
|
|
312
|
+
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),
|
|
326
313
|
contentType: "application/json",
|
|
314
|
+
requestType: "json",
|
|
327
315
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
328
316
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
317
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
329
318
|
});
|
|
330
319
|
if (_response.ok) {
|
|
331
320
|
return;
|
|
@@ -348,7 +337,7 @@ class Profiles {
|
|
|
348
337
|
body: _response.error.rawBody,
|
|
349
338
|
});
|
|
350
339
|
case "timeout":
|
|
351
|
-
throw new errors.CourierTimeoutError();
|
|
340
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling DELETE /profiles/{user_id}.");
|
|
352
341
|
case "unknown":
|
|
353
342
|
throw new errors.CourierError({
|
|
354
343
|
message: _response.error.errorMessage,
|
|
@@ -366,33 +355,26 @@ class Profiles {
|
|
|
366
355
|
* @throws {@link Courier.BadRequestError}
|
|
367
356
|
*
|
|
368
357
|
* @example
|
|
369
|
-
* await
|
|
370
|
-
* cursor: "string"
|
|
371
|
-
* })
|
|
358
|
+
* await client.profiles.getListSubscriptions("user_id")
|
|
372
359
|
*/
|
|
373
|
-
getListSubscriptions(
|
|
374
|
-
|
|
375
|
-
|
|
360
|
+
getListSubscriptions(userId_1) {
|
|
361
|
+
return __awaiter(this, arguments, void 0, function* (userId, request = {}, requestOptions) {
|
|
362
|
+
var _a, _b, _c;
|
|
376
363
|
const { cursor } = request;
|
|
377
364
|
const _queryParams = {};
|
|
378
365
|
if (cursor != null) {
|
|
379
366
|
_queryParams["cursor"] = cursor;
|
|
380
367
|
}
|
|
381
368
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
382
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
369
|
+
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, `/profiles/${encodeURIComponent(userId)}/lists`),
|
|
383
370
|
method: "GET",
|
|
384
|
-
headers: {
|
|
385
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
386
|
-
"X-Fern-Language": "JavaScript",
|
|
387
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
388
|
-
"X-Fern-SDK-Version": "v6.3.0",
|
|
389
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
390
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
391
|
-
},
|
|
371
|
+
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),
|
|
392
372
|
contentType: "application/json",
|
|
393
373
|
queryParameters: _queryParams,
|
|
374
|
+
requestType: "json",
|
|
394
375
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
395
376
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
377
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
396
378
|
});
|
|
397
379
|
if (_response.ok) {
|
|
398
380
|
return _response.body;
|
|
@@ -415,7 +397,7 @@ class Profiles {
|
|
|
415
397
|
body: _response.error.rawBody,
|
|
416
398
|
});
|
|
417
399
|
case "timeout":
|
|
418
|
-
throw new errors.CourierTimeoutError();
|
|
400
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /profiles/{user_id}/lists.");
|
|
419
401
|
case "unknown":
|
|
420
402
|
throw new errors.CourierError({
|
|
421
403
|
message: _response.error.errorMessage,
|
|
@@ -433,36 +415,29 @@ class Profiles {
|
|
|
433
415
|
* @throws {@link Courier.BadRequestError}
|
|
434
416
|
*
|
|
435
417
|
* @example
|
|
436
|
-
* await
|
|
418
|
+
* await client.profiles.subscribeToLists("user_id", {
|
|
437
419
|
* lists: [{
|
|
438
|
-
* listId: "
|
|
439
|
-
* preferences:
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
420
|
+
* listId: "listId",
|
|
421
|
+
* preferences: undefined
|
|
422
|
+
* }, {
|
|
423
|
+
* listId: "listId",
|
|
424
|
+
* preferences: undefined
|
|
443
425
|
* }]
|
|
444
426
|
* })
|
|
445
427
|
*/
|
|
446
428
|
subscribeToLists(userId, request, requestOptions) {
|
|
447
|
-
var _a, _b;
|
|
448
429
|
return __awaiter(this, void 0, void 0, function* () {
|
|
430
|
+
var _a, _b, _c;
|
|
449
431
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
450
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
432
|
+
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, `/profiles/${encodeURIComponent(userId)}/lists`),
|
|
451
433
|
method: "POST",
|
|
452
|
-
headers: {
|
|
453
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
454
|
-
"X-Fern-Language": "JavaScript",
|
|
455
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
456
|
-
"X-Fern-SDK-Version": "v6.3.0",
|
|
457
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
458
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
459
|
-
"Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined,
|
|
460
|
-
"X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry : undefined,
|
|
461
|
-
},
|
|
434
|
+
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, "Idempotency-Key": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey : undefined, "X-Idempotency-Expiration": (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry) != null ? requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyExpiry : undefined }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
462
435
|
contentType: "application/json",
|
|
436
|
+
requestType: "json",
|
|
463
437
|
body: request,
|
|
464
438
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
465
439
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
440
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
466
441
|
});
|
|
467
442
|
if (_response.ok) {
|
|
468
443
|
return _response.body;
|
|
@@ -485,7 +460,7 @@ class Profiles {
|
|
|
485
460
|
body: _response.error.rawBody,
|
|
486
461
|
});
|
|
487
462
|
case "timeout":
|
|
488
|
-
throw new errors.CourierTimeoutError();
|
|
463
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling POST /profiles/{user_id}/lists.");
|
|
489
464
|
case "unknown":
|
|
490
465
|
throw new errors.CourierError({
|
|
491
466
|
message: _response.error.errorMessage,
|
|
@@ -502,25 +477,20 @@ class Profiles {
|
|
|
502
477
|
* @throws {@link Courier.BadRequestError}
|
|
503
478
|
*
|
|
504
479
|
* @example
|
|
505
|
-
* await
|
|
480
|
+
* await client.profiles.deleteListSubscription("user_id")
|
|
506
481
|
*/
|
|
507
482
|
deleteListSubscription(userId, requestOptions) {
|
|
508
|
-
var _a, _b;
|
|
509
483
|
return __awaiter(this, void 0, void 0, function* () {
|
|
484
|
+
var _a, _b, _c;
|
|
510
485
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
511
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
486
|
+
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, `/profiles/${encodeURIComponent(userId)}/lists`),
|
|
512
487
|
method: "DELETE",
|
|
513
|
-
headers: {
|
|
514
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
515
|
-
"X-Fern-Language": "JavaScript",
|
|
516
|
-
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
517
|
-
"X-Fern-SDK-Version": "v6.3.0",
|
|
518
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
519
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
520
|
-
},
|
|
488
|
+
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),
|
|
521
489
|
contentType: "application/json",
|
|
490
|
+
requestType: "json",
|
|
522
491
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
523
492
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
493
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
524
494
|
});
|
|
525
495
|
if (_response.ok) {
|
|
526
496
|
return _response.body;
|
|
@@ -543,7 +513,7 @@ class Profiles {
|
|
|
543
513
|
body: _response.error.rawBody,
|
|
544
514
|
});
|
|
545
515
|
case "timeout":
|
|
546
|
-
throw new errors.CourierTimeoutError();
|
|
516
|
+
throw new errors.CourierTimeoutError("Timeout exceeded when calling DELETE /profiles/{user_id}/lists.");
|
|
547
517
|
case "unknown":
|
|
548
518
|
throw new errors.CourierError({
|
|
549
519
|
message: _response.error.errorMessage,
|
|
@@ -552,12 +522,12 @@ class Profiles {
|
|
|
552
522
|
});
|
|
553
523
|
}
|
|
554
524
|
_getAuthorizationHeader() {
|
|
555
|
-
var _a;
|
|
556
525
|
return __awaiter(this, void 0, void 0, function* () {
|
|
526
|
+
var _a;
|
|
557
527
|
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"];
|
|
558
528
|
if (bearer == null) {
|
|
559
529
|
throw new errors.CourierError({
|
|
560
|
-
message: "Please specify
|
|
530
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a COURIER_AUTH_TOKEN environment variable",
|
|
561
531
|
});
|
|
562
532
|
}
|
|
563
533
|
return `Bearer ${bearer}`;
|
|
@@ -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 MsTeams = Courier.SendToMsTeamsUserId | Courier.SendToMsTeamsEmail | Courier.SendToMsTeamsChannelId | Courier.SendToMsTeamsConversationId | Courier.SendToMsTeamsChannelName;
|
|
@@ -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 Slack = Courier.SendToSlackChannel | Courier.SendToSlackEmail | Courier.SendToSlackUserId;
|
|
@@ -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 WebhookAuthMode = "none" | "basic" | "bearer";
|
|
5
5
|
export declare const WebhookAuthMode: {
|
|
6
6
|
readonly None: "none";
|
|
7
7
|
readonly Basic: "basic";
|
|
@@ -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 WebhookProfileType = "limited" | "expanded";
|
|
5
5
|
export declare const WebhookProfileType: {
|
|
6
6
|
readonly Limited: "limited";
|
|
7
7
|
readonly Expanded: "expanded";
|
|
@@ -58,4 +58,5 @@ __exportStar(require("./WebhookMethod"), exports);
|
|
|
58
58
|
__exportStar(require("./WebhookAuthentication"), exports);
|
|
59
59
|
__exportStar(require("./WebhookAuthMode"), exports);
|
|
60
60
|
__exportStar(require("./WebhookProfileType"), exports);
|
|
61
|
+
__exportStar(require("./ProfileUpdateRequest"), exports);
|
|
61
62
|
__exportStar(require("./UserProfilePatch"), exports);
|
|
@@ -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 ChannelSource = "subscription" | "list" | "recipient";
|
|
5
5
|
export declare const ChannelSource: {
|
|
6
6
|
readonly Subscription: "subscription";
|
|
7
7
|
readonly List: "list";
|
|
@@ -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 Content = Courier.ElementalContent | Courier.ElementalContentSugar;
|
|
@@ -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 Criteria = "no-escalation" | "delivered" | "viewed" | "engaged";
|
|
5
5
|
export declare const Criteria: {
|
|
6
6
|
readonly NoEscalation: "no-escalation";
|
|
7
7
|
readonly Delivered: "delivered";
|